@lv-x-software-house/x_view 1.2.8-dev.14 → 1.2.8-dev.16
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 +57 -42
- package/dist/index.mjs +57 -42
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1282,8 +1282,8 @@ var userActionHandlers = {
|
|
|
1282
1282
|
specificParentData.nodes.push(newNode);
|
|
1283
1283
|
specificParentData.links.push(newLink);
|
|
1284
1284
|
try {
|
|
1285
|
-
const
|
|
1286
|
-
if (
|
|
1285
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
1286
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
1287
1287
|
const viewFilePayload = {
|
|
1288
1288
|
parent_dbs: sceneDataRef.current.parent_dbs,
|
|
1289
1289
|
nodes: sceneDataRef.current.nodes,
|
|
@@ -1312,7 +1312,7 @@ var userActionHandlers = {
|
|
|
1312
1312
|
);
|
|
1313
1313
|
}
|
|
1314
1314
|
graphDataRef.current[parentFileId] = specificParentData;
|
|
1315
|
-
if (
|
|
1315
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
1316
1316
|
sceneDataRef.current.quest_nodes = [...specificParentData.nodes];
|
|
1317
1317
|
}
|
|
1318
1318
|
const finalPosition = stateRef.current.ghostElements.node.position.clone();
|
|
@@ -1378,7 +1378,12 @@ var userActionHandlers = {
|
|
|
1378
1378
|
)
|
|
1379
1379
|
);
|
|
1380
1380
|
targetFinalPositions.push(endPosition);
|
|
1381
|
-
const targetMesh = createNodeMesh(
|
|
1381
|
+
const targetMesh = createNodeMesh(
|
|
1382
|
+
nodeData,
|
|
1383
|
+
startPosition,
|
|
1384
|
+
glowTexture,
|
|
1385
|
+
!!nodeData.is_quest
|
|
1386
|
+
);
|
|
1382
1387
|
targetMesh.scale.set(0.01, 0.01, 0.01);
|
|
1383
1388
|
graphGroup.add(targetMesh);
|
|
1384
1389
|
if (targetMesh.userData.labelObject) {
|
|
@@ -1560,8 +1565,8 @@ var userActionHandlers = {
|
|
|
1560
1565
|
target: targetNodeData.id
|
|
1561
1566
|
};
|
|
1562
1567
|
try {
|
|
1563
|
-
const
|
|
1564
|
-
if (
|
|
1568
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
1569
|
+
if (isView && parentFileIdToSave === context.sceneConfigId) {
|
|
1565
1570
|
const specificParentData = graphDataRef.current[context.sceneConfigId];
|
|
1566
1571
|
specificParentData.links.push(newLink);
|
|
1567
1572
|
const viewFilePayload = {
|
|
@@ -1723,8 +1728,8 @@ var userActionHandlers = {
|
|
|
1723
1728
|
};
|
|
1724
1729
|
const saveParentData = async (fileId, fileOwnerId, data) => {
|
|
1725
1730
|
var _a;
|
|
1726
|
-
const
|
|
1727
|
-
if (
|
|
1731
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
1732
|
+
if (isView && fileId === context.sceneConfigId) {
|
|
1728
1733
|
const viewFilePayload = {
|
|
1729
1734
|
parent_dbs: sceneDataRef.current.parent_dbs,
|
|
1730
1735
|
nodes: sceneDataRef.current.nodes,
|
|
@@ -1886,8 +1891,8 @@ var userActionHandlers = {
|
|
|
1886
1891
|
specificParentData.links = newLinks;
|
|
1887
1892
|
let filenameToSave;
|
|
1888
1893
|
let payloadToSave;
|
|
1889
|
-
const
|
|
1890
|
-
if (
|
|
1894
|
+
const isView = ((_g = context.viewType) == null ? void 0 : _g.toLowerCase()) === "view";
|
|
1895
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
1891
1896
|
filenameToSave = context.sceneSaveUrl;
|
|
1892
1897
|
sceneDataRef.current.links = sceneDataRef.current.links.filter(
|
|
1893
1898
|
(l) => String(l.id) !== String(linkIdToDelete)
|
|
@@ -1903,7 +1908,7 @@ var userActionHandlers = {
|
|
|
1903
1908
|
}
|
|
1904
1909
|
try {
|
|
1905
1910
|
await context.actions.save_view_data(filenameToSave, payloadToSave);
|
|
1906
|
-
if (
|
|
1911
|
+
if (isView && parentFileId === context.sceneConfigId && context.actions.delete_quest_link_firestore) {
|
|
1907
1912
|
await context.actions.delete_quest_link_firestore(
|
|
1908
1913
|
context.ownerId,
|
|
1909
1914
|
context.sceneConfigId,
|
|
@@ -2123,8 +2128,8 @@ var userActionHandlers = {
|
|
|
2123
2128
|
);
|
|
2124
2129
|
let filenameToSave;
|
|
2125
2130
|
let payloadToSave;
|
|
2126
|
-
const
|
|
2127
|
-
if (
|
|
2131
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
2132
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
2128
2133
|
filenameToSave = context.sceneSaveUrl;
|
|
2129
2134
|
const strNodesToDelete = Array.from(nodesToDelete).map(String);
|
|
2130
2135
|
const strLinksToDelete = Array.from(linksToDelete).map(String);
|
|
@@ -2238,8 +2243,8 @@ var userActionHandlers = {
|
|
|
2238
2243
|
specificParentData.links = newLinks;
|
|
2239
2244
|
let filenameToSave;
|
|
2240
2245
|
let payloadToSave;
|
|
2241
|
-
const
|
|
2242
|
-
if (
|
|
2246
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
2247
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
2243
2248
|
filenameToSave = context.sceneSaveUrl;
|
|
2244
2249
|
const newVisualNodes = sceneDataRef.current.nodes.filter(
|
|
2245
2250
|
(n) => String(n.id) !== strNodeId
|
|
@@ -2305,6 +2310,7 @@ var userActionHandlers = {
|
|
|
2305
2310
|
var _a, _b, _c, _d;
|
|
2306
2311
|
const { graphDataRef, sceneDataRef, stateRef, setters } = context;
|
|
2307
2312
|
if (!graphDataRef.current || !sceneDataRef.current) return;
|
|
2313
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
2308
2314
|
const {
|
|
2309
2315
|
_baseEmissiveIntensity,
|
|
2310
2316
|
_baseScale,
|
|
@@ -2349,7 +2355,7 @@ var userActionHandlers = {
|
|
|
2349
2355
|
const oldNode = specificParentData.nodes[nodeIndex];
|
|
2350
2356
|
const isNewDone = oldNode.status !== "Done" && nodeToSave.status === "Done";
|
|
2351
2357
|
specificParentData.nodes[nodeIndex] = { ...nodeToSave };
|
|
2352
|
-
if (isNewDone && nodeToSave.is_quest && ((
|
|
2358
|
+
if (isNewDone && nodeToSave.is_quest && ((_b = nodeToSave.recurrence_config) == null ? void 0 : _b.enabled)) {
|
|
2353
2359
|
const nextDateObj = calculateNextRecurrenceDate(
|
|
2354
2360
|
nodeToSave.recurrence_config
|
|
2355
2361
|
);
|
|
@@ -2394,7 +2400,7 @@ var userActionHandlers = {
|
|
|
2394
2400
|
],
|
|
2395
2401
|
version_node: {
|
|
2396
2402
|
is_version: true,
|
|
2397
|
-
parent_node: ((
|
|
2403
|
+
parent_node: ((_c = nodeToSave.version_node) == null ? void 0 : _c.parent_node) || nodeToSave.id
|
|
2398
2404
|
},
|
|
2399
2405
|
reviewStack: (nodeToSave.reviewStack || []).map((r) => ({
|
|
2400
2406
|
...r,
|
|
@@ -2402,7 +2408,7 @@ var userActionHandlers = {
|
|
|
2402
2408
|
})),
|
|
2403
2409
|
recurrence_config: nextRecurrenceConfig
|
|
2404
2410
|
};
|
|
2405
|
-
const rootId = ((
|
|
2411
|
+
const rootId = ((_d = nodeToSave.version_node) == null ? void 0 : _d.parent_node) || nodeToSave.id;
|
|
2406
2412
|
const nextQuestLink = {
|
|
2407
2413
|
id: `link_${import_short_uuid.default.generate()}`,
|
|
2408
2414
|
source: rootId,
|
|
@@ -2452,8 +2458,7 @@ var userActionHandlers = {
|
|
|
2452
2458
|
}
|
|
2453
2459
|
}
|
|
2454
2460
|
try {
|
|
2455
|
-
|
|
2456
|
-
if (isView2 && parentFileId === context.sceneConfigId) {
|
|
2461
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
2457
2462
|
const visualNodeIndex = sceneDataRef.current.nodes.findIndex(
|
|
2458
2463
|
(n) => String(n.id) === String(nodeToSave.id)
|
|
2459
2464
|
);
|
|
@@ -2492,7 +2497,7 @@ var userActionHandlers = {
|
|
|
2492
2497
|
);
|
|
2493
2498
|
}
|
|
2494
2499
|
graphDataRef.current[parentFileId] = specificParentData;
|
|
2495
|
-
if (
|
|
2500
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
2496
2501
|
sceneDataRef.current.quest_nodes = [...specificParentData.nodes];
|
|
2497
2502
|
}
|
|
2498
2503
|
updateExistingNodeVisuals(stateRef.current, nodeToSave);
|
|
@@ -2545,8 +2550,8 @@ var userActionHandlers = {
|
|
|
2545
2550
|
return;
|
|
2546
2551
|
}
|
|
2547
2552
|
try {
|
|
2548
|
-
const
|
|
2549
|
-
if (
|
|
2553
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
2554
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
2550
2555
|
const viewFilePayload = {
|
|
2551
2556
|
parent_dbs: sceneDataRef.current.parent_dbs,
|
|
2552
2557
|
nodes: sceneDataRef.current.nodes,
|
|
@@ -16174,11 +16179,19 @@ function XViewScene({
|
|
|
16174
16179
|
}
|
|
16175
16180
|
}
|
|
16176
16181
|
Object.values(nodeObjects).forEach((mesh) => {
|
|
16177
|
-
const
|
|
16178
|
-
if (
|
|
16179
|
-
mesh.remove(
|
|
16180
|
-
if (
|
|
16181
|
-
|
|
16182
|
+
const oldTimelineLabel = mesh.getObjectByName("timelineLabel");
|
|
16183
|
+
if (oldTimelineLabel) {
|
|
16184
|
+
mesh.remove(oldTimelineLabel);
|
|
16185
|
+
if (oldTimelineLabel.material.map)
|
|
16186
|
+
oldTimelineLabel.material.map.dispose();
|
|
16187
|
+
oldTimelineLabel.material.dispose();
|
|
16188
|
+
}
|
|
16189
|
+
const oldQuestDateLabel = mesh.getObjectByName("questDateLabel");
|
|
16190
|
+
if (oldQuestDateLabel) {
|
|
16191
|
+
mesh.remove(oldQuestDateLabel);
|
|
16192
|
+
if (oldQuestDateLabel.material.map)
|
|
16193
|
+
oldQuestDateLabel.material.map.dispose();
|
|
16194
|
+
oldQuestDateLabel.material.dispose();
|
|
16182
16195
|
}
|
|
16183
16196
|
delete mesh.userData.timelineIntervalBar;
|
|
16184
16197
|
delete mesh.userData.timelineEndLabel;
|
|
@@ -16419,11 +16432,13 @@ function XViewScene({
|
|
|
16419
16432
|
const versionTween = new import_tween2.Tween(mesh.position).to({ x: baseX, y, z: 0 }, 1500).easing(import_tween2.Easing.Cubic.InOut);
|
|
16420
16433
|
tweenGroup.add(versionTween);
|
|
16421
16434
|
versionTween.start();
|
|
16422
|
-
|
|
16423
|
-
|
|
16424
|
-
|
|
16425
|
-
|
|
16426
|
-
|
|
16435
|
+
if (!mesh.getObjectByName("questDateLabel")) {
|
|
16436
|
+
const startLabelText = type === "interval" ? startDate.getFullYear().toString() : label;
|
|
16437
|
+
const startLabel = createTextSprite(startLabelText, 48);
|
|
16438
|
+
startLabel.name = "timelineLabel";
|
|
16439
|
+
startLabel.position.set(0, -2.5, 0);
|
|
16440
|
+
mesh.add(startLabel);
|
|
16441
|
+
}
|
|
16427
16442
|
if (type === "interval") {
|
|
16428
16443
|
const relativeEndY = timeToYMap.get(endDate.getTime()) - timeToYMap.get(startDate.getTime());
|
|
16429
16444
|
if (relativeEndY > 0) {
|
|
@@ -20181,8 +20196,8 @@ function XViewScene({
|
|
|
20181
20196
|
if (!sceneDataRef.current) return;
|
|
20182
20197
|
sceneDataRef.current.milestones = newMilestones;
|
|
20183
20198
|
setSceneVersion((v) => v + 1);
|
|
20184
|
-
const
|
|
20185
|
-
if (!
|
|
20199
|
+
const isView = ((_a2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _a2.toLowerCase()) === "view";
|
|
20200
|
+
if (!isView || !save_view_data || !sceneSaveUrl) return;
|
|
20186
20201
|
const questFileData = {
|
|
20187
20202
|
nodes: ((_b2 = parentDataRef.current[sceneConfigId]) == null ? void 0 : _b2.nodes) || sceneDataRef.current.quest_nodes || [],
|
|
20188
20203
|
links: ((_c2 = parentDataRef.current[sceneConfigId]) == null ? void 0 : _c2.links) || sceneDataRef.current.quest_links || [],
|
|
@@ -20229,7 +20244,7 @@ function XViewScene({
|
|
|
20229
20244
|
});
|
|
20230
20245
|
sceneDataRef.current.nodes = currentNodes;
|
|
20231
20246
|
sceneDataRef.current.links = currentLinks;
|
|
20232
|
-
const
|
|
20247
|
+
const isView = ((_a2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _a2.toLowerCase()) === "view";
|
|
20233
20248
|
const sceneFileData = {
|
|
20234
20249
|
...sceneDataRef.current,
|
|
20235
20250
|
nodes: currentNodes,
|
|
@@ -20351,8 +20366,8 @@ function XViewScene({
|
|
|
20351
20366
|
if (event.key.toLowerCase() === "q") {
|
|
20352
20367
|
const isUiClear = !stateRef.current.creation.isActive && !stateRef.current.connection.isActive && !stateRef.current.relink.isActive && !stateRef.current.ancestry.isActive && !((_b2 = context.versionMode) == null ? void 0 : _b2.isActive) && !contextMenu.visible && !multiContextMenu.visible && !relationshipMenu.visible && !readingMode.isActive && !isImportModalOpen && !isBoardsOpen && !isSidebarOpen && !isMilestoneManagerOpen && !detailsNode && !detailsLink && !ancestryLinkDetails && !imageViewer.visible && !editingAncestryRel.visible && !questMode.isActive;
|
|
20353
20368
|
if (isUiClear) {
|
|
20354
|
-
const
|
|
20355
|
-
if (!
|
|
20369
|
+
const isView = ((_c2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _c2.toLowerCase()) === "view";
|
|
20370
|
+
if (!isView) return;
|
|
20356
20371
|
const {
|
|
20357
20372
|
graphGroup,
|
|
20358
20373
|
glowTexture,
|
|
@@ -21137,11 +21152,11 @@ async function get_scene_view_data_logic(db_services, scene_config, owner_id, ty
|
|
|
21137
21152
|
parentDbObjects.push({ db_id: scene_config, owner_id });
|
|
21138
21153
|
}
|
|
21139
21154
|
}
|
|
21140
|
-
const
|
|
21155
|
+
const isView = type && type.toLowerCase() === "view";
|
|
21141
21156
|
const parentResponsesPromises = parentDbObjects.map(
|
|
21142
21157
|
(db_info) => db_services.get_file(`x_view_dbs/${db_info.owner_id}/${db_info.db_id}`)
|
|
21143
21158
|
);
|
|
21144
|
-
if (
|
|
21159
|
+
if (isView) {
|
|
21145
21160
|
const questFetchWithMigrationPromise = (async () => {
|
|
21146
21161
|
try {
|
|
21147
21162
|
const questsResponse = await db_services.get_view_quests_firestore(
|
|
@@ -21183,7 +21198,7 @@ async function get_scene_view_data_logic(db_services, scene_config, owner_id, ty
|
|
|
21183
21198
|
let questDataObj = null;
|
|
21184
21199
|
for (let i = 0; i < parentResponsesResults.length; i++) {
|
|
21185
21200
|
const result = parentResponsesResults[i];
|
|
21186
|
-
if (
|
|
21201
|
+
if (isView && i === parentResponsesResults.length - 1) {
|
|
21187
21202
|
if (result.status === "fulfilled" && ((_a = result.value) == null ? void 0 : _a.success)) {
|
|
21188
21203
|
questDataObj = result.value.data;
|
|
21189
21204
|
if (result.value.quest_counter !== void 0) {
|
|
@@ -21205,7 +21220,7 @@ async function get_scene_view_data_logic(db_services, scene_config, owner_id, ty
|
|
|
21205
21220
|
const currentQuestNodes = (questDataObj == null ? void 0 : questDataObj.nodes) || [];
|
|
21206
21221
|
const currentQuestLinks = (questDataObj == null ? void 0 : questDataObj.links) || [];
|
|
21207
21222
|
const currentMilestones = (questDataObj == null ? void 0 : questDataObj.milestones) || [];
|
|
21208
|
-
if (
|
|
21223
|
+
if (isView) {
|
|
21209
21224
|
parentData[scene_config] = {
|
|
21210
21225
|
dataset_name: "Quests Internas (View)",
|
|
21211
21226
|
nodes: currentQuestNodes,
|
package/dist/index.mjs
CHANGED
|
@@ -1243,8 +1243,8 @@ var userActionHandlers = {
|
|
|
1243
1243
|
specificParentData.nodes.push(newNode);
|
|
1244
1244
|
specificParentData.links.push(newLink);
|
|
1245
1245
|
try {
|
|
1246
|
-
const
|
|
1247
|
-
if (
|
|
1246
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
1247
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
1248
1248
|
const viewFilePayload = {
|
|
1249
1249
|
parent_dbs: sceneDataRef.current.parent_dbs,
|
|
1250
1250
|
nodes: sceneDataRef.current.nodes,
|
|
@@ -1273,7 +1273,7 @@ var userActionHandlers = {
|
|
|
1273
1273
|
);
|
|
1274
1274
|
}
|
|
1275
1275
|
graphDataRef.current[parentFileId] = specificParentData;
|
|
1276
|
-
if (
|
|
1276
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
1277
1277
|
sceneDataRef.current.quest_nodes = [...specificParentData.nodes];
|
|
1278
1278
|
}
|
|
1279
1279
|
const finalPosition = stateRef.current.ghostElements.node.position.clone();
|
|
@@ -1339,7 +1339,12 @@ var userActionHandlers = {
|
|
|
1339
1339
|
)
|
|
1340
1340
|
);
|
|
1341
1341
|
targetFinalPositions.push(endPosition);
|
|
1342
|
-
const targetMesh = createNodeMesh(
|
|
1342
|
+
const targetMesh = createNodeMesh(
|
|
1343
|
+
nodeData,
|
|
1344
|
+
startPosition,
|
|
1345
|
+
glowTexture,
|
|
1346
|
+
!!nodeData.is_quest
|
|
1347
|
+
);
|
|
1343
1348
|
targetMesh.scale.set(0.01, 0.01, 0.01);
|
|
1344
1349
|
graphGroup.add(targetMesh);
|
|
1345
1350
|
if (targetMesh.userData.labelObject) {
|
|
@@ -1521,8 +1526,8 @@ var userActionHandlers = {
|
|
|
1521
1526
|
target: targetNodeData.id
|
|
1522
1527
|
};
|
|
1523
1528
|
try {
|
|
1524
|
-
const
|
|
1525
|
-
if (
|
|
1529
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
1530
|
+
if (isView && parentFileIdToSave === context.sceneConfigId) {
|
|
1526
1531
|
const specificParentData = graphDataRef.current[context.sceneConfigId];
|
|
1527
1532
|
specificParentData.links.push(newLink);
|
|
1528
1533
|
const viewFilePayload = {
|
|
@@ -1684,8 +1689,8 @@ var userActionHandlers = {
|
|
|
1684
1689
|
};
|
|
1685
1690
|
const saveParentData = async (fileId, fileOwnerId, data) => {
|
|
1686
1691
|
var _a;
|
|
1687
|
-
const
|
|
1688
|
-
if (
|
|
1692
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
1693
|
+
if (isView && fileId === context.sceneConfigId) {
|
|
1689
1694
|
const viewFilePayload = {
|
|
1690
1695
|
parent_dbs: sceneDataRef.current.parent_dbs,
|
|
1691
1696
|
nodes: sceneDataRef.current.nodes,
|
|
@@ -1847,8 +1852,8 @@ var userActionHandlers = {
|
|
|
1847
1852
|
specificParentData.links = newLinks;
|
|
1848
1853
|
let filenameToSave;
|
|
1849
1854
|
let payloadToSave;
|
|
1850
|
-
const
|
|
1851
|
-
if (
|
|
1855
|
+
const isView = ((_g = context.viewType) == null ? void 0 : _g.toLowerCase()) === "view";
|
|
1856
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
1852
1857
|
filenameToSave = context.sceneSaveUrl;
|
|
1853
1858
|
sceneDataRef.current.links = sceneDataRef.current.links.filter(
|
|
1854
1859
|
(l) => String(l.id) !== String(linkIdToDelete)
|
|
@@ -1864,7 +1869,7 @@ var userActionHandlers = {
|
|
|
1864
1869
|
}
|
|
1865
1870
|
try {
|
|
1866
1871
|
await context.actions.save_view_data(filenameToSave, payloadToSave);
|
|
1867
|
-
if (
|
|
1872
|
+
if (isView && parentFileId === context.sceneConfigId && context.actions.delete_quest_link_firestore) {
|
|
1868
1873
|
await context.actions.delete_quest_link_firestore(
|
|
1869
1874
|
context.ownerId,
|
|
1870
1875
|
context.sceneConfigId,
|
|
@@ -2084,8 +2089,8 @@ var userActionHandlers = {
|
|
|
2084
2089
|
);
|
|
2085
2090
|
let filenameToSave;
|
|
2086
2091
|
let payloadToSave;
|
|
2087
|
-
const
|
|
2088
|
-
if (
|
|
2092
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
2093
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
2089
2094
|
filenameToSave = context.sceneSaveUrl;
|
|
2090
2095
|
const strNodesToDelete = Array.from(nodesToDelete).map(String);
|
|
2091
2096
|
const strLinksToDelete = Array.from(linksToDelete).map(String);
|
|
@@ -2199,8 +2204,8 @@ var userActionHandlers = {
|
|
|
2199
2204
|
specificParentData.links = newLinks;
|
|
2200
2205
|
let filenameToSave;
|
|
2201
2206
|
let payloadToSave;
|
|
2202
|
-
const
|
|
2203
|
-
if (
|
|
2207
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
2208
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
2204
2209
|
filenameToSave = context.sceneSaveUrl;
|
|
2205
2210
|
const newVisualNodes = sceneDataRef.current.nodes.filter(
|
|
2206
2211
|
(n) => String(n.id) !== strNodeId
|
|
@@ -2266,6 +2271,7 @@ var userActionHandlers = {
|
|
|
2266
2271
|
var _a, _b, _c, _d;
|
|
2267
2272
|
const { graphDataRef, sceneDataRef, stateRef, setters } = context;
|
|
2268
2273
|
if (!graphDataRef.current || !sceneDataRef.current) return;
|
|
2274
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
2269
2275
|
const {
|
|
2270
2276
|
_baseEmissiveIntensity,
|
|
2271
2277
|
_baseScale,
|
|
@@ -2310,7 +2316,7 @@ var userActionHandlers = {
|
|
|
2310
2316
|
const oldNode = specificParentData.nodes[nodeIndex];
|
|
2311
2317
|
const isNewDone = oldNode.status !== "Done" && nodeToSave.status === "Done";
|
|
2312
2318
|
specificParentData.nodes[nodeIndex] = { ...nodeToSave };
|
|
2313
|
-
if (isNewDone && nodeToSave.is_quest && ((
|
|
2319
|
+
if (isNewDone && nodeToSave.is_quest && ((_b = nodeToSave.recurrence_config) == null ? void 0 : _b.enabled)) {
|
|
2314
2320
|
const nextDateObj = calculateNextRecurrenceDate(
|
|
2315
2321
|
nodeToSave.recurrence_config
|
|
2316
2322
|
);
|
|
@@ -2355,7 +2361,7 @@ var userActionHandlers = {
|
|
|
2355
2361
|
],
|
|
2356
2362
|
version_node: {
|
|
2357
2363
|
is_version: true,
|
|
2358
|
-
parent_node: ((
|
|
2364
|
+
parent_node: ((_c = nodeToSave.version_node) == null ? void 0 : _c.parent_node) || nodeToSave.id
|
|
2359
2365
|
},
|
|
2360
2366
|
reviewStack: (nodeToSave.reviewStack || []).map((r) => ({
|
|
2361
2367
|
...r,
|
|
@@ -2363,7 +2369,7 @@ var userActionHandlers = {
|
|
|
2363
2369
|
})),
|
|
2364
2370
|
recurrence_config: nextRecurrenceConfig
|
|
2365
2371
|
};
|
|
2366
|
-
const rootId = ((
|
|
2372
|
+
const rootId = ((_d = nodeToSave.version_node) == null ? void 0 : _d.parent_node) || nodeToSave.id;
|
|
2367
2373
|
const nextQuestLink = {
|
|
2368
2374
|
id: `link_${short.generate()}`,
|
|
2369
2375
|
source: rootId,
|
|
@@ -2413,8 +2419,7 @@ var userActionHandlers = {
|
|
|
2413
2419
|
}
|
|
2414
2420
|
}
|
|
2415
2421
|
try {
|
|
2416
|
-
|
|
2417
|
-
if (isView2 && parentFileId === context.sceneConfigId) {
|
|
2422
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
2418
2423
|
const visualNodeIndex = sceneDataRef.current.nodes.findIndex(
|
|
2419
2424
|
(n) => String(n.id) === String(nodeToSave.id)
|
|
2420
2425
|
);
|
|
@@ -2453,7 +2458,7 @@ var userActionHandlers = {
|
|
|
2453
2458
|
);
|
|
2454
2459
|
}
|
|
2455
2460
|
graphDataRef.current[parentFileId] = specificParentData;
|
|
2456
|
-
if (
|
|
2461
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
2457
2462
|
sceneDataRef.current.quest_nodes = [...specificParentData.nodes];
|
|
2458
2463
|
}
|
|
2459
2464
|
updateExistingNodeVisuals(stateRef.current, nodeToSave);
|
|
@@ -2506,8 +2511,8 @@ var userActionHandlers = {
|
|
|
2506
2511
|
return;
|
|
2507
2512
|
}
|
|
2508
2513
|
try {
|
|
2509
|
-
const
|
|
2510
|
-
if (
|
|
2514
|
+
const isView = ((_a = context.viewType) == null ? void 0 : _a.toLowerCase()) === "view";
|
|
2515
|
+
if (isView && parentFileId === context.sceneConfigId) {
|
|
2511
2516
|
const viewFilePayload = {
|
|
2512
2517
|
parent_dbs: sceneDataRef.current.parent_dbs,
|
|
2513
2518
|
nodes: sceneDataRef.current.nodes,
|
|
@@ -16237,11 +16242,19 @@ function XViewScene({
|
|
|
16237
16242
|
}
|
|
16238
16243
|
}
|
|
16239
16244
|
Object.values(nodeObjects).forEach((mesh) => {
|
|
16240
|
-
const
|
|
16241
|
-
if (
|
|
16242
|
-
mesh.remove(
|
|
16243
|
-
if (
|
|
16244
|
-
|
|
16245
|
+
const oldTimelineLabel = mesh.getObjectByName("timelineLabel");
|
|
16246
|
+
if (oldTimelineLabel) {
|
|
16247
|
+
mesh.remove(oldTimelineLabel);
|
|
16248
|
+
if (oldTimelineLabel.material.map)
|
|
16249
|
+
oldTimelineLabel.material.map.dispose();
|
|
16250
|
+
oldTimelineLabel.material.dispose();
|
|
16251
|
+
}
|
|
16252
|
+
const oldQuestDateLabel = mesh.getObjectByName("questDateLabel");
|
|
16253
|
+
if (oldQuestDateLabel) {
|
|
16254
|
+
mesh.remove(oldQuestDateLabel);
|
|
16255
|
+
if (oldQuestDateLabel.material.map)
|
|
16256
|
+
oldQuestDateLabel.material.map.dispose();
|
|
16257
|
+
oldQuestDateLabel.material.dispose();
|
|
16245
16258
|
}
|
|
16246
16259
|
delete mesh.userData.timelineIntervalBar;
|
|
16247
16260
|
delete mesh.userData.timelineEndLabel;
|
|
@@ -16482,11 +16495,13 @@ function XViewScene({
|
|
|
16482
16495
|
const versionTween = new Tween2(mesh.position).to({ x: baseX, y, z: 0 }, 1500).easing(Easing2.Cubic.InOut);
|
|
16483
16496
|
tweenGroup.add(versionTween);
|
|
16484
16497
|
versionTween.start();
|
|
16485
|
-
|
|
16486
|
-
|
|
16487
|
-
|
|
16488
|
-
|
|
16489
|
-
|
|
16498
|
+
if (!mesh.getObjectByName("questDateLabel")) {
|
|
16499
|
+
const startLabelText = type === "interval" ? startDate.getFullYear().toString() : label;
|
|
16500
|
+
const startLabel = createTextSprite(startLabelText, 48);
|
|
16501
|
+
startLabel.name = "timelineLabel";
|
|
16502
|
+
startLabel.position.set(0, -2.5, 0);
|
|
16503
|
+
mesh.add(startLabel);
|
|
16504
|
+
}
|
|
16490
16505
|
if (type === "interval") {
|
|
16491
16506
|
const relativeEndY = timeToYMap.get(endDate.getTime()) - timeToYMap.get(startDate.getTime());
|
|
16492
16507
|
if (relativeEndY > 0) {
|
|
@@ -20244,8 +20259,8 @@ function XViewScene({
|
|
|
20244
20259
|
if (!sceneDataRef.current) return;
|
|
20245
20260
|
sceneDataRef.current.milestones = newMilestones;
|
|
20246
20261
|
setSceneVersion((v) => v + 1);
|
|
20247
|
-
const
|
|
20248
|
-
if (!
|
|
20262
|
+
const isView = ((_a2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _a2.toLowerCase()) === "view";
|
|
20263
|
+
if (!isView || !save_view_data || !sceneSaveUrl) return;
|
|
20249
20264
|
const questFileData = {
|
|
20250
20265
|
nodes: ((_b2 = parentDataRef.current[sceneConfigId]) == null ? void 0 : _b2.nodes) || sceneDataRef.current.quest_nodes || [],
|
|
20251
20266
|
links: ((_c2 = parentDataRef.current[sceneConfigId]) == null ? void 0 : _c2.links) || sceneDataRef.current.quest_links || [],
|
|
@@ -20292,7 +20307,7 @@ function XViewScene({
|
|
|
20292
20307
|
});
|
|
20293
20308
|
sceneDataRef.current.nodes = currentNodes;
|
|
20294
20309
|
sceneDataRef.current.links = currentLinks;
|
|
20295
|
-
const
|
|
20310
|
+
const isView = ((_a2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _a2.toLowerCase()) === "view";
|
|
20296
20311
|
const sceneFileData = {
|
|
20297
20312
|
...sceneDataRef.current,
|
|
20298
20313
|
nodes: currentNodes,
|
|
@@ -20414,8 +20429,8 @@ function XViewScene({
|
|
|
20414
20429
|
if (event.key.toLowerCase() === "q") {
|
|
20415
20430
|
const isUiClear = !stateRef.current.creation.isActive && !stateRef.current.connection.isActive && !stateRef.current.relink.isActive && !stateRef.current.ancestry.isActive && !((_b2 = context.versionMode) == null ? void 0 : _b2.isActive) && !contextMenu.visible && !multiContextMenu.visible && !relationshipMenu.visible && !readingMode.isActive && !isImportModalOpen && !isBoardsOpen && !isSidebarOpen && !isMilestoneManagerOpen && !detailsNode && !detailsLink && !ancestryLinkDetails && !imageViewer.visible && !editingAncestryRel.visible && !questMode.isActive;
|
|
20416
20431
|
if (isUiClear) {
|
|
20417
|
-
const
|
|
20418
|
-
if (!
|
|
20432
|
+
const isView = ((_c2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _c2.toLowerCase()) === "view";
|
|
20433
|
+
if (!isView) return;
|
|
20419
20434
|
const {
|
|
20420
20435
|
graphGroup,
|
|
20421
20436
|
glowTexture,
|
|
@@ -21200,11 +21215,11 @@ async function get_scene_view_data_logic(db_services, scene_config, owner_id, ty
|
|
|
21200
21215
|
parentDbObjects.push({ db_id: scene_config, owner_id });
|
|
21201
21216
|
}
|
|
21202
21217
|
}
|
|
21203
|
-
const
|
|
21218
|
+
const isView = type && type.toLowerCase() === "view";
|
|
21204
21219
|
const parentResponsesPromises = parentDbObjects.map(
|
|
21205
21220
|
(db_info) => db_services.get_file(`x_view_dbs/${db_info.owner_id}/${db_info.db_id}`)
|
|
21206
21221
|
);
|
|
21207
|
-
if (
|
|
21222
|
+
if (isView) {
|
|
21208
21223
|
const questFetchWithMigrationPromise = (async () => {
|
|
21209
21224
|
try {
|
|
21210
21225
|
const questsResponse = await db_services.get_view_quests_firestore(
|
|
@@ -21246,7 +21261,7 @@ async function get_scene_view_data_logic(db_services, scene_config, owner_id, ty
|
|
|
21246
21261
|
let questDataObj = null;
|
|
21247
21262
|
for (let i = 0; i < parentResponsesResults.length; i++) {
|
|
21248
21263
|
const result = parentResponsesResults[i];
|
|
21249
|
-
if (
|
|
21264
|
+
if (isView && i === parentResponsesResults.length - 1) {
|
|
21250
21265
|
if (result.status === "fulfilled" && ((_a = result.value) == null ? void 0 : _a.success)) {
|
|
21251
21266
|
questDataObj = result.value.data;
|
|
21252
21267
|
if (result.value.quest_counter !== void 0) {
|
|
@@ -21268,7 +21283,7 @@ async function get_scene_view_data_logic(db_services, scene_config, owner_id, ty
|
|
|
21268
21283
|
const currentQuestNodes = (questDataObj == null ? void 0 : questDataObj.nodes) || [];
|
|
21269
21284
|
const currentQuestLinks = (questDataObj == null ? void 0 : questDataObj.links) || [];
|
|
21270
21285
|
const currentMilestones = (questDataObj == null ? void 0 : questDataObj.milestones) || [];
|
|
21271
|
-
if (
|
|
21286
|
+
if (isView) {
|
|
21272
21287
|
parentData[scene_config] = {
|
|
21273
21288
|
dataset_name: "Quests Internas (View)",
|
|
21274
21289
|
nodes: currentQuestNodes,
|
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.16",
|
|
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",
|