@lv-x-software-house/x_view 1.1.9-dev.5 → 1.1.9-dev.6
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 +14 -14
- package/dist/index.mjs +14 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -186,8 +186,8 @@ function ContextMenu({
|
|
|
186
186
|
return !isVisible;
|
|
187
187
|
}).map((link) => {
|
|
188
188
|
const isSource = String(link.source) === String(data.nodeData.id);
|
|
189
|
-
const
|
|
190
|
-
const targetNode = nodeMap.get(String(
|
|
189
|
+
const targetNodeId = isSource ? link.target : link.source;
|
|
190
|
+
const targetNode = nodeMap.get(String(targetNodeId));
|
|
191
191
|
return { link, targetNode, direction: isSource ? "outgoing" : "incoming" };
|
|
192
192
|
}).filter((c) => {
|
|
193
193
|
var _a2;
|
|
@@ -1812,16 +1812,16 @@ var userActionHandlers = {
|
|
|
1812
1812
|
linksToExpand.forEach((link) => {
|
|
1813
1813
|
var _a;
|
|
1814
1814
|
const isSource = String(link.source) === String(sourceNode.id);
|
|
1815
|
-
const
|
|
1815
|
+
const targetNodeId = isSource ? link.target : link.source;
|
|
1816
1816
|
const linkAlreadyInSceneData = sceneDataRef.current.links.some((l) => String(l.id) === String(link.id));
|
|
1817
1817
|
if (!linkAlreadyInSceneData) {
|
|
1818
1818
|
sceneDataRef.current.links.push(link);
|
|
1819
1819
|
}
|
|
1820
|
-
if (!nodeObjects[String(
|
|
1820
|
+
if (!nodeObjects[String(targetNodeId)]) {
|
|
1821
1821
|
const allParentNodes = Object.values(graphDataRef.current).flatMap((fileData) => fileData.nodes);
|
|
1822
|
-
const nodeData = allParentNodes.find((n) => String(n.id) === String(
|
|
1822
|
+
const nodeData = allParentNodes.find((n) => String(n.id) === String(targetNodeId));
|
|
1823
1823
|
if (!nodeData) {
|
|
1824
|
-
console.warn(`Dados do Node com ID ${
|
|
1824
|
+
console.warn(`Dados do Node com ID ${targetNodeId} n\xE3o encontrados no cache.`);
|
|
1825
1825
|
return;
|
|
1826
1826
|
}
|
|
1827
1827
|
if (!sceneDataRef.current.nodes.some((n) => String(n.id) === String(nodeData.id))) {
|
|
@@ -1838,7 +1838,7 @@ var userActionHandlers = {
|
|
|
1838
1838
|
if (targetMesh.userData.labelObject) {
|
|
1839
1839
|
graphGroup.add(targetMesh.userData.labelObject);
|
|
1840
1840
|
}
|
|
1841
|
-
nodeObjects[String(
|
|
1841
|
+
nodeObjects[String(targetNodeId)] = targetMesh;
|
|
1842
1842
|
clickableNodes.push(targetMesh);
|
|
1843
1843
|
const posTween = new import_tween.Tween(targetMesh.position).to(endPosition, 1200).easing(import_tween.Easing.Quadratic.Out);
|
|
1844
1844
|
tweenGroup.add(posTween);
|
|
@@ -4874,16 +4874,16 @@ function AncestryPickerModal({
|
|
|
4874
4874
|
}
|
|
4875
4875
|
|
|
4876
4876
|
// src/components/CreateAncestryPanel.jsx
|
|
4877
|
-
var findNodePath = (tree,
|
|
4877
|
+
var findNodePath = (tree, targetNodeId, currentPath = []) => {
|
|
4878
4878
|
var _a;
|
|
4879
4879
|
if (!tree) return null;
|
|
4880
4880
|
const currentNodeId = tree.is_section ? tree.section_id : String((_a = tree.node) == null ? void 0 : _a.id);
|
|
4881
|
-
if (String(currentNodeId) === String(
|
|
4881
|
+
if (String(currentNodeId) === String(targetNodeId)) {
|
|
4882
4882
|
return { node: tree, path: currentPath };
|
|
4883
4883
|
}
|
|
4884
4884
|
if (tree.children) {
|
|
4885
4885
|
for (let i = 0; i < tree.children.length; i++) {
|
|
4886
|
-
const res = findNodePath(tree.children[i],
|
|
4886
|
+
const res = findNodePath(tree.children[i], targetNodeId, [...currentPath, i]);
|
|
4887
4887
|
if (res) return res;
|
|
4888
4888
|
}
|
|
4889
4889
|
}
|
|
@@ -8797,16 +8797,16 @@ var getAllNodeIdsFromTree = (treeNode) => {
|
|
|
8797
8797
|
traverse(treeNode);
|
|
8798
8798
|
return Array.from(ids);
|
|
8799
8799
|
};
|
|
8800
|
-
var findNodePath2 = (tree,
|
|
8800
|
+
var findNodePath2 = (tree, targetNodeId, currentPath = []) => {
|
|
8801
8801
|
var _a;
|
|
8802
8802
|
if (!tree) return null;
|
|
8803
8803
|
const currentNodeId = tree.is_section ? tree.section_id : String((_a = tree.node) == null ? void 0 : _a.id);
|
|
8804
|
-
if (String(currentNodeId) === String(
|
|
8804
|
+
if (String(currentNodeId) === String(targetNodeId)) {
|
|
8805
8805
|
return { node: tree, path: currentPath };
|
|
8806
8806
|
}
|
|
8807
8807
|
if (tree.children) {
|
|
8808
8808
|
for (let i = 0; i < tree.children.length; i++) {
|
|
8809
|
-
const res = findNodePath2(tree.children[i],
|
|
8809
|
+
const res = findNodePath2(tree.children[i], targetNodeId, [...currentPath, i]);
|
|
8810
8810
|
if (res) return res;
|
|
8811
8811
|
}
|
|
8812
8812
|
}
|
|
@@ -10875,7 +10875,7 @@ function XViewScene({
|
|
|
10875
10875
|
},
|
|
10876
10876
|
[addOrUpdateNodeMesh, tweenToTarget, buildFullAncestryTree, readingMode.isActive, ancestryMode.isActive]
|
|
10877
10877
|
);
|
|
10878
|
-
const handleRenderAbstractionTree = (0, import_react23.useCallback)((ancestryObject) => {
|
|
10878
|
+
const handleRenderAbstractionTree = (0, import_react23.useCallback)((ancestryObject, targetNodeId = null) => {
|
|
10879
10879
|
setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
|
|
10880
10880
|
if (!ancestryObject || !ancestryObject.abstraction_tree) return;
|
|
10881
10881
|
const { ancestryGroup, nodeObjects, renderer, renderedAncestries } = stateRef.current;
|
package/dist/index.mjs
CHANGED
|
@@ -142,8 +142,8 @@ function ContextMenu({
|
|
|
142
142
|
return !isVisible;
|
|
143
143
|
}).map((link) => {
|
|
144
144
|
const isSource = String(link.source) === String(data.nodeData.id);
|
|
145
|
-
const
|
|
146
|
-
const targetNode = nodeMap.get(String(
|
|
145
|
+
const targetNodeId = isSource ? link.target : link.source;
|
|
146
|
+
const targetNode = nodeMap.get(String(targetNodeId));
|
|
147
147
|
return { link, targetNode, direction: isSource ? "outgoing" : "incoming" };
|
|
148
148
|
}).filter((c) => {
|
|
149
149
|
var _a2;
|
|
@@ -1768,16 +1768,16 @@ var userActionHandlers = {
|
|
|
1768
1768
|
linksToExpand.forEach((link) => {
|
|
1769
1769
|
var _a;
|
|
1770
1770
|
const isSource = String(link.source) === String(sourceNode.id);
|
|
1771
|
-
const
|
|
1771
|
+
const targetNodeId = isSource ? link.target : link.source;
|
|
1772
1772
|
const linkAlreadyInSceneData = sceneDataRef.current.links.some((l) => String(l.id) === String(link.id));
|
|
1773
1773
|
if (!linkAlreadyInSceneData) {
|
|
1774
1774
|
sceneDataRef.current.links.push(link);
|
|
1775
1775
|
}
|
|
1776
|
-
if (!nodeObjects[String(
|
|
1776
|
+
if (!nodeObjects[String(targetNodeId)]) {
|
|
1777
1777
|
const allParentNodes = Object.values(graphDataRef.current).flatMap((fileData) => fileData.nodes);
|
|
1778
|
-
const nodeData = allParentNodes.find((n) => String(n.id) === String(
|
|
1778
|
+
const nodeData = allParentNodes.find((n) => String(n.id) === String(targetNodeId));
|
|
1779
1779
|
if (!nodeData) {
|
|
1780
|
-
console.warn(`Dados do Node com ID ${
|
|
1780
|
+
console.warn(`Dados do Node com ID ${targetNodeId} n\xE3o encontrados no cache.`);
|
|
1781
1781
|
return;
|
|
1782
1782
|
}
|
|
1783
1783
|
if (!sceneDataRef.current.nodes.some((n) => String(n.id) === String(nodeData.id))) {
|
|
@@ -1794,7 +1794,7 @@ var userActionHandlers = {
|
|
|
1794
1794
|
if (targetMesh.userData.labelObject) {
|
|
1795
1795
|
graphGroup.add(targetMesh.userData.labelObject);
|
|
1796
1796
|
}
|
|
1797
|
-
nodeObjects[String(
|
|
1797
|
+
nodeObjects[String(targetNodeId)] = targetMesh;
|
|
1798
1798
|
clickableNodes.push(targetMesh);
|
|
1799
1799
|
const posTween = new Tween(targetMesh.position).to(endPosition, 1200).easing(Easing.Quadratic.Out);
|
|
1800
1800
|
tweenGroup.add(posTween);
|
|
@@ -4855,16 +4855,16 @@ function AncestryPickerModal({
|
|
|
4855
4855
|
}
|
|
4856
4856
|
|
|
4857
4857
|
// src/components/CreateAncestryPanel.jsx
|
|
4858
|
-
var findNodePath = (tree,
|
|
4858
|
+
var findNodePath = (tree, targetNodeId, currentPath = []) => {
|
|
4859
4859
|
var _a;
|
|
4860
4860
|
if (!tree) return null;
|
|
4861
4861
|
const currentNodeId = tree.is_section ? tree.section_id : String((_a = tree.node) == null ? void 0 : _a.id);
|
|
4862
|
-
if (String(currentNodeId) === String(
|
|
4862
|
+
if (String(currentNodeId) === String(targetNodeId)) {
|
|
4863
4863
|
return { node: tree, path: currentPath };
|
|
4864
4864
|
}
|
|
4865
4865
|
if (tree.children) {
|
|
4866
4866
|
for (let i = 0; i < tree.children.length; i++) {
|
|
4867
|
-
const res = findNodePath(tree.children[i],
|
|
4867
|
+
const res = findNodePath(tree.children[i], targetNodeId, [...currentPath, i]);
|
|
4868
4868
|
if (res) return res;
|
|
4869
4869
|
}
|
|
4870
4870
|
}
|
|
@@ -8791,16 +8791,16 @@ var getAllNodeIdsFromTree = (treeNode) => {
|
|
|
8791
8791
|
traverse(treeNode);
|
|
8792
8792
|
return Array.from(ids);
|
|
8793
8793
|
};
|
|
8794
|
-
var findNodePath2 = (tree,
|
|
8794
|
+
var findNodePath2 = (tree, targetNodeId, currentPath = []) => {
|
|
8795
8795
|
var _a;
|
|
8796
8796
|
if (!tree) return null;
|
|
8797
8797
|
const currentNodeId = tree.is_section ? tree.section_id : String((_a = tree.node) == null ? void 0 : _a.id);
|
|
8798
|
-
if (String(currentNodeId) === String(
|
|
8798
|
+
if (String(currentNodeId) === String(targetNodeId)) {
|
|
8799
8799
|
return { node: tree, path: currentPath };
|
|
8800
8800
|
}
|
|
8801
8801
|
if (tree.children) {
|
|
8802
8802
|
for (let i = 0; i < tree.children.length; i++) {
|
|
8803
|
-
const res = findNodePath2(tree.children[i],
|
|
8803
|
+
const res = findNodePath2(tree.children[i], targetNodeId, [...currentPath, i]);
|
|
8804
8804
|
if (res) return res;
|
|
8805
8805
|
}
|
|
8806
8806
|
}
|
|
@@ -10869,7 +10869,7 @@ function XViewScene({
|
|
|
10869
10869
|
},
|
|
10870
10870
|
[addOrUpdateNodeMesh, tweenToTarget, buildFullAncestryTree, readingMode.isActive, ancestryMode.isActive]
|
|
10871
10871
|
);
|
|
10872
|
-
const handleRenderAbstractionTree = useCallback3((ancestryObject) => {
|
|
10872
|
+
const handleRenderAbstractionTree = useCallback3((ancestryObject, targetNodeId = null) => {
|
|
10873
10873
|
setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
|
|
10874
10874
|
if (!ancestryObject || !ancestryObject.abstraction_tree) return;
|
|
10875
10875
|
const { ancestryGroup, nodeObjects, renderer, renderedAncestries } = stateRef.current;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lv-x-software-house/x_view",
|
|
3
|
-
"version": "1.1.9-dev.
|
|
3
|
+
"version": "1.1.9-dev.6",
|
|
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",
|