@lv-x-software-house/x_view 1.2.4-dev.8 → 1.2.4-dev.9
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 +13 -33
- package/dist/index.mjs +13 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11526,15 +11526,10 @@ function XViewScene({
|
|
|
11526
11526
|
creationMode,
|
|
11527
11527
|
versionMode,
|
|
11528
11528
|
questMode,
|
|
11529
|
-
// <-- Adicionado
|
|
11530
11529
|
sceneSaveUrl,
|
|
11531
|
-
// <-- Adicionado
|
|
11532
11530
|
sceneConfigId,
|
|
11533
|
-
// <-- Adicionado
|
|
11534
11531
|
ownerId,
|
|
11535
|
-
// <-- Adicionado
|
|
11536
11532
|
viewType: viewParams == null ? void 0 : viewParams.type,
|
|
11537
|
-
// <-- Adicionado
|
|
11538
11533
|
userId: (_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.id,
|
|
11539
11534
|
setters: {
|
|
11540
11535
|
setContextMenu,
|
|
@@ -11548,7 +11543,6 @@ function XViewScene({
|
|
|
11548
11543
|
setSceneVersion,
|
|
11549
11544
|
setAncestryMode,
|
|
11550
11545
|
setQuestMode
|
|
11551
|
-
// <-- Adicionado
|
|
11552
11546
|
},
|
|
11553
11547
|
tweenToTarget,
|
|
11554
11548
|
handleVersionTimeline,
|
|
@@ -11595,20 +11589,12 @@ function XViewScene({
|
|
|
11595
11589
|
graphDataRef.current[sceneConfigId2] = { nodes: [], links: [] };
|
|
11596
11590
|
}
|
|
11597
11591
|
graphDataRef.current[sceneConfigId2].nodes.push(newNode);
|
|
11598
|
-
sceneDataRef2.current.nodes.push(newNode);
|
|
11599
|
-
const currentVisualNodes = Object.values(stateRef2.current.nodeObjects).map((mesh) => {
|
|
11600
|
-
const { _baseEmissiveIntensity, labelObject, labelOffset, timelineIntervalBar, timelineEndLabel, ...rest } = mesh.userData;
|
|
11601
|
-
return rest;
|
|
11602
|
-
});
|
|
11603
|
-
currentVisualNodes.push(newNode);
|
|
11604
|
-
const currentVisualLinks = stateRef2.current.allLinks.map((line) => {
|
|
11605
|
-
const { sourceNode, targetNode, ...rest } = line.userData;
|
|
11606
|
-
return rest;
|
|
11607
|
-
});
|
|
11608
11592
|
const sceneFileData = {
|
|
11609
11593
|
parent_dbs: sceneDataRef2.current.parent_dbs,
|
|
11610
|
-
nodes:
|
|
11611
|
-
|
|
11594
|
+
nodes: sceneDataRef2.current.nodes,
|
|
11595
|
+
// <-- Mantém o cenário inicial inalterado
|
|
11596
|
+
links: sceneDataRef2.current.links,
|
|
11597
|
+
// <-- Mantém o cenário inicial inalterado
|
|
11612
11598
|
quest_nodes: graphDataRef.current[sceneConfigId2].nodes,
|
|
11613
11599
|
quest_links: graphDataRef.current[sceneConfigId2].links
|
|
11614
11600
|
};
|
|
@@ -11632,14 +11618,14 @@ function XViewScene({
|
|
|
11632
11618
|
}
|
|
11633
11619
|
};
|
|
11634
11620
|
userActionHandlers.handleCompleteConnection = async (context, targetNodeData) => {
|
|
11635
|
-
const { stateRef: stateRef2, graphDataRef, sceneDataRef: sceneDataRef2, sceneConfigId: sceneConfigId2, sceneSaveUrl: sceneSaveUrl2 } = context;
|
|
11621
|
+
const { stateRef: stateRef2, graphDataRef, sceneDataRef: sceneDataRef2, sceneConfigId: sceneConfigId2, sceneSaveUrl: sceneSaveUrl2, ownerId: ownerId2 } = context;
|
|
11636
11622
|
const { sourceNodeData } = stateRef2.current.connection;
|
|
11637
11623
|
if (!graphDataRef.current || !sceneDataRef2.current || !sourceNodeData || !targetNodeData) {
|
|
11638
11624
|
userActionHandlers.handleCancelConnection(context);
|
|
11639
11625
|
return;
|
|
11640
11626
|
}
|
|
11641
|
-
const sourceParentInfo = getParentFileInfoForNode(graphDataRef.current, sceneDataRef2.current, sourceNodeData.id, sceneConfigId2,
|
|
11642
|
-
const targetParentInfo = getParentFileInfoForNode(graphDataRef.current, sceneDataRef2.current, targetNodeData.id, sceneConfigId2,
|
|
11627
|
+
const sourceParentInfo = getParentFileInfoForNode(graphDataRef.current, sceneDataRef2.current, sourceNodeData.id, sceneConfigId2, ownerId2);
|
|
11628
|
+
const targetParentInfo = getParentFileInfoForNode(graphDataRef.current, sceneDataRef2.current, targetNodeData.id, sceneConfigId2, ownerId2);
|
|
11643
11629
|
let parentInfoToSave = sourceParentInfo;
|
|
11644
11630
|
if (sourceParentInfo.parentFileId === sceneConfigId2 && targetParentInfo.parentFileId !== sceneConfigId2) {
|
|
11645
11631
|
parentInfoToSave = targetParentInfo;
|
|
@@ -11656,19 +11642,12 @@ function XViewScene({
|
|
|
11656
11642
|
if (parentFileIdToSave === sceneConfigId2) {
|
|
11657
11643
|
const specificParentData = graphDataRef.current[sceneConfigId2];
|
|
11658
11644
|
specificParentData.links.push(newLink);
|
|
11659
|
-
const currentVisualNodes = Object.values(stateRef2.current.nodeObjects).map((m) => {
|
|
11660
|
-
const { _baseEmissiveIntensity, labelObject, labelOffset, timelineIntervalBar, timelineEndLabel, ...rest } = m.userData;
|
|
11661
|
-
return rest;
|
|
11662
|
-
});
|
|
11663
|
-
const currentVisualLinks = stateRef2.current.allLinks.map((l) => {
|
|
11664
|
-
const { sourceNode, targetNode, ...rest } = l.userData;
|
|
11665
|
-
return rest;
|
|
11666
|
-
});
|
|
11667
|
-
currentVisualLinks.push(newLink);
|
|
11668
11645
|
const viewFilePayload = {
|
|
11669
11646
|
parent_dbs: sceneDataRef2.current.parent_dbs,
|
|
11670
|
-
nodes:
|
|
11671
|
-
|
|
11647
|
+
nodes: sceneDataRef2.current.nodes,
|
|
11648
|
+
// <-- Usa o estado original intocado
|
|
11649
|
+
links: sceneDataRef2.current.links,
|
|
11650
|
+
// <-- Usa o estado original intocado
|
|
11672
11651
|
quest_nodes: specificParentData.nodes,
|
|
11673
11652
|
quest_links: specificParentData.links
|
|
11674
11653
|
// Salva a conexão aqui!
|
|
@@ -12977,11 +12956,12 @@ function XViewScene({
|
|
|
12977
12956
|
const { sourceNode, targetNode, ...serializableLinkData } = line.userData;
|
|
12978
12957
|
return serializableLinkData;
|
|
12979
12958
|
});
|
|
12959
|
+
sceneDataRef.current.nodes = currentNodes;
|
|
12960
|
+
sceneDataRef.current.links = currentLinks;
|
|
12980
12961
|
const sceneFileData = {
|
|
12981
12962
|
parent_dbs: sceneDataRef.current.parent_dbs,
|
|
12982
12963
|
nodes: currentNodes,
|
|
12983
12964
|
links: currentLinks,
|
|
12984
|
-
// --- ADICIONE ESTAS DUAS LINHAS PARA PRESERVAR A FONTE DA VERDADE ---
|
|
12985
12965
|
quest_nodes: ((_a2 = parentDataRef.current[sceneConfigId]) == null ? void 0 : _a2.nodes) || [],
|
|
12986
12966
|
quest_links: ((_b2 = parentDataRef.current[sceneConfigId]) == null ? void 0 : _b2.links) || []
|
|
12987
12967
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -11526,15 +11526,10 @@ function XViewScene({
|
|
|
11526
11526
|
creationMode,
|
|
11527
11527
|
versionMode,
|
|
11528
11528
|
questMode,
|
|
11529
|
-
// <-- Adicionado
|
|
11530
11529
|
sceneSaveUrl,
|
|
11531
|
-
// <-- Adicionado
|
|
11532
11530
|
sceneConfigId,
|
|
11533
|
-
// <-- Adicionado
|
|
11534
11531
|
ownerId,
|
|
11535
|
-
// <-- Adicionado
|
|
11536
11532
|
viewType: viewParams == null ? void 0 : viewParams.type,
|
|
11537
|
-
// <-- Adicionado
|
|
11538
11533
|
userId: (_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.id,
|
|
11539
11534
|
setters: {
|
|
11540
11535
|
setContextMenu,
|
|
@@ -11548,7 +11543,6 @@ function XViewScene({
|
|
|
11548
11543
|
setSceneVersion,
|
|
11549
11544
|
setAncestryMode,
|
|
11550
11545
|
setQuestMode
|
|
11551
|
-
// <-- Adicionado
|
|
11552
11546
|
},
|
|
11553
11547
|
tweenToTarget,
|
|
11554
11548
|
handleVersionTimeline,
|
|
@@ -11595,20 +11589,12 @@ function XViewScene({
|
|
|
11595
11589
|
graphDataRef.current[sceneConfigId2] = { nodes: [], links: [] };
|
|
11596
11590
|
}
|
|
11597
11591
|
graphDataRef.current[sceneConfigId2].nodes.push(newNode);
|
|
11598
|
-
sceneDataRef2.current.nodes.push(newNode);
|
|
11599
|
-
const currentVisualNodes = Object.values(stateRef2.current.nodeObjects).map((mesh) => {
|
|
11600
|
-
const { _baseEmissiveIntensity, labelObject, labelOffset, timelineIntervalBar, timelineEndLabel, ...rest } = mesh.userData;
|
|
11601
|
-
return rest;
|
|
11602
|
-
});
|
|
11603
|
-
currentVisualNodes.push(newNode);
|
|
11604
|
-
const currentVisualLinks = stateRef2.current.allLinks.map((line) => {
|
|
11605
|
-
const { sourceNode, targetNode, ...rest } = line.userData;
|
|
11606
|
-
return rest;
|
|
11607
|
-
});
|
|
11608
11592
|
const sceneFileData = {
|
|
11609
11593
|
parent_dbs: sceneDataRef2.current.parent_dbs,
|
|
11610
|
-
nodes:
|
|
11611
|
-
|
|
11594
|
+
nodes: sceneDataRef2.current.nodes,
|
|
11595
|
+
// <-- Mantém o cenário inicial inalterado
|
|
11596
|
+
links: sceneDataRef2.current.links,
|
|
11597
|
+
// <-- Mantém o cenário inicial inalterado
|
|
11612
11598
|
quest_nodes: graphDataRef.current[sceneConfigId2].nodes,
|
|
11613
11599
|
quest_links: graphDataRef.current[sceneConfigId2].links
|
|
11614
11600
|
};
|
|
@@ -11632,14 +11618,14 @@ function XViewScene({
|
|
|
11632
11618
|
}
|
|
11633
11619
|
};
|
|
11634
11620
|
userActionHandlers.handleCompleteConnection = async (context, targetNodeData) => {
|
|
11635
|
-
const { stateRef: stateRef2, graphDataRef, sceneDataRef: sceneDataRef2, sceneConfigId: sceneConfigId2, sceneSaveUrl: sceneSaveUrl2 } = context;
|
|
11621
|
+
const { stateRef: stateRef2, graphDataRef, sceneDataRef: sceneDataRef2, sceneConfigId: sceneConfigId2, sceneSaveUrl: sceneSaveUrl2, ownerId: ownerId2 } = context;
|
|
11636
11622
|
const { sourceNodeData } = stateRef2.current.connection;
|
|
11637
11623
|
if (!graphDataRef.current || !sceneDataRef2.current || !sourceNodeData || !targetNodeData) {
|
|
11638
11624
|
userActionHandlers.handleCancelConnection(context);
|
|
11639
11625
|
return;
|
|
11640
11626
|
}
|
|
11641
|
-
const sourceParentInfo = getParentFileInfoForNode(graphDataRef.current, sceneDataRef2.current, sourceNodeData.id, sceneConfigId2,
|
|
11642
|
-
const targetParentInfo = getParentFileInfoForNode(graphDataRef.current, sceneDataRef2.current, targetNodeData.id, sceneConfigId2,
|
|
11627
|
+
const sourceParentInfo = getParentFileInfoForNode(graphDataRef.current, sceneDataRef2.current, sourceNodeData.id, sceneConfigId2, ownerId2);
|
|
11628
|
+
const targetParentInfo = getParentFileInfoForNode(graphDataRef.current, sceneDataRef2.current, targetNodeData.id, sceneConfigId2, ownerId2);
|
|
11643
11629
|
let parentInfoToSave = sourceParentInfo;
|
|
11644
11630
|
if (sourceParentInfo.parentFileId === sceneConfigId2 && targetParentInfo.parentFileId !== sceneConfigId2) {
|
|
11645
11631
|
parentInfoToSave = targetParentInfo;
|
|
@@ -11656,19 +11642,12 @@ function XViewScene({
|
|
|
11656
11642
|
if (parentFileIdToSave === sceneConfigId2) {
|
|
11657
11643
|
const specificParentData = graphDataRef.current[sceneConfigId2];
|
|
11658
11644
|
specificParentData.links.push(newLink);
|
|
11659
|
-
const currentVisualNodes = Object.values(stateRef2.current.nodeObjects).map((m) => {
|
|
11660
|
-
const { _baseEmissiveIntensity, labelObject, labelOffset, timelineIntervalBar, timelineEndLabel, ...rest } = m.userData;
|
|
11661
|
-
return rest;
|
|
11662
|
-
});
|
|
11663
|
-
const currentVisualLinks = stateRef2.current.allLinks.map((l) => {
|
|
11664
|
-
const { sourceNode, targetNode, ...rest } = l.userData;
|
|
11665
|
-
return rest;
|
|
11666
|
-
});
|
|
11667
|
-
currentVisualLinks.push(newLink);
|
|
11668
11645
|
const viewFilePayload = {
|
|
11669
11646
|
parent_dbs: sceneDataRef2.current.parent_dbs,
|
|
11670
|
-
nodes:
|
|
11671
|
-
|
|
11647
|
+
nodes: sceneDataRef2.current.nodes,
|
|
11648
|
+
// <-- Usa o estado original intocado
|
|
11649
|
+
links: sceneDataRef2.current.links,
|
|
11650
|
+
// <-- Usa o estado original intocado
|
|
11672
11651
|
quest_nodes: specificParentData.nodes,
|
|
11673
11652
|
quest_links: specificParentData.links
|
|
11674
11653
|
// Salva a conexão aqui!
|
|
@@ -12977,11 +12956,12 @@ function XViewScene({
|
|
|
12977
12956
|
const { sourceNode, targetNode, ...serializableLinkData } = line.userData;
|
|
12978
12957
|
return serializableLinkData;
|
|
12979
12958
|
});
|
|
12959
|
+
sceneDataRef.current.nodes = currentNodes;
|
|
12960
|
+
sceneDataRef.current.links = currentLinks;
|
|
12980
12961
|
const sceneFileData = {
|
|
12981
12962
|
parent_dbs: sceneDataRef.current.parent_dbs,
|
|
12982
12963
|
nodes: currentNodes,
|
|
12983
12964
|
links: currentLinks,
|
|
12984
|
-
// --- ADICIONE ESTAS DUAS LINHAS PARA PRESERVAR A FONTE DA VERDADE ---
|
|
12985
12965
|
quest_nodes: ((_a2 = parentDataRef.current[sceneConfigId]) == null ? void 0 : _a2.nodes) || [],
|
|
12986
12966
|
quest_links: ((_b2 = parentDataRef.current[sceneConfigId]) == null ? void 0 : _b2.links) || []
|
|
12987
12967
|
};
|
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.9",
|
|
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",
|