@lv-x-software-house/x_view 1.2.1 → 1.2.2-dev.10

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.
Files changed (3) hide show
  1. package/dist/index.js +160 -59
  2. package/dist/index.mjs +162 -61
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -287,10 +287,10 @@ function ContextMenu({
287
287
  const canCreateVersion = ability.can("create", "Versioning");
288
288
  const canReadVersion = ability.can("read", "Versioning");
289
289
  const shouldShowVersioningBtn = canCreateVersion || canReadVersion && hasVersions;
290
- 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: () => {
290
+ 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" }, 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" }), /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => {
291
291
  onFocusNode == null ? void 0 : onFocusNode(data.nodeData);
292
292
  onClose();
293
- }, 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" }), /* @__PURE__ */ import_react.default.createElement("button", { onClick: (e) => handleCopyLink(e, data.nodeData), className: baseButtonClass, title: "Copiar Link para Compartilhar" }, isLinkCopied ? /* @__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: "#4ade80", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("polyline", { points: "20 6 9 17 4 12" })) : /* @__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", { className: isLinkCopied ? "text-green-400" : "" }, isLinkCopied ? "Copiado!" : "Copiar Link")), 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"))));
293
+ }, 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")), /* @__PURE__ */ import_react.default.createElement("button", { onClick: (e) => handleCopyLink(e, data.nodeData), className: baseButtonClass, title: "Copiar Link para Compartilhar" }, isLinkCopied ? /* @__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: "#4ade80", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("polyline", { points: "20 6 9 17 4 12" })) : /* @__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", { className: isLinkCopied ? "text-green-400" : "" }, isLinkCopied ? "Copiado!" : "Copiar Link")), 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"))));
294
294
  };
295
295
  const renderVersionSubMenuView = () => {
296
296
  const group = versionSubMenu;
@@ -855,7 +855,6 @@ var x_view_config = {
855
855
  ANCESTOR_HIGHLIGHT_COLOR: "#FFD700",
856
856
  BLOOM_EFFECT: { strength: 1.35, radius: 0.6, threshold: 0.52 },
857
857
  EMISSIVE_MULTIPLIER: {
858
- // AJUSTE: Valores agora representam ADIÇÃO de intensidade, não multiplicação
859
858
  BASE: 0,
860
859
  HOVER: 2,
861
860
  SELECTED: 1.5,
@@ -907,7 +906,6 @@ var computeNodeMaterialProps = (colorHex) => {
907
906
  return {
908
907
  color: srgb,
909
908
  emissive: emissiveColor
910
- // Intensity é controlada externamente
911
909
  };
912
910
  };
913
911
  var createNodeMesh = (nodeData, position, glowTexture) => {
@@ -1198,6 +1196,7 @@ var createMultipleLinkLines = (linksArray, sourceNodeMesh, targetNodeMesh, resol
1198
1196
  resolution,
1199
1197
  isCurved,
1200
1198
  isCurved,
1199
+ isCurved,
1201
1200
  curveOffset
1202
1201
  );
1203
1202
  line.userData = {
@@ -1574,12 +1573,12 @@ var userActionHandlers = {
1574
1573
  stateRef.current.creation = { isActive: true, sourceNodeData };
1575
1574
  const ghostGeometry = new THREE.SphereGeometry(1.5, 32, 32);
1576
1575
  const sourceColor = sourceNodeData.color || "#cccccc";
1577
- const { emissiveIntensity } = computeNodeMaterialProps(sourceColor);
1578
- const ghostColor = new THREE.Color(sourceColor);
1576
+ const { color: ghostColor, emissive: ghostEmissive } = computeNodeMaterialProps(sourceColor);
1579
1577
  const ghostMaterial = new THREE.MeshStandardMaterial({
1580
1578
  color: ghostColor,
1581
- emissive: ghostColor,
1582
- emissiveIntensity,
1579
+ emissive: ghostEmissive,
1580
+ emissiveIntensity: MIN_VISIBILITY_INTENSITY,
1581
+ // <-- Forçamos o brilho mínimo
1583
1582
  roughness: 0.6,
1584
1583
  metalness: 0,
1585
1584
  transparent: true,
@@ -1650,27 +1649,50 @@ var userActionHandlers = {
1650
1649
  setters.setFormPosition((p) => ({ ...p, opacity: 0 }));
1651
1650
  },
1652
1651
  handleSaveNode: async (context, newNodeData) => {
1653
- const { graphDataRef, sceneDataRef, stateRef, creationMode, setters } = context;
1652
+ const { graphDataRef, sceneDataRef, stateRef, creationMode, setters, actions } = context;
1654
1653
  if (!graphDataRef.current || !sceneDataRef.current) return;
1655
1654
  const { sourceNodeData } = creationMode;
1656
- const newNode = { id: import_short_uuid.default.generate(), ...newNodeData };
1655
+ const { targetDatasetId, ...nodeDataToSave } = newNodeData;
1656
+ const newNode = { id: import_short_uuid.default.generate(), ...nodeDataToSave };
1657
1657
  const newLink = { id: `link_${import_short_uuid.default.generate()}`, source: sourceNodeData.id, target: newNode.id };
1658
- const parentInfo = getParentFileInfoForNode(graphDataRef.current, sceneDataRef.current, sourceNodeData.id);
1659
- if (!parentInfo || !parentInfo.ownerId) {
1660
- console.error("N\xE3o foi poss\xEDvel encontrar as informa\xE7\xF5es do arquivo pai (ou ownerId) para o Node de origem:", sourceNodeData.id);
1661
- alert("Ocorreu um erro ao identificar o arquivo pai ou seu propriet\xE1rio.");
1658
+ const sourceParentInfo = stateRef.current.nodeIdToParentFileMap.get(String(sourceNodeData.id));
1659
+ const finalTargetDatasetId = targetDatasetId || sourceParentInfo.parentFileId;
1660
+ const targetParentInfo = sceneDataRef.current.parent_dbs.find((db) => String(db.db_id) === String(finalTargetDatasetId));
1661
+ if (!sourceParentInfo || !targetParentInfo) {
1662
+ alert("Erro ao identificar os datasets de origem ou destino.");
1662
1663
  return;
1663
1664
  }
1664
- const { parentFileId, ownerId } = parentInfo;
1665
- const specificParentData = JSON.parse(JSON.stringify(graphDataRef.current[parentFileId]));
1666
- specificParentData.nodes.push(newNode);
1667
- specificParentData.links.push(newLink);
1668
- const filenameForSpecificParent = `x_view_dbs/${ownerId}/${parentFileId}`;
1665
+ const isCrossDataset = String(sourceParentInfo.parentFileId) !== String(finalTargetDatasetId);
1666
+ const sourceDataToUpdate = JSON.parse(JSON.stringify(graphDataRef.current[sourceParentInfo.parentFileId]));
1667
+ let targetDataToUpdate = isCrossDataset ? JSON.parse(JSON.stringify(graphDataRef.current[finalTargetDatasetId])) : sourceDataToUpdate;
1668
+ targetDataToUpdate.nodes.push(newNode);
1669
+ sourceDataToUpdate.links.push(newLink);
1670
+ const savePromises = [];
1671
+ if (isCrossDataset) {
1672
+ savePromises.push(
1673
+ actions.save_view_data(`x_view_dbs/${sourceParentInfo.ownerId}/${sourceParentInfo.parentFileId}`, sourceDataToUpdate)
1674
+ );
1675
+ savePromises.push(
1676
+ actions.save_view_data(`x_view_dbs/${targetParentInfo.owner_id}/${finalTargetDatasetId}`, targetDataToUpdate)
1677
+ );
1678
+ } else {
1679
+ savePromises.push(
1680
+ actions.save_view_data(`x_view_dbs/${sourceParentInfo.ownerId}/${sourceParentInfo.parentFileId}`, sourceDataToUpdate)
1681
+ );
1682
+ }
1669
1683
  try {
1670
- await context.actions.save_view_data(filenameForSpecificParent, specificParentData);
1671
- graphDataRef.current[parentFileId] = specificParentData;
1684
+ await Promise.all(savePromises);
1685
+ graphDataRef.current[sourceParentInfo.parentFileId] = sourceDataToUpdate;
1686
+ if (isCrossDataset) {
1687
+ graphDataRef.current[finalTargetDatasetId] = targetDataToUpdate;
1688
+ }
1672
1689
  const finalPosition = stateRef.current.ghostElements.node.position.clone();
1673
1690
  addNewNodeToScene(stateRef.current, newNode, newLink, finalPosition);
1691
+ stateRef.current.nodeIdToParentFileMap.set(String(newNode.id), {
1692
+ parentFileId: finalTargetDatasetId,
1693
+ ownerId: targetParentInfo.owner_id,
1694
+ datasetName: targetDataToUpdate.dataset_name || "Dataset Desconhecido"
1695
+ });
1674
1696
  setters.setSceneVersion((v) => v + 1);
1675
1697
  } catch (error) {
1676
1698
  console.error("Falha ao salvar os dados do grafo:", error);
@@ -1708,12 +1730,12 @@ var userActionHandlers = {
1708
1730
  stateRef.current.creation = { isActive: true, sourceNodeData };
1709
1731
  const ghostGeometry = new THREE.SphereGeometry(1.5, 32, 32);
1710
1732
  const sourceColor = sourceNodeData.color || "#cccccc";
1711
- const { emissiveIntensity } = computeNodeMaterialProps(sourceColor);
1712
- const ghostColor = new THREE.Color(sourceColor);
1733
+ const { color: ghostColor, emissive: ghostEmissive } = computeNodeMaterialProps(sourceColor);
1713
1734
  const ghostMaterial = new THREE.MeshStandardMaterial({
1714
1735
  color: ghostColor,
1715
- emissive: ghostColor,
1716
- emissiveIntensity,
1736
+ emissive: ghostEmissive,
1737
+ emissiveIntensity: MIN_VISIBILITY_INTENSITY,
1738
+ // <-- Forçamos o brilho mínimo
1717
1739
  roughness: 0.6,
1718
1740
  metalness: 0,
1719
1741
  transparent: true,
@@ -3767,6 +3789,7 @@ function DescriptionEditModal({
3767
3789
  e.preventDefault();
3768
3790
  e.stopPropagation();
3769
3791
  e.stopImmediatePropagation();
3792
+ if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current);
3770
3793
  setIsMentionModalOpen(false);
3771
3794
  setMentionTriggerIndex(null);
3772
3795
  setTooltipData(null);
@@ -3860,6 +3883,7 @@ function DescriptionEditModal({
3860
3883
  setIsImportModalOpen(false);
3861
3884
  };
3862
3885
  const handleMentionSelect = (node) => {
3886
+ if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current);
3863
3887
  const tag = `[[MENTION:node:${node.id}]]`;
3864
3888
  const el = textareaRef.current;
3865
3889
  if (mentionTriggerIndex !== null && el) {
@@ -4073,7 +4097,7 @@ function DescriptionEditModal({
4073
4097
  className: "px-3 py-1.5 bg-indigo-600/30 hover:bg-indigo-600 text-indigo-200 text-xs rounded-lg transition-colors disabled:opacity-50"
4074
4098
  },
4075
4099
  "OK"
4076
- ))), /* @__PURE__ */ import_react5.default.createElement("div", { className: "p-2 border-t border-white/10 bg-slate-950/50 flex justify-end" }, /* @__PURE__ */ import_react5.default.createElement("button", { onClick: () => setIsImageModalOpen(false), className: "px-3 py-1.5 text-xs text-slate-400 hover:text-white transition-colors" }, "Cancelar")))), /* @__PURE__ */ import_react5.default.createElement("p", { className: "mt-2 text-xs text-slate-500 shrink-0" }, "Dica: Tags agora incluem ID (ex: ", /* @__PURE__ */ import_react5.default.createElement("b", null, "*/1:a9f2/"), ") para garantir que refer\xEAncias n\xE3o quebrem se voc\xEA reordenar o texto.")),
4100
+ ))), /* @__PURE__ */ import_react5.default.createElement("div", { className: "p-2 border-t border-white/10 bg-slate-950/50 flex justify-end" }, /* @__PURE__ */ import_react5.default.createElement("button", { onClick: () => setIsImageModalOpen(false), className: "px-3 py-1.5 text-xs text-slate-400 hover:text-white transition-colors" }, "Cancelar"))))),
4077
4101
  /* @__PURE__ */ import_react5.default.createElement("div", { className: "sticky bottom-0 z-10 bg-slate-950/95 border-t border-white/10 px-6 py-4 flex justify-end gap-3 shrink-0" }, /* @__PURE__ */ import_react5.default.createElement("button", { onClick: handleSave, className: "px-6 py-2 rounded-lg bg-gradient-to-tr from-indigo-600 to-indigo-400 hover:from-indigo-500 hover:to-indigo-300 transition-colors font-semibold text-sm shadow-[0_8px_24px_rgba(99,102,241,0.35)]" }, "Salvar"))
4078
4102
  )), tooltipData && /* @__PURE__ */ import_react5.default.createElement(
4079
4103
  "div",
@@ -5256,6 +5280,7 @@ function CreateAncestryPanel({
5256
5280
  const branchProgressMapRef = (0, import_react10.useRef)({});
5257
5281
  const [lastSavedSnapshot, setLastSavedSnapshot] = (0, import_react10.useState)(null);
5258
5282
  const [isPrivate, setIsPrivate] = (0, import_react10.useState)(ancestryMode.is_private || false);
5283
+ const initializedContextIdRef = (0, import_react10.useRef)(null);
5259
5284
  const availableImages = customProps.filter((p) => p.type === "images").flatMap((p) => Array.isArray(p.value) ? p.value : []).filter((img) => img.value && img.value.trim() !== "");
5260
5285
  const handleImageClickFromText = (url, name) => {
5261
5286
  if (onOpenImageViewer) {
@@ -5454,6 +5479,11 @@ function CreateAncestryPanel({
5454
5479
  }, [isContextLinked, branchStack]);
5455
5480
  (0, import_react10.useEffect)(() => {
5456
5481
  const ctx = getCurrentContext();
5482
+ const currentContextId = branchStack.length > 0 ? branchStack[branchStack.length - 1].branchId : ancestryMode.currentAncestryId || `new_${ancestryMode.ancestral_node}`;
5483
+ if (initializedContextIdRef.current === currentContextId) {
5484
+ return;
5485
+ }
5486
+ initializedContextIdRef.current = currentContextId;
5457
5487
  let sourceObject = {};
5458
5488
  if (ctx) {
5459
5489
  sourceObject = ctx;
@@ -5804,7 +5834,7 @@ function CreateAncestryPanel({
5804
5834
  const currentAbsTreeStr = JSON.stringify(ancestryMode.abstraction_tree);
5805
5835
  abstractionTreeChanged = currentAbsTreeStr !== lastSavedSnapshot.abstractionTree;
5806
5836
  }
5807
- return treeChanged || nameChanged || descChanged || sectionsChanged || propsChanged || privateChanged;
5837
+ return treeChanged || nameChanged || descChanged || sectionsChanged || propsChanged || privateChanged || abstractionTreeChanged;
5808
5838
  }, [
5809
5839
  ancestryName,
5810
5840
  description,
@@ -6772,8 +6802,12 @@ function InSceneCreationForm({
6772
6802
  availableAncestries = [],
6773
6803
  onMentionClick,
6774
6804
  sourceTypes,
6775
- onUploadFile
6805
+ onUploadFile,
6806
+ availableDatasets = [],
6807
+ sourceNodeDatasetId,
6808
+ viewType
6776
6809
  }) {
6810
+ var _a;
6777
6811
  const [name, setName] = (0, import_react13.useState)("");
6778
6812
  const [types, setTypes] = (0, import_react13.useState)([]);
6779
6813
  const [typeInput, setTypeInput] = (0, import_react13.useState)("");
@@ -6787,6 +6821,25 @@ function InSceneCreationForm({
6787
6821
  const [isDescriptionModalOpen, setIsDescriptionModalOpen] = (0, import_react13.useState)(false);
6788
6822
  const [useImageAsTexture, setUseImageAsTexture] = (0, import_react13.useState)(false);
6789
6823
  const [selectedImageUrl, setSelectedImageUrl] = (0, import_react13.useState)(null);
6824
+ const [targetDatasetId, setTargetDatasetId] = (0, import_react13.useState)(sourceNodeDatasetId || "");
6825
+ const [isDatasetDropdownOpen, setIsDatasetDropdownOpen] = (0, import_react13.useState)(false);
6826
+ const datasetDropdownRef = (0, import_react13.useRef)(null);
6827
+ (0, import_react13.useEffect)(() => {
6828
+ if (sourceNodeDatasetId) setTargetDatasetId(sourceNodeDatasetId);
6829
+ }, [sourceNodeDatasetId]);
6830
+ (0, import_react13.useEffect)(() => {
6831
+ function handleClickOutside(event) {
6832
+ if (datasetDropdownRef.current && !datasetDropdownRef.current.contains(event.target)) {
6833
+ setIsDatasetDropdownOpen(false);
6834
+ }
6835
+ }
6836
+ if (isDatasetDropdownOpen) {
6837
+ document.addEventListener("mousedown", handleClickOutside);
6838
+ }
6839
+ return () => {
6840
+ document.removeEventListener("mousedown", handleClickOutside);
6841
+ };
6842
+ }, [isDatasetDropdownOpen]);
6790
6843
  const propsEndRef = (0, import_react13.useRef)(null);
6791
6844
  const hasImages = customProps.some((p) => p.type === "images" && Array.isArray(p.value) && p.value.length > 0 && p.value.some((img) => img.value));
6792
6845
  (0, import_react13.useEffect)(() => {
@@ -6832,8 +6885,8 @@ function InSceneCreationForm({
6832
6885
  const newProp = createNewCustomProperty(customProps);
6833
6886
  setCustomProps([...customProps, newProp]);
6834
6887
  setTimeout(() => {
6835
- var _a;
6836
- (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
6888
+ var _a2;
6889
+ (_a2 = propsEndRef.current) == null ? void 0 : _a2.scrollIntoView({ behavior: "smooth", block: "center" });
6837
6890
  }, 100);
6838
6891
  };
6839
6892
  const handleRemoveProp = (index) => setCustomProps(customProps.filter((_, i) => i !== index));
@@ -6866,12 +6919,12 @@ function InSceneCreationForm({
6866
6919
  onSizeChange == null ? void 0 : onSizeChange(newSize);
6867
6920
  };
6868
6921
  const handleToggleImageMode = () => {
6869
- var _a, _b;
6922
+ var _a2, _b;
6870
6923
  const newValue = !useImageAsTexture;
6871
6924
  setUseImageAsTexture(newValue);
6872
6925
  if (newValue) {
6873
6926
  const firstImageProp = customProps.find((p) => p.type === "images");
6874
- if (firstImageProp && ((_b = (_a = firstImageProp.value) == null ? void 0 : _a[0]) == null ? void 0 : _b.value)) {
6927
+ if (firstImageProp && ((_b = (_a2 = firstImageProp.value) == null ? void 0 : _a2[0]) == null ? void 0 : _b.value)) {
6875
6928
  const url = firstImageProp.value[0].value;
6876
6929
  setSelectedImageUrl(url);
6877
6930
  onImageChange == null ? void 0 : onImageChange(true, url);
@@ -6904,6 +6957,7 @@ function InSceneCreationForm({
6904
6957
  description_sections: processedSections,
6905
6958
  useImageAsTexture,
6906
6959
  textureImageUrl: useImageAsTexture ? selectedImageUrl : null,
6960
+ targetDatasetId,
6907
6961
  ...additionalData
6908
6962
  });
6909
6963
  };
@@ -6924,6 +6978,7 @@ function InSceneCreationForm({
6924
6978
  onOpenImageViewer([{ name: name2 || "Imagem", value: url }], 0);
6925
6979
  }
6926
6980
  };
6981
+ const selectedDatasetName = ((_a = availableDatasets.find((ds) => ds.id === targetDatasetId)) == null ? void 0 : _a.name) || "Selecione um Dataset...";
6927
6982
  return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(
6928
6983
  "div",
6929
6984
  {
@@ -6981,7 +7036,27 @@ function InSceneCreationForm({
6981
7036
  }
6982
7037
  },
6983
7038
  suggestedType
6984
- ))))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ import_react13.default.createElement("label", { className: "text-xs text-slate-300" }, "Nome do Node"), /* @__PURE__ */ import_react13.default.createElement("input", { required: true, type: "text", placeholder: "Ex.: Cliente XPTO", value: name, onChange: handleNameInputChange, className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60" })), /* @__PURE__ */ import_react13.default.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ import_react13.default.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o (Opcional)"), /* @__PURE__ */ import_react13.default.createElement("div", { className: "relative group min-h-[80px] bg-slate-800/70 p-2.5 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ import_react13.default.createElement(
7039
+ ))))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ import_react13.default.createElement("label", { className: "text-xs text-slate-300" }, "Nome do Node"), /* @__PURE__ */ import_react13.default.createElement("input", { required: true, type: "text", placeholder: "Ex.: Cliente XPTO", value: name, onChange: handleNameInputChange, className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60" })), viewType === "view" && availableDatasets.length > 0 && /* @__PURE__ */ import_react13.default.createElement("div", { className: "space-y-1.5 relative", ref: datasetDropdownRef }, /* @__PURE__ */ import_react13.default.createElement("label", { className: "text-xs text-slate-300" }, "Criar Node no Dataset:"), /* @__PURE__ */ import_react13.default.createElement(
7040
+ "button",
7041
+ {
7042
+ type: "button",
7043
+ onClick: () => setIsDatasetDropdownOpen(!isDatasetDropdownOpen),
7044
+ className: "w-full flex items-center justify-between bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60 hover:bg-slate-700/70 transition-colors text-slate-200 text-left"
7045
+ },
7046
+ /* @__PURE__ */ import_react13.default.createElement("span", { className: "truncate pr-2" }, selectedDatasetName),
7047
+ /* @__PURE__ */ import_react13.default.createElement(import_fi12.FiChevronDown, { className: `flex-shrink-0 text-slate-400 transition-transform ${isDatasetDropdownOpen ? "rotate-180" : ""}` })
7048
+ ), isDatasetDropdownOpen && /* @__PURE__ */ import_react13.default.createElement("ul", { className: "custom-scrollbar absolute top-[66px] left-0 z-20 w-full max-h-48 overflow-y-auto rounded-lg bg-slate-800 border border-white/10 shadow-xl py-1" }, availableDatasets.map((ds) => /* @__PURE__ */ import_react13.default.createElement(
7049
+ "li",
7050
+ {
7051
+ key: ds.id,
7052
+ onClick: () => {
7053
+ setTargetDatasetId(ds.id);
7054
+ setIsDatasetDropdownOpen(false);
7055
+ },
7056
+ className: `px-3 py-2 text-sm cursor-pointer transition-colors ${targetDatasetId === ds.id ? "bg-indigo-600/40 text-indigo-200 font-medium" : "text-slate-300 hover:bg-white/5"}`
7057
+ },
7058
+ ds.name
7059
+ )))), /* @__PURE__ */ import_react13.default.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ import_react13.default.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o (Opcional)"), /* @__PURE__ */ import_react13.default.createElement("div", { className: "relative group min-h-[80px] bg-slate-800/70 p-2.5 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ import_react13.default.createElement(
6985
7060
  DescriptionDisplay,
6986
7061
  {
6987
7062
  description,
@@ -7317,7 +7392,8 @@ function NodeDetailsPanel({
7317
7392
  onMentionClick,
7318
7393
  onIntensityChange,
7319
7394
  onUploadFile,
7320
- userRole
7395
+ userRole,
7396
+ currentDatasetName
7321
7397
  }) {
7322
7398
  const [name, setName] = (0, import_react15.useState)((node == null ? void 0 : node.name) ?? "");
7323
7399
  const [types, setTypes] = (0, import_react15.useState)([]);
@@ -7728,7 +7804,7 @@ function NodeDetailsPanel({
7728
7804
  onUploadFile: canEdit ? onUploadFile : void 0,
7729
7805
  readOnly: !canEdit
7730
7806
  }
7731
- )), /* @__PURE__ */ import_react15.default.createElement("div", { ref: propsEndRef })))), /* @__PURE__ */ import_react15.default.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ import_react15.default.createElement("button", { onClick: handleCancel, disabled: isSaving, className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm disabled:opacity-50" }, canEdit ? "Cancelar" : "Fechar"), canEdit && /* @__PURE__ */ import_react15.default.createElement(
7807
+ )), /* @__PURE__ */ import_react15.default.createElement("div", { ref: propsEndRef }))), currentDatasetName && /* @__PURE__ */ import_react15.default.createElement("div", { className: "pt-3 mt-4 border-t border-white/10 flex items-center justify-end gap-2 text-xs text-slate-400" }, /* @__PURE__ */ import_react15.default.createElement("span", { className: "truncate text-right" }, /* @__PURE__ */ import_react15.default.createElement("span", { className: "text-slate-200 font-medium" }, currentDatasetName)))), /* @__PURE__ */ import_react15.default.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ import_react15.default.createElement("button", { onClick: handleCancel, disabled: isSaving, className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm disabled:opacity-50" }, canEdit ? "Cancelar" : "Fechar"), canEdit && /* @__PURE__ */ import_react15.default.createElement(
7732
7808
  "button",
7733
7809
  {
7734
7810
  onClick: () => handleSave(false),
@@ -9049,7 +9125,7 @@ function XViewScene({
9049
9125
  delete_file_action,
9050
9126
  check_user_permission
9051
9127
  }) {
9052
- var _a, _b, _c, _d, _e, _f;
9128
+ var _a, _b, _c, _d, _e, _f, _g;
9053
9129
  const { data: session, status } = (0, import_react24.useSession)();
9054
9130
  const router = (0, import_navigation.useRouter)();
9055
9131
  const searchParams = (0, import_navigation.useSearchParams)();
@@ -9201,9 +9277,10 @@ function XViewScene({
9201
9277
  const parentFile = allParentData[parentFileId];
9202
9278
  const parentDbInfo = parentDbsArray.find((db) => String(db.db_id) === String(parentFileId));
9203
9279
  const ownerId2 = (parentDbInfo == null ? void 0 : parentDbInfo.owner_id) || null;
9280
+ const datasetName = parentFile.dataset_name || `Dataset #${parentFileId.substring(0, 6)}`;
9204
9281
  if (parentFile.nodes && ownerId2) {
9205
9282
  for (const node of parentFile.nodes) {
9206
- map.set(String(node.id), { parentFileId, ownerId: ownerId2 });
9283
+ map.set(String(node.id), { parentFileId, ownerId: ownerId2, datasetName });
9207
9284
  }
9208
9285
  }
9209
9286
  }
@@ -9723,6 +9800,9 @@ function XViewScene({
9723
9800
  sceneDataRef.current = sceneResponse.data.scene;
9724
9801
  parentDataRef.current = sceneResponse.data.parent;
9725
9802
  ancestryDataRef.current = sceneResponse.data.ancestry;
9803
+ console.log("Console de sceneResponse.data.scene:", sceneResponse.data.scene);
9804
+ console.log("Console de sceneResponse.data.parent:", sceneResponse.data.parent);
9805
+ console.log("Console de sceneResponse.data.ancestry:", sceneResponse.data.ancestry);
9726
9806
  setIsInitialized(true);
9727
9807
  } else {
9728
9808
  console.error("Falha ao buscar dados da cena:", (sceneResponse == null ? void 0 : sceneResponse.error) || "Resposta inv\xE1lida.");
@@ -10504,32 +10584,33 @@ function XViewScene({
10504
10584
  const handleGhostNodeColorChange = (newColor) => {
10505
10585
  const { node: ghostNode, aura: ghostAura } = stateRef.current.ghostElements;
10506
10586
  if (!ghostNode) return;
10507
- const { emissiveIntensity } = computeNodeMaterialProps(newColor);
10508
- const pureColor = new THREE3.Color(newColor);
10587
+ const { color, emissive } = computeNodeMaterialProps(newColor);
10588
+ const currentIntensity = ghostNode.userData.intensity !== void 0 ? Number(ghostNode.userData.intensity) : 0;
10589
+ const finalIntensity = currentIntensity + MIN_VISIBILITY_INTENSITY;
10509
10590
  const isImageNode = ghostNode.userData.useImageAsTexture === true || String(ghostNode.userData.useImageAsTexture) === "true";
10510
10591
  if (isImageNode) {
10511
10592
  const borderMesh = ghostNode.getObjectByName("borderRing");
10512
10593
  if (borderMesh && borderMesh.material) {
10513
- borderMesh.material.color.copy(pureColor);
10594
+ borderMesh.material.color.copy(color);
10514
10595
  if (borderMesh.material.emissive) {
10515
- borderMesh.material.emissive.copy(pureColor);
10516
- borderMesh.material.emissiveIntensity = emissiveIntensity;
10596
+ borderMesh.material.emissive.copy(emissive);
10597
+ borderMesh.material.emissiveIntensity = finalIntensity;
10517
10598
  }
10518
10599
  }
10519
10600
  } else {
10520
10601
  if (ghostNode.material) {
10521
- ghostNode.material.color.copy(pureColor);
10602
+ ghostNode.material.color.copy(color);
10522
10603
  if (ghostNode.material.emissive) {
10523
- ghostNode.material.emissive.copy(pureColor);
10524
- ghostNode.material.emissiveIntensity = emissiveIntensity;
10604
+ ghostNode.material.emissive.copy(emissive);
10605
+ ghostNode.material.emissiveIntensity = finalIntensity;
10525
10606
  }
10526
10607
  }
10527
10608
  }
10528
10609
  if (ghostAura && ghostAura.material) {
10529
- ghostAura.material.color.set(newColor);
10610
+ ghostAura.material.color.copy(color).lerp(new THREE3.Color("#ffffff"), 0.25);
10530
10611
  }
10531
10612
  ghostNode.userData.color = newColor;
10532
- ghostNode.userData._baseEmissiveIntensity = emissiveIntensity;
10613
+ ghostNode.userData._baseEmissiveIntensity = finalIntensity;
10533
10614
  };
10534
10615
  const handleGhostNodeSizeChange = (sizeKey) => {
10535
10616
  const { node: ghostNode } = stateRef.current.ghostElements;
@@ -10570,7 +10651,9 @@ function XViewScene({
10570
10651
  var _a2;
10571
10652
  const mesh = stateRef.current.nodeObjects[String(nodeId)];
10572
10653
  if (!mesh) return;
10573
- const { color, emissive, emissiveIntensity } = computeNodeMaterialProps(newColor);
10654
+ const { color, emissive } = computeNodeMaterialProps(newColor);
10655
+ const currentIntensity = mesh.userData.intensity !== void 0 ? Number(mesh.userData.intensity) : 0;
10656
+ const finalIntensity = currentIntensity + MIN_VISIBILITY_INTENSITY;
10574
10657
  const isImageNode = mesh.userData.useImageAsTexture === true || String(mesh.userData.useImageAsTexture) === "true";
10575
10658
  if (isImageNode) {
10576
10659
  const borderMesh = mesh.getObjectByName("borderRing");
@@ -10578,20 +10661,22 @@ function XViewScene({
10578
10661
  borderMesh.material.color.copy(color);
10579
10662
  if (borderMesh.material.emissive) {
10580
10663
  borderMesh.material.emissive.copy(emissive);
10581
- borderMesh.material.emissiveIntensity = emissiveIntensity;
10664
+ borderMesh.material.emissiveIntensity = finalIntensity;
10582
10665
  }
10583
10666
  }
10584
10667
  } else {
10585
10668
  if (mesh.material) {
10586
10669
  mesh.material.color.copy(color);
10587
10670
  mesh.material.emissive.copy(emissive);
10588
- mesh.material.emissiveIntensity = emissiveIntensity;
10671
+ mesh.material.emissiveIntensity = finalIntensity;
10589
10672
  }
10590
10673
  }
10591
10674
  const aura = mesh.getObjectByName("aura");
10592
- if ((_a2 = aura == null ? void 0 : aura.material) == null ? void 0 : _a2.color) aura.material.color.set(newColor);
10675
+ if ((_a2 = aura == null ? void 0 : aura.material) == null ? void 0 : _a2.color) {
10676
+ aura.material.color.copy(color).lerp(new THREE3.Color("#ffffff"), 0.25);
10677
+ }
10593
10678
  mesh.userData.color = newColor;
10594
- mesh.userData._baseEmissiveIntensity = emissiveIntensity;
10679
+ mesh.userData._baseEmissiveIntensity = finalIntensity;
10595
10680
  };
10596
10681
  const handleDetailNodeSizeChange = (nodeId, newSize) => {
10597
10682
  const mesh = stateRef.current.nodeObjects[String(nodeId)];
@@ -12044,6 +12129,18 @@ function XViewScene({
12044
12129
  tweenToTarget(nodeMesh, 1.2);
12045
12130
  }
12046
12131
  }, [tweenToTarget]);
12132
+ const availableDatasets = (0, import_react23.useMemo)(() => {
12133
+ if (!sceneDataRef.current || !parentDataRef.current) return [];
12134
+ return sceneDataRef.current.parent_dbs.map((db) => {
12135
+ var _a2;
12136
+ return {
12137
+ id: db.db_id,
12138
+ name: ((_a2 = parentDataRef.current[db.db_id]) == null ? void 0 : _a2.dataset_name) || `Dataset #${db.db_id.substring(0, 6)}`
12139
+ };
12140
+ });
12141
+ }, [sceneVersion, isInitialized]);
12142
+ const sourceNodeDatasetId = creationMode.sourceNodeData ? (_b = stateRef.current.nodeIdToParentFileMap.get(String(creationMode.sourceNodeData.id))) == null ? void 0 : _b.parentFileId : null;
12143
+ const detailsNodeDatasetInfo = detailsNode ? stateRef.current.nodeIdToParentFileMap.get(String(detailsNode.id)) : null;
12047
12144
  (0, import_react23.useEffect)(() => {
12048
12145
  if (isInitialized && focusNodeId && !hasFocusedInitial) {
12049
12146
  const nodeObjects = stateRef.current.nodeObjects || {};
@@ -12133,10 +12230,13 @@ function XViewScene({
12133
12230
  style: { position: "absolute", left: `${formPosition.left}px`, top: `${formPosition.top}px`, opacity: formPosition.opacity, zIndex: 20, transition: "opacity 200ms ease-out" },
12134
12231
  refEl: formRef,
12135
12232
  existingTypes: existingNodeTypes,
12136
- initialColor: (_b = creationMode.sourceNodeData) == null ? void 0 : _b.color,
12137
- sourceTypes: (_c = creationMode.sourceNodeData) == null ? void 0 : _c.type,
12233
+ initialColor: (_c = creationMode.sourceNodeData) == null ? void 0 : _c.color,
12234
+ sourceTypes: (_d = creationMode.sourceNodeData) == null ? void 0 : _d.type,
12138
12235
  onIntensityChange: handleGhostNodeIntensityChange,
12139
- onUploadFile: upload_file_action
12236
+ onUploadFile: upload_file_action,
12237
+ availableDatasets,
12238
+ sourceNodeDatasetId,
12239
+ viewType: viewParams == null ? void 0 : viewParams.type
12140
12240
  }
12141
12241
  ),
12142
12242
  versionMode.isActive && /* @__PURE__ */ import_react23.default.createElement(
@@ -12151,8 +12251,8 @@ function XViewScene({
12151
12251
  onMentionClick: handleAddExistingNode,
12152
12252
  style: { position: "absolute", left: `${formPosition.left}px`, top: `${formPosition.top}px`, opacity: formPosition.opacity, zIndex: 20, transition: "opacity 200ms ease-out" },
12153
12253
  refEl: formRef,
12154
- fixedType: (_d = versionMode.sourceNodeData) == null ? void 0 : _d.type,
12155
- fixedColor: (_e = versionMode.sourceNodeData) == null ? void 0 : _e.color,
12254
+ fixedType: (_e = versionMode.sourceNodeData) == null ? void 0 : _e.type,
12255
+ fixedColor: (_f = versionMode.sourceNodeData) == null ? void 0 : _f.color,
12156
12256
  onUploadFile: upload_file_action
12157
12257
  }
12158
12258
  ),
@@ -12261,7 +12361,8 @@ function XViewScene({
12261
12361
  onMentionClick: handleAddExistingNode,
12262
12362
  onIntensityChange: handleDetailNodeIntensityChange,
12263
12363
  onUploadFile: upload_file_action,
12264
- userRole: userPermissionRole
12364
+ userRole: userPermissionRole,
12365
+ currentDatasetName: detailsNodeDatasetInfo == null ? void 0 : detailsNodeDatasetInfo.datasetName
12265
12366
  }
12266
12367
  ),
12267
12368
  detailsLink && /* @__PURE__ */ import_react23.default.createElement(
@@ -12389,7 +12490,7 @@ function XViewScene({
12389
12490
  onClose: () => setIsImportModalOpen(false),
12390
12491
  onConfirm: handleConfirmImport,
12391
12492
  session,
12392
- parentDbs: ((_f = sceneDataRef.current) == null ? void 0 : _f.parent_dbs) || [],
12493
+ parentDbs: ((_g = sceneDataRef.current) == null ? void 0 : _g.parent_dbs) || [],
12393
12494
  onFetchAvailableFiles: import_parent_file_modal_get,
12394
12495
  currentViewName: viewParams == null ? void 0 : viewParams.name,
12395
12496
  currentAncestries: ancestryDataRef.current || []
package/dist/index.mjs CHANGED
@@ -243,10 +243,10 @@ function ContextMenu({
243
243
  const canCreateVersion = ability.can("create", "Versioning");
244
244
  const canReadVersion = ability.can("read", "Versioning");
245
245
  const shouldShowVersioningBtn = canCreateVersion || canReadVersion && hasVersions;
246
- 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: () => {
246
+ 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" }, 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" }), /* @__PURE__ */ React.createElement("button", { onClick: () => {
247
247
  onFocusNode == null ? void 0 : onFocusNode(data.nodeData);
248
248
  onClose();
249
- }, 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" }), /* @__PURE__ */ React.createElement("button", { onClick: (e) => handleCopyLink(e, data.nodeData), className: baseButtonClass, title: "Copiar Link para Compartilhar" }, isLinkCopied ? /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#4ade80", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("polyline", { points: "20 6 9 17 4 12" })) : /* @__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", { className: isLinkCopied ? "text-green-400" : "" }, isLinkCopied ? "Copiado!" : "Copiar Link")), 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"))));
249
+ }, 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")), /* @__PURE__ */ React.createElement("button", { onClick: (e) => handleCopyLink(e, data.nodeData), className: baseButtonClass, title: "Copiar Link para Compartilhar" }, isLinkCopied ? /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#4ade80", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("polyline", { points: "20 6 9 17 4 12" })) : /* @__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", { className: isLinkCopied ? "text-green-400" : "" }, isLinkCopied ? "Copiado!" : "Copiar Link")), 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"))));
250
250
  };
251
251
  const renderVersionSubMenuView = () => {
252
252
  const group = versionSubMenu;
@@ -811,7 +811,6 @@ var x_view_config = {
811
811
  ANCESTOR_HIGHLIGHT_COLOR: "#FFD700",
812
812
  BLOOM_EFFECT: { strength: 1.35, radius: 0.6, threshold: 0.52 },
813
813
  EMISSIVE_MULTIPLIER: {
814
- // AJUSTE: Valores agora representam ADIÇÃO de intensidade, não multiplicação
815
814
  BASE: 0,
816
815
  HOVER: 2,
817
816
  SELECTED: 1.5,
@@ -863,7 +862,6 @@ var computeNodeMaterialProps = (colorHex) => {
863
862
  return {
864
863
  color: srgb,
865
864
  emissive: emissiveColor
866
- // Intensity é controlada externamente
867
865
  };
868
866
  };
869
867
  var createNodeMesh = (nodeData, position, glowTexture) => {
@@ -1154,6 +1152,7 @@ var createMultipleLinkLines = (linksArray, sourceNodeMesh, targetNodeMesh, resol
1154
1152
  resolution,
1155
1153
  isCurved,
1156
1154
  isCurved,
1155
+ isCurved,
1157
1156
  curveOffset
1158
1157
  );
1159
1158
  line.userData = {
@@ -1530,12 +1529,12 @@ var userActionHandlers = {
1530
1529
  stateRef.current.creation = { isActive: true, sourceNodeData };
1531
1530
  const ghostGeometry = new THREE.SphereGeometry(1.5, 32, 32);
1532
1531
  const sourceColor = sourceNodeData.color || "#cccccc";
1533
- const { emissiveIntensity } = computeNodeMaterialProps(sourceColor);
1534
- const ghostColor = new THREE.Color(sourceColor);
1532
+ const { color: ghostColor, emissive: ghostEmissive } = computeNodeMaterialProps(sourceColor);
1535
1533
  const ghostMaterial = new THREE.MeshStandardMaterial({
1536
1534
  color: ghostColor,
1537
- emissive: ghostColor,
1538
- emissiveIntensity,
1535
+ emissive: ghostEmissive,
1536
+ emissiveIntensity: MIN_VISIBILITY_INTENSITY,
1537
+ // <-- Forçamos o brilho mínimo
1539
1538
  roughness: 0.6,
1540
1539
  metalness: 0,
1541
1540
  transparent: true,
@@ -1606,27 +1605,50 @@ var userActionHandlers = {
1606
1605
  setters.setFormPosition((p) => ({ ...p, opacity: 0 }));
1607
1606
  },
1608
1607
  handleSaveNode: async (context, newNodeData) => {
1609
- const { graphDataRef, sceneDataRef, stateRef, creationMode, setters } = context;
1608
+ const { graphDataRef, sceneDataRef, stateRef, creationMode, setters, actions } = context;
1610
1609
  if (!graphDataRef.current || !sceneDataRef.current) return;
1611
1610
  const { sourceNodeData } = creationMode;
1612
- const newNode = { id: short.generate(), ...newNodeData };
1611
+ const { targetDatasetId, ...nodeDataToSave } = newNodeData;
1612
+ const newNode = { id: short.generate(), ...nodeDataToSave };
1613
1613
  const newLink = { id: `link_${short.generate()}`, source: sourceNodeData.id, target: newNode.id };
1614
- const parentInfo = getParentFileInfoForNode(graphDataRef.current, sceneDataRef.current, sourceNodeData.id);
1615
- if (!parentInfo || !parentInfo.ownerId) {
1616
- console.error("N\xE3o foi poss\xEDvel encontrar as informa\xE7\xF5es do arquivo pai (ou ownerId) para o Node de origem:", sourceNodeData.id);
1617
- alert("Ocorreu um erro ao identificar o arquivo pai ou seu propriet\xE1rio.");
1614
+ const sourceParentInfo = stateRef.current.nodeIdToParentFileMap.get(String(sourceNodeData.id));
1615
+ const finalTargetDatasetId = targetDatasetId || sourceParentInfo.parentFileId;
1616
+ const targetParentInfo = sceneDataRef.current.parent_dbs.find((db) => String(db.db_id) === String(finalTargetDatasetId));
1617
+ if (!sourceParentInfo || !targetParentInfo) {
1618
+ alert("Erro ao identificar os datasets de origem ou destino.");
1618
1619
  return;
1619
1620
  }
1620
- const { parentFileId, ownerId } = parentInfo;
1621
- const specificParentData = JSON.parse(JSON.stringify(graphDataRef.current[parentFileId]));
1622
- specificParentData.nodes.push(newNode);
1623
- specificParentData.links.push(newLink);
1624
- const filenameForSpecificParent = `x_view_dbs/${ownerId}/${parentFileId}`;
1621
+ const isCrossDataset = String(sourceParentInfo.parentFileId) !== String(finalTargetDatasetId);
1622
+ const sourceDataToUpdate = JSON.parse(JSON.stringify(graphDataRef.current[sourceParentInfo.parentFileId]));
1623
+ let targetDataToUpdate = isCrossDataset ? JSON.parse(JSON.stringify(graphDataRef.current[finalTargetDatasetId])) : sourceDataToUpdate;
1624
+ targetDataToUpdate.nodes.push(newNode);
1625
+ sourceDataToUpdate.links.push(newLink);
1626
+ const savePromises = [];
1627
+ if (isCrossDataset) {
1628
+ savePromises.push(
1629
+ actions.save_view_data(`x_view_dbs/${sourceParentInfo.ownerId}/${sourceParentInfo.parentFileId}`, sourceDataToUpdate)
1630
+ );
1631
+ savePromises.push(
1632
+ actions.save_view_data(`x_view_dbs/${targetParentInfo.owner_id}/${finalTargetDatasetId}`, targetDataToUpdate)
1633
+ );
1634
+ } else {
1635
+ savePromises.push(
1636
+ actions.save_view_data(`x_view_dbs/${sourceParentInfo.ownerId}/${sourceParentInfo.parentFileId}`, sourceDataToUpdate)
1637
+ );
1638
+ }
1625
1639
  try {
1626
- await context.actions.save_view_data(filenameForSpecificParent, specificParentData);
1627
- graphDataRef.current[parentFileId] = specificParentData;
1640
+ await Promise.all(savePromises);
1641
+ graphDataRef.current[sourceParentInfo.parentFileId] = sourceDataToUpdate;
1642
+ if (isCrossDataset) {
1643
+ graphDataRef.current[finalTargetDatasetId] = targetDataToUpdate;
1644
+ }
1628
1645
  const finalPosition = stateRef.current.ghostElements.node.position.clone();
1629
1646
  addNewNodeToScene(stateRef.current, newNode, newLink, finalPosition);
1647
+ stateRef.current.nodeIdToParentFileMap.set(String(newNode.id), {
1648
+ parentFileId: finalTargetDatasetId,
1649
+ ownerId: targetParentInfo.owner_id,
1650
+ datasetName: targetDataToUpdate.dataset_name || "Dataset Desconhecido"
1651
+ });
1630
1652
  setters.setSceneVersion((v) => v + 1);
1631
1653
  } catch (error) {
1632
1654
  console.error("Falha ao salvar os dados do grafo:", error);
@@ -1664,12 +1686,12 @@ var userActionHandlers = {
1664
1686
  stateRef.current.creation = { isActive: true, sourceNodeData };
1665
1687
  const ghostGeometry = new THREE.SphereGeometry(1.5, 32, 32);
1666
1688
  const sourceColor = sourceNodeData.color || "#cccccc";
1667
- const { emissiveIntensity } = computeNodeMaterialProps(sourceColor);
1668
- const ghostColor = new THREE.Color(sourceColor);
1689
+ const { color: ghostColor, emissive: ghostEmissive } = computeNodeMaterialProps(sourceColor);
1669
1690
  const ghostMaterial = new THREE.MeshStandardMaterial({
1670
1691
  color: ghostColor,
1671
- emissive: ghostColor,
1672
- emissiveIntensity,
1692
+ emissive: ghostEmissive,
1693
+ emissiveIntensity: MIN_VISIBILITY_INTENSITY,
1694
+ // <-- Forçamos o brilho mínimo
1673
1695
  roughness: 0.6,
1674
1696
  metalness: 0,
1675
1697
  transparent: true,
@@ -3723,6 +3745,7 @@ function DescriptionEditModal({
3723
3745
  e.preventDefault();
3724
3746
  e.stopPropagation();
3725
3747
  e.stopImmediatePropagation();
3748
+ if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current);
3726
3749
  setIsMentionModalOpen(false);
3727
3750
  setMentionTriggerIndex(null);
3728
3751
  setTooltipData(null);
@@ -3816,6 +3839,7 @@ function DescriptionEditModal({
3816
3839
  setIsImportModalOpen(false);
3817
3840
  };
3818
3841
  const handleMentionSelect = (node) => {
3842
+ if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current);
3819
3843
  const tag = `[[MENTION:node:${node.id}]]`;
3820
3844
  const el = textareaRef.current;
3821
3845
  if (mentionTriggerIndex !== null && el) {
@@ -4029,7 +4053,7 @@ function DescriptionEditModal({
4029
4053
  className: "px-3 py-1.5 bg-indigo-600/30 hover:bg-indigo-600 text-indigo-200 text-xs rounded-lg transition-colors disabled:opacity-50"
4030
4054
  },
4031
4055
  "OK"
4032
- ))), /* @__PURE__ */ React5.createElement("div", { className: "p-2 border-t border-white/10 bg-slate-950/50 flex justify-end" }, /* @__PURE__ */ React5.createElement("button", { onClick: () => setIsImageModalOpen(false), className: "px-3 py-1.5 text-xs text-slate-400 hover:text-white transition-colors" }, "Cancelar")))), /* @__PURE__ */ React5.createElement("p", { className: "mt-2 text-xs text-slate-500 shrink-0" }, "Dica: Tags agora incluem ID (ex: ", /* @__PURE__ */ React5.createElement("b", null, "*/1:a9f2/"), ") para garantir que refer\xEAncias n\xE3o quebrem se voc\xEA reordenar o texto.")),
4056
+ ))), /* @__PURE__ */ React5.createElement("div", { className: "p-2 border-t border-white/10 bg-slate-950/50 flex justify-end" }, /* @__PURE__ */ React5.createElement("button", { onClick: () => setIsImageModalOpen(false), className: "px-3 py-1.5 text-xs text-slate-400 hover:text-white transition-colors" }, "Cancelar"))))),
4033
4057
  /* @__PURE__ */ React5.createElement("div", { className: "sticky bottom-0 z-10 bg-slate-950/95 border-t border-white/10 px-6 py-4 flex justify-end gap-3 shrink-0" }, /* @__PURE__ */ React5.createElement("button", { onClick: handleSave, className: "px-6 py-2 rounded-lg bg-gradient-to-tr from-indigo-600 to-indigo-400 hover:from-indigo-500 hover:to-indigo-300 transition-colors font-semibold text-sm shadow-[0_8px_24px_rgba(99,102,241,0.35)]" }, "Salvar"))
4034
4058
  )), tooltipData && /* @__PURE__ */ React5.createElement(
4035
4059
  "div",
@@ -5242,6 +5266,7 @@ function CreateAncestryPanel({
5242
5266
  const branchProgressMapRef = useRef8({});
5243
5267
  const [lastSavedSnapshot, setLastSavedSnapshot] = useState10(null);
5244
5268
  const [isPrivate, setIsPrivate] = useState10(ancestryMode.is_private || false);
5269
+ const initializedContextIdRef = useRef8(null);
5245
5270
  const availableImages = customProps.filter((p) => p.type === "images").flatMap((p) => Array.isArray(p.value) ? p.value : []).filter((img) => img.value && img.value.trim() !== "");
5246
5271
  const handleImageClickFromText = (url, name) => {
5247
5272
  if (onOpenImageViewer) {
@@ -5440,6 +5465,11 @@ function CreateAncestryPanel({
5440
5465
  }, [isContextLinked, branchStack]);
5441
5466
  useEffect10(() => {
5442
5467
  const ctx = getCurrentContext();
5468
+ const currentContextId = branchStack.length > 0 ? branchStack[branchStack.length - 1].branchId : ancestryMode.currentAncestryId || `new_${ancestryMode.ancestral_node}`;
5469
+ if (initializedContextIdRef.current === currentContextId) {
5470
+ return;
5471
+ }
5472
+ initializedContextIdRef.current = currentContextId;
5443
5473
  let sourceObject = {};
5444
5474
  if (ctx) {
5445
5475
  sourceObject = ctx;
@@ -5790,7 +5820,7 @@ function CreateAncestryPanel({
5790
5820
  const currentAbsTreeStr = JSON.stringify(ancestryMode.abstraction_tree);
5791
5821
  abstractionTreeChanged = currentAbsTreeStr !== lastSavedSnapshot.abstractionTree;
5792
5822
  }
5793
- return treeChanged || nameChanged || descChanged || sectionsChanged || propsChanged || privateChanged;
5823
+ return treeChanged || nameChanged || descChanged || sectionsChanged || propsChanged || privateChanged || abstractionTreeChanged;
5794
5824
  }, [
5795
5825
  ancestryName,
5796
5826
  description,
@@ -6740,7 +6770,7 @@ function ColorPicker({ color, onChange, disabled }) {
6740
6770
  }
6741
6771
 
6742
6772
  // src/components/InSceneCreationForm.jsx
6743
- import { FiPlus as FiPlus3, FiMaximize2, FiX as FiX3, FiCheck as FiCheck7, FiEdit2 as FiEdit24, FiSun } from "react-icons/fi";
6773
+ import { FiPlus as FiPlus3, FiMaximize2, FiX as FiX3, FiCheck as FiCheck7, FiEdit2 as FiEdit24, FiSun, FiChevronDown as FiChevronDown4 } from "react-icons/fi";
6744
6774
  function InSceneCreationForm({
6745
6775
  onSave,
6746
6776
  onCancel,
@@ -6758,8 +6788,12 @@ function InSceneCreationForm({
6758
6788
  availableAncestries = [],
6759
6789
  onMentionClick,
6760
6790
  sourceTypes,
6761
- onUploadFile
6791
+ onUploadFile,
6792
+ availableDatasets = [],
6793
+ sourceNodeDatasetId,
6794
+ viewType
6762
6795
  }) {
6796
+ var _a;
6763
6797
  const [name, setName] = useState13("");
6764
6798
  const [types, setTypes] = useState13([]);
6765
6799
  const [typeInput, setTypeInput] = useState13("");
@@ -6773,6 +6807,25 @@ function InSceneCreationForm({
6773
6807
  const [isDescriptionModalOpen, setIsDescriptionModalOpen] = useState13(false);
6774
6808
  const [useImageAsTexture, setUseImageAsTexture] = useState13(false);
6775
6809
  const [selectedImageUrl, setSelectedImageUrl] = useState13(null);
6810
+ const [targetDatasetId, setTargetDatasetId] = useState13(sourceNodeDatasetId || "");
6811
+ const [isDatasetDropdownOpen, setIsDatasetDropdownOpen] = useState13(false);
6812
+ const datasetDropdownRef = useRef10(null);
6813
+ useEffect13(() => {
6814
+ if (sourceNodeDatasetId) setTargetDatasetId(sourceNodeDatasetId);
6815
+ }, [sourceNodeDatasetId]);
6816
+ useEffect13(() => {
6817
+ function handleClickOutside(event) {
6818
+ if (datasetDropdownRef.current && !datasetDropdownRef.current.contains(event.target)) {
6819
+ setIsDatasetDropdownOpen(false);
6820
+ }
6821
+ }
6822
+ if (isDatasetDropdownOpen) {
6823
+ document.addEventListener("mousedown", handleClickOutside);
6824
+ }
6825
+ return () => {
6826
+ document.removeEventListener("mousedown", handleClickOutside);
6827
+ };
6828
+ }, [isDatasetDropdownOpen]);
6776
6829
  const propsEndRef = useRef10(null);
6777
6830
  const hasImages = customProps.some((p) => p.type === "images" && Array.isArray(p.value) && p.value.length > 0 && p.value.some((img) => img.value));
6778
6831
  useEffect13(() => {
@@ -6818,8 +6871,8 @@ function InSceneCreationForm({
6818
6871
  const newProp = createNewCustomProperty(customProps);
6819
6872
  setCustomProps([...customProps, newProp]);
6820
6873
  setTimeout(() => {
6821
- var _a;
6822
- (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
6874
+ var _a2;
6875
+ (_a2 = propsEndRef.current) == null ? void 0 : _a2.scrollIntoView({ behavior: "smooth", block: "center" });
6823
6876
  }, 100);
6824
6877
  };
6825
6878
  const handleRemoveProp = (index) => setCustomProps(customProps.filter((_, i) => i !== index));
@@ -6852,12 +6905,12 @@ function InSceneCreationForm({
6852
6905
  onSizeChange == null ? void 0 : onSizeChange(newSize);
6853
6906
  };
6854
6907
  const handleToggleImageMode = () => {
6855
- var _a, _b;
6908
+ var _a2, _b;
6856
6909
  const newValue = !useImageAsTexture;
6857
6910
  setUseImageAsTexture(newValue);
6858
6911
  if (newValue) {
6859
6912
  const firstImageProp = customProps.find((p) => p.type === "images");
6860
- if (firstImageProp && ((_b = (_a = firstImageProp.value) == null ? void 0 : _a[0]) == null ? void 0 : _b.value)) {
6913
+ if (firstImageProp && ((_b = (_a2 = firstImageProp.value) == null ? void 0 : _a2[0]) == null ? void 0 : _b.value)) {
6861
6914
  const url = firstImageProp.value[0].value;
6862
6915
  setSelectedImageUrl(url);
6863
6916
  onImageChange == null ? void 0 : onImageChange(true, url);
@@ -6890,6 +6943,7 @@ function InSceneCreationForm({
6890
6943
  description_sections: processedSections,
6891
6944
  useImageAsTexture,
6892
6945
  textureImageUrl: useImageAsTexture ? selectedImageUrl : null,
6946
+ targetDatasetId,
6893
6947
  ...additionalData
6894
6948
  });
6895
6949
  };
@@ -6910,6 +6964,7 @@ function InSceneCreationForm({
6910
6964
  onOpenImageViewer([{ name: name2 || "Imagem", value: url }], 0);
6911
6965
  }
6912
6966
  };
6967
+ const selectedDatasetName = ((_a = availableDatasets.find((ds) => ds.id === targetDatasetId)) == null ? void 0 : _a.name) || "Selecione um Dataset...";
6913
6968
  return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
6914
6969
  "div",
6915
6970
  {
@@ -6967,7 +7022,27 @@ function InSceneCreationForm({
6967
7022
  }
6968
7023
  },
6969
7024
  suggestedType
6970
- ))))), /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Nome do Node"), /* @__PURE__ */ React13.createElement("input", { required: true, type: "text", placeholder: "Ex.: Cliente XPTO", value: name, onChange: handleNameInputChange, className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60" })), /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o (Opcional)"), /* @__PURE__ */ React13.createElement("div", { className: "relative group min-h-[80px] bg-slate-800/70 p-2.5 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ React13.createElement(
7025
+ ))))), /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Nome do Node"), /* @__PURE__ */ React13.createElement("input", { required: true, type: "text", placeholder: "Ex.: Cliente XPTO", value: name, onChange: handleNameInputChange, className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60" })), viewType === "view" && availableDatasets.length > 0 && /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5 relative", ref: datasetDropdownRef }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Criar Node no Dataset:"), /* @__PURE__ */ React13.createElement(
7026
+ "button",
7027
+ {
7028
+ type: "button",
7029
+ onClick: () => setIsDatasetDropdownOpen(!isDatasetDropdownOpen),
7030
+ className: "w-full flex items-center justify-between bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60 hover:bg-slate-700/70 transition-colors text-slate-200 text-left"
7031
+ },
7032
+ /* @__PURE__ */ React13.createElement("span", { className: "truncate pr-2" }, selectedDatasetName),
7033
+ /* @__PURE__ */ React13.createElement(FiChevronDown4, { className: `flex-shrink-0 text-slate-400 transition-transform ${isDatasetDropdownOpen ? "rotate-180" : ""}` })
7034
+ ), isDatasetDropdownOpen && /* @__PURE__ */ React13.createElement("ul", { className: "custom-scrollbar absolute top-[66px] left-0 z-20 w-full max-h-48 overflow-y-auto rounded-lg bg-slate-800 border border-white/10 shadow-xl py-1" }, availableDatasets.map((ds) => /* @__PURE__ */ React13.createElement(
7035
+ "li",
7036
+ {
7037
+ key: ds.id,
7038
+ onClick: () => {
7039
+ setTargetDatasetId(ds.id);
7040
+ setIsDatasetDropdownOpen(false);
7041
+ },
7042
+ className: `px-3 py-2 text-sm cursor-pointer transition-colors ${targetDatasetId === ds.id ? "bg-indigo-600/40 text-indigo-200 font-medium" : "text-slate-300 hover:bg-white/5"}`
7043
+ },
7044
+ ds.name
7045
+ )))), /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o (Opcional)"), /* @__PURE__ */ React13.createElement("div", { className: "relative group min-h-[80px] bg-slate-800/70 p-2.5 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ React13.createElement(
6971
7046
  DescriptionDisplay,
6972
7047
  {
6973
7048
  description,
@@ -7285,7 +7360,7 @@ function InSceneVersionForm({
7285
7360
 
7286
7361
  // src/components/NodeDetailsPanel.jsx
7287
7362
  import React15, { useState as useState15, useEffect as useEffect15, useRef as useRef12 } from "react";
7288
- import { FiPlus as FiPlus5, FiMaximize2 as FiMaximize23, FiX as FiX4, FiCheck as FiCheck9, FiImage as FiImage3, FiEdit2 as FiEdit26, FiLoader as FiLoader2, FiBookOpen as FiBookOpen3, FiSun as FiSun2, FiLink as FiLink5 } from "react-icons/fi";
7363
+ import { FiPlus as FiPlus5, FiMaximize2 as FiMaximize23, FiX as FiX4, FiCheck as FiCheck9, FiImage as FiImage3, FiEdit2 as FiEdit26, FiLoader as FiLoader2, FiBookOpen as FiBookOpen3, FiSun as FiSun2, FiLink as FiLink5, FiDatabase } from "react-icons/fi";
7289
7364
  function NodeDetailsPanel({
7290
7365
  node,
7291
7366
  onClose,
@@ -7303,7 +7378,8 @@ function NodeDetailsPanel({
7303
7378
  onMentionClick,
7304
7379
  onIntensityChange,
7305
7380
  onUploadFile,
7306
- userRole
7381
+ userRole,
7382
+ currentDatasetName
7307
7383
  }) {
7308
7384
  const [name, setName] = useState15((node == null ? void 0 : node.name) ?? "");
7309
7385
  const [types, setTypes] = useState15([]);
@@ -7714,7 +7790,7 @@ function NodeDetailsPanel({
7714
7790
  onUploadFile: canEdit ? onUploadFile : void 0,
7715
7791
  readOnly: !canEdit
7716
7792
  }
7717
- )), /* @__PURE__ */ React15.createElement("div", { ref: propsEndRef })))), /* @__PURE__ */ React15.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React15.createElement("button", { onClick: handleCancel, disabled: isSaving, className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm disabled:opacity-50" }, canEdit ? "Cancelar" : "Fechar"), canEdit && /* @__PURE__ */ React15.createElement(
7793
+ )), /* @__PURE__ */ React15.createElement("div", { ref: propsEndRef }))), currentDatasetName && /* @__PURE__ */ React15.createElement("div", { className: "pt-3 mt-4 border-t border-white/10 flex items-center justify-end gap-2 text-xs text-slate-400" }, /* @__PURE__ */ React15.createElement("span", { className: "truncate text-right" }, /* @__PURE__ */ React15.createElement("span", { className: "text-slate-200 font-medium" }, currentDatasetName)))), /* @__PURE__ */ React15.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React15.createElement("button", { onClick: handleCancel, disabled: isSaving, className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm disabled:opacity-50" }, canEdit ? "Cancelar" : "Fechar"), canEdit && /* @__PURE__ */ React15.createElement(
7718
7794
  "button",
7719
7795
  {
7720
7796
  onClick: () => handleSave(false),
@@ -9048,7 +9124,7 @@ function XViewScene({
9048
9124
  delete_file_action,
9049
9125
  check_user_permission
9050
9126
  }) {
9051
- var _a, _b, _c, _d, _e, _f;
9127
+ var _a, _b, _c, _d, _e, _f, _g;
9052
9128
  const { data: session, status } = useSession();
9053
9129
  const router = useRouter();
9054
9130
  const searchParams = useSearchParams();
@@ -9200,9 +9276,10 @@ function XViewScene({
9200
9276
  const parentFile = allParentData[parentFileId];
9201
9277
  const parentDbInfo = parentDbsArray.find((db) => String(db.db_id) === String(parentFileId));
9202
9278
  const ownerId2 = (parentDbInfo == null ? void 0 : parentDbInfo.owner_id) || null;
9279
+ const datasetName = parentFile.dataset_name || `Dataset #${parentFileId.substring(0, 6)}`;
9203
9280
  if (parentFile.nodes && ownerId2) {
9204
9281
  for (const node of parentFile.nodes) {
9205
- map.set(String(node.id), { parentFileId, ownerId: ownerId2 });
9282
+ map.set(String(node.id), { parentFileId, ownerId: ownerId2, datasetName });
9206
9283
  }
9207
9284
  }
9208
9285
  }
@@ -9722,6 +9799,9 @@ function XViewScene({
9722
9799
  sceneDataRef.current = sceneResponse.data.scene;
9723
9800
  parentDataRef.current = sceneResponse.data.parent;
9724
9801
  ancestryDataRef.current = sceneResponse.data.ancestry;
9802
+ console.log("Console de sceneResponse.data.scene:", sceneResponse.data.scene);
9803
+ console.log("Console de sceneResponse.data.parent:", sceneResponse.data.parent);
9804
+ console.log("Console de sceneResponse.data.ancestry:", sceneResponse.data.ancestry);
9725
9805
  setIsInitialized(true);
9726
9806
  } else {
9727
9807
  console.error("Falha ao buscar dados da cena:", (sceneResponse == null ? void 0 : sceneResponse.error) || "Resposta inv\xE1lida.");
@@ -10503,32 +10583,33 @@ function XViewScene({
10503
10583
  const handleGhostNodeColorChange = (newColor) => {
10504
10584
  const { node: ghostNode, aura: ghostAura } = stateRef.current.ghostElements;
10505
10585
  if (!ghostNode) return;
10506
- const { emissiveIntensity } = computeNodeMaterialProps(newColor);
10507
- const pureColor = new THREE3.Color(newColor);
10586
+ const { color, emissive } = computeNodeMaterialProps(newColor);
10587
+ const currentIntensity = ghostNode.userData.intensity !== void 0 ? Number(ghostNode.userData.intensity) : 0;
10588
+ const finalIntensity = currentIntensity + MIN_VISIBILITY_INTENSITY;
10508
10589
  const isImageNode = ghostNode.userData.useImageAsTexture === true || String(ghostNode.userData.useImageAsTexture) === "true";
10509
10590
  if (isImageNode) {
10510
10591
  const borderMesh = ghostNode.getObjectByName("borderRing");
10511
10592
  if (borderMesh && borderMesh.material) {
10512
- borderMesh.material.color.copy(pureColor);
10593
+ borderMesh.material.color.copy(color);
10513
10594
  if (borderMesh.material.emissive) {
10514
- borderMesh.material.emissive.copy(pureColor);
10515
- borderMesh.material.emissiveIntensity = emissiveIntensity;
10595
+ borderMesh.material.emissive.copy(emissive);
10596
+ borderMesh.material.emissiveIntensity = finalIntensity;
10516
10597
  }
10517
10598
  }
10518
10599
  } else {
10519
10600
  if (ghostNode.material) {
10520
- ghostNode.material.color.copy(pureColor);
10601
+ ghostNode.material.color.copy(color);
10521
10602
  if (ghostNode.material.emissive) {
10522
- ghostNode.material.emissive.copy(pureColor);
10523
- ghostNode.material.emissiveIntensity = emissiveIntensity;
10603
+ ghostNode.material.emissive.copy(emissive);
10604
+ ghostNode.material.emissiveIntensity = finalIntensity;
10524
10605
  }
10525
10606
  }
10526
10607
  }
10527
10608
  if (ghostAura && ghostAura.material) {
10528
- ghostAura.material.color.set(newColor);
10609
+ ghostAura.material.color.copy(color).lerp(new THREE3.Color("#ffffff"), 0.25);
10529
10610
  }
10530
10611
  ghostNode.userData.color = newColor;
10531
- ghostNode.userData._baseEmissiveIntensity = emissiveIntensity;
10612
+ ghostNode.userData._baseEmissiveIntensity = finalIntensity;
10532
10613
  };
10533
10614
  const handleGhostNodeSizeChange = (sizeKey) => {
10534
10615
  const { node: ghostNode } = stateRef.current.ghostElements;
@@ -10569,7 +10650,9 @@ function XViewScene({
10569
10650
  var _a2;
10570
10651
  const mesh = stateRef.current.nodeObjects[String(nodeId)];
10571
10652
  if (!mesh) return;
10572
- const { color, emissive, emissiveIntensity } = computeNodeMaterialProps(newColor);
10653
+ const { color, emissive } = computeNodeMaterialProps(newColor);
10654
+ const currentIntensity = mesh.userData.intensity !== void 0 ? Number(mesh.userData.intensity) : 0;
10655
+ const finalIntensity = currentIntensity + MIN_VISIBILITY_INTENSITY;
10573
10656
  const isImageNode = mesh.userData.useImageAsTexture === true || String(mesh.userData.useImageAsTexture) === "true";
10574
10657
  if (isImageNode) {
10575
10658
  const borderMesh = mesh.getObjectByName("borderRing");
@@ -10577,20 +10660,22 @@ function XViewScene({
10577
10660
  borderMesh.material.color.copy(color);
10578
10661
  if (borderMesh.material.emissive) {
10579
10662
  borderMesh.material.emissive.copy(emissive);
10580
- borderMesh.material.emissiveIntensity = emissiveIntensity;
10663
+ borderMesh.material.emissiveIntensity = finalIntensity;
10581
10664
  }
10582
10665
  }
10583
10666
  } else {
10584
10667
  if (mesh.material) {
10585
10668
  mesh.material.color.copy(color);
10586
10669
  mesh.material.emissive.copy(emissive);
10587
- mesh.material.emissiveIntensity = emissiveIntensity;
10670
+ mesh.material.emissiveIntensity = finalIntensity;
10588
10671
  }
10589
10672
  }
10590
10673
  const aura = mesh.getObjectByName("aura");
10591
- if ((_a2 = aura == null ? void 0 : aura.material) == null ? void 0 : _a2.color) aura.material.color.set(newColor);
10674
+ if ((_a2 = aura == null ? void 0 : aura.material) == null ? void 0 : _a2.color) {
10675
+ aura.material.color.copy(color).lerp(new THREE3.Color("#ffffff"), 0.25);
10676
+ }
10592
10677
  mesh.userData.color = newColor;
10593
- mesh.userData._baseEmissiveIntensity = emissiveIntensity;
10678
+ mesh.userData._baseEmissiveIntensity = finalIntensity;
10594
10679
  };
10595
10680
  const handleDetailNodeSizeChange = (nodeId, newSize) => {
10596
10681
  const mesh = stateRef.current.nodeObjects[String(nodeId)];
@@ -12043,6 +12128,18 @@ function XViewScene({
12043
12128
  tweenToTarget(nodeMesh, 1.2);
12044
12129
  }
12045
12130
  }, [tweenToTarget]);
12131
+ const availableDatasets = useMemo12(() => {
12132
+ if (!sceneDataRef.current || !parentDataRef.current) return [];
12133
+ return sceneDataRef.current.parent_dbs.map((db) => {
12134
+ var _a2;
12135
+ return {
12136
+ id: db.db_id,
12137
+ name: ((_a2 = parentDataRef.current[db.db_id]) == null ? void 0 : _a2.dataset_name) || `Dataset #${db.db_id.substring(0, 6)}`
12138
+ };
12139
+ });
12140
+ }, [sceneVersion, isInitialized]);
12141
+ const sourceNodeDatasetId = creationMode.sourceNodeData ? (_b = stateRef.current.nodeIdToParentFileMap.get(String(creationMode.sourceNodeData.id))) == null ? void 0 : _b.parentFileId : null;
12142
+ const detailsNodeDatasetInfo = detailsNode ? stateRef.current.nodeIdToParentFileMap.get(String(detailsNode.id)) : null;
12046
12143
  useEffect21(() => {
12047
12144
  if (isInitialized && focusNodeId && !hasFocusedInitial) {
12048
12145
  const nodeObjects = stateRef.current.nodeObjects || {};
@@ -12132,10 +12229,13 @@ function XViewScene({
12132
12229
  style: { position: "absolute", left: `${formPosition.left}px`, top: `${formPosition.top}px`, opacity: formPosition.opacity, zIndex: 20, transition: "opacity 200ms ease-out" },
12133
12230
  refEl: formRef,
12134
12231
  existingTypes: existingNodeTypes,
12135
- initialColor: (_b = creationMode.sourceNodeData) == null ? void 0 : _b.color,
12136
- sourceTypes: (_c = creationMode.sourceNodeData) == null ? void 0 : _c.type,
12232
+ initialColor: (_c = creationMode.sourceNodeData) == null ? void 0 : _c.color,
12233
+ sourceTypes: (_d = creationMode.sourceNodeData) == null ? void 0 : _d.type,
12137
12234
  onIntensityChange: handleGhostNodeIntensityChange,
12138
- onUploadFile: upload_file_action
12235
+ onUploadFile: upload_file_action,
12236
+ availableDatasets,
12237
+ sourceNodeDatasetId,
12238
+ viewType: viewParams == null ? void 0 : viewParams.type
12139
12239
  }
12140
12240
  ),
12141
12241
  versionMode.isActive && /* @__PURE__ */ React23.createElement(
@@ -12150,8 +12250,8 @@ function XViewScene({
12150
12250
  onMentionClick: handleAddExistingNode,
12151
12251
  style: { position: "absolute", left: `${formPosition.left}px`, top: `${formPosition.top}px`, opacity: formPosition.opacity, zIndex: 20, transition: "opacity 200ms ease-out" },
12152
12252
  refEl: formRef,
12153
- fixedType: (_d = versionMode.sourceNodeData) == null ? void 0 : _d.type,
12154
- fixedColor: (_e = versionMode.sourceNodeData) == null ? void 0 : _e.color,
12253
+ fixedType: (_e = versionMode.sourceNodeData) == null ? void 0 : _e.type,
12254
+ fixedColor: (_f = versionMode.sourceNodeData) == null ? void 0 : _f.color,
12155
12255
  onUploadFile: upload_file_action
12156
12256
  }
12157
12257
  ),
@@ -12260,7 +12360,8 @@ function XViewScene({
12260
12360
  onMentionClick: handleAddExistingNode,
12261
12361
  onIntensityChange: handleDetailNodeIntensityChange,
12262
12362
  onUploadFile: upload_file_action,
12263
- userRole: userPermissionRole
12363
+ userRole: userPermissionRole,
12364
+ currentDatasetName: detailsNodeDatasetInfo == null ? void 0 : detailsNodeDatasetInfo.datasetName
12264
12365
  }
12265
12366
  ),
12266
12367
  detailsLink && /* @__PURE__ */ React23.createElement(
@@ -12388,7 +12489,7 @@ function XViewScene({
12388
12489
  onClose: () => setIsImportModalOpen(false),
12389
12490
  onConfirm: handleConfirmImport,
12390
12491
  session,
12391
- parentDbs: ((_f = sceneDataRef.current) == null ? void 0 : _f.parent_dbs) || [],
12492
+ parentDbs: ((_g = sceneDataRef.current) == null ? void 0 : _g.parent_dbs) || [],
12392
12493
  onFetchAvailableFiles: import_parent_file_modal_get,
12393
12494
  currentViewName: viewParams == null ? void 0 : viewParams.name,
12394
12495
  currentAncestries: ancestryDataRef.current || []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.2.1",
3
+ "version": "1.2.2-dev.10",
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",