@lv-x-software-house/x_view 1.1.9-dev.9 → 1.2.1-dev.1
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 +54 -14
- package/dist/index.mjs +54 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -122,6 +122,7 @@ function ContextMenu({
|
|
|
122
122
|
onRenderAncestry,
|
|
123
123
|
onEditAncestry,
|
|
124
124
|
onDeleteAncestry,
|
|
125
|
+
onFocusNode,
|
|
125
126
|
onClose
|
|
126
127
|
}) {
|
|
127
128
|
var _a, _b;
|
|
@@ -271,7 +272,10 @@ function ContextMenu({
|
|
|
271
272
|
const canCreateVersion = ability.can("create", "Versioning");
|
|
272
273
|
const canReadVersion = ability.can("read", "Versioning");
|
|
273
274
|
const shouldShowVersioningBtn = canCreateVersion || canReadVersion && hasVersions;
|
|
274
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "flex items-center gap-2 px-2 pt-1 pb-2" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "inline-flex h-2 w-2 rounded-full bg-indigo-400/80 shadow-[0_0_12px_1px_rgba(99,102,241,0.5)]" }), /* @__PURE__ */ import_react.default.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "A\xE7\xF5es R\xE1pidas")), /* @__PURE__ */ import_react.default.createElement("div", { className: "flex flex-col gap-1" },
|
|
275
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "flex items-center gap-2 px-2 pt-1 pb-2" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "inline-flex h-2 w-2 rounded-full bg-indigo-400/80 shadow-[0_0_12px_1px_rgba(99,102,241,0.5)]" }), /* @__PURE__ */ import_react.default.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "A\xE7\xF5es R\xE1pidas")), /* @__PURE__ */ import_react.default.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => {
|
|
276
|
+
onFocusNode == null ? void 0 : onFocusNode(data.nodeData);
|
|
277
|
+
onClose();
|
|
278
|
+
}, className: baseButtonClass, title: "Focar na c\xE2mera" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react.default.createElement("circle", { cx: "12", cy: "12", r: "3" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Focar neste Node")), ability.can("create", "Connection") && /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => onStartConnection == null ? void 0 : onStartConnection(data.nodeData), className: baseButtonClass, title: "Conectar" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Conectar")), ability.can("create", "Node") && /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => onStartCreation == null ? void 0 : onStartCreation(data.nodeData), className: baseButtonClass, title: "Criar e Conectar" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react.default.createElement("line", { x1: "12", y1: "8", x2: "12", y2: "16" }), /* @__PURE__ */ import_react.default.createElement("line", { x1: "8", y1: "12", x2: "16", y2: "12" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Criar e Conectar")), ability.can("create", "Ancestry") && /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => onStartAncestryCreation == null ? void 0 : onStartAncestryCreation(data.nodeData), className: baseButtonClass, title: "Criar Ancestralidade" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M10 20.5c.5-.5.8-1.2.8-2s-.3-1.5-.8-2c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8c-.5.5-.8 1.2-.8 2s.3 1.5.8 2c.5.5 1.2.8 2 .8s1.5-.3 2-.8Z" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M10 16v-3a2 2 0 0 1 2-2h4" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M14 3.5c.5.5.8 1.2.8 2s-.3 1.5-.8 2c-.5-.5-1.2-.8-2 .8s1.5.3-2-.8c-.5-.5-.8-1.2-.8-2s.3-1.5.8-2c.5.5 1.2-.8 2 .8s1.5.3 2 .8Z" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M14 8v3a2 2 0 0 0 2 2h4" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Criar Ancestralidade")), shouldShowVersioningBtn && /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => setMenuView("versioning"), className: baseButtonClass, title: hasVersions ? "Versionamento" : "Criar Versionamento" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("line", { x1: "6", y1: "3", x2: "6", y2: "15" }), /* @__PURE__ */ import_react.default.createElement("circle", { cx: "18", cy: "6", r: "3" }), /* @__PURE__ */ import_react.default.createElement("circle", { cx: "6", cy: "18", r: "3" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M18 9a9 9 0 0 1-9 9" })), /* @__PURE__ */ import_react.default.createElement("span", null, hasVersions || !canCreateVersion ? "Versionamento" : "Criar Versionamento")), (connections.length > 0 || availableAncestries.length > 0) && ability.can("read", "Connection") && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => setMenuView("connections"), className: baseButtonClass, title: "Conex\xF5es" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2z" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M8 12h8" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M12 8v8" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Conex\xF5es (", totalConnectionsCount, ")"))), /* @__PURE__ */ import_react.default.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), ability.can("dismiss", "Node") && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => onDismissNode == null ? void 0 : onDismissNode(data.nodeData), className: baseButtonClass, title: "Remover da visualiza\xE7\xE3o" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }), /* @__PURE__ */ import_react.default.createElement("line", { x1: "2", y1: "2", x2: "22", y2: "22" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Dismiss")), /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => onDismissOtherNodes == null ? void 0 : onDismissOtherNodes(data.nodeData), className: baseButtonClass, title: "Remover outros da visualiza\xE7\xE3o" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("circle", { cx: "12", cy: "12", r: "3" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Dismiss other nodes"))), ability.can("delete", "Node") && /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => onDeleteNode == null ? void 0 : onDeleteNode(data.nodeData), className: deleteButtonClass, title: "Excluir Node" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("polyline", { points: "3 6 5 6 21 6" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ import_react.default.createElement("line", { x1: "10", y1: "11", x2: "10", y2: "17" }), /* @__PURE__ */ import_react.default.createElement("line", { x1: "14", y1: "11", x2: "14", y2: "17" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Excluir Node"))));
|
|
275
279
|
};
|
|
276
280
|
const renderVersionSubMenuView = () => {
|
|
277
281
|
const group = versionSubMenu;
|
|
@@ -4548,13 +4552,20 @@ function DescriptionReadModePanel({
|
|
|
4548
4552
|
customProperties = [],
|
|
4549
4553
|
onImageClick,
|
|
4550
4554
|
userRole,
|
|
4551
|
-
// --- NOVAS PROPS PARA ABSTRAÇÃO ---
|
|
4552
4555
|
abstractionTree = null,
|
|
4553
|
-
onRenderAbstractionTree = null
|
|
4556
|
+
onRenderAbstractionTree = null,
|
|
4557
|
+
initialShowAbstraction = false
|
|
4558
|
+
// <--- NOVA PROP RECEBIDA
|
|
4554
4559
|
}) {
|
|
4555
4560
|
const [showProperties, setShowProperties] = (0, import_react7.useState)(false);
|
|
4556
4561
|
const [showAbstraction, setShowAbstraction] = (0, import_react7.useState)(false);
|
|
4557
4562
|
const [targetRenderNodeId, setTargetRenderNodeId] = (0, import_react7.useState)(null);
|
|
4563
|
+
import_react7.default.useEffect(() => {
|
|
4564
|
+
setShowAbstraction(initialShowAbstraction);
|
|
4565
|
+
if (initialShowAbstraction) {
|
|
4566
|
+
setShowProperties(false);
|
|
4567
|
+
}
|
|
4568
|
+
}, [initialShowAbstraction]);
|
|
4558
4569
|
const swallow = (e) => e.stopPropagation();
|
|
4559
4570
|
const hasCustomProps = customProperties && customProperties.length > 0;
|
|
4560
4571
|
const hasAbstraction = Boolean(abstractionTree && (abstractionTree.node || abstractionTree.children && abstractionTree.children.length > 0));
|
|
@@ -4625,7 +4636,15 @@ function DescriptionReadModePanel({
|
|
|
4625
4636
|
/* @__PURE__ */ import_react7.default.createElement("div", { className: "px-6 pt-5 pb-3 flex items-start justify-between gap-4 border-b border-white/10 shrink-0 bg-slate-950/50 backdrop-blur-md z-20" }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "flex items-center gap-3 overflow-hidden" }, /* @__PURE__ */ import_react7.default.createElement(
|
|
4626
4637
|
"button",
|
|
4627
4638
|
{
|
|
4628
|
-
onClick:
|
|
4639
|
+
onClick: () => {
|
|
4640
|
+
if (showAbstraction) {
|
|
4641
|
+
setShowAbstraction(false);
|
|
4642
|
+
} else if (showProperties) {
|
|
4643
|
+
setShowProperties(false);
|
|
4644
|
+
} else if (onBack) {
|
|
4645
|
+
onBack();
|
|
4646
|
+
}
|
|
4647
|
+
},
|
|
4629
4648
|
className: "w-8 h-8 flex-shrink-0 grid place-content-center rounded-lg border border-white/10 bg-white/5 hover:bg-white/10 transition-colors text-slate-300",
|
|
4630
4649
|
title: "Voltar"
|
|
4631
4650
|
},
|
|
@@ -9026,7 +9045,8 @@ function XViewScene({
|
|
|
9026
9045
|
const [readingMode, setReadingMode] = (0, import_react23.useState)({
|
|
9027
9046
|
isActive: false,
|
|
9028
9047
|
ancestry: null,
|
|
9029
|
-
branchStack: []
|
|
9048
|
+
branchStack: [],
|
|
9049
|
+
autoAbstraction: false
|
|
9030
9050
|
});
|
|
9031
9051
|
const [formPosition, setFormPosition] = (0, import_react23.useState)({ left: 16, top: 16, opacity: 0 });
|
|
9032
9052
|
const [detailsNode, setDetailsNode] = (0, import_react23.useState)(null);
|
|
@@ -11329,19 +11349,30 @@ function XViewScene({
|
|
|
11329
11349
|
currentMaxIndex: 0,
|
|
11330
11350
|
progressMap: {}
|
|
11331
11351
|
};
|
|
11352
|
+
const hasDescription = ancestryObject.description && ancestryObject.description.trim() !== "";
|
|
11353
|
+
const hasMainTreeNodes = ancestryObject.tree.children && ancestryObject.tree.children.length > 0;
|
|
11354
|
+
const hasAbstractionNodes = ancestryObject.abstraction_tree && ancestryObject.abstraction_tree.children && ancestryObject.abstraction_tree.children.length > 0;
|
|
11355
|
+
const shouldAutoRenderAbstraction = !hasDescription && !hasMainTreeNodes && hasAbstractionNodes;
|
|
11332
11356
|
setReadingMode({
|
|
11333
11357
|
isActive: true,
|
|
11334
11358
|
ancestry: ancestryObject,
|
|
11335
|
-
branchStack: []
|
|
11359
|
+
branchStack: [],
|
|
11360
|
+
autoAbstraction: shouldAutoRenderAbstraction
|
|
11361
|
+
// <--- FLAG ENVIADA PARA A UI
|
|
11336
11362
|
});
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11340
|
-
|
|
11341
|
-
|
|
11342
|
-
|
|
11363
|
+
if (shouldAutoRenderAbstraction) {
|
|
11364
|
+
handleRenderAbstractionTree(ancestryObject, null);
|
|
11365
|
+
} else {
|
|
11366
|
+
const initialSections = /* @__PURE__ */ new Set(["preamble", 0, "0"]);
|
|
11367
|
+
const ancestryWithForceUpdate = {
|
|
11368
|
+
...ancestryObject,
|
|
11369
|
+
_forceUpdate: true
|
|
11370
|
+
};
|
|
11371
|
+
await handleRenderAncestry(ancestryWithForceUpdate, initialSections);
|
|
11372
|
+
}
|
|
11343
11373
|
},
|
|
11344
|
-
[handleRenderAncestry]
|
|
11374
|
+
[handleRenderAncestry, handleRenderAbstractionTree]
|
|
11375
|
+
// <--- DEPENDÊNCIA ADICIONADA
|
|
11345
11376
|
);
|
|
11346
11377
|
const handleReadModeSectionChange = (0, import_react23.useCallback)((activeSectionId) => {
|
|
11347
11378
|
const { ancestry, branchStack } = readingMode;
|
|
@@ -11908,6 +11939,13 @@ function XViewScene({
|
|
|
11908
11939
|
const handleToggleAncestryAddMode = (0, import_react23.useCallback)(() => {
|
|
11909
11940
|
setAncestryMode((prev) => ({ ...prev, isAddingNodes: !prev.isAddingNodes }));
|
|
11910
11941
|
}, []);
|
|
11942
|
+
const handleFocusNode = (0, import_react23.useCallback)((nodeData) => {
|
|
11943
|
+
if (!nodeData) return;
|
|
11944
|
+
const nodeMesh = stateRef.current.nodeObjects[String(nodeData.id)];
|
|
11945
|
+
if (nodeMesh) {
|
|
11946
|
+
tweenToTarget(nodeMesh, 1.2);
|
|
11947
|
+
}
|
|
11948
|
+
}, [tweenToTarget]);
|
|
11911
11949
|
if (isLoading || status === "loading" || permissionStatus === "loading") {
|
|
11912
11950
|
return /* @__PURE__ */ import_react23.default.createElement(LoadingScreen, null);
|
|
11913
11951
|
}
|
|
@@ -12007,6 +12045,7 @@ function XViewScene({
|
|
|
12007
12045
|
description: getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.description,
|
|
12008
12046
|
savedSections: getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.description_sections,
|
|
12009
12047
|
customProperties: (getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.customProperties) || [],
|
|
12048
|
+
initialShowAbstraction: readingMode.autoAbstraction,
|
|
12010
12049
|
onBack: null,
|
|
12011
12050
|
onEdit: () => {
|
|
12012
12051
|
handleCloseReadMode();
|
|
@@ -12169,7 +12208,8 @@ function XViewScene({
|
|
|
12169
12208
|
onExpandConnections: (sourceNode, links) => userActionHandlers.handleExpandConnections(actionHandlerContext, sourceNode, links),
|
|
12170
12209
|
onRenderAncestry: handleStartReadingAncestry,
|
|
12171
12210
|
onEditAncestry: handleEditAncestry,
|
|
12172
|
-
onDeleteAncestry: (ancestryId) => handleDeleteAncestry(ancestryId)
|
|
12211
|
+
onDeleteAncestry: (ancestryId) => handleDeleteAncestry(ancestryId),
|
|
12212
|
+
onFocusNode: handleFocusNode
|
|
12173
12213
|
}
|
|
12174
12214
|
),
|
|
12175
12215
|
/* @__PURE__ */ import_react23.default.createElement(
|
package/dist/index.mjs
CHANGED
|
@@ -78,6 +78,7 @@ function ContextMenu({
|
|
|
78
78
|
onRenderAncestry,
|
|
79
79
|
onEditAncestry,
|
|
80
80
|
onDeleteAncestry,
|
|
81
|
+
onFocusNode,
|
|
81
82
|
onClose
|
|
82
83
|
}) {
|
|
83
84
|
var _a, _b;
|
|
@@ -227,7 +228,10 @@ function ContextMenu({
|
|
|
227
228
|
const canCreateVersion = ability.can("create", "Versioning");
|
|
228
229
|
const canReadVersion = ability.can("read", "Versioning");
|
|
229
230
|
const shouldShowVersioningBtn = canCreateVersion || canReadVersion && hasVersions;
|
|
230
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 px-2 pt-1 pb-2" }, /* @__PURE__ */ React.createElement("span", { className: "inline-flex h-2 w-2 rounded-full bg-indigo-400/80 shadow-[0_0_12px_1px_rgba(99,102,241,0.5)]" }), /* @__PURE__ */ React.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "A\xE7\xF5es R\xE1pidas")), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-1" },
|
|
231
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 px-2 pt-1 pb-2" }, /* @__PURE__ */ React.createElement("span", { className: "inline-flex h-2 w-2 rounded-full bg-indigo-400/80 shadow-[0_0_12px_1px_rgba(99,102,241,0.5)]" }), /* @__PURE__ */ React.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "A\xE7\xF5es R\xE1pidas")), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React.createElement("button", { onClick: () => {
|
|
232
|
+
onFocusNode == null ? void 0 : onFocusNode(data.nodeData);
|
|
233
|
+
onClose();
|
|
234
|
+
}, className: baseButtonClass, title: "Focar na c\xE2mera" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "3" })), /* @__PURE__ */ React.createElement("span", null, "Focar neste Node")), ability.can("create", "Connection") && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartConnection == null ? void 0 : onStartConnection(data.nodeData), className: baseButtonClass, title: "Conectar" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72" }), /* @__PURE__ */ React.createElement("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72" })), /* @__PURE__ */ React.createElement("span", null, "Conectar")), ability.can("create", "Node") && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartCreation == null ? void 0 : onStartCreation(data.nodeData), className: baseButtonClass, title: "Criar e Conectar" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React.createElement("line", { x1: "12", y1: "8", x2: "12", y2: "16" }), /* @__PURE__ */ React.createElement("line", { x1: "8", y1: "12", x2: "16", y2: "12" })), /* @__PURE__ */ React.createElement("span", null, "Criar e Conectar")), ability.can("create", "Ancestry") && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartAncestryCreation == null ? void 0 : onStartAncestryCreation(data.nodeData), className: baseButtonClass, title: "Criar Ancestralidade" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M10 20.5c.5-.5.8-1.2.8-2s-.3-1.5-.8-2c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8c-.5.5-.8 1.2-.8 2s.3 1.5.8 2c.5.5 1.2.8 2 .8s1.5-.3 2-.8Z" }), /* @__PURE__ */ React.createElement("path", { d: "M10 16v-3a2 2 0 0 1 2-2h4" }), /* @__PURE__ */ React.createElement("path", { d: "M14 3.5c.5.5.8 1.2.8 2s-.3 1.5-.8 2c-.5-.5-1.2-.8-2 .8s1.5.3-2-.8c-.5-.5-.8-1.2-.8-2s.3-1.5.8-2c.5.5 1.2-.8 2 .8s1.5.3 2 .8Z" }), /* @__PURE__ */ React.createElement("path", { d: "M14 8v3a2 2 0 0 0 2 2h4" })), /* @__PURE__ */ React.createElement("span", null, "Criar Ancestralidade")), shouldShowVersioningBtn && /* @__PURE__ */ React.createElement("button", { onClick: () => setMenuView("versioning"), className: baseButtonClass, title: hasVersions ? "Versionamento" : "Criar Versionamento" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("line", { x1: "6", y1: "3", x2: "6", y2: "15" }), /* @__PURE__ */ React.createElement("circle", { cx: "18", cy: "6", r: "3" }), /* @__PURE__ */ React.createElement("circle", { cx: "6", cy: "18", r: "3" }), /* @__PURE__ */ React.createElement("path", { d: "M18 9a9 9 0 0 1-9 9" })), /* @__PURE__ */ React.createElement("span", null, hasVersions || !canCreateVersion ? "Versionamento" : "Criar Versionamento")), (connections.length > 0 || availableAncestries.length > 0) && ability.can("read", "Connection") && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ React.createElement("button", { onClick: () => setMenuView("connections"), className: baseButtonClass, title: "Conex\xF5es" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2z" }), /* @__PURE__ */ React.createElement("path", { d: "M8 12h8" }), /* @__PURE__ */ React.createElement("path", { d: "M12 8v8" })), /* @__PURE__ */ React.createElement("span", null, "Conex\xF5es (", totalConnectionsCount, ")"))), /* @__PURE__ */ React.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), ability.can("dismiss", "Node") && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("button", { onClick: () => onDismissNode == null ? void 0 : onDismissNode(data.nodeData), className: baseButtonClass, title: "Remover da visualiza\xE7\xE3o" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }), /* @__PURE__ */ React.createElement("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }), /* @__PURE__ */ React.createElement("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }), /* @__PURE__ */ React.createElement("line", { x1: "2", y1: "2", x2: "22", y2: "22" })), /* @__PURE__ */ React.createElement("span", null, "Dismiss")), /* @__PURE__ */ React.createElement("button", { onClick: () => onDismissOtherNodes == null ? void 0 : onDismissOtherNodes(data.nodeData), className: baseButtonClass, title: "Remover outros da visualiza\xE7\xE3o" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "3" }), /* @__PURE__ */ React.createElement("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }), /* @__PURE__ */ React.createElement("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ React.createElement("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }), /* @__PURE__ */ React.createElement("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })), /* @__PURE__ */ React.createElement("span", null, "Dismiss other nodes"))), ability.can("delete", "Node") && /* @__PURE__ */ React.createElement("button", { onClick: () => onDeleteNode == null ? void 0 : onDeleteNode(data.nodeData), className: deleteButtonClass, title: "Excluir Node" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("polyline", { points: "3 6 5 6 21 6" }), /* @__PURE__ */ React.createElement("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ React.createElement("line", { x1: "10", y1: "11", x2: "10", y2: "17" }), /* @__PURE__ */ React.createElement("line", { x1: "14", y1: "11", x2: "14", y2: "17" })), /* @__PURE__ */ React.createElement("span", null, "Excluir Node"))));
|
|
231
235
|
};
|
|
232
236
|
const renderVersionSubMenuView = () => {
|
|
233
237
|
const group = versionSubMenu;
|
|
@@ -4516,13 +4520,20 @@ function DescriptionReadModePanel({
|
|
|
4516
4520
|
customProperties = [],
|
|
4517
4521
|
onImageClick,
|
|
4518
4522
|
userRole,
|
|
4519
|
-
// --- NOVAS PROPS PARA ABSTRAÇÃO ---
|
|
4520
4523
|
abstractionTree = null,
|
|
4521
|
-
onRenderAbstractionTree = null
|
|
4524
|
+
onRenderAbstractionTree = null,
|
|
4525
|
+
initialShowAbstraction = false
|
|
4526
|
+
// <--- NOVA PROP RECEBIDA
|
|
4522
4527
|
}) {
|
|
4523
4528
|
const [showProperties, setShowProperties] = useState7(false);
|
|
4524
4529
|
const [showAbstraction, setShowAbstraction] = useState7(false);
|
|
4525
4530
|
const [targetRenderNodeId, setTargetRenderNodeId] = useState7(null);
|
|
4531
|
+
React7.useEffect(() => {
|
|
4532
|
+
setShowAbstraction(initialShowAbstraction);
|
|
4533
|
+
if (initialShowAbstraction) {
|
|
4534
|
+
setShowProperties(false);
|
|
4535
|
+
}
|
|
4536
|
+
}, [initialShowAbstraction]);
|
|
4526
4537
|
const swallow = (e) => e.stopPropagation();
|
|
4527
4538
|
const hasCustomProps = customProperties && customProperties.length > 0;
|
|
4528
4539
|
const hasAbstraction = Boolean(abstractionTree && (abstractionTree.node || abstractionTree.children && abstractionTree.children.length > 0));
|
|
@@ -4593,7 +4604,15 @@ function DescriptionReadModePanel({
|
|
|
4593
4604
|
/* @__PURE__ */ React7.createElement("div", { className: "px-6 pt-5 pb-3 flex items-start justify-between gap-4 border-b border-white/10 shrink-0 bg-slate-950/50 backdrop-blur-md z-20" }, /* @__PURE__ */ React7.createElement("div", { className: "flex items-center gap-3 overflow-hidden" }, /* @__PURE__ */ React7.createElement(
|
|
4594
4605
|
"button",
|
|
4595
4606
|
{
|
|
4596
|
-
onClick:
|
|
4607
|
+
onClick: () => {
|
|
4608
|
+
if (showAbstraction) {
|
|
4609
|
+
setShowAbstraction(false);
|
|
4610
|
+
} else if (showProperties) {
|
|
4611
|
+
setShowProperties(false);
|
|
4612
|
+
} else if (onBack) {
|
|
4613
|
+
onBack();
|
|
4614
|
+
}
|
|
4615
|
+
},
|
|
4597
4616
|
className: "w-8 h-8 flex-shrink-0 grid place-content-center rounded-lg border border-white/10 bg-white/5 hover:bg-white/10 transition-colors text-slate-300",
|
|
4598
4617
|
title: "Voltar"
|
|
4599
4618
|
},
|
|
@@ -9022,7 +9041,8 @@ function XViewScene({
|
|
|
9022
9041
|
const [readingMode, setReadingMode] = useState22({
|
|
9023
9042
|
isActive: false,
|
|
9024
9043
|
ancestry: null,
|
|
9025
|
-
branchStack: []
|
|
9044
|
+
branchStack: [],
|
|
9045
|
+
autoAbstraction: false
|
|
9026
9046
|
});
|
|
9027
9047
|
const [formPosition, setFormPosition] = useState22({ left: 16, top: 16, opacity: 0 });
|
|
9028
9048
|
const [detailsNode, setDetailsNode] = useState22(null);
|
|
@@ -11325,19 +11345,30 @@ function XViewScene({
|
|
|
11325
11345
|
currentMaxIndex: 0,
|
|
11326
11346
|
progressMap: {}
|
|
11327
11347
|
};
|
|
11348
|
+
const hasDescription = ancestryObject.description && ancestryObject.description.trim() !== "";
|
|
11349
|
+
const hasMainTreeNodes = ancestryObject.tree.children && ancestryObject.tree.children.length > 0;
|
|
11350
|
+
const hasAbstractionNodes = ancestryObject.abstraction_tree && ancestryObject.abstraction_tree.children && ancestryObject.abstraction_tree.children.length > 0;
|
|
11351
|
+
const shouldAutoRenderAbstraction = !hasDescription && !hasMainTreeNodes && hasAbstractionNodes;
|
|
11328
11352
|
setReadingMode({
|
|
11329
11353
|
isActive: true,
|
|
11330
11354
|
ancestry: ancestryObject,
|
|
11331
|
-
branchStack: []
|
|
11355
|
+
branchStack: [],
|
|
11356
|
+
autoAbstraction: shouldAutoRenderAbstraction
|
|
11357
|
+
// <--- FLAG ENVIADA PARA A UI
|
|
11332
11358
|
});
|
|
11333
|
-
|
|
11334
|
-
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11359
|
+
if (shouldAutoRenderAbstraction) {
|
|
11360
|
+
handleRenderAbstractionTree(ancestryObject, null);
|
|
11361
|
+
} else {
|
|
11362
|
+
const initialSections = /* @__PURE__ */ new Set(["preamble", 0, "0"]);
|
|
11363
|
+
const ancestryWithForceUpdate = {
|
|
11364
|
+
...ancestryObject,
|
|
11365
|
+
_forceUpdate: true
|
|
11366
|
+
};
|
|
11367
|
+
await handleRenderAncestry(ancestryWithForceUpdate, initialSections);
|
|
11368
|
+
}
|
|
11339
11369
|
},
|
|
11340
|
-
[handleRenderAncestry]
|
|
11370
|
+
[handleRenderAncestry, handleRenderAbstractionTree]
|
|
11371
|
+
// <--- DEPENDÊNCIA ADICIONADA
|
|
11341
11372
|
);
|
|
11342
11373
|
const handleReadModeSectionChange = useCallback3((activeSectionId) => {
|
|
11343
11374
|
const { ancestry, branchStack } = readingMode;
|
|
@@ -11904,6 +11935,13 @@ function XViewScene({
|
|
|
11904
11935
|
const handleToggleAncestryAddMode = useCallback3(() => {
|
|
11905
11936
|
setAncestryMode((prev) => ({ ...prev, isAddingNodes: !prev.isAddingNodes }));
|
|
11906
11937
|
}, []);
|
|
11938
|
+
const handleFocusNode = useCallback3((nodeData) => {
|
|
11939
|
+
if (!nodeData) return;
|
|
11940
|
+
const nodeMesh = stateRef.current.nodeObjects[String(nodeData.id)];
|
|
11941
|
+
if (nodeMesh) {
|
|
11942
|
+
tweenToTarget(nodeMesh, 1.2);
|
|
11943
|
+
}
|
|
11944
|
+
}, [tweenToTarget]);
|
|
11907
11945
|
if (isLoading || status === "loading" || permissionStatus === "loading") {
|
|
11908
11946
|
return /* @__PURE__ */ React23.createElement(LoadingScreen, null);
|
|
11909
11947
|
}
|
|
@@ -12003,6 +12041,7 @@ function XViewScene({
|
|
|
12003
12041
|
description: getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.description,
|
|
12004
12042
|
savedSections: getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.description_sections,
|
|
12005
12043
|
customProperties: (getReadModeDisplayContext == null ? void 0 : getReadModeDisplayContext.customProperties) || [],
|
|
12044
|
+
initialShowAbstraction: readingMode.autoAbstraction,
|
|
12006
12045
|
onBack: null,
|
|
12007
12046
|
onEdit: () => {
|
|
12008
12047
|
handleCloseReadMode();
|
|
@@ -12165,7 +12204,8 @@ function XViewScene({
|
|
|
12165
12204
|
onExpandConnections: (sourceNode, links) => userActionHandlers.handleExpandConnections(actionHandlerContext, sourceNode, links),
|
|
12166
12205
|
onRenderAncestry: handleStartReadingAncestry,
|
|
12167
12206
|
onEditAncestry: handleEditAncestry,
|
|
12168
|
-
onDeleteAncestry: (ancestryId) => handleDeleteAncestry(ancestryId)
|
|
12207
|
+
onDeleteAncestry: (ancestryId) => handleDeleteAncestry(ancestryId),
|
|
12208
|
+
onFocusNode: handleFocusNode
|
|
12169
12209
|
}
|
|
12170
12210
|
),
|
|
12171
12211
|
/* @__PURE__ */ React23.createElement(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lv-x-software-house/x_view",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1-dev.1",
|
|
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",
|