@lv-x-software-house/x_view 1.2.4-dev.16 → 1.2.4-dev.17
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 +2 -35
- package/dist/index.mjs +2 -35
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1895,10 +1895,6 @@ var userActionHandlers = {
|
|
|
1895
1895
|
var _a;
|
|
1896
1896
|
const isSource = String(link.source) === String(sourceNode.id);
|
|
1897
1897
|
const targetNodeId = isSource ? link.target : link.source;
|
|
1898
|
-
const linkAlreadyInSceneData = sceneDataRef.current.links.some((l) => String(l.id) === String(link.id));
|
|
1899
|
-
if (!linkAlreadyInSceneData) {
|
|
1900
|
-
sceneDataRef.current.links.push(link);
|
|
1901
|
-
}
|
|
1902
1898
|
if (!nodeObjects[String(targetNodeId)]) {
|
|
1903
1899
|
const allParentNodes = Object.values(graphDataRef.current).flatMap((fileData) => fileData.nodes);
|
|
1904
1900
|
const nodeData = allParentNodes.find((n) => String(n.id) === String(targetNodeId));
|
|
@@ -1906,9 +1902,6 @@ var userActionHandlers = {
|
|
|
1906
1902
|
console.warn(`Dados do Node com ID ${targetNodeId} n\xE3o encontrados no cache.`);
|
|
1907
1903
|
return;
|
|
1908
1904
|
}
|
|
1909
|
-
if (!sceneDataRef.current.nodes.some((n) => String(n.id) === String(nodeData.id))) {
|
|
1910
|
-
sceneDataRef.current.nodes.push(nodeData);
|
|
1911
|
-
}
|
|
1912
1905
|
const startPosition = sourceNodeMesh.position.clone();
|
|
1913
1906
|
const endPosition = startPosition.clone().add(
|
|
1914
1907
|
new THREE.Vector3((Math.random() - 0.5) * 60, (Math.random() - 0.5) * 15, (Math.random() - 0.5) * 60)
|
|
@@ -2280,12 +2273,6 @@ var userActionHandlers = {
|
|
|
2280
2273
|
if (!nodeData || !sceneDataRef.current) return;
|
|
2281
2274
|
const nodeIdToDismiss = nodeData.id;
|
|
2282
2275
|
const strNodeId = String(nodeIdToDismiss);
|
|
2283
|
-
sceneDataRef.current.nodes = sceneDataRef.current.nodes.filter(
|
|
2284
|
-
(n) => String(n.id) !== strNodeId
|
|
2285
|
-
);
|
|
2286
|
-
sceneDataRef.current.links = sceneDataRef.current.links.filter(
|
|
2287
|
-
(l) => String(l.source) !== strNodeId && String(l.target) !== strNodeId
|
|
2288
|
-
);
|
|
2289
2276
|
const { ancestryGroup, ancestryLinks } = stateRef.current;
|
|
2290
2277
|
if (ancestryGroup && ancestryLinks) {
|
|
2291
2278
|
const remainingAncestryLinks = [];
|
|
@@ -2327,22 +2314,12 @@ var userActionHandlers = {
|
|
|
2327
2314
|
removeNodeFromScene(stateRef.current, nodeId);
|
|
2328
2315
|
setters.setDetailsNode((prev) => String(prev == null ? void 0 : prev.id) === String(nodeId) ? null : prev);
|
|
2329
2316
|
});
|
|
2330
|
-
sceneDataRef.current.nodes = sceneDataRef.current.nodes.filter(
|
|
2331
|
-
(n) => String(n.id) === strNodeIdToKeep
|
|
2332
|
-
);
|
|
2333
|
-
sceneDataRef.current.links = [];
|
|
2334
2317
|
},
|
|
2335
2318
|
handleDismissMultipleNodes: (context, nodeIds) => {
|
|
2336
2319
|
const { stateRef, sceneDataRef, setters } = context;
|
|
2337
2320
|
setters.setMultiContextMenu({ visible: false });
|
|
2338
2321
|
if (!nodeIds || nodeIds.size === 0 || !sceneDataRef.current) return;
|
|
2339
2322
|
const strNodeIds = Array.from(nodeIds).map(String);
|
|
2340
|
-
sceneDataRef.current.nodes = sceneDataRef.current.nodes.filter(
|
|
2341
|
-
(n) => !strNodeIds.includes(String(n.id))
|
|
2342
|
-
);
|
|
2343
|
-
sceneDataRef.current.links = sceneDataRef.current.links.filter(
|
|
2344
|
-
(l) => !strNodeIds.includes(String(l.source)) && !strNodeIds.includes(String(l.target))
|
|
2345
|
-
);
|
|
2346
2323
|
const { ancestryGroup, ancestryLinks } = stateRef.current;
|
|
2347
2324
|
if (ancestryGroup && ancestryLinks) {
|
|
2348
2325
|
const remainingAncestryLinks = [];
|
|
@@ -2398,12 +2375,6 @@ var userActionHandlers = {
|
|
|
2398
2375
|
removeNodeFromScene(stateRef.current, nodeId);
|
|
2399
2376
|
setters.setDetailsNode((prev) => String(prev == null ? void 0 : prev.id) === String(nodeId) ? null : prev);
|
|
2400
2377
|
});
|
|
2401
|
-
sceneDataRef.current.nodes = sceneDataRef.current.nodes.filter(
|
|
2402
|
-
(n) => strNodeIdsToKeep.includes(String(n.id))
|
|
2403
|
-
);
|
|
2404
|
-
sceneDataRef.current.links = sceneDataRef.current.links.filter(
|
|
2405
|
-
(l) => strNodeIdsToKeep.includes(String(l.source)) && strNodeIdsToKeep.includes(String(l.target))
|
|
2406
|
-
);
|
|
2407
2378
|
stateRef.current.selectedNodes.clear();
|
|
2408
2379
|
},
|
|
2409
2380
|
handleDeleteMultipleNodes: async (context, nodeIds) => {
|
|
@@ -2661,7 +2632,7 @@ var userActionHandlers = {
|
|
|
2661
2632
|
}
|
|
2662
2633
|
},
|
|
2663
2634
|
handleAddExistingNodeById: (context, nodeId) => {
|
|
2664
|
-
var _a
|
|
2635
|
+
var _a;
|
|
2665
2636
|
const { stateRef, sceneDataRef, graphDataRef, tweenToTarget, setters } = context;
|
|
2666
2637
|
const state = stateRef.current;
|
|
2667
2638
|
const graphFull = graphDataRef.current;
|
|
@@ -2677,16 +2648,12 @@ var userActionHandlers = {
|
|
|
2677
2648
|
tweenToTarget(state.nodeObjects[strNodeId]);
|
|
2678
2649
|
return;
|
|
2679
2650
|
}
|
|
2680
|
-
const alreadyInSceneData = (((_a = sceneDataRef.current) == null ? void 0 : _a.nodes) || []).some((n) => String(n.id) === String(strNodeId));
|
|
2681
|
-
if (!alreadyInSceneData) {
|
|
2682
|
-
sceneDataRef.current.nodes.push(nodeData);
|
|
2683
|
-
}
|
|
2684
2651
|
const base = state.controls ? state.controls.target.clone() : new THREE.Vector3(0, 0, 0);
|
|
2685
2652
|
const offset = new THREE.Vector3((Math.random() - 0.5) * 20, (Math.random() - 0.5) * 6, (Math.random() - 0.5) * 20);
|
|
2686
2653
|
const position = base.add(offset);
|
|
2687
2654
|
addStandaloneNodeToScene(state, nodeData, position);
|
|
2688
2655
|
tweenToTarget(position, 1.3);
|
|
2689
|
-
(
|
|
2656
|
+
(_a = setters == null ? void 0 : setters.setSceneVersion) == null ? void 0 : _a.call(setters, (v) => v + 1);
|
|
2690
2657
|
}
|
|
2691
2658
|
};
|
|
2692
2659
|
|
package/dist/index.mjs
CHANGED
|
@@ -1851,10 +1851,6 @@ var userActionHandlers = {
|
|
|
1851
1851
|
var _a;
|
|
1852
1852
|
const isSource = String(link.source) === String(sourceNode.id);
|
|
1853
1853
|
const targetNodeId = isSource ? link.target : link.source;
|
|
1854
|
-
const linkAlreadyInSceneData = sceneDataRef.current.links.some((l) => String(l.id) === String(link.id));
|
|
1855
|
-
if (!linkAlreadyInSceneData) {
|
|
1856
|
-
sceneDataRef.current.links.push(link);
|
|
1857
|
-
}
|
|
1858
1854
|
if (!nodeObjects[String(targetNodeId)]) {
|
|
1859
1855
|
const allParentNodes = Object.values(graphDataRef.current).flatMap((fileData) => fileData.nodes);
|
|
1860
1856
|
const nodeData = allParentNodes.find((n) => String(n.id) === String(targetNodeId));
|
|
@@ -1862,9 +1858,6 @@ var userActionHandlers = {
|
|
|
1862
1858
|
console.warn(`Dados do Node com ID ${targetNodeId} n\xE3o encontrados no cache.`);
|
|
1863
1859
|
return;
|
|
1864
1860
|
}
|
|
1865
|
-
if (!sceneDataRef.current.nodes.some((n) => String(n.id) === String(nodeData.id))) {
|
|
1866
|
-
sceneDataRef.current.nodes.push(nodeData);
|
|
1867
|
-
}
|
|
1868
1861
|
const startPosition = sourceNodeMesh.position.clone();
|
|
1869
1862
|
const endPosition = startPosition.clone().add(
|
|
1870
1863
|
new THREE.Vector3((Math.random() - 0.5) * 60, (Math.random() - 0.5) * 15, (Math.random() - 0.5) * 60)
|
|
@@ -2236,12 +2229,6 @@ var userActionHandlers = {
|
|
|
2236
2229
|
if (!nodeData || !sceneDataRef.current) return;
|
|
2237
2230
|
const nodeIdToDismiss = nodeData.id;
|
|
2238
2231
|
const strNodeId = String(nodeIdToDismiss);
|
|
2239
|
-
sceneDataRef.current.nodes = sceneDataRef.current.nodes.filter(
|
|
2240
|
-
(n) => String(n.id) !== strNodeId
|
|
2241
|
-
);
|
|
2242
|
-
sceneDataRef.current.links = sceneDataRef.current.links.filter(
|
|
2243
|
-
(l) => String(l.source) !== strNodeId && String(l.target) !== strNodeId
|
|
2244
|
-
);
|
|
2245
2232
|
const { ancestryGroup, ancestryLinks } = stateRef.current;
|
|
2246
2233
|
if (ancestryGroup && ancestryLinks) {
|
|
2247
2234
|
const remainingAncestryLinks = [];
|
|
@@ -2283,22 +2270,12 @@ var userActionHandlers = {
|
|
|
2283
2270
|
removeNodeFromScene(stateRef.current, nodeId);
|
|
2284
2271
|
setters.setDetailsNode((prev) => String(prev == null ? void 0 : prev.id) === String(nodeId) ? null : prev);
|
|
2285
2272
|
});
|
|
2286
|
-
sceneDataRef.current.nodes = sceneDataRef.current.nodes.filter(
|
|
2287
|
-
(n) => String(n.id) === strNodeIdToKeep
|
|
2288
|
-
);
|
|
2289
|
-
sceneDataRef.current.links = [];
|
|
2290
2273
|
},
|
|
2291
2274
|
handleDismissMultipleNodes: (context, nodeIds) => {
|
|
2292
2275
|
const { stateRef, sceneDataRef, setters } = context;
|
|
2293
2276
|
setters.setMultiContextMenu({ visible: false });
|
|
2294
2277
|
if (!nodeIds || nodeIds.size === 0 || !sceneDataRef.current) return;
|
|
2295
2278
|
const strNodeIds = Array.from(nodeIds).map(String);
|
|
2296
|
-
sceneDataRef.current.nodes = sceneDataRef.current.nodes.filter(
|
|
2297
|
-
(n) => !strNodeIds.includes(String(n.id))
|
|
2298
|
-
);
|
|
2299
|
-
sceneDataRef.current.links = sceneDataRef.current.links.filter(
|
|
2300
|
-
(l) => !strNodeIds.includes(String(l.source)) && !strNodeIds.includes(String(l.target))
|
|
2301
|
-
);
|
|
2302
2279
|
const { ancestryGroup, ancestryLinks } = stateRef.current;
|
|
2303
2280
|
if (ancestryGroup && ancestryLinks) {
|
|
2304
2281
|
const remainingAncestryLinks = [];
|
|
@@ -2354,12 +2331,6 @@ var userActionHandlers = {
|
|
|
2354
2331
|
removeNodeFromScene(stateRef.current, nodeId);
|
|
2355
2332
|
setters.setDetailsNode((prev) => String(prev == null ? void 0 : prev.id) === String(nodeId) ? null : prev);
|
|
2356
2333
|
});
|
|
2357
|
-
sceneDataRef.current.nodes = sceneDataRef.current.nodes.filter(
|
|
2358
|
-
(n) => strNodeIdsToKeep.includes(String(n.id))
|
|
2359
|
-
);
|
|
2360
|
-
sceneDataRef.current.links = sceneDataRef.current.links.filter(
|
|
2361
|
-
(l) => strNodeIdsToKeep.includes(String(l.source)) && strNodeIdsToKeep.includes(String(l.target))
|
|
2362
|
-
);
|
|
2363
2334
|
stateRef.current.selectedNodes.clear();
|
|
2364
2335
|
},
|
|
2365
2336
|
handleDeleteMultipleNodes: async (context, nodeIds) => {
|
|
@@ -2617,7 +2588,7 @@ var userActionHandlers = {
|
|
|
2617
2588
|
}
|
|
2618
2589
|
},
|
|
2619
2590
|
handleAddExistingNodeById: (context, nodeId) => {
|
|
2620
|
-
var _a
|
|
2591
|
+
var _a;
|
|
2621
2592
|
const { stateRef, sceneDataRef, graphDataRef, tweenToTarget, setters } = context;
|
|
2622
2593
|
const state = stateRef.current;
|
|
2623
2594
|
const graphFull = graphDataRef.current;
|
|
@@ -2633,16 +2604,12 @@ var userActionHandlers = {
|
|
|
2633
2604
|
tweenToTarget(state.nodeObjects[strNodeId]);
|
|
2634
2605
|
return;
|
|
2635
2606
|
}
|
|
2636
|
-
const alreadyInSceneData = (((_a = sceneDataRef.current) == null ? void 0 : _a.nodes) || []).some((n) => String(n.id) === String(strNodeId));
|
|
2637
|
-
if (!alreadyInSceneData) {
|
|
2638
|
-
sceneDataRef.current.nodes.push(nodeData);
|
|
2639
|
-
}
|
|
2640
2607
|
const base = state.controls ? state.controls.target.clone() : new THREE.Vector3(0, 0, 0);
|
|
2641
2608
|
const offset = new THREE.Vector3((Math.random() - 0.5) * 20, (Math.random() - 0.5) * 6, (Math.random() - 0.5) * 20);
|
|
2642
2609
|
const position = base.add(offset);
|
|
2643
2610
|
addStandaloneNodeToScene(state, nodeData, position);
|
|
2644
2611
|
tweenToTarget(position, 1.3);
|
|
2645
|
-
(
|
|
2612
|
+
(_a = setters == null ? void 0 : setters.setSceneVersion) == null ? void 0 : _a.call(setters, (v) => v + 1);
|
|
2646
2613
|
}
|
|
2647
2614
|
};
|
|
2648
2615
|
|
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.
|
|
3
|
+
"version": "1.2.4-dev.17",
|
|
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",
|