@lv-x-software-house/x_view 1.2.4-dev.13 → 1.2.4-dev.14
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 -35
- package/dist/index.mjs +57 -35
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10294,7 +10294,7 @@ function XViewScene({
|
|
|
10294
10294
|
});
|
|
10295
10295
|
}
|
|
10296
10296
|
return {
|
|
10297
|
-
node: effectiveNode
|
|
10297
|
+
...effectiveNode ? { node: effectiveNode } : { node: { id: nodeId, name: "Unknown" } },
|
|
10298
10298
|
relationship: treeItem.relationship || {},
|
|
10299
10299
|
children: (treeItem.children || []).map(recursiveBuild).filter(Boolean),
|
|
10300
10300
|
parallel_branches: processedBranches
|
|
@@ -11098,38 +11098,6 @@ function XViewScene({
|
|
|
11098
11098
|
}
|
|
11099
11099
|
}
|
|
11100
11100
|
}
|
|
11101
|
-
function handleCancelAncestryCreation() {
|
|
11102
|
-
setAncestryMode({ isActive: false, tree: null, selectedParentId: null, isEditMode: false, currentAncestryId: null, ancestryName: "", ancestryDescription: "", ancestryDescriptionSections: [], isAddingNodes: false });
|
|
11103
|
-
if (mountRef.current) mountRef.current.style.cursor = "grab";
|
|
11104
|
-
}
|
|
11105
|
-
function handleKeyDown(event) {
|
|
11106
|
-
var _a2, _b2, _c2, _d2;
|
|
11107
|
-
const context = actionHandlerContext;
|
|
11108
|
-
if (event.key === "Escape") {
|
|
11109
|
-
if (stateRef.current.connection.isActive) userActionHandlers.handleCancelConnection(context);
|
|
11110
|
-
if (stateRef.current.relink.isActive) userActionHandlers.handleCancelRelink(context);
|
|
11111
|
-
if (stateRef.current.creation.isActive) userActionHandlers.handleCancelCreation(context);
|
|
11112
|
-
if ((_a2 = stateRef.current.versionMode) == null ? void 0 : _a2.isActive) userActionHandlers.handleCancelVersioning(context);
|
|
11113
|
-
if (stateRef.current.ancestry.isActive) handleCancelAncestryCreation();
|
|
11114
|
-
if ((_b2 = context.questMode) == null ? void 0 : _b2.isActive) context.setters.setQuestMode({ isActive: false });
|
|
11115
|
-
if (stateRef.current.selectedNodes.size > 0) {
|
|
11116
|
-
stateRef.current.selectedNodes.clear();
|
|
11117
|
-
}
|
|
11118
|
-
setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
|
|
11119
|
-
setMultiContextMenu((prev) => ({ ...prev, visible: false }));
|
|
11120
|
-
setRelationshipMenu((prev) => ({ ...prev, visible: false }));
|
|
11121
|
-
}
|
|
11122
|
-
if (event.key.toLowerCase() === "q") {
|
|
11123
|
-
const isUiClear = !stateRef.current.creation.isActive && !stateRef.current.connection.isActive && !stateRef.current.relink.isActive && !stateRef.current.ancestry.isActive && !((_c2 = context.versionMode) == null ? void 0 : _c2.isActive) && !contextMenu.visible && !multiContextMenu.visible && !relationshipMenu.visible && !readingMode.isActive && !isImportModalOpen && !isAncestryBoardOpen;
|
|
11124
|
-
if (isUiClear) {
|
|
11125
|
-
const isView = ((_d2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _d2.toLowerCase()) === "view";
|
|
11126
|
-
if (!isView) {
|
|
11127
|
-
return;
|
|
11128
|
-
}
|
|
11129
|
-
setQuestMode({ isActive: true });
|
|
11130
|
-
}
|
|
11131
|
-
}
|
|
11132
|
-
}
|
|
11133
11101
|
function handleDoubleClick(event) {
|
|
11134
11102
|
if (stateRef.current.camera) stateRef.current.camera.layers.enableAll();
|
|
11135
11103
|
if (isFromUiOverlay(event) || stateRef.current.isDragging || stateRef.current.creation.isActive || stateRef.current.connection.isActive || stateRef.current.relink.isActive) return;
|
|
@@ -11182,7 +11150,6 @@ function XViewScene({
|
|
|
11182
11150
|
currentMount.addEventListener("dblclick", handleDoubleClick);
|
|
11183
11151
|
currentMount.addEventListener("pointermove", onPointerMove);
|
|
11184
11152
|
currentMount.addEventListener("contextmenu", handleContextMenu);
|
|
11185
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
11186
11153
|
const originalBackground = scene.background;
|
|
11187
11154
|
const clock = new THREE3.Clock();
|
|
11188
11155
|
let animationFrameId = 0;
|
|
@@ -11320,7 +11287,6 @@ function XViewScene({
|
|
|
11320
11287
|
return () => {
|
|
11321
11288
|
cancelAnimationFrame(animationFrameId);
|
|
11322
11289
|
window.removeEventListener("resize", handleResize);
|
|
11323
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
11324
11290
|
currentMount.removeEventListener("pointerdown", onPointerDown);
|
|
11325
11291
|
currentMount.removeEventListener("pointerup", onPointerUp);
|
|
11326
11292
|
currentMount.removeEventListener("dblclick", handleDoubleClick);
|
|
@@ -13124,6 +13090,62 @@ function XViewScene({
|
|
|
13124
13090
|
}
|
|
13125
13091
|
}
|
|
13126
13092
|
}, [isInitialized, sceneVersion, focusAncestryId, hasOpenedInitialAncestry, handleStartReadingAncestry]);
|
|
13093
|
+
(0, import_react25.useEffect)(() => {
|
|
13094
|
+
function handleKeyDown(event) {
|
|
13095
|
+
var _a2, _b2, _c2, _d2;
|
|
13096
|
+
const context = actionHandlerContext;
|
|
13097
|
+
if (event.key === "Escape") {
|
|
13098
|
+
if (stateRef.current.connection.isActive) userActionHandlers.handleCancelConnection(context);
|
|
13099
|
+
if (stateRef.current.relink.isActive) userActionHandlers.handleCancelRelink(context);
|
|
13100
|
+
if (stateRef.current.creation.isActive) userActionHandlers.handleCancelCreation(context);
|
|
13101
|
+
if ((_a2 = stateRef.current.versionMode) == null ? void 0 : _a2.isActive) userActionHandlers.handleCancelVersioning(context);
|
|
13102
|
+
if (stateRef.current.ancestry.isActive) {
|
|
13103
|
+
setAncestryMode({ isActive: false, tree: null, selectedParentId: null, isEditMode: false, currentAncestryId: null, ancestryName: "", ancestryDescription: "", ancestryDescriptionSections: [], isAddingNodes: false });
|
|
13104
|
+
if (mountRef.current) mountRef.current.style.cursor = "grab";
|
|
13105
|
+
}
|
|
13106
|
+
if ((_b2 = context.questMode) == null ? void 0 : _b2.isActive) context.setters.setQuestMode({ isActive: false });
|
|
13107
|
+
if (stateRef.current.selectedNodes.size > 0) {
|
|
13108
|
+
stateRef.current.selectedNodes.clear();
|
|
13109
|
+
}
|
|
13110
|
+
setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
|
|
13111
|
+
setMultiContextMenu((prev) => ({ ...prev, visible: false }));
|
|
13112
|
+
setRelationshipMenu((prev) => ({ ...prev, visible: false }));
|
|
13113
|
+
}
|
|
13114
|
+
if (event.key.toLowerCase() === "q") {
|
|
13115
|
+
const isUiClear = !stateRef.current.creation.isActive && !stateRef.current.connection.isActive && !stateRef.current.relink.isActive && !stateRef.current.ancestry.isActive && !((_c2 = context.versionMode) == null ? void 0 : _c2.isActive) && !contextMenu.visible && !multiContextMenu.visible && !relationshipMenu.visible && !readingMode.isActive && !isImportModalOpen && !isAncestryBoardOpen && !isSidebarOpen && // Condição nova
|
|
13116
|
+
!detailsNode && // Condição nova
|
|
13117
|
+
!detailsLink && // Condição nova
|
|
13118
|
+
!ancestryLinkDetails && // Condição nova
|
|
13119
|
+
!imageViewer.visible && // Condição nova
|
|
13120
|
+
!editingAncestryRel.visible && // Condição nova
|
|
13121
|
+
!questMode.isActive;
|
|
13122
|
+
if (isUiClear) {
|
|
13123
|
+
const isView = ((_d2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _d2.toLowerCase()) === "view";
|
|
13124
|
+
if (!isView) return;
|
|
13125
|
+
setQuestMode({ isActive: true });
|
|
13126
|
+
}
|
|
13127
|
+
}
|
|
13128
|
+
}
|
|
13129
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
13130
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
13131
|
+
}, [
|
|
13132
|
+
// Dependências: sempre que um painel abrir ou fechar, o React atualiza o listener com os dados frescos
|
|
13133
|
+
contextMenu.visible,
|
|
13134
|
+
multiContextMenu.visible,
|
|
13135
|
+
relationshipMenu.visible,
|
|
13136
|
+
readingMode.isActive,
|
|
13137
|
+
isImportModalOpen,
|
|
13138
|
+
isAncestryBoardOpen,
|
|
13139
|
+
isSidebarOpen,
|
|
13140
|
+
detailsNode,
|
|
13141
|
+
detailsLink,
|
|
13142
|
+
ancestryLinkDetails,
|
|
13143
|
+
imageViewer.visible,
|
|
13144
|
+
editingAncestryRel.visible,
|
|
13145
|
+
questMode.isActive,
|
|
13146
|
+
viewParams,
|
|
13147
|
+
actionHandlerContext
|
|
13148
|
+
]);
|
|
13127
13149
|
if (isLoading || status === "loading" || permissionStatus === "loading") {
|
|
13128
13150
|
return /* @__PURE__ */ import_react25.default.createElement(LoadingScreen, null);
|
|
13129
13151
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -10294,7 +10294,7 @@ function XViewScene({
|
|
|
10294
10294
|
});
|
|
10295
10295
|
}
|
|
10296
10296
|
return {
|
|
10297
|
-
node: effectiveNode
|
|
10297
|
+
...effectiveNode ? { node: effectiveNode } : { node: { id: nodeId, name: "Unknown" } },
|
|
10298
10298
|
relationship: treeItem.relationship || {},
|
|
10299
10299
|
children: (treeItem.children || []).map(recursiveBuild).filter(Boolean),
|
|
10300
10300
|
parallel_branches: processedBranches
|
|
@@ -11098,38 +11098,6 @@ function XViewScene({
|
|
|
11098
11098
|
}
|
|
11099
11099
|
}
|
|
11100
11100
|
}
|
|
11101
|
-
function handleCancelAncestryCreation() {
|
|
11102
|
-
setAncestryMode({ isActive: false, tree: null, selectedParentId: null, isEditMode: false, currentAncestryId: null, ancestryName: "", ancestryDescription: "", ancestryDescriptionSections: [], isAddingNodes: false });
|
|
11103
|
-
if (mountRef.current) mountRef.current.style.cursor = "grab";
|
|
11104
|
-
}
|
|
11105
|
-
function handleKeyDown(event) {
|
|
11106
|
-
var _a2, _b2, _c2, _d2;
|
|
11107
|
-
const context = actionHandlerContext;
|
|
11108
|
-
if (event.key === "Escape") {
|
|
11109
|
-
if (stateRef.current.connection.isActive) userActionHandlers.handleCancelConnection(context);
|
|
11110
|
-
if (stateRef.current.relink.isActive) userActionHandlers.handleCancelRelink(context);
|
|
11111
|
-
if (stateRef.current.creation.isActive) userActionHandlers.handleCancelCreation(context);
|
|
11112
|
-
if ((_a2 = stateRef.current.versionMode) == null ? void 0 : _a2.isActive) userActionHandlers.handleCancelVersioning(context);
|
|
11113
|
-
if (stateRef.current.ancestry.isActive) handleCancelAncestryCreation();
|
|
11114
|
-
if ((_b2 = context.questMode) == null ? void 0 : _b2.isActive) context.setters.setQuestMode({ isActive: false });
|
|
11115
|
-
if (stateRef.current.selectedNodes.size > 0) {
|
|
11116
|
-
stateRef.current.selectedNodes.clear();
|
|
11117
|
-
}
|
|
11118
|
-
setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
|
|
11119
|
-
setMultiContextMenu((prev) => ({ ...prev, visible: false }));
|
|
11120
|
-
setRelationshipMenu((prev) => ({ ...prev, visible: false }));
|
|
11121
|
-
}
|
|
11122
|
-
if (event.key.toLowerCase() === "q") {
|
|
11123
|
-
const isUiClear = !stateRef.current.creation.isActive && !stateRef.current.connection.isActive && !stateRef.current.relink.isActive && !stateRef.current.ancestry.isActive && !((_c2 = context.versionMode) == null ? void 0 : _c2.isActive) && !contextMenu.visible && !multiContextMenu.visible && !relationshipMenu.visible && !readingMode.isActive && !isImportModalOpen && !isAncestryBoardOpen;
|
|
11124
|
-
if (isUiClear) {
|
|
11125
|
-
const isView = ((_d2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _d2.toLowerCase()) === "view";
|
|
11126
|
-
if (!isView) {
|
|
11127
|
-
return;
|
|
11128
|
-
}
|
|
11129
|
-
setQuestMode({ isActive: true });
|
|
11130
|
-
}
|
|
11131
|
-
}
|
|
11132
|
-
}
|
|
11133
11101
|
function handleDoubleClick(event) {
|
|
11134
11102
|
if (stateRef.current.camera) stateRef.current.camera.layers.enableAll();
|
|
11135
11103
|
if (isFromUiOverlay(event) || stateRef.current.isDragging || stateRef.current.creation.isActive || stateRef.current.connection.isActive || stateRef.current.relink.isActive) return;
|
|
@@ -11182,7 +11150,6 @@ function XViewScene({
|
|
|
11182
11150
|
currentMount.addEventListener("dblclick", handleDoubleClick);
|
|
11183
11151
|
currentMount.addEventListener("pointermove", onPointerMove);
|
|
11184
11152
|
currentMount.addEventListener("contextmenu", handleContextMenu);
|
|
11185
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
11186
11153
|
const originalBackground = scene.background;
|
|
11187
11154
|
const clock = new THREE3.Clock();
|
|
11188
11155
|
let animationFrameId = 0;
|
|
@@ -11320,7 +11287,6 @@ function XViewScene({
|
|
|
11320
11287
|
return () => {
|
|
11321
11288
|
cancelAnimationFrame(animationFrameId);
|
|
11322
11289
|
window.removeEventListener("resize", handleResize);
|
|
11323
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
11324
11290
|
currentMount.removeEventListener("pointerdown", onPointerDown);
|
|
11325
11291
|
currentMount.removeEventListener("pointerup", onPointerUp);
|
|
11326
11292
|
currentMount.removeEventListener("dblclick", handleDoubleClick);
|
|
@@ -13124,6 +13090,62 @@ function XViewScene({
|
|
|
13124
13090
|
}
|
|
13125
13091
|
}
|
|
13126
13092
|
}, [isInitialized, sceneVersion, focusAncestryId, hasOpenedInitialAncestry, handleStartReadingAncestry]);
|
|
13093
|
+
useEffect21(() => {
|
|
13094
|
+
function handleKeyDown(event) {
|
|
13095
|
+
var _a2, _b2, _c2, _d2;
|
|
13096
|
+
const context = actionHandlerContext;
|
|
13097
|
+
if (event.key === "Escape") {
|
|
13098
|
+
if (stateRef.current.connection.isActive) userActionHandlers.handleCancelConnection(context);
|
|
13099
|
+
if (stateRef.current.relink.isActive) userActionHandlers.handleCancelRelink(context);
|
|
13100
|
+
if (stateRef.current.creation.isActive) userActionHandlers.handleCancelCreation(context);
|
|
13101
|
+
if ((_a2 = stateRef.current.versionMode) == null ? void 0 : _a2.isActive) userActionHandlers.handleCancelVersioning(context);
|
|
13102
|
+
if (stateRef.current.ancestry.isActive) {
|
|
13103
|
+
setAncestryMode({ isActive: false, tree: null, selectedParentId: null, isEditMode: false, currentAncestryId: null, ancestryName: "", ancestryDescription: "", ancestryDescriptionSections: [], isAddingNodes: false });
|
|
13104
|
+
if (mountRef.current) mountRef.current.style.cursor = "grab";
|
|
13105
|
+
}
|
|
13106
|
+
if ((_b2 = context.questMode) == null ? void 0 : _b2.isActive) context.setters.setQuestMode({ isActive: false });
|
|
13107
|
+
if (stateRef.current.selectedNodes.size > 0) {
|
|
13108
|
+
stateRef.current.selectedNodes.clear();
|
|
13109
|
+
}
|
|
13110
|
+
setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
|
|
13111
|
+
setMultiContextMenu((prev) => ({ ...prev, visible: false }));
|
|
13112
|
+
setRelationshipMenu((prev) => ({ ...prev, visible: false }));
|
|
13113
|
+
}
|
|
13114
|
+
if (event.key.toLowerCase() === "q") {
|
|
13115
|
+
const isUiClear = !stateRef.current.creation.isActive && !stateRef.current.connection.isActive && !stateRef.current.relink.isActive && !stateRef.current.ancestry.isActive && !((_c2 = context.versionMode) == null ? void 0 : _c2.isActive) && !contextMenu.visible && !multiContextMenu.visible && !relationshipMenu.visible && !readingMode.isActive && !isImportModalOpen && !isAncestryBoardOpen && !isSidebarOpen && // Condição nova
|
|
13116
|
+
!detailsNode && // Condição nova
|
|
13117
|
+
!detailsLink && // Condição nova
|
|
13118
|
+
!ancestryLinkDetails && // Condição nova
|
|
13119
|
+
!imageViewer.visible && // Condição nova
|
|
13120
|
+
!editingAncestryRel.visible && // Condição nova
|
|
13121
|
+
!questMode.isActive;
|
|
13122
|
+
if (isUiClear) {
|
|
13123
|
+
const isView = ((_d2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _d2.toLowerCase()) === "view";
|
|
13124
|
+
if (!isView) return;
|
|
13125
|
+
setQuestMode({ isActive: true });
|
|
13126
|
+
}
|
|
13127
|
+
}
|
|
13128
|
+
}
|
|
13129
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
13130
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
13131
|
+
}, [
|
|
13132
|
+
// Dependências: sempre que um painel abrir ou fechar, o React atualiza o listener com os dados frescos
|
|
13133
|
+
contextMenu.visible,
|
|
13134
|
+
multiContextMenu.visible,
|
|
13135
|
+
relationshipMenu.visible,
|
|
13136
|
+
readingMode.isActive,
|
|
13137
|
+
isImportModalOpen,
|
|
13138
|
+
isAncestryBoardOpen,
|
|
13139
|
+
isSidebarOpen,
|
|
13140
|
+
detailsNode,
|
|
13141
|
+
detailsLink,
|
|
13142
|
+
ancestryLinkDetails,
|
|
13143
|
+
imageViewer.visible,
|
|
13144
|
+
editingAncestryRel.visible,
|
|
13145
|
+
questMode.isActive,
|
|
13146
|
+
viewParams,
|
|
13147
|
+
actionHandlerContext
|
|
13148
|
+
]);
|
|
13127
13149
|
if (isLoading || status === "loading" || permissionStatus === "loading") {
|
|
13128
13150
|
return /* @__PURE__ */ React24.createElement(LoadingScreen, null);
|
|
13129
13151
|
}
|
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.14",
|
|
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",
|