@lv-x-software-house/x_view 1.2.8-dev.12 → 1.2.8-dev.13
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 +31 -86
- package/dist/index.mjs +31 -86
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1530,10 +1530,16 @@ var userActionHandlers = {
|
|
|
1530
1530
|
context.sceneConfigId,
|
|
1531
1531
|
context.ownerId
|
|
1532
1532
|
);
|
|
1533
|
-
|
|
1533
|
+
const targetParentInfo = getParentFileInfoForNode(
|
|
1534
|
+
graphDataRef.current,
|
|
1535
|
+
sceneDataRef.current,
|
|
1536
|
+
targetNodeData.id,
|
|
1537
|
+
context.sceneConfigId,
|
|
1538
|
+
context.ownerId
|
|
1539
|
+
);
|
|
1540
|
+
if (!sourceParentInfo || !sourceParentInfo.ownerId || !targetParentInfo) {
|
|
1534
1541
|
console.error(
|
|
1535
|
-
"N\xE3o foi poss\xEDvel encontrar as informa\xE7\xF5es do arquivo pai (ou ownerId) para
|
|
1536
|
-
sourceNodeData.id
|
|
1542
|
+
"N\xE3o foi poss\xEDvel encontrar as informa\xE7\xF5es do arquivo pai (ou ownerId) para os Nodes da conex\xE3o."
|
|
1537
1543
|
);
|
|
1538
1544
|
alert(
|
|
1539
1545
|
"Ocorreu um erro ao identificar o arquivo pai ou seu propriet\xE1rio."
|
|
@@ -1541,9 +1547,13 @@ var userActionHandlers = {
|
|
|
1541
1547
|
userActionHandlers.handleCancelConnection(context);
|
|
1542
1548
|
return;
|
|
1543
1549
|
}
|
|
1544
|
-
|
|
1545
|
-
const
|
|
1546
|
-
const
|
|
1550
|
+
let parentInfoToSave = sourceParentInfo;
|
|
1551
|
+
const isSourceQuest = sourceParentInfo.parentFileId === context.sceneConfigId;
|
|
1552
|
+
const isTargetQuest = targetParentInfo.parentFileId === context.sceneConfigId;
|
|
1553
|
+
if (isSourceQuest || isTargetQuest) {
|
|
1554
|
+
parentInfoToSave = { parentFileId: context.sceneConfigId, ownerId: context.ownerId };
|
|
1555
|
+
}
|
|
1556
|
+
const { parentFileId: parentFileIdToSave, ownerId: ownerIdToSave } = parentInfoToSave;
|
|
1547
1557
|
const newLink = {
|
|
1548
1558
|
id: `link_${import_short_uuid.default.generate()}`,
|
|
1549
1559
|
source: sourceNodeData.id,
|
|
@@ -1834,14 +1844,21 @@ var userActionHandlers = {
|
|
|
1834
1844
|
);
|
|
1835
1845
|
return;
|
|
1836
1846
|
}
|
|
1837
|
-
const
|
|
1847
|
+
const sourceParentInfo = getParentFileInfoForNode(
|
|
1838
1848
|
graphDataRef.current,
|
|
1839
1849
|
sceneDataRef.current,
|
|
1840
1850
|
linkObject.userData.source,
|
|
1841
1851
|
context.sceneConfigId,
|
|
1842
1852
|
context.ownerId
|
|
1843
1853
|
);
|
|
1844
|
-
|
|
1854
|
+
const targetParentInfo = getParentFileInfoForNode(
|
|
1855
|
+
graphDataRef.current,
|
|
1856
|
+
sceneDataRef.current,
|
|
1857
|
+
linkObject.userData.target,
|
|
1858
|
+
context.sceneConfigId,
|
|
1859
|
+
context.ownerId
|
|
1860
|
+
);
|
|
1861
|
+
if (!sourceParentInfo || !sourceParentInfo.ownerId) {
|
|
1845
1862
|
console.error(
|
|
1846
1863
|
"N\xE3o foi poss\xEDvel encontrar as informa\xE7\xF5es do arquivo pai (ou ownerId) para o link:",
|
|
1847
1864
|
linkIdToDelete
|
|
@@ -1851,6 +1868,12 @@ var userActionHandlers = {
|
|
|
1851
1868
|
);
|
|
1852
1869
|
return;
|
|
1853
1870
|
}
|
|
1871
|
+
let parentInfo = sourceParentInfo;
|
|
1872
|
+
const isSourceQuest = sourceParentInfo.parentFileId === context.sceneConfigId;
|
|
1873
|
+
const isTargetQuest = (targetParentInfo == null ? void 0 : targetParentInfo.parentFileId) === context.sceneConfigId;
|
|
1874
|
+
if (isSourceQuest || isTargetQuest) {
|
|
1875
|
+
parentInfo = { parentFileId: context.sceneConfigId, ownerId: context.ownerId };
|
|
1876
|
+
}
|
|
1854
1877
|
const { parentFileId, ownerId } = parentInfo;
|
|
1855
1878
|
const srcName = ((_c = (_b = (_a = linkObject.userData) == null ? void 0 : _a.sourceNode) == null ? void 0 : _b.userData) == null ? void 0 : _c.name) ?? linkObject.userData.source;
|
|
1856
1879
|
const tgtName = ((_f = (_e = (_d = linkObject.userData) == null ? void 0 : _d.targetNode) == null ? void 0 : _e.userData) == null ? void 0 : _f.name) ?? linkObject.userData.target;
|
|
@@ -18436,84 +18459,6 @@ function XViewScene({
|
|
|
18436
18459
|
alert("Ocorreu um erro ao criar a Quest.");
|
|
18437
18460
|
}
|
|
18438
18461
|
};
|
|
18439
|
-
userActionHandlers.handleCompleteConnection = async (context, targetNodeData) => {
|
|
18440
|
-
const {
|
|
18441
|
-
stateRef: stateRef2,
|
|
18442
|
-
graphDataRef: graphDataRef2,
|
|
18443
|
-
sceneDataRef: sceneDataRef2,
|
|
18444
|
-
sceneConfigId: sceneConfigId2,
|
|
18445
|
-
sceneSaveUrl: sceneSaveUrl2,
|
|
18446
|
-
ownerId: ownerId2
|
|
18447
|
-
} = context;
|
|
18448
|
-
const { sourceNodeData } = stateRef2.current.connection;
|
|
18449
|
-
if (!graphDataRef2.current || !sceneDataRef2.current || !sourceNodeData || !targetNodeData) {
|
|
18450
|
-
userActionHandlers.handleCancelConnection(context);
|
|
18451
|
-
return;
|
|
18452
|
-
}
|
|
18453
|
-
const sourceParentInfo = getParentFileInfoForNode(
|
|
18454
|
-
graphDataRef2.current,
|
|
18455
|
-
sceneDataRef2.current,
|
|
18456
|
-
sourceNodeData.id,
|
|
18457
|
-
sceneConfigId2,
|
|
18458
|
-
ownerId2
|
|
18459
|
-
);
|
|
18460
|
-
const targetParentInfo = getParentFileInfoForNode(
|
|
18461
|
-
graphDataRef2.current,
|
|
18462
|
-
sceneDataRef2.current,
|
|
18463
|
-
targetNodeData.id,
|
|
18464
|
-
sceneConfigId2,
|
|
18465
|
-
ownerId2
|
|
18466
|
-
);
|
|
18467
|
-
let parentInfoToSave = sourceParentInfo;
|
|
18468
|
-
const isSourceQuest = sourceParentInfo.parentFileId === sceneConfigId2;
|
|
18469
|
-
const isTargetQuest = targetParentInfo.parentFileId === sceneConfigId2;
|
|
18470
|
-
if (isSourceQuest || isTargetQuest) {
|
|
18471
|
-
parentInfoToSave = { parentFileId: sceneConfigId2, ownerId: ownerId2 };
|
|
18472
|
-
}
|
|
18473
|
-
const { parentFileId: parentFileIdToSave, ownerId: ownerIdToSave } = parentInfoToSave;
|
|
18474
|
-
const newLink = {
|
|
18475
|
-
id: `link_${import_short_uuid2.default.generate()}`,
|
|
18476
|
-
source: sourceNodeData.id,
|
|
18477
|
-
target: targetNodeData.id
|
|
18478
|
-
};
|
|
18479
|
-
try {
|
|
18480
|
-
if (parentFileIdToSave === sceneConfigId2) {
|
|
18481
|
-
const specificParentData = graphDataRef2.current[sceneConfigId2];
|
|
18482
|
-
specificParentData.links.push(newLink);
|
|
18483
|
-
const viewFilePayload = {
|
|
18484
|
-
...sceneDataRef2.current,
|
|
18485
|
-
quest_counter: sceneDataRef2.current.quest_counter || 1
|
|
18486
|
-
};
|
|
18487
|
-
const questFilePayload = {
|
|
18488
|
-
nodes: specificParentData.nodes,
|
|
18489
|
-
links: specificParentData.links,
|
|
18490
|
-
milestones: sceneDataRef2.current.milestones || []
|
|
18491
|
-
};
|
|
18492
|
-
await context.actions.save_view_data(sceneSaveUrl2, viewFilePayload);
|
|
18493
|
-
const questSaveUrl = sceneSaveUrl2.replace(
|
|
18494
|
-
"x_view_scenes",
|
|
18495
|
-
"x_view_quests"
|
|
18496
|
-
);
|
|
18497
|
-
await context.actions.save_view_data(questSaveUrl, questFilePayload);
|
|
18498
|
-
} else {
|
|
18499
|
-
const specificParentData = JSON.parse(
|
|
18500
|
-
JSON.stringify(graphDataRef2.current[parentFileIdToSave])
|
|
18501
|
-
);
|
|
18502
|
-
specificParentData.links.push(newLink);
|
|
18503
|
-
const filenameForSpecificParent = `x_view_dbs/${ownerIdToSave}/${parentFileIdToSave}`;
|
|
18504
|
-
await context.actions.save_view_data(
|
|
18505
|
-
filenameForSpecificParent,
|
|
18506
|
-
specificParentData
|
|
18507
|
-
);
|
|
18508
|
-
graphDataRef2.current[parentFileIdToSave] = specificParentData;
|
|
18509
|
-
}
|
|
18510
|
-
addNewLinkToScene(stateRef2.current, newLink);
|
|
18511
|
-
} catch (error) {
|
|
18512
|
-
console.error("Falha ao salvar a nova conex\xE3o:", error);
|
|
18513
|
-
alert("Ocorreu um erro ao salvar a nova conex\xE3o.");
|
|
18514
|
-
}
|
|
18515
|
-
userActionHandlers.handleCancelConnection(context);
|
|
18516
|
-
};
|
|
18517
18462
|
const handleClearAncestryVisuals = (0, import_react33.useCallback)((ancestryId) => {
|
|
18518
18463
|
const { renderedAncestries, ancestryGroup } = stateRef.current;
|
|
18519
18464
|
const renderIndex = renderedAncestries.findIndex(
|
package/dist/index.mjs
CHANGED
|
@@ -1491,10 +1491,16 @@ var userActionHandlers = {
|
|
|
1491
1491
|
context.sceneConfigId,
|
|
1492
1492
|
context.ownerId
|
|
1493
1493
|
);
|
|
1494
|
-
|
|
1494
|
+
const targetParentInfo = getParentFileInfoForNode(
|
|
1495
|
+
graphDataRef.current,
|
|
1496
|
+
sceneDataRef.current,
|
|
1497
|
+
targetNodeData.id,
|
|
1498
|
+
context.sceneConfigId,
|
|
1499
|
+
context.ownerId
|
|
1500
|
+
);
|
|
1501
|
+
if (!sourceParentInfo || !sourceParentInfo.ownerId || !targetParentInfo) {
|
|
1495
1502
|
console.error(
|
|
1496
|
-
"N\xE3o foi poss\xEDvel encontrar as informa\xE7\xF5es do arquivo pai (ou ownerId) para
|
|
1497
|
-
sourceNodeData.id
|
|
1503
|
+
"N\xE3o foi poss\xEDvel encontrar as informa\xE7\xF5es do arquivo pai (ou ownerId) para os Nodes da conex\xE3o."
|
|
1498
1504
|
);
|
|
1499
1505
|
alert(
|
|
1500
1506
|
"Ocorreu um erro ao identificar o arquivo pai ou seu propriet\xE1rio."
|
|
@@ -1502,9 +1508,13 @@ var userActionHandlers = {
|
|
|
1502
1508
|
userActionHandlers.handleCancelConnection(context);
|
|
1503
1509
|
return;
|
|
1504
1510
|
}
|
|
1505
|
-
|
|
1506
|
-
const
|
|
1507
|
-
const
|
|
1511
|
+
let parentInfoToSave = sourceParentInfo;
|
|
1512
|
+
const isSourceQuest = sourceParentInfo.parentFileId === context.sceneConfigId;
|
|
1513
|
+
const isTargetQuest = targetParentInfo.parentFileId === context.sceneConfigId;
|
|
1514
|
+
if (isSourceQuest || isTargetQuest) {
|
|
1515
|
+
parentInfoToSave = { parentFileId: context.sceneConfigId, ownerId: context.ownerId };
|
|
1516
|
+
}
|
|
1517
|
+
const { parentFileId: parentFileIdToSave, ownerId: ownerIdToSave } = parentInfoToSave;
|
|
1508
1518
|
const newLink = {
|
|
1509
1519
|
id: `link_${short.generate()}`,
|
|
1510
1520
|
source: sourceNodeData.id,
|
|
@@ -1795,14 +1805,21 @@ var userActionHandlers = {
|
|
|
1795
1805
|
);
|
|
1796
1806
|
return;
|
|
1797
1807
|
}
|
|
1798
|
-
const
|
|
1808
|
+
const sourceParentInfo = getParentFileInfoForNode(
|
|
1799
1809
|
graphDataRef.current,
|
|
1800
1810
|
sceneDataRef.current,
|
|
1801
1811
|
linkObject.userData.source,
|
|
1802
1812
|
context.sceneConfigId,
|
|
1803
1813
|
context.ownerId
|
|
1804
1814
|
);
|
|
1805
|
-
|
|
1815
|
+
const targetParentInfo = getParentFileInfoForNode(
|
|
1816
|
+
graphDataRef.current,
|
|
1817
|
+
sceneDataRef.current,
|
|
1818
|
+
linkObject.userData.target,
|
|
1819
|
+
context.sceneConfigId,
|
|
1820
|
+
context.ownerId
|
|
1821
|
+
);
|
|
1822
|
+
if (!sourceParentInfo || !sourceParentInfo.ownerId) {
|
|
1806
1823
|
console.error(
|
|
1807
1824
|
"N\xE3o foi poss\xEDvel encontrar as informa\xE7\xF5es do arquivo pai (ou ownerId) para o link:",
|
|
1808
1825
|
linkIdToDelete
|
|
@@ -1812,6 +1829,12 @@ var userActionHandlers = {
|
|
|
1812
1829
|
);
|
|
1813
1830
|
return;
|
|
1814
1831
|
}
|
|
1832
|
+
let parentInfo = sourceParentInfo;
|
|
1833
|
+
const isSourceQuest = sourceParentInfo.parentFileId === context.sceneConfigId;
|
|
1834
|
+
const isTargetQuest = (targetParentInfo == null ? void 0 : targetParentInfo.parentFileId) === context.sceneConfigId;
|
|
1835
|
+
if (isSourceQuest || isTargetQuest) {
|
|
1836
|
+
parentInfo = { parentFileId: context.sceneConfigId, ownerId: context.ownerId };
|
|
1837
|
+
}
|
|
1815
1838
|
const { parentFileId, ownerId } = parentInfo;
|
|
1816
1839
|
const srcName = ((_c = (_b = (_a = linkObject.userData) == null ? void 0 : _a.sourceNode) == null ? void 0 : _b.userData) == null ? void 0 : _c.name) ?? linkObject.userData.source;
|
|
1817
1840
|
const tgtName = ((_f = (_e = (_d = linkObject.userData) == null ? void 0 : _d.targetNode) == null ? void 0 : _e.userData) == null ? void 0 : _f.name) ?? linkObject.userData.target;
|
|
@@ -18499,84 +18522,6 @@ function XViewScene({
|
|
|
18499
18522
|
alert("Ocorreu um erro ao criar a Quest.");
|
|
18500
18523
|
}
|
|
18501
18524
|
};
|
|
18502
|
-
userActionHandlers.handleCompleteConnection = async (context, targetNodeData) => {
|
|
18503
|
-
const {
|
|
18504
|
-
stateRef: stateRef2,
|
|
18505
|
-
graphDataRef: graphDataRef2,
|
|
18506
|
-
sceneDataRef: sceneDataRef2,
|
|
18507
|
-
sceneConfigId: sceneConfigId2,
|
|
18508
|
-
sceneSaveUrl: sceneSaveUrl2,
|
|
18509
|
-
ownerId: ownerId2
|
|
18510
|
-
} = context;
|
|
18511
|
-
const { sourceNodeData } = stateRef2.current.connection;
|
|
18512
|
-
if (!graphDataRef2.current || !sceneDataRef2.current || !sourceNodeData || !targetNodeData) {
|
|
18513
|
-
userActionHandlers.handleCancelConnection(context);
|
|
18514
|
-
return;
|
|
18515
|
-
}
|
|
18516
|
-
const sourceParentInfo = getParentFileInfoForNode(
|
|
18517
|
-
graphDataRef2.current,
|
|
18518
|
-
sceneDataRef2.current,
|
|
18519
|
-
sourceNodeData.id,
|
|
18520
|
-
sceneConfigId2,
|
|
18521
|
-
ownerId2
|
|
18522
|
-
);
|
|
18523
|
-
const targetParentInfo = getParentFileInfoForNode(
|
|
18524
|
-
graphDataRef2.current,
|
|
18525
|
-
sceneDataRef2.current,
|
|
18526
|
-
targetNodeData.id,
|
|
18527
|
-
sceneConfigId2,
|
|
18528
|
-
ownerId2
|
|
18529
|
-
);
|
|
18530
|
-
let parentInfoToSave = sourceParentInfo;
|
|
18531
|
-
const isSourceQuest = sourceParentInfo.parentFileId === sceneConfigId2;
|
|
18532
|
-
const isTargetQuest = targetParentInfo.parentFileId === sceneConfigId2;
|
|
18533
|
-
if (isSourceQuest || isTargetQuest) {
|
|
18534
|
-
parentInfoToSave = { parentFileId: sceneConfigId2, ownerId: ownerId2 };
|
|
18535
|
-
}
|
|
18536
|
-
const { parentFileId: parentFileIdToSave, ownerId: ownerIdToSave } = parentInfoToSave;
|
|
18537
|
-
const newLink = {
|
|
18538
|
-
id: `link_${short2.generate()}`,
|
|
18539
|
-
source: sourceNodeData.id,
|
|
18540
|
-
target: targetNodeData.id
|
|
18541
|
-
};
|
|
18542
|
-
try {
|
|
18543
|
-
if (parentFileIdToSave === sceneConfigId2) {
|
|
18544
|
-
const specificParentData = graphDataRef2.current[sceneConfigId2];
|
|
18545
|
-
specificParentData.links.push(newLink);
|
|
18546
|
-
const viewFilePayload = {
|
|
18547
|
-
...sceneDataRef2.current,
|
|
18548
|
-
quest_counter: sceneDataRef2.current.quest_counter || 1
|
|
18549
|
-
};
|
|
18550
|
-
const questFilePayload = {
|
|
18551
|
-
nodes: specificParentData.nodes,
|
|
18552
|
-
links: specificParentData.links,
|
|
18553
|
-
milestones: sceneDataRef2.current.milestones || []
|
|
18554
|
-
};
|
|
18555
|
-
await context.actions.save_view_data(sceneSaveUrl2, viewFilePayload);
|
|
18556
|
-
const questSaveUrl = sceneSaveUrl2.replace(
|
|
18557
|
-
"x_view_scenes",
|
|
18558
|
-
"x_view_quests"
|
|
18559
|
-
);
|
|
18560
|
-
await context.actions.save_view_data(questSaveUrl, questFilePayload);
|
|
18561
|
-
} else {
|
|
18562
|
-
const specificParentData = JSON.parse(
|
|
18563
|
-
JSON.stringify(graphDataRef2.current[parentFileIdToSave])
|
|
18564
|
-
);
|
|
18565
|
-
specificParentData.links.push(newLink);
|
|
18566
|
-
const filenameForSpecificParent = `x_view_dbs/${ownerIdToSave}/${parentFileIdToSave}`;
|
|
18567
|
-
await context.actions.save_view_data(
|
|
18568
|
-
filenameForSpecificParent,
|
|
18569
|
-
specificParentData
|
|
18570
|
-
);
|
|
18571
|
-
graphDataRef2.current[parentFileIdToSave] = specificParentData;
|
|
18572
|
-
}
|
|
18573
|
-
addNewLinkToScene(stateRef2.current, newLink);
|
|
18574
|
-
} catch (error) {
|
|
18575
|
-
console.error("Falha ao salvar a nova conex\xE3o:", error);
|
|
18576
|
-
alert("Ocorreu um erro ao salvar a nova conex\xE3o.");
|
|
18577
|
-
}
|
|
18578
|
-
userActionHandlers.handleCancelConnection(context);
|
|
18579
|
-
};
|
|
18580
18525
|
const handleClearAncestryVisuals = useCallback7((ancestryId) => {
|
|
18581
18526
|
const { renderedAncestries, ancestryGroup } = stateRef.current;
|
|
18582
18527
|
const renderIndex = renderedAncestries.findIndex(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lv-x-software-house/x_view",
|
|
3
|
-
"version": "1.2.8-dev.
|
|
3
|
+
"version": "1.2.8-dev.13",
|
|
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",
|