@lv-x-software-house/x_view 1.2.4-dev.22 → 1.2.4-dev.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +607 -281
- package/dist/index.mjs +547 -221
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -43,9 +43,9 @@ __export(index_exports, {
|
|
|
43
43
|
module.exports = __toCommonJS(index_exports);
|
|
44
44
|
|
|
45
45
|
// src/XViewScene.jsx
|
|
46
|
-
var
|
|
46
|
+
var import_react26 = __toESM(require("react"));
|
|
47
47
|
var import_navigation = require("next/navigation");
|
|
48
|
-
var
|
|
48
|
+
var import_react27 = require("next-auth/react");
|
|
49
49
|
var import_crypto_js = __toESM(require("crypto-js"));
|
|
50
50
|
var THREE3 = __toESM(require("three"));
|
|
51
51
|
var import_OrbitControls = require("three/examples/jsm/controls/OrbitControls.js");
|
|
@@ -8654,8 +8654,313 @@ function NodeDetailsPanel({
|
|
|
8654
8654
|
));
|
|
8655
8655
|
}
|
|
8656
8656
|
|
|
8657
|
-
// src/components/
|
|
8657
|
+
// src/components/QuestDetailsPanel.jsx
|
|
8658
8658
|
var import_react18 = __toESM(require("react"));
|
|
8659
|
+
var import_fi16 = require("react-icons/fi");
|
|
8660
|
+
var QUEST_STATUS_COLORS2 = {
|
|
8661
|
+
"Backlog": "#64748b",
|
|
8662
|
+
"In Progress": "#eab308",
|
|
8663
|
+
"Review": "#a855f7",
|
|
8664
|
+
"Done": "#22c55e"
|
|
8665
|
+
};
|
|
8666
|
+
function QuestDetailsPanel({
|
|
8667
|
+
node,
|
|
8668
|
+
onClose,
|
|
8669
|
+
onSave,
|
|
8670
|
+
onNameChange,
|
|
8671
|
+
onColorChange,
|
|
8672
|
+
onSizeChange,
|
|
8673
|
+
onDataUpdate,
|
|
8674
|
+
onOpenImageViewer,
|
|
8675
|
+
existingTypes = [],
|
|
8676
|
+
availableNodes = [],
|
|
8677
|
+
availableAncestries = [],
|
|
8678
|
+
onOpenReference,
|
|
8679
|
+
onMentionClick,
|
|
8680
|
+
onUploadFile,
|
|
8681
|
+
userRole,
|
|
8682
|
+
currentDatasetName
|
|
8683
|
+
}) {
|
|
8684
|
+
const [name, setName] = (0, import_react18.useState)((node == null ? void 0 : node.name) ?? "");
|
|
8685
|
+
const [types, setTypes] = (0, import_react18.useState)((node == null ? void 0 : node.type) ? Array.isArray(node.type) ? node.type : [node.type] : ["quest"]);
|
|
8686
|
+
const [typeInput, setTypeInput] = (0, import_react18.useState)("");
|
|
8687
|
+
const [status, setStatus] = (0, import_react18.useState)((node == null ? void 0 : node.status) ?? "Backlog");
|
|
8688
|
+
const [size, setSize] = (0, import_react18.useState)((node == null ? void 0 : node.size) ?? "medium");
|
|
8689
|
+
const [description, setDescription] = (0, import_react18.useState)((node == null ? void 0 : node.description) ?? "");
|
|
8690
|
+
const [intensity, setIntensity] = (0, import_react18.useState)((node == null ? void 0 : node.intensity) !== void 0 ? node.intensity : 0);
|
|
8691
|
+
const [isStatusDropdownOpen, setIsStatusDropdownOpen] = (0, import_react18.useState)(false);
|
|
8692
|
+
const [customProps, setCustomProps] = (0, import_react18.useState)(() => extractCustomPropsFromNode(node || {}));
|
|
8693
|
+
const [showTypeSuggestions, setShowTypeSuggestions] = (0, import_react18.useState)(false);
|
|
8694
|
+
const [filteredTypes, setFilteredTypes] = (0, import_react18.useState)([]);
|
|
8695
|
+
const [isDescriptionModalOpen, setIsDescriptionModalOpen] = (0, import_react18.useState)(false);
|
|
8696
|
+
const [isReadMode, setIsReadMode] = (0, import_react18.useState)(false);
|
|
8697
|
+
const [existingSections, setExistingSections] = (0, import_react18.useState)((node == null ? void 0 : node.description_sections) || []);
|
|
8698
|
+
const [isSaving, setIsSaving] = (0, import_react18.useState)(false);
|
|
8699
|
+
const [isLinkCopied, setIsLinkCopied] = (0, import_react18.useState)(false);
|
|
8700
|
+
const maxPanelW = typeof window !== "undefined" ? window.innerWidth * 0.92 : 1200;
|
|
8701
|
+
const { width: panelWidth, isResizing, handlePointerDown: handleResize, setWidth } = useResizablePanel({
|
|
8702
|
+
initialWidth: isReadMode ? 700 : 440,
|
|
8703
|
+
minWidth: 320,
|
|
8704
|
+
maxWidth: maxPanelW
|
|
8705
|
+
});
|
|
8706
|
+
(0, import_react18.useEffect)(() => {
|
|
8707
|
+
setWidth(isReadMode ? 700 : 440);
|
|
8708
|
+
}, [isReadMode, setWidth]);
|
|
8709
|
+
const prevNodeIdRef = (0, import_react18.useRef)(null);
|
|
8710
|
+
const propsEndRef = (0, import_react18.useRef)(null);
|
|
8711
|
+
const canEdit = userRole !== "viewer";
|
|
8712
|
+
const availableImages = customProps.filter((p) => p.type === "images").flatMap((p) => Array.isArray(p.value) ? p.value : []).filter((img) => img.value && img.value.trim() !== "");
|
|
8713
|
+
const handleImageClickFromText = (url, name2) => {
|
|
8714
|
+
if (onOpenImageViewer) {
|
|
8715
|
+
onOpenImageViewer([{ name: name2 || "Imagem", value: url }], 0);
|
|
8716
|
+
}
|
|
8717
|
+
};
|
|
8718
|
+
(0, import_react18.useEffect)(() => {
|
|
8719
|
+
if ((node == null ? void 0 : node.id) !== prevNodeIdRef.current) {
|
|
8720
|
+
prevNodeIdRef.current = node == null ? void 0 : node.id;
|
|
8721
|
+
setName((node == null ? void 0 : node.name) ?? "");
|
|
8722
|
+
setTypes((node == null ? void 0 : node.type) ? Array.isArray(node.type) ? node.type : [node.type] : ["quest"]);
|
|
8723
|
+
setStatus((node == null ? void 0 : node.status) ?? "Backlog");
|
|
8724
|
+
setSize((node == null ? void 0 : node.size) ?? "medium");
|
|
8725
|
+
setDescription((node == null ? void 0 : node.description) ?? "");
|
|
8726
|
+
setIntensity((node == null ? void 0 : node.intensity) !== void 0 ? node.intensity : 0);
|
|
8727
|
+
setExistingSections((node == null ? void 0 : node.description_sections) || []);
|
|
8728
|
+
setCustomProps(extractCustomPropsFromNode(node || {}));
|
|
8729
|
+
}
|
|
8730
|
+
}, [node]);
|
|
8731
|
+
(0, import_react18.useEffect)(() => {
|
|
8732
|
+
if (typeInput.trim() === "") {
|
|
8733
|
+
setFilteredTypes(existingTypes.filter((t) => !types.includes(t)));
|
|
8734
|
+
} else {
|
|
8735
|
+
const lowercasedInput = typeInput.toLowerCase();
|
|
8736
|
+
setFilteredTypes(
|
|
8737
|
+
existingTypes.filter(
|
|
8738
|
+
(t) => t.toLowerCase().includes(lowercasedInput) && !types.includes(t)
|
|
8739
|
+
)
|
|
8740
|
+
);
|
|
8741
|
+
}
|
|
8742
|
+
}, [typeInput, existingTypes, types]);
|
|
8743
|
+
const handleCopyLink = () => {
|
|
8744
|
+
if (!(node == null ? void 0 : node.id)) return;
|
|
8745
|
+
const baseUrl = window.location.origin + window.location.pathname;
|
|
8746
|
+
const fullUrl = `${baseUrl}?focus=${node.id}`;
|
|
8747
|
+
navigator.clipboard.writeText(fullUrl).then(() => {
|
|
8748
|
+
setIsLinkCopied(true);
|
|
8749
|
+
setTimeout(() => setIsLinkCopied(false), 2e3);
|
|
8750
|
+
}).catch((err) => {
|
|
8751
|
+
console.error("Erro ao copiar link:", err);
|
|
8752
|
+
});
|
|
8753
|
+
};
|
|
8754
|
+
const swallow = (e) => e.stopPropagation();
|
|
8755
|
+
const handleNameChange = (e) => {
|
|
8756
|
+
const v = e.target.value;
|
|
8757
|
+
setName(v);
|
|
8758
|
+
onNameChange == null ? void 0 : onNameChange(node.id, v);
|
|
8759
|
+
};
|
|
8760
|
+
const handleSizeChange = (newSize) => {
|
|
8761
|
+
setSize(newSize);
|
|
8762
|
+
onSizeChange == null ? void 0 : onSizeChange(node.id, newSize);
|
|
8763
|
+
};
|
|
8764
|
+
const handleStatusChange = (newStatus) => {
|
|
8765
|
+
setStatus(newStatus);
|
|
8766
|
+
const newColor = QUEST_STATUS_COLORS2[newStatus];
|
|
8767
|
+
onColorChange == null ? void 0 : onColorChange(node.id, newColor);
|
|
8768
|
+
onDataUpdate == null ? void 0 : onDataUpdate({ ...node, status: newStatus, color: newColor });
|
|
8769
|
+
};
|
|
8770
|
+
const handleAddType = (newType) => {
|
|
8771
|
+
const trimmed = newType.trim();
|
|
8772
|
+
if (trimmed && !types.includes(trimmed)) {
|
|
8773
|
+
setTypes([...types, trimmed]);
|
|
8774
|
+
setTypeInput("");
|
|
8775
|
+
setShowTypeSuggestions(false);
|
|
8776
|
+
}
|
|
8777
|
+
};
|
|
8778
|
+
const handleRemoveType = (indexToRemove) => {
|
|
8779
|
+
if (types[indexToRemove] === "quest") return;
|
|
8780
|
+
setTypes(types.filter((_, index) => index !== indexToRemove));
|
|
8781
|
+
};
|
|
8782
|
+
const handleTypeInputKeyDown = (e) => {
|
|
8783
|
+
if (e.key === "Enter") {
|
|
8784
|
+
e.preventDefault();
|
|
8785
|
+
handleAddType(typeInput);
|
|
8786
|
+
} else if (e.key === "Backspace" && typeInput === "" && types.length > 1) {
|
|
8787
|
+
handleRemoveType(types.length - 1);
|
|
8788
|
+
}
|
|
8789
|
+
};
|
|
8790
|
+
const handleAddProp = () => {
|
|
8791
|
+
const newProp = createNewCustomProperty(customProps);
|
|
8792
|
+
setCustomProps((p) => [...p, newProp]);
|
|
8793
|
+
setTimeout(() => {
|
|
8794
|
+
var _a;
|
|
8795
|
+
(_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
8796
|
+
}, 100);
|
|
8797
|
+
};
|
|
8798
|
+
const handleRemoveProp = (i) => {
|
|
8799
|
+
const newProps = customProps.filter((_, idx) => idx !== i);
|
|
8800
|
+
setCustomProps(newProps);
|
|
8801
|
+
triggerAutoSave({ customProps: newProps });
|
|
8802
|
+
};
|
|
8803
|
+
const handleUpdateProp = (index, updatedProp) => {
|
|
8804
|
+
const newProps = [...customProps];
|
|
8805
|
+
newProps[index] = updatedProp;
|
|
8806
|
+
setCustomProps(newProps);
|
|
8807
|
+
if (!updatedProp.isEditing) {
|
|
8808
|
+
triggerAutoSave({ customProps: newProps });
|
|
8809
|
+
}
|
|
8810
|
+
};
|
|
8811
|
+
const handleSaveDescriptionInline = (newDescription) => {
|
|
8812
|
+
setDescription(newDescription);
|
|
8813
|
+
onDataUpdate({ ...node, description: newDescription });
|
|
8814
|
+
triggerAutoSave({ description: newDescription });
|
|
8815
|
+
};
|
|
8816
|
+
const handleSave = async (keepOpen = false, overrides = {}) => {
|
|
8817
|
+
const currentName = overrides.name !== void 0 ? overrides.name : name;
|
|
8818
|
+
const currentTypes = overrides.types !== void 0 ? overrides.types : types;
|
|
8819
|
+
const currentDescription = overrides.description !== void 0 ? overrides.description : description;
|
|
8820
|
+
const currentCustomProps = overrides.customProps !== void 0 ? overrides.customProps : customProps;
|
|
8821
|
+
const currentExistingSections = overrides.existingSections !== void 0 ? overrides.existingSections : existingSections;
|
|
8822
|
+
const currentStatus = overrides.status !== void 0 ? overrides.status : status;
|
|
8823
|
+
if (!currentName.trim() || currentTypes.length === 0) {
|
|
8824
|
+
alert("O campo 'Nome' e pelo menos um 'Tipo' s\xE3o obrigat\xF3rios.");
|
|
8825
|
+
return;
|
|
8826
|
+
}
|
|
8827
|
+
setIsSaving(true);
|
|
8828
|
+
try {
|
|
8829
|
+
const extrasObj = toObjectFromCustomProps(currentCustomProps.filter((p) => !p.isEditing));
|
|
8830
|
+
const processedSections = processDescriptionForSave(currentDescription, currentExistingSections);
|
|
8831
|
+
const dataToSave = {
|
|
8832
|
+
id: node.id,
|
|
8833
|
+
name: currentName.trim(),
|
|
8834
|
+
type: currentTypes,
|
|
8835
|
+
color: QUEST_STATUS_COLORS2[currentStatus],
|
|
8836
|
+
status: currentStatus,
|
|
8837
|
+
size,
|
|
8838
|
+
description: currentDescription,
|
|
8839
|
+
description_sections: processedSections,
|
|
8840
|
+
useImageAsTexture: false,
|
|
8841
|
+
textureImageUrl: null,
|
|
8842
|
+
intensity,
|
|
8843
|
+
is_quest: true,
|
|
8844
|
+
...extrasObj,
|
|
8845
|
+
version_node: node.version_node
|
|
8846
|
+
};
|
|
8847
|
+
await onSave(dataToSave, keepOpen);
|
|
8848
|
+
onDataUpdate(dataToSave);
|
|
8849
|
+
if (!keepOpen) {
|
|
8850
|
+
onClose();
|
|
8851
|
+
}
|
|
8852
|
+
} finally {
|
|
8853
|
+
setIsSaving(false);
|
|
8854
|
+
}
|
|
8855
|
+
};
|
|
8856
|
+
const triggerAutoSave = (overrides = {}) => {
|
|
8857
|
+
handleSave(true, overrides);
|
|
8858
|
+
};
|
|
8859
|
+
const handleCancel = () => {
|
|
8860
|
+
if (node) {
|
|
8861
|
+
onNameChange == null ? void 0 : onNameChange(node.id, node.name);
|
|
8862
|
+
onColorChange == null ? void 0 : onColorChange(node.id, node.color);
|
|
8863
|
+
onSizeChange == null ? void 0 : onSizeChange(node.id, node.size || "medium");
|
|
8864
|
+
}
|
|
8865
|
+
onClose();
|
|
8866
|
+
};
|
|
8867
|
+
const currentUsedTypes = customProps.map((p) => p.type).filter((t) => UNIQUE_PROP_TYPES.includes(t));
|
|
8868
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(
|
|
8869
|
+
"div",
|
|
8870
|
+
{
|
|
8871
|
+
className: `ui-overlay absolute group rounded-2xl border border-white/10 bg-slate-950/70 backdrop-blur-xl shadow-[0_20px_80px_rgba(0,0,0,0.6)] ring-1 ring-white/10 text-white overflow-hidden flex flex-col ${isResizing ? "transition-none" : "transition-all duration-300 ease-out"}`,
|
|
8872
|
+
style: { top: 16, right: 16, zIndex: 1100, maxHeight: "calc(100vh - 32px)", width: `${panelWidth}px`, maxWidth: "92vw" },
|
|
8873
|
+
onPointerDown: swallow,
|
|
8874
|
+
onPointerMove: swallow,
|
|
8875
|
+
onPointerUp: swallow,
|
|
8876
|
+
onClick: swallow,
|
|
8877
|
+
onWheel: swallow,
|
|
8878
|
+
onContextMenu: swallow,
|
|
8879
|
+
onDoubleClick: swallow
|
|
8880
|
+
},
|
|
8881
|
+
/* @__PURE__ */ import_react18.default.createElement("div", { onPointerDown: (e) => {
|
|
8882
|
+
e.stopPropagation();
|
|
8883
|
+
handleResize(e);
|
|
8884
|
+
}, className: "absolute left-0 top-0 bottom-0 w-2 cursor-col-resize hover:bg-indigo-500/50 z-[2000] transition-colors", title: "Arraste para redimensionar" }),
|
|
8885
|
+
isReadMode ? /* @__PURE__ */ import_react18.default.createElement(
|
|
8886
|
+
DescriptionReadModePanel,
|
|
8887
|
+
{
|
|
8888
|
+
title: name || (node == null ? void 0 : node.name),
|
|
8889
|
+
description,
|
|
8890
|
+
savedSections: existingSections,
|
|
8891
|
+
onBack: () => setIsReadMode(false),
|
|
8892
|
+
onEdit: () => {
|
|
8893
|
+
if (canEdit) {
|
|
8894
|
+
setIsReadMode(false);
|
|
8895
|
+
setIsDescriptionModalOpen(true);
|
|
8896
|
+
}
|
|
8897
|
+
},
|
|
8898
|
+
onClose: handleCancel,
|
|
8899
|
+
availableNodes,
|
|
8900
|
+
availableAncestries,
|
|
8901
|
+
onOpenReference,
|
|
8902
|
+
onMentionClick,
|
|
8903
|
+
onImageClick: handleImageClickFromText,
|
|
8904
|
+
onSaveDescription: handleSaveDescriptionInline
|
|
8905
|
+
}
|
|
8906
|
+
) : /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement("div", { className: "h-[2px]", style: { background: `linear-gradient(to right, transparent, ${QUEST_STATUS_COLORS2[status]}, transparent)` } }), /* @__PURE__ */ import_react18.default.createElement("div", { className: "px-6 pt-5 pb-3 flex items-start justify-between gap-4" }, /* @__PURE__ */ import_react18.default.createElement("div", null, /* @__PURE__ */ import_react18.default.createElement("div", { className: "flex items-center gap-2 mb-1" }, /* @__PURE__ */ import_react18.default.createElement(import_fi16.FiTarget, { className: "text-sky-400", size: 14 }), /* @__PURE__ */ import_react18.default.createElement("p", { className: "text-xs/relaxed text-slate-300" }, "Detalhes da Quest"), /* @__PURE__ */ import_react18.default.createElement("button", { onClick: handleCopyLink, className: `ml-1 p-1 transition-colors ${isLinkCopied ? "text-green-400" : "text-slate-400 hover:text-sky-400"}`, title: isLinkCopied ? "Link Copiado!" : "Copiar link para esta Quest" }, isLinkCopied ? /* @__PURE__ */ import_react18.default.createElement(import_fi16.FiCheck, { size: 12 }) : /* @__PURE__ */ import_react18.default.createElement(import_fi16.FiLink, { size: 12 }))), /* @__PURE__ */ import_react18.default.createElement("h2", { className: "text-xl sm:text-2xl font-semibold tracking-tight" }, name || (node == null ? void 0 : node.name))), /* @__PURE__ */ import_react18.default.createElement("button", { onClick: handleCancel, disabled: isSaving, className: "w-9 h-9 grid place-content-center rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-xl disabled:opacity-50", title: "Cancelar" }, "\xD7")), /* @__PURE__ */ import_react18.default.createElement("div", { className: "px-6 pb-28 overflow-y-auto overscroll-contain space-y-4 max-h-[68vh] custom-scrollbar" }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ import_react18.default.createElement("label", { className: "text-xs text-slate-300" }, "Status da Quest"), /* @__PURE__ */ import_react18.default.createElement("div", { className: "relative" }, /* @__PURE__ */ import_react18.default.createElement(
|
|
8907
|
+
"button",
|
|
8908
|
+
{
|
|
8909
|
+
type: "button",
|
|
8910
|
+
onClick: () => canEdit && setIsStatusDropdownOpen(!isStatusDropdownOpen),
|
|
8911
|
+
disabled: !canEdit,
|
|
8912
|
+
className: `w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 transition-colors flex items-center justify-between ${canEdit ? "hover:border-white/20 focus:ring-2 focus:ring-indigo-400/60 cursor-pointer" : "cursor-default opacity-80"}`
|
|
8913
|
+
},
|
|
8914
|
+
/* @__PURE__ */ import_react18.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react18.default.createElement("span", { className: "w-3 h-3 rounded-full shadow-[0_0_8px_rgba(0,0,0,0.5)]", style: { backgroundColor: QUEST_STATUS_COLORS2[status] } }), /* @__PURE__ */ import_react18.default.createElement("span", { className: "text-slate-200 font-medium" }, status)),
|
|
8915
|
+
canEdit && /* @__PURE__ */ import_react18.default.createElement(import_fi16.FiChevronDown, { className: `text-slate-400 transition-transform duration-200 ${isStatusDropdownOpen ? "rotate-180" : ""}` })
|
|
8916
|
+
), isStatusDropdownOpen && canEdit && /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsStatusDropdownOpen(false) }), /* @__PURE__ */ import_react18.default.createElement("ul", { className: "absolute top-full left-0 mt-1.5 w-full bg-slate-800 border border-white/10 rounded-lg shadow-[0_8px_30px_rgba(0,0,0,0.5)] z-50 overflow-hidden" }, Object.keys(QUEST_STATUS_COLORS2).map((s) => /* @__PURE__ */ import_react18.default.createElement(
|
|
8917
|
+
"li",
|
|
8918
|
+
{
|
|
8919
|
+
key: s,
|
|
8920
|
+
onClick: () => {
|
|
8921
|
+
handleStatusChange(s);
|
|
8922
|
+
setIsStatusDropdownOpen(false);
|
|
8923
|
+
},
|
|
8924
|
+
className: `px-3 py-2.5 text-sm cursor-pointer transition-colors flex items-center gap-2 ${status === s ? "bg-indigo-500/20 text-white" : "text-slate-300 hover:bg-white/5 hover:text-white"}`
|
|
8925
|
+
},
|
|
8926
|
+
/* @__PURE__ */ import_react18.default.createElement("span", { className: "w-3 h-3 rounded-full", style: { backgroundColor: QUEST_STATUS_COLORS2[s] } }),
|
|
8927
|
+
s
|
|
8928
|
+
)))))), /* @__PURE__ */ import_react18.default.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ import_react18.default.createElement("label", { className: "text-xs text-slate-300" }, "Nome"), /* @__PURE__ */ import_react18.default.createElement("input", { type: "text", value: name, onChange: handleNameChange, readOnly: !canEdit, className: `w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none ${canEdit ? "focus:ring-2 focus:ring-indigo-400/60" : "cursor-default text-slate-400"}` })), /* @__PURE__ */ import_react18.default.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ import_react18.default.createElement("label", { className: "text-xs text-slate-300" }, "Tipos Adicionais"), /* @__PURE__ */ import_react18.default.createElement("div", { className: `relative w-full bg-slate-800/70 p-1.5 min-h-[42px] flex flex-wrap gap-1.5 rounded-lg border border-white/10 ${canEdit ? "focus-within:ring-2 focus-within:ring-indigo-400/60" : ""} transition-all` }, types.map((t, index) => /* @__PURE__ */ import_react18.default.createElement("span", { key: index, className: `flex items-center gap-1 px-1.5 py-0.5 rounded-md text-xs font-medium border ${t === "quest" ? "bg-sky-500/20 text-sky-200 border-sky-500/30" : "bg-indigo-500/30 text-indigo-100 border-indigo-500/20"}` }, t, canEdit && t !== "quest" && /* @__PURE__ */ import_react18.default.createElement("button", { type: "button", onClick: () => handleRemoveType(index), className: "hover:text-white transition-colors" }, /* @__PURE__ */ import_react18.default.createElement(import_fi16.FiX, { size: 12 })))), canEdit && /* @__PURE__ */ import_react18.default.createElement("input", { type: "text", value: typeInput, onChange: (e) => {
|
|
8929
|
+
setTypeInput(e.target.value);
|
|
8930
|
+
setShowTypeSuggestions(true);
|
|
8931
|
+
}, onKeyDown: handleTypeInputKeyDown, onClick: () => setShowTypeSuggestions(true), onBlur: () => {
|
|
8932
|
+
if (typeInput.trim()) {
|
|
8933
|
+
handleAddType(typeInput);
|
|
8934
|
+
}
|
|
8935
|
+
setTimeout(() => setShowTypeSuggestions(false), 150);
|
|
8936
|
+
}, className: "flex-1 bg-transparent text-sm min-w-[80px] focus:outline-none text-slate-200", placeholder: types.length === 1 ? "Ex.: Client" : "", autoComplete: "off" }), canEdit && showTypeSuggestions && filteredTypes.length > 0 && /* @__PURE__ */ import_react18.default.createElement("ul", { className: "custom-scrollbar absolute top-full left-0 z-10 w-full mt-1 max-h-40 overflow-y-auto rounded-lg bg-slate-800 border border-white/10 shadow-lg" }, filteredTypes.map((suggestedType, index) => /* @__PURE__ */ import_react18.default.createElement("li", { key: index, className: "px-3 py-2 text-sm text-slate-200 cursor-pointer hover:bg-indigo-600/50", onMouseDown: (e) => {
|
|
8937
|
+
e.preventDefault();
|
|
8938
|
+
handleAddType(suggestedType);
|
|
8939
|
+
} }, suggestedType))))), /* @__PURE__ */ import_react18.default.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ import_react18.default.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o"), /* @__PURE__ */ import_react18.default.createElement("div", { className: "relative group min-h-[60px] bg-slate-800/40 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ import_react18.default.createElement(DescriptionDisplay, { description, savedSections: existingSections, availableNodes, availableAncestries, onOpenReference, onMentionClick, onImageClick: handleImageClickFromText, onSaveDescription: handleSaveDescriptionInline }), /* @__PURE__ */ import_react18.default.createElement("div", { className: "absolute top-0 right-0 flex bg-slate-900/50 rounded-bl-lg backdrop-blur-sm opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity overflow-hidden border-b border-l border-white/5" }, /* @__PURE__ */ import_react18.default.createElement("button", { type: "button", onClick: () => setIsReadMode(true), className: `p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors ${canEdit ? "border-r border-white/5" : ""}`, title: "Modo de Leitura" }, /* @__PURE__ */ import_react18.default.createElement(import_fi16.FiBookOpen, { size: 14 })), canEdit && /* @__PURE__ */ import_react18.default.createElement("button", { type: "button", onClick: () => setIsDescriptionModalOpen(true), className: "p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors", title: "Editar descri\xE7\xE3o (Modo de Escrita)" }, /* @__PURE__ */ import_react18.default.createElement(import_fi16.FiEdit2, { size: 14 }))), canEdit && !description && /* @__PURE__ */ import_react18.default.createElement("div", { onClick: () => setIsDescriptionModalOpen(true), className: "absolute inset-0 flex items-center justify-center text-xs text-slate-500 cursor-text" }, "Adicionar descri\xE7\xE3o..."))), /* @__PURE__ */ import_react18.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ import_react18.default.createElement("label", { className: "text-xs text-slate-300" }, "Tamanho no Node (Size)"), /* @__PURE__ */ import_react18.default.createElement("div", { className: "flex items-center gap-5" }, ["small", "medium", "large"].map((s) => {
|
|
8940
|
+
const isSelected = size === s;
|
|
8941
|
+
return /* @__PURE__ */ import_react18.default.createElement("button", { key: s, type: "button", onClick: () => canEdit && handleSizeChange(s), className: `flex items-center gap-2 group focus:outline-none ${canEdit ? "cursor-pointer" : "cursor-default opacity-80"}` }, /* @__PURE__ */ import_react18.default.createElement("div", { className: `w-4 h-4 rounded-[4px] border flex items-center justify-center transition-all duration-200 ${isSelected ? "bg-indigo-500 border-indigo-500 shadow-[0_0_10px_rgba(99,102,241,0.4)]" : "border-slate-600 bg-transparent " + (canEdit ? "group-hover:border-slate-500" : "")}` }, isSelected && /* @__PURE__ */ import_react18.default.createElement(import_fi16.FiCheck, { size: 12, className: "text-white" })), /* @__PURE__ */ import_react18.default.createElement("span", { className: `text-sm capitalize transition-colors ${isSelected ? "text-white font-medium" : "text-slate-400 " + (canEdit ? "group-hover:text-slate-300" : "")}` }, s));
|
|
8942
|
+
}))), /* @__PURE__ */ import_react18.default.createElement("div", { className: "pt-2" }, /* @__PURE__ */ import_react18.default.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ import_react18.default.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais"), canEdit && /* @__PURE__ */ import_react18.default.createElement("button", { type: "button", onClick: handleAddProp, className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors" }, /* @__PURE__ */ import_react18.default.createElement(import_fi16.FiPlus, { size: 14 }), " Adicionar")), /* @__PURE__ */ import_react18.default.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, idx) => /* @__PURE__ */ import_react18.default.createElement(CustomPropertyDisplay, { key: prop.id, prop, onUpdate: canEdit ? (updatedProp) => handleUpdateProp(idx, updatedProp) : void 0, onRemove: canEdit ? () => handleRemoveProp(idx) : void 0, onOpenImageViewer, unavailableTypes: currentUsedTypes.filter((t) => t !== prop.type), isTextureMode: false, onUploadFile: canEdit ? onUploadFile : void 0, readOnly: !canEdit })), /* @__PURE__ */ import_react18.default.createElement("div", { ref: propsEndRef }))), currentDatasetName && /* @__PURE__ */ import_react18.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_react18.default.createElement("span", { className: "truncate text-right" }, /* @__PURE__ */ import_react18.default.createElement("span", { className: "text-slate-200 font-medium" }, currentDatasetName)))), /* @__PURE__ */ import_react18.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_react18.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_react18.default.createElement("button", { onClick: () => handleSave(false), disabled: isSaving, className: `px-4 py-2 rounded-lg transition-all font-semibold text-sm shadow-[0_8px_24px_rgba(99,102,241,0.35)] flex items-center gap-2 ${isSaving ? "bg-slate-700 text-slate-300 cursor-wait" : "bg-gradient-to-tr from-indigo-600 to-indigo-400 hover:from-indigo-500 hover:to-indigo-300 text-white"}` }, isSaving && /* @__PURE__ */ import_react18.default.createElement(import_fi16.FiLoader, { className: "animate-spin" }), isSaving ? "Salvando..." : "Salvar Quest")))
|
|
8943
|
+
), isDescriptionModalOpen && canEdit && /* @__PURE__ */ import_react18.default.createElement(
|
|
8944
|
+
DescriptionEditModal,
|
|
8945
|
+
{
|
|
8946
|
+
isOpen: isDescriptionModalOpen,
|
|
8947
|
+
title: "Editar Descri\xE7\xE3o da Quest",
|
|
8948
|
+
initialValue: description,
|
|
8949
|
+
onSave: (newDescription) => {
|
|
8950
|
+
setDescription(newDescription);
|
|
8951
|
+
onDataUpdate((prev) => ({ ...prev, description: newDescription }));
|
|
8952
|
+
triggerAutoSave({ description: newDescription });
|
|
8953
|
+
},
|
|
8954
|
+
onClose: () => setIsDescriptionModalOpen(false),
|
|
8955
|
+
availableNodes,
|
|
8956
|
+
availableAncestries,
|
|
8957
|
+
availableImages
|
|
8958
|
+
}
|
|
8959
|
+
));
|
|
8960
|
+
}
|
|
8961
|
+
|
|
8962
|
+
// src/components/MultiNodeContextMenu.jsx
|
|
8963
|
+
var import_react19 = __toESM(require("react"));
|
|
8659
8964
|
function MultiNodeContextMenu({
|
|
8660
8965
|
data,
|
|
8661
8966
|
userRole,
|
|
@@ -8664,12 +8969,12 @@ function MultiNodeContextMenu({
|
|
|
8664
8969
|
onDismissOtherNodes,
|
|
8665
8970
|
onDeleteNodes
|
|
8666
8971
|
}) {
|
|
8667
|
-
const menuRef = (0,
|
|
8668
|
-
const [menuPos, setMenuPos] = (0,
|
|
8669
|
-
const [isConfirmingDelete, setIsConfirmingDelete] = (0,
|
|
8972
|
+
const menuRef = (0, import_react19.useRef)(null);
|
|
8973
|
+
const [menuPos, setMenuPos] = (0, import_react19.useState)({ left: 0, top: 0 });
|
|
8974
|
+
const [isConfirmingDelete, setIsConfirmingDelete] = (0, import_react19.useState)(false);
|
|
8670
8975
|
const ability = defineAbilityFor(userRole);
|
|
8671
8976
|
const canDelete = ability.can("delete", "Node");
|
|
8672
|
-
(0,
|
|
8977
|
+
(0, import_react19.useLayoutEffect)(() => {
|
|
8673
8978
|
if (!data.visible || !menuRef.current) return;
|
|
8674
8979
|
const el = menuRef.current;
|
|
8675
8980
|
const w = el.clientWidth;
|
|
@@ -8682,7 +8987,7 @@ function MultiNodeContextMenu({
|
|
|
8682
8987
|
if (top + h + 8 > vh) top = Math.max(8, vh - h - 8);
|
|
8683
8988
|
setMenuPos({ left, top });
|
|
8684
8989
|
}, [data]);
|
|
8685
|
-
(0,
|
|
8990
|
+
(0, import_react19.useEffect)(() => {
|
|
8686
8991
|
if (data.visible) {
|
|
8687
8992
|
setIsConfirmingDelete(false);
|
|
8688
8993
|
}
|
|
@@ -8697,7 +9002,7 @@ function MultiNodeContextMenu({
|
|
|
8697
9002
|
const baseButtonClass = "w-full flex items-center gap-2.5 px-2 py-1.5 text-left text-sm rounded-md hover:bg-indigo-500/20 text-slate-200 hover:text-white transition-colors duration-150 truncate";
|
|
8698
9003
|
const deleteButtonClass = "w-full flex items-center gap-2.5 px-2 py-1.5 text-left text-sm rounded-md hover:bg-red-500/25 text-red-400 hover:text-red-300 transition-colors duration-150 truncate";
|
|
8699
9004
|
const nodeCount = data.nodeIds.size;
|
|
8700
|
-
return /* @__PURE__ */
|
|
9005
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
8701
9006
|
"div",
|
|
8702
9007
|
{
|
|
8703
9008
|
ref: menuRef,
|
|
@@ -8711,28 +9016,28 @@ function MultiNodeContextMenu({
|
|
|
8711
9016
|
onContextMenu: swallow,
|
|
8712
9017
|
onDoubleClick: swallow
|
|
8713
9018
|
},
|
|
8714
|
-
/* @__PURE__ */
|
|
8715
|
-
/* @__PURE__ */
|
|
9019
|
+
/* @__PURE__ */ import_react19.default.createElement("div", { className: "h-[2px] bg-gradient-to-r from-indigo-400/0 via-indigo-400/70 to-indigo-400/0" }),
|
|
9020
|
+
/* @__PURE__ */ import_react19.default.createElement("div", { className: "p-1.5" }, isConfirmingDelete ? /* @__PURE__ */ import_react19.default.createElement("div", { className: "flex flex-col gap-3 p-2" }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "flex flex-col items-center text-center gap-2" }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "w-10 h-10 rounded-full bg-red-500/20 flex items-center justify-center text-red-400 mb-1" }, /* @__PURE__ */ import_react19.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react19.default.createElement("polyline", { points: "3 6 5 6 21 6" }), /* @__PURE__ */ import_react19.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_react19.default.createElement("p", { className: "text-sm text-slate-200" }, "Excluir ", /* @__PURE__ */ import_react19.default.createElement("strong", null, nodeCount, " Nodes"), "?"), /* @__PURE__ */ import_react19.default.createElement("p", { className: "text-[11px] text-slate-400 leading-tight" }, "Esta a\xE7\xE3o \xE9 irrevers\xEDvel. Todas as conex\xF5es associadas a eles ser\xE3o apagadas.")), /* @__PURE__ */ import_react19.default.createElement("div", { className: "flex gap-2 mt-1" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
8716
9021
|
"button",
|
|
8717
9022
|
{
|
|
8718
9023
|
onClick: () => setIsConfirmingDelete(false),
|
|
8719
9024
|
className: "flex-1 px-2 py-2 text-xs font-medium bg-white/10 hover:bg-white/20 rounded-md text-white transition-colors"
|
|
8720
9025
|
},
|
|
8721
9026
|
"Cancelar"
|
|
8722
|
-
), /* @__PURE__ */
|
|
9027
|
+
), /* @__PURE__ */ import_react19.default.createElement(
|
|
8723
9028
|
"button",
|
|
8724
9029
|
{
|
|
8725
9030
|
onClick: () => onDeleteNodes(data.nodeIds),
|
|
8726
9031
|
className: "flex-1 px-2 py-2 text-xs font-medium bg-red-500 hover:bg-red-600 rounded-md text-white transition-colors"
|
|
8727
9032
|
},
|
|
8728
9033
|
"Excluir"
|
|
8729
|
-
))) : /* @__PURE__ */
|
|
9034
|
+
))) : /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement("div", { className: "flex items-center gap-2 px-2 pt-1 pb-2" }, /* @__PURE__ */ import_react19.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_react19.default.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "A\xE7\xF5es em Grupo (", nodeCount, " Nodes)")), /* @__PURE__ */ import_react19.default.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ import_react19.default.createElement("button", { onClick: () => onDismissNodes(data.nodeIds), className: baseButtonClass, title: "Remover da visualiza\xE7\xE3o" }, /* @__PURE__ */ import_react19.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_react19.default.createElement("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }), /* @__PURE__ */ import_react19.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_react19.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_react19.default.createElement("line", { x1: "2", y1: "2", x2: "22", y2: "22" })), /* @__PURE__ */ import_react19.default.createElement("span", null, "Dismiss (", nodeCount, ")")), /* @__PURE__ */ import_react19.default.createElement("button", { onClick: () => onDismissOtherNodes(data.nodeIds), className: baseButtonClass, title: "Remover outros da visualiza\xE7\xE3o" }, /* @__PURE__ */ import_react19.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_react19.default.createElement("circle", { cx: "12", cy: "12", r: "3" }), /* @__PURE__ */ import_react19.default.createElement("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }), /* @__PURE__ */ import_react19.default.createElement("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ import_react19.default.createElement("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }), /* @__PURE__ */ import_react19.default.createElement("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })), /* @__PURE__ */ import_react19.default.createElement("span", null, "Dismiss other nodes")), canDelete && /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ import_react19.default.createElement("button", { onClick: () => setIsConfirmingDelete(true), className: deleteButtonClass, title: "Excluir Nodes" }, /* @__PURE__ */ import_react19.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_react19.default.createElement("polyline", { points: "3 6 5 6 21 6" }), /* @__PURE__ */ import_react19.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_react19.default.createElement("line", { x1: "10", y1: "11", x2: "10", y2: "17" }), /* @__PURE__ */ import_react19.default.createElement("line", { x1: "14", y1: "11", x2: "14", y2: "17" })), /* @__PURE__ */ import_react19.default.createElement("span", null, "Excluir Nodes (", nodeCount, ")"))))))
|
|
8730
9035
|
);
|
|
8731
9036
|
}
|
|
8732
9037
|
|
|
8733
9038
|
// src/components/RelationshipDetailsPanel.jsx
|
|
8734
|
-
var
|
|
8735
|
-
var
|
|
9039
|
+
var import_react20 = __toESM(require("react"));
|
|
9040
|
+
var import_fi17 = require("react-icons/fi");
|
|
8736
9041
|
function RelationshipDetailsPanel({
|
|
8737
9042
|
link,
|
|
8738
9043
|
onClose,
|
|
@@ -8746,19 +9051,19 @@ function RelationshipDetailsPanel({
|
|
|
8746
9051
|
onUploadFile,
|
|
8747
9052
|
userRole
|
|
8748
9053
|
}) {
|
|
8749
|
-
const [name, setName] = (0,
|
|
8750
|
-
const [description, setDescription] = (0,
|
|
8751
|
-
const [customProps, setCustomProps] = (0,
|
|
8752
|
-
const [existingSections, setExistingSections] = (0,
|
|
8753
|
-
const [isDescriptionModalOpen, setIsDescriptionModalOpen] = (0,
|
|
8754
|
-
const [isSaving, setIsSaving] = (0,
|
|
8755
|
-
const [isReadMode, setIsReadMode] = (0,
|
|
8756
|
-
const propsEndRef = (0,
|
|
8757
|
-
const canEdit = (0,
|
|
9054
|
+
const [name, setName] = (0, import_react20.useState)((link == null ? void 0 : link.name) ?? "");
|
|
9055
|
+
const [description, setDescription] = (0, import_react20.useState)((link == null ? void 0 : link.description) ?? "");
|
|
9056
|
+
const [customProps, setCustomProps] = (0, import_react20.useState)(() => extractCustomPropsFromNode(link || {}));
|
|
9057
|
+
const [existingSections, setExistingSections] = (0, import_react20.useState)((link == null ? void 0 : link.description_sections) || []);
|
|
9058
|
+
const [isDescriptionModalOpen, setIsDescriptionModalOpen] = (0, import_react20.useState)(false);
|
|
9059
|
+
const [isSaving, setIsSaving] = (0, import_react20.useState)(false);
|
|
9060
|
+
const [isReadMode, setIsReadMode] = (0, import_react20.useState)(false);
|
|
9061
|
+
const propsEndRef = (0, import_react20.useRef)(null);
|
|
9062
|
+
const canEdit = (0, import_react20.useMemo)(() => {
|
|
8758
9063
|
const ability = defineAbilityFor(userRole);
|
|
8759
9064
|
return ability.can("update", "Connection");
|
|
8760
9065
|
}, [userRole]);
|
|
8761
|
-
(0,
|
|
9066
|
+
(0, import_react20.useEffect)(() => {
|
|
8762
9067
|
setName((link == null ? void 0 : link.name) ?? "");
|
|
8763
9068
|
setDescription((link == null ? void 0 : link.description) ?? "");
|
|
8764
9069
|
setExistingSections((link == null ? void 0 : link.description_sections) || []);
|
|
@@ -8833,7 +9138,7 @@ function RelationshipDetailsPanel({
|
|
|
8833
9138
|
onOpenImageViewer([{ name: name2 || "Imagem", value: url }], 0);
|
|
8834
9139
|
}
|
|
8835
9140
|
};
|
|
8836
|
-
return /* @__PURE__ */
|
|
9141
|
+
return /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, /* @__PURE__ */ import_react20.default.createElement(
|
|
8837
9142
|
"div",
|
|
8838
9143
|
{
|
|
8839
9144
|
className: `ui-overlay absolute group rounded-2xl border border-white/10 bg-slate-950/70 backdrop-blur-xl shadow-[0_20px_80px_rgba(0,0,0,0.6)] ring-1 ring-white/10 text-white overflow-hidden transition-all duration-300 ease-out
|
|
@@ -8848,7 +9153,7 @@ function RelationshipDetailsPanel({
|
|
|
8848
9153
|
onContextMenu: swallow,
|
|
8849
9154
|
onDoubleClick: swallow
|
|
8850
9155
|
},
|
|
8851
|
-
isReadMode ? /* @__PURE__ */
|
|
9156
|
+
isReadMode ? /* @__PURE__ */ import_react20.default.createElement(
|
|
8852
9157
|
DescriptionReadModePanel,
|
|
8853
9158
|
{
|
|
8854
9159
|
title: name || "Rela\xE7\xE3o",
|
|
@@ -8869,7 +9174,7 @@ function RelationshipDetailsPanel({
|
|
|
8869
9174
|
onImageClick: handleImageClickFromText,
|
|
8870
9175
|
onSaveDescription: handleSaveDescriptionInline
|
|
8871
9176
|
}
|
|
8872
|
-
) : /* @__PURE__ */
|
|
9177
|
+
) : /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, /* @__PURE__ */ import_react20.default.createElement("div", { className: "h-[2px] bg-gradient-to-r from-teal-400/0 via-teal-400/70 to-teal-400/0" }), /* @__PURE__ */ import_react20.default.createElement("div", { className: "px-6 pt-5 pb-3 flex items-start justify-between gap-4" }, /* @__PURE__ */ import_react20.default.createElement("div", null, /* @__PURE__ */ import_react20.default.createElement("div", { className: "flex items-center gap-2 mb-1" }, /* @__PURE__ */ import_react20.default.createElement("span", { className: "inline-flex h-2.5 w-2.5 rounded-full bg-teal-400/80 shadow-[0_0_18px_2px_rgba(45,212,191,0.55)]" }), /* @__PURE__ */ import_react20.default.createElement("p", { className: "text-xs/relaxed text-slate-300" }, "Detalhes da Rela\xE7\xE3o")), /* @__PURE__ */ import_react20.default.createElement("h2", { className: "text-xl sm:text-2xl font-semibold tracking-tight" }, name || "Rela\xE7\xE3o")), /* @__PURE__ */ import_react20.default.createElement("button", { onClick: onClose, disabled: isSaving, className: "w-9 h-9 grid place-content-center rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-xl disabled:opacity-50", title: "Fechar" }, "\xD7")), /* @__PURE__ */ import_react20.default.createElement("div", { className: "px-6 pb-28 overflow-y-auto overscroll-contain space-y-4 max-h-[68vh] custom-scrollbar" }, /* @__PURE__ */ import_react20.default.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ import_react20.default.createElement("label", { className: "text-xs text-slate-300" }, "Nome da Rela\xE7\xE3o (Opcional)"), /* @__PURE__ */ import_react20.default.createElement(
|
|
8873
9178
|
"input",
|
|
8874
9179
|
{
|
|
8875
9180
|
type: "text",
|
|
@@ -8881,7 +9186,7 @@ function RelationshipDetailsPanel({
|
|
|
8881
9186
|
${!canEdit ? "opacity-50 cursor-not-allowed" : ""}
|
|
8882
9187
|
`
|
|
8883
9188
|
}
|
|
8884
|
-
)), /* @__PURE__ */
|
|
9189
|
+
)), /* @__PURE__ */ import_react20.default.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ import_react20.default.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o"), /* @__PURE__ */ import_react20.default.createElement("div", { className: "relative group min-h-[60px] bg-slate-800/40 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ import_react20.default.createElement(
|
|
8885
9190
|
DescriptionDisplay,
|
|
8886
9191
|
{
|
|
8887
9192
|
description,
|
|
@@ -8893,7 +9198,7 @@ function RelationshipDetailsPanel({
|
|
|
8893
9198
|
onImageClick: handleImageClickFromText,
|
|
8894
9199
|
onSaveDescription: handleSaveDescriptionInline
|
|
8895
9200
|
}
|
|
8896
|
-
), /* @__PURE__ */
|
|
9201
|
+
), /* @__PURE__ */ import_react20.default.createElement("div", { className: "absolute top-0 right-0 flex bg-slate-900/50 rounded-bl-lg backdrop-blur-sm opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity overflow-hidden border-b border-l border-white/5" }, /* @__PURE__ */ import_react20.default.createElement(
|
|
8897
9202
|
"button",
|
|
8898
9203
|
{
|
|
8899
9204
|
type: "button",
|
|
@@ -8901,8 +9206,8 @@ function RelationshipDetailsPanel({
|
|
|
8901
9206
|
className: "p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors border-r border-white/5",
|
|
8902
9207
|
title: "Modo de Leitura"
|
|
8903
9208
|
},
|
|
8904
|
-
/* @__PURE__ */
|
|
8905
|
-
), canEdit && /* @__PURE__ */
|
|
9209
|
+
/* @__PURE__ */ import_react20.default.createElement(import_fi17.FiBookOpen, { size: 14 })
|
|
9210
|
+
), canEdit && /* @__PURE__ */ import_react20.default.createElement(
|
|
8906
9211
|
"button",
|
|
8907
9212
|
{
|
|
8908
9213
|
type: "button",
|
|
@@ -8910,15 +9215,15 @@ function RelationshipDetailsPanel({
|
|
|
8910
9215
|
className: "p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors",
|
|
8911
9216
|
title: "Editar descri\xE7\xE3o"
|
|
8912
9217
|
},
|
|
8913
|
-
/* @__PURE__ */
|
|
8914
|
-
)), !description && canEdit && /* @__PURE__ */
|
|
9218
|
+
/* @__PURE__ */ import_react20.default.createElement(import_fi17.FiEdit2, { size: 14 })
|
|
9219
|
+
)), !description && canEdit && /* @__PURE__ */ import_react20.default.createElement(
|
|
8915
9220
|
"div",
|
|
8916
9221
|
{
|
|
8917
9222
|
onClick: () => setIsDescriptionModalOpen(true),
|
|
8918
9223
|
className: "absolute inset-0 flex items-center justify-center text-xs text-slate-500 cursor-text"
|
|
8919
9224
|
},
|
|
8920
9225
|
"Adicionar descri\xE7\xE3o..."
|
|
8921
|
-
))), /* @__PURE__ */
|
|
9226
|
+
))), /* @__PURE__ */ import_react20.default.createElement("div", { className: "pt-2" }, /* @__PURE__ */ import_react20.default.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ import_react20.default.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais"), canEdit && /* @__PURE__ */ import_react20.default.createElement("button", { type: "button", onClick: handleAddProp, className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors" }, /* @__PURE__ */ import_react20.default.createElement(import_fi17.FiPlus, { size: 14 }), " Adicionar")), /* @__PURE__ */ import_react20.default.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, idx) => /* @__PURE__ */ import_react20.default.createElement(
|
|
8922
9227
|
CustomPropertyDisplay,
|
|
8923
9228
|
{
|
|
8924
9229
|
key: prop.id,
|
|
@@ -8930,7 +9235,7 @@ function RelationshipDetailsPanel({
|
|
|
8930
9235
|
onUploadFile,
|
|
8931
9236
|
disabled: !canEdit
|
|
8932
9237
|
}
|
|
8933
|
-
)), /* @__PURE__ */
|
|
9238
|
+
)), /* @__PURE__ */ import_react20.default.createElement("div", { ref: propsEndRef })))), /* @__PURE__ */ import_react20.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_react20.default.createElement("button", { onClick: onClose, 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_react20.default.createElement(
|
|
8934
9239
|
"button",
|
|
8935
9240
|
{
|
|
8936
9241
|
onClick: () => handleSave(false),
|
|
@@ -8939,10 +9244,10 @@ function RelationshipDetailsPanel({
|
|
|
8939
9244
|
${isSaving ? "bg-slate-700 text-slate-300 cursor-wait" : "bg-gradient-to-tr from-teal-600 to-teal-400 hover:from-teal-500 hover:to-teal-300 text-white"}
|
|
8940
9245
|
`
|
|
8941
9246
|
},
|
|
8942
|
-
isSaving && /* @__PURE__ */
|
|
9247
|
+
isSaving && /* @__PURE__ */ import_react20.default.createElement(import_fi17.FiLoader, { className: "animate-spin" }),
|
|
8943
9248
|
isSaving ? "Salvando..." : "Salvar"
|
|
8944
9249
|
)))
|
|
8945
|
-
), isDescriptionModalOpen && /* @__PURE__ */
|
|
9250
|
+
), isDescriptionModalOpen && /* @__PURE__ */ import_react20.default.createElement(
|
|
8946
9251
|
DescriptionEditModal,
|
|
8947
9252
|
{
|
|
8948
9253
|
isOpen: isDescriptionModalOpen,
|
|
@@ -8963,7 +9268,7 @@ function RelationshipDetailsPanel({
|
|
|
8963
9268
|
}
|
|
8964
9269
|
|
|
8965
9270
|
// src/components/RelationshipContextMenu.jsx
|
|
8966
|
-
var
|
|
9271
|
+
var import_react21 = __toESM(require("react"));
|
|
8967
9272
|
function RelationshipContextMenu({
|
|
8968
9273
|
data,
|
|
8969
9274
|
userRole,
|
|
@@ -8973,25 +9278,25 @@ function RelationshipContextMenu({
|
|
|
8973
9278
|
onDelete,
|
|
8974
9279
|
onClose
|
|
8975
9280
|
}) {
|
|
8976
|
-
const menuRef = (0,
|
|
8977
|
-
const [menuPos, setMenuPos] = (0,
|
|
8978
|
-
const [isConfirmingDelete, setIsConfirmingDelete] = (0,
|
|
8979
|
-
const ability = (0,
|
|
8980
|
-
const sourceName = (0,
|
|
9281
|
+
const menuRef = (0, import_react21.useRef)(null);
|
|
9282
|
+
const [menuPos, setMenuPos] = (0, import_react21.useState)({ left: 0, top: 0 });
|
|
9283
|
+
const [isConfirmingDelete, setIsConfirmingDelete] = (0, import_react21.useState)(false);
|
|
9284
|
+
const ability = (0, import_react21.useMemo)(() => defineAbilityFor(userRole), [userRole]);
|
|
9285
|
+
const sourceName = (0, import_react21.useMemo)(
|
|
8981
9286
|
() => {
|
|
8982
9287
|
var _a, _b, _c, _d;
|
|
8983
9288
|
return ((_d = (_c = (_b = (_a = data == null ? void 0 : data.linkObject) == null ? void 0 : _a.userData) == null ? void 0 : _b.sourceNode) == null ? void 0 : _c.userData) == null ? void 0 : _d.name) ?? "(sem nome)";
|
|
8984
9289
|
},
|
|
8985
9290
|
[data == null ? void 0 : data.linkObject]
|
|
8986
9291
|
);
|
|
8987
|
-
const targetName = (0,
|
|
9292
|
+
const targetName = (0, import_react21.useMemo)(
|
|
8988
9293
|
() => {
|
|
8989
9294
|
var _a, _b, _c, _d;
|
|
8990
9295
|
return ((_d = (_c = (_b = (_a = data == null ? void 0 : data.linkObject) == null ? void 0 : _a.userData) == null ? void 0 : _b.targetNode) == null ? void 0 : _c.userData) == null ? void 0 : _d.name) ?? "(sem nome)";
|
|
8991
9296
|
},
|
|
8992
9297
|
[data == null ? void 0 : data.linkObject]
|
|
8993
9298
|
);
|
|
8994
|
-
(0,
|
|
9299
|
+
(0, import_react21.useLayoutEffect)(() => {
|
|
8995
9300
|
if (!data.visible || !menuRef.current) return;
|
|
8996
9301
|
const el = menuRef.current;
|
|
8997
9302
|
const w = el.clientWidth;
|
|
@@ -9004,7 +9309,7 @@ function RelationshipContextMenu({
|
|
|
9004
9309
|
if (top + h + 8 > vh) top = Math.max(8, vh - h - 8);
|
|
9005
9310
|
setMenuPos({ left, top });
|
|
9006
9311
|
}, [data]);
|
|
9007
|
-
(0,
|
|
9312
|
+
(0, import_react21.useEffect)(() => {
|
|
9008
9313
|
if (data.visible) {
|
|
9009
9314
|
setIsConfirmingDelete(false);
|
|
9010
9315
|
}
|
|
@@ -9020,7 +9325,7 @@ function RelationshipContextMenu({
|
|
|
9020
9325
|
const dangerButtonClass = "w-full flex items-center gap-2.5 px-2 py-1.5 text-left text-sm rounded-md hover:bg-rose-500/20 text-rose-300 hover:text-rose-100 transition-colors duration-150 truncate";
|
|
9021
9326
|
const canUpdate = ability.can("update", "Connection");
|
|
9022
9327
|
const canDelete = ability.can("delete", "Connection");
|
|
9023
|
-
return /* @__PURE__ */
|
|
9328
|
+
return /* @__PURE__ */ import_react21.default.createElement(
|
|
9024
9329
|
"div",
|
|
9025
9330
|
{
|
|
9026
9331
|
ref: menuRef,
|
|
@@ -9034,29 +9339,29 @@ function RelationshipContextMenu({
|
|
|
9034
9339
|
onContextMenu: swallow,
|
|
9035
9340
|
onDoubleClick: swallow
|
|
9036
9341
|
},
|
|
9037
|
-
/* @__PURE__ */
|
|
9038
|
-
/* @__PURE__ */
|
|
9342
|
+
/* @__PURE__ */ import_react21.default.createElement("div", { className: "h-[2px] bg-gradient-to-r from-teal-400/0 via-teal-400/70 to-teal-400/0" }),
|
|
9343
|
+
/* @__PURE__ */ import_react21.default.createElement("div", { className: "p-1.5" }, isConfirmingDelete ? /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex flex-col gap-3 p-2" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex flex-col items-center text-center gap-2" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-10 h-10 rounded-full bg-rose-500/20 flex items-center justify-center text-rose-400 mb-1" }, /* @__PURE__ */ import_react21.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react21.default.createElement("polyline", { points: "3 6 5 6 21 6" }), /* @__PURE__ */ import_react21.default.createElement("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), /* @__PURE__ */ import_react21.default.createElement("path", { d: "M10 11v6" }), /* @__PURE__ */ import_react21.default.createElement("path", { d: "M14 11v6" }), /* @__PURE__ */ import_react21.default.createElement("path", { d: "M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2" }))), /* @__PURE__ */ import_react21.default.createElement("p", { className: "text-sm text-slate-200" }, "Excluir rela\xE7\xE3o?"), /* @__PURE__ */ import_react21.default.createElement("p", { className: "text-[11px] text-slate-400 leading-tight break-words" }, "Desconectar ", /* @__PURE__ */ import_react21.default.createElement("strong", null, sourceName), " de ", /* @__PURE__ */ import_react21.default.createElement("strong", null, targetName), ".")), /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex gap-2 mt-1" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
9039
9344
|
"button",
|
|
9040
9345
|
{
|
|
9041
9346
|
onClick: () => setIsConfirmingDelete(false),
|
|
9042
9347
|
className: "flex-1 px-2 py-2 text-xs font-medium bg-white/10 hover:bg-white/20 rounded-md text-white transition-colors"
|
|
9043
9348
|
},
|
|
9044
9349
|
"Cancelar"
|
|
9045
|
-
), /* @__PURE__ */
|
|
9350
|
+
), /* @__PURE__ */ import_react21.default.createElement(
|
|
9046
9351
|
"button",
|
|
9047
9352
|
{
|
|
9048
9353
|
onClick: () => onDelete == null ? void 0 : onDelete(data.linkObject),
|
|
9049
9354
|
className: "flex-1 px-2 py-2 text-xs font-medium bg-rose-600 hover:bg-rose-500 rounded-md text-white transition-colors"
|
|
9050
9355
|
},
|
|
9051
9356
|
"Excluir"
|
|
9052
|
-
))) : /* @__PURE__ */
|
|
9357
|
+
))) : /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex items-center gap-2 px-2 pt-1 pb-2" }, /* @__PURE__ */ import_react21.default.createElement("span", { className: "inline-flex h-2 w-2 rounded-full bg-teal-400/80 shadow-[0_0_12px_1px_rgba(45,212,191,0.5)]" }), /* @__PURE__ */ import_react21.default.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "Rela\xE7\xE3o")), /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex flex-col gap-1" }, canUpdate && /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, /* @__PURE__ */ import_react21.default.createElement(
|
|
9053
9358
|
"button",
|
|
9054
9359
|
{
|
|
9055
9360
|
onClick: () => onRelinkSource == null ? void 0 : onRelinkSource(data.linkObject),
|
|
9056
9361
|
className: baseButtonClass,
|
|
9057
9362
|
title: "Desconectar ponta ligada ao Source"
|
|
9058
9363
|
},
|
|
9059
|
-
/* @__PURE__ */
|
|
9364
|
+
/* @__PURE__ */ import_react21.default.createElement(
|
|
9060
9365
|
"svg",
|
|
9061
9366
|
{
|
|
9062
9367
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9069,18 +9374,18 @@ function RelationshipContextMenu({
|
|
|
9069
9374
|
strokeLinecap: "round",
|
|
9070
9375
|
strokeLinejoin: "round"
|
|
9071
9376
|
},
|
|
9072
|
-
/* @__PURE__ */
|
|
9073
|
-
/* @__PURE__ */
|
|
9377
|
+
/* @__PURE__ */ import_react21.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" }),
|
|
9378
|
+
/* @__PURE__ */ import_react21.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" })
|
|
9074
9379
|
),
|
|
9075
|
-
/* @__PURE__ */
|
|
9076
|
-
), /* @__PURE__ */
|
|
9380
|
+
/* @__PURE__ */ import_react21.default.createElement("span", null, "Desconectar Source (", sourceName, ")")
|
|
9381
|
+
), /* @__PURE__ */ import_react21.default.createElement(
|
|
9077
9382
|
"button",
|
|
9078
9383
|
{
|
|
9079
9384
|
onClick: () => onRelinkTarget == null ? void 0 : onRelinkTarget(data.linkObject),
|
|
9080
9385
|
className: baseButtonClass,
|
|
9081
9386
|
title: "Desconectar ponta ligada ao Target"
|
|
9082
9387
|
},
|
|
9083
|
-
/* @__PURE__ */
|
|
9388
|
+
/* @__PURE__ */ import_react21.default.createElement(
|
|
9084
9389
|
"svg",
|
|
9085
9390
|
{
|
|
9086
9391
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9093,21 +9398,21 @@ function RelationshipContextMenu({
|
|
|
9093
9398
|
strokeLinecap: "round",
|
|
9094
9399
|
strokeLinejoin: "round"
|
|
9095
9400
|
},
|
|
9096
|
-
/* @__PURE__ */
|
|
9097
|
-
/* @__PURE__ */
|
|
9098
|
-
/* @__PURE__ */
|
|
9099
|
-
/* @__PURE__ */
|
|
9100
|
-
/* @__PURE__ */
|
|
9401
|
+
/* @__PURE__ */ import_react21.default.createElement("polyline", { points: "16 3 21 3 21 8" }),
|
|
9402
|
+
/* @__PURE__ */ import_react21.default.createElement("line", { x1: "4", y1: "20", x2: "21", y2: "3" }),
|
|
9403
|
+
/* @__PURE__ */ import_react21.default.createElement("polyline", { points: "21 16 21 21 16 21" }),
|
|
9404
|
+
/* @__PURE__ */ import_react21.default.createElement("line", { x1: "15", y1: "15", x2: "21", y2: "21" }),
|
|
9405
|
+
/* @__PURE__ */ import_react21.default.createElement("line", { x1: "4", y1: "4", x2: "9", y2: "9" })
|
|
9101
9406
|
),
|
|
9102
|
-
/* @__PURE__ */
|
|
9103
|
-
), /* @__PURE__ */
|
|
9407
|
+
/* @__PURE__ */ import_react21.default.createElement("span", null, "Desconectar Target (", targetName, ")")
|
|
9408
|
+
), /* @__PURE__ */ import_react21.default.createElement("div", { className: "h-[1px] my-1 mx-1 bg-white/10" })), /* @__PURE__ */ import_react21.default.createElement(
|
|
9104
9409
|
"button",
|
|
9105
9410
|
{
|
|
9106
9411
|
onClick: () => onOpenDetails == null ? void 0 : onOpenDetails(data.linkObject),
|
|
9107
9412
|
className: baseButtonClass,
|
|
9108
9413
|
title: "Abrir detalhes da rela\xE7\xE3o"
|
|
9109
9414
|
},
|
|
9110
|
-
/* @__PURE__ */
|
|
9415
|
+
/* @__PURE__ */ import_react21.default.createElement(
|
|
9111
9416
|
"svg",
|
|
9112
9417
|
{
|
|
9113
9418
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9120,19 +9425,19 @@ function RelationshipContextMenu({
|
|
|
9120
9425
|
strokeLinecap: "round",
|
|
9121
9426
|
strokeLinejoin: "round"
|
|
9122
9427
|
},
|
|
9123
|
-
/* @__PURE__ */
|
|
9124
|
-
/* @__PURE__ */
|
|
9125
|
-
/* @__PURE__ */
|
|
9428
|
+
/* @__PURE__ */ import_react21.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
9429
|
+
/* @__PURE__ */ import_react21.default.createElement("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
9430
|
+
/* @__PURE__ */ import_react21.default.createElement("line", { x1: "12", y1: "8", x2: "12", y2: "8" })
|
|
9126
9431
|
),
|
|
9127
|
-
/* @__PURE__ */
|
|
9128
|
-
), canDelete && /* @__PURE__ */
|
|
9432
|
+
/* @__PURE__ */ import_react21.default.createElement("span", null, "Abrir Detalhes")
|
|
9433
|
+
), canDelete && /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, /* @__PURE__ */ import_react21.default.createElement("div", { className: "h-[1px] my-1 mx-1 bg-white/10" }), /* @__PURE__ */ import_react21.default.createElement(
|
|
9129
9434
|
"button",
|
|
9130
9435
|
{
|
|
9131
9436
|
onClick: () => setIsConfirmingDelete(true),
|
|
9132
9437
|
className: dangerButtonClass,
|
|
9133
9438
|
title: "Excluir esta conex\xE3o"
|
|
9134
9439
|
},
|
|
9135
|
-
/* @__PURE__ */
|
|
9440
|
+
/* @__PURE__ */ import_react21.default.createElement(
|
|
9136
9441
|
"svg",
|
|
9137
9442
|
{
|
|
9138
9443
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9145,19 +9450,19 @@ function RelationshipContextMenu({
|
|
|
9145
9450
|
strokeLinecap: "round",
|
|
9146
9451
|
strokeLinejoin: "round"
|
|
9147
9452
|
},
|
|
9148
|
-
/* @__PURE__ */
|
|
9149
|
-
/* @__PURE__ */
|
|
9150
|
-
/* @__PURE__ */
|
|
9151
|
-
/* @__PURE__ */
|
|
9152
|
-
/* @__PURE__ */
|
|
9453
|
+
/* @__PURE__ */ import_react21.default.createElement("polyline", { points: "3 6 5 6 21 6" }),
|
|
9454
|
+
/* @__PURE__ */ import_react21.default.createElement("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }),
|
|
9455
|
+
/* @__PURE__ */ import_react21.default.createElement("path", { d: "M10 11v6" }),
|
|
9456
|
+
/* @__PURE__ */ import_react21.default.createElement("path", { d: "M14 11v6" }),
|
|
9457
|
+
/* @__PURE__ */ import_react21.default.createElement("path", { d: "M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2" })
|
|
9153
9458
|
),
|
|
9154
|
-
/* @__PURE__ */
|
|
9459
|
+
/* @__PURE__ */ import_react21.default.createElement("span", null, "Excluir conex\xE3o (", sourceName, " \u2192 ", targetName, ")")
|
|
9155
9460
|
)))))
|
|
9156
9461
|
);
|
|
9157
9462
|
}
|
|
9158
9463
|
|
|
9159
9464
|
// src/components/LoadingScreen.jsx
|
|
9160
|
-
var
|
|
9465
|
+
var import_react22 = __toESM(require("react"));
|
|
9161
9466
|
var styles = {
|
|
9162
9467
|
loadingOverlay: {
|
|
9163
9468
|
position: "fixed",
|
|
@@ -9189,11 +9494,11 @@ var styles = {
|
|
|
9189
9494
|
`
|
|
9190
9495
|
};
|
|
9191
9496
|
function LoadingScreen() {
|
|
9192
|
-
return /* @__PURE__ */
|
|
9497
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement("style", null, styles.keyframes), /* @__PURE__ */ import_react22.default.createElement("div", { style: styles.loadingOverlay }, /* @__PURE__ */ import_react22.default.createElement("div", { style: styles.spinner })));
|
|
9193
9498
|
}
|
|
9194
9499
|
|
|
9195
9500
|
// src/components/ImportParentFileModal.jsx
|
|
9196
|
-
var
|
|
9501
|
+
var import_react23 = __toESM(require("react"));
|
|
9197
9502
|
function ImportParentFileModal({
|
|
9198
9503
|
isOpen,
|
|
9199
9504
|
onClose,
|
|
@@ -9204,12 +9509,12 @@ function ImportParentFileModal({
|
|
|
9204
9509
|
onFetchAvailableFiles,
|
|
9205
9510
|
currentViewName
|
|
9206
9511
|
}) {
|
|
9207
|
-
const [activeTab, setActiveTab] = (0,
|
|
9208
|
-
const [availableDbs, setAvailableDbs] = (0,
|
|
9209
|
-
const [availableViews, setAvailableViews] = (0,
|
|
9210
|
-
const [selectedItem, setSelectedItem] = (0,
|
|
9211
|
-
const [isLoading, setIsLoading] = (0,
|
|
9212
|
-
(0,
|
|
9512
|
+
const [activeTab, setActiveTab] = (0, import_react23.useState)("databases");
|
|
9513
|
+
const [availableDbs, setAvailableDbs] = (0, import_react23.useState)([]);
|
|
9514
|
+
const [availableViews, setAvailableViews] = (0, import_react23.useState)([]);
|
|
9515
|
+
const [selectedItem, setSelectedItem] = (0, import_react23.useState)(null);
|
|
9516
|
+
const [isLoading, setIsLoading] = (0, import_react23.useState)(false);
|
|
9517
|
+
(0, import_react23.useEffect)(() => {
|
|
9213
9518
|
if (isOpen && session && onFetchAvailableFiles) {
|
|
9214
9519
|
const fetchData = async () => {
|
|
9215
9520
|
setIsLoading(true);
|
|
@@ -9245,7 +9550,7 @@ function ImportParentFileModal({
|
|
|
9245
9550
|
fetchData();
|
|
9246
9551
|
}
|
|
9247
9552
|
}, [isOpen, session, parentDbs, onFetchAvailableFiles, currentViewName]);
|
|
9248
|
-
(0,
|
|
9553
|
+
(0, import_react23.useEffect)(() => {
|
|
9249
9554
|
setSelectedItem(null);
|
|
9250
9555
|
}, [activeTab]);
|
|
9251
9556
|
if (!isOpen) {
|
|
@@ -9274,13 +9579,13 @@ function ImportParentFileModal({
|
|
|
9274
9579
|
const swallow = (e) => e.stopPropagation();
|
|
9275
9580
|
const currentList = activeTab === "databases" ? availableDbs : availableViews;
|
|
9276
9581
|
const emptyMessage = activeTab === "databases" ? "Nenhum novo arquivo parent dispon\xEDvel." : "Nenhuma view dispon\xEDvel para importa\xE7\xE3o.";
|
|
9277
|
-
return /* @__PURE__ */
|
|
9582
|
+
return /* @__PURE__ */ import_react23.default.createElement(
|
|
9278
9583
|
"div",
|
|
9279
9584
|
{
|
|
9280
9585
|
className: "ui-overlay fixed inset-0 z-[1200] flex items-center justify-center bg-black/60 backdrop-blur-sm",
|
|
9281
9586
|
onClick: onClose
|
|
9282
9587
|
},
|
|
9283
|
-
/* @__PURE__ */
|
|
9588
|
+
/* @__PURE__ */ import_react23.default.createElement(
|
|
9284
9589
|
"div",
|
|
9285
9590
|
{
|
|
9286
9591
|
className: "ui-overlay relative rounded-2xl border border-white/10 bg-slate-950/80 shadow-[0_20px_80px_rgba(0,0,0,0.6)] text-white w-[min(92vw,500px)] flex flex-col max-h-[85vh]",
|
|
@@ -9292,14 +9597,14 @@ function ImportParentFileModal({
|
|
|
9292
9597
|
onContextMenu: swallow,
|
|
9293
9598
|
onDoubleClick: swallow
|
|
9294
9599
|
},
|
|
9295
|
-
/* @__PURE__ */
|
|
9600
|
+
/* @__PURE__ */ import_react23.default.createElement("div", { className: "flex items-center justify-between px-6 py-4 border-b border-white/10 flex-shrink-0" }, /* @__PURE__ */ import_react23.default.createElement("h2", { className: "text-lg font-semibold" }, "Importar"), /* @__PURE__ */ import_react23.default.createElement(
|
|
9296
9601
|
"button",
|
|
9297
9602
|
{
|
|
9298
9603
|
onClick: onClose,
|
|
9299
9604
|
className: "p-2 rounded-md text-slate-400 hover:text-white hover:bg-white/10 transition-colors",
|
|
9300
9605
|
title: "Fechar"
|
|
9301
9606
|
},
|
|
9302
|
-
/* @__PURE__ */
|
|
9607
|
+
/* @__PURE__ */ import_react23.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
9303
9608
|
"path",
|
|
9304
9609
|
{
|
|
9305
9610
|
fillRule: "evenodd",
|
|
@@ -9308,14 +9613,14 @@ function ImportParentFileModal({
|
|
|
9308
9613
|
}
|
|
9309
9614
|
))
|
|
9310
9615
|
)),
|
|
9311
|
-
/* @__PURE__ */
|
|
9616
|
+
/* @__PURE__ */ import_react23.default.createElement("div", { className: "flex px-6 border-b border-white/10 bg-white/5 flex-shrink-0" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
9312
9617
|
"button",
|
|
9313
9618
|
{
|
|
9314
9619
|
onClick: () => setActiveTab("databases"),
|
|
9315
9620
|
className: `flex-1 py-3 text-sm font-medium border-b-2 transition-colors ${activeTab === "databases" ? "border-indigo-500 text-white" : "border-transparent text-slate-400 hover:text-slate-200"}`
|
|
9316
9621
|
},
|
|
9317
9622
|
"Arquivos Parent"
|
|
9318
|
-
), /* @__PURE__ */
|
|
9623
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
9319
9624
|
"button",
|
|
9320
9625
|
{
|
|
9321
9626
|
onClick: () => setActiveTab("views"),
|
|
@@ -9323,24 +9628,24 @@ function ImportParentFileModal({
|
|
|
9323
9628
|
},
|
|
9324
9629
|
"Views (Ancestralidades)"
|
|
9325
9630
|
)),
|
|
9326
|
-
/* @__PURE__ */
|
|
9631
|
+
/* @__PURE__ */ import_react23.default.createElement("div", { className: "p-6 overflow-y-auto custom-scrollbar flex-grow min-h-[200px]" }, isLoading ? /* @__PURE__ */ import_react23.default.createElement("div", { className: "flex items-center justify-center h-40" }, /* @__PURE__ */ import_react23.default.createElement("div", { className: "w-8 h-8 border-4 border-t-indigo-500 border-slate-700 rounded-full animate-spin" })) : /* @__PURE__ */ import_react23.default.createElement("div", { className: "space-y-2" }, currentList.length > 0 ? currentList.map((item) => /* @__PURE__ */ import_react23.default.createElement(
|
|
9327
9632
|
"div",
|
|
9328
9633
|
{
|
|
9329
9634
|
key: item.id,
|
|
9330
9635
|
onClick: () => setSelectedItem(item),
|
|
9331
9636
|
className: `px-4 py-3 rounded-lg border cursor-pointer transition-all duration-150 flex flex-col gap-1 ${(selectedItem == null ? void 0 : selectedItem.id) === item.id ? "bg-indigo-600 border-indigo-500 shadow-lg" : "bg-slate-800/60 border-white/10 hover:border-white/20 hover:bg-slate-800"}`
|
|
9332
9637
|
},
|
|
9333
|
-
/* @__PURE__ */
|
|
9334
|
-
item.description && /* @__PURE__ */
|
|
9335
|
-
)) : /* @__PURE__ */
|
|
9336
|
-
/* @__PURE__ */
|
|
9638
|
+
/* @__PURE__ */ import_react23.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ import_react23.default.createElement("span", { className: "font-medium text-slate-100" }, item.name), activeTab === "views" && /* @__PURE__ */ import_react23.default.createElement("span", { className: "text-[10px] px-1.5 py-0.5 rounded bg-black/30 text-indigo-300 border border-indigo-500/30" }, "VIEW")),
|
|
9639
|
+
item.description && /* @__PURE__ */ import_react23.default.createElement("p", { className: `text-xs ${(selectedItem == null ? void 0 : selectedItem.id) === item.id ? "text-indigo-200" : "text-slate-400"}` }, item.description)
|
|
9640
|
+
)) : /* @__PURE__ */ import_react23.default.createElement("p", { className: "text-slate-400 text-center py-10" }, emptyMessage))),
|
|
9641
|
+
/* @__PURE__ */ import_react23.default.createElement("div", { className: "px-6 py-4 border-t border-white/10 flex justify-end gap-3 flex-shrink-0 bg-slate-900/50" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
9337
9642
|
"button",
|
|
9338
9643
|
{
|
|
9339
9644
|
onClick: onClose,
|
|
9340
9645
|
className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm text-slate-300"
|
|
9341
9646
|
},
|
|
9342
9647
|
"Cancelar"
|
|
9343
|
-
), /* @__PURE__ */
|
|
9648
|
+
), /* @__PURE__ */ import_react23.default.createElement(
|
|
9344
9649
|
"button",
|
|
9345
9650
|
{
|
|
9346
9651
|
onClick: handleConfirm,
|
|
@@ -9354,8 +9659,8 @@ function ImportParentFileModal({
|
|
|
9354
9659
|
}
|
|
9355
9660
|
|
|
9356
9661
|
// src/components/AncestryLinkDetailsPanel.jsx
|
|
9357
|
-
var
|
|
9358
|
-
var
|
|
9662
|
+
var import_react24 = __toESM(require("react"));
|
|
9663
|
+
var import_fi18 = require("react-icons/fi");
|
|
9359
9664
|
function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenReference, onMentionClick, onUploadFile }) {
|
|
9360
9665
|
var _a, _b, _c, _d;
|
|
9361
9666
|
const relationshipData = data.relationship || {};
|
|
@@ -9364,21 +9669,21 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
9364
9669
|
const customProps = extractCustomPropsFromNode(relationshipData);
|
|
9365
9670
|
const sourceName = ((_b = (_a = data.sourceNode) == null ? void 0 : _a.userData) == null ? void 0 : _b.name) || "Origem";
|
|
9366
9671
|
const targetName = ((_d = (_c = data.targetNode) == null ? void 0 : _c.userData) == null ? void 0 : _d.name) || "Destino";
|
|
9367
|
-
const [isReadMode, setIsReadMode] = (0,
|
|
9672
|
+
const [isReadMode, setIsReadMode] = (0, import_react24.useState)(false);
|
|
9368
9673
|
const swallow = (e) => e.stopPropagation();
|
|
9369
9674
|
const handleImageClickFromText = (url, name) => {
|
|
9370
9675
|
if (onOpenImageViewer) {
|
|
9371
9676
|
onOpenImageViewer([{ name: name || "Imagem", value: url }], 0);
|
|
9372
9677
|
}
|
|
9373
9678
|
};
|
|
9374
|
-
return /* @__PURE__ */
|
|
9679
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
|
9375
9680
|
"div",
|
|
9376
9681
|
{
|
|
9377
9682
|
className: "ui-overlay fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[1200]",
|
|
9378
9683
|
onClick: onClose,
|
|
9379
9684
|
onPointerDown: swallow
|
|
9380
9685
|
},
|
|
9381
|
-
/* @__PURE__ */
|
|
9686
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
9382
9687
|
"div",
|
|
9383
9688
|
{
|
|
9384
9689
|
className: `relative group rounded-2xl border border-white/10 bg-slate-950/80 shadow-[0_20px_80px_rgba(0,0,0,0.6)] ring-1 ring-white/10 text-white overflow-hidden flex flex-col max-h-[calc(100vh-4rem)] transition-all duration-300 ease-out
|
|
@@ -9386,7 +9691,7 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
9386
9691
|
`,
|
|
9387
9692
|
onClick: swallow
|
|
9388
9693
|
},
|
|
9389
|
-
isReadMode ? /* @__PURE__ */
|
|
9694
|
+
isReadMode ? /* @__PURE__ */ import_react24.default.createElement(
|
|
9390
9695
|
DescriptionReadModePanel,
|
|
9391
9696
|
{
|
|
9392
9697
|
title: `${sourceName} \u2794 ${targetName}`,
|
|
@@ -9398,15 +9703,15 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
9398
9703
|
onMentionClick,
|
|
9399
9704
|
onImageClick: handleImageClickFromText
|
|
9400
9705
|
}
|
|
9401
|
-
) : /* @__PURE__ */
|
|
9706
|
+
) : /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement("div", { className: "h-[2px] bg-gradient-to-r from-blue-500/0 via-blue-500/70 to-blue-500/0" }), /* @__PURE__ */ import_react24.default.createElement("div", { className: "px-6 pt-5 pb-3 flex items-start justify-between gap-4" }, /* @__PURE__ */ import_react24.default.createElement("div", null, /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-center gap-2 mb-1" }, /* @__PURE__ */ import_react24.default.createElement("span", { className: "inline-flex h-2.5 w-2.5 rounded-full bg-blue-500/80 shadow-[0_0_18px_2px_rgba(59,130,246,0.55)]" }), /* @__PURE__ */ import_react24.default.createElement("p", { className: "text-xs/relaxed text-slate-300" }, "Detalhes da Ancestralidade")), /* @__PURE__ */ import_react24.default.createElement("h2", { className: "text-lg font-semibold tracking-tight flex items-center gap-2" }, /* @__PURE__ */ import_react24.default.createElement("span", { className: "truncate max-w-[150px]" }, sourceName), /* @__PURE__ */ import_react24.default.createElement("span", { className: "text-slate-500 text-sm" }, "\u2794"), /* @__PURE__ */ import_react24.default.createElement("span", { className: "truncate max-w-[150px]" }, targetName))), /* @__PURE__ */ import_react24.default.createElement("button", { onClick: onClose, className: "w-9 h-9 grid place-content-center rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-xl", title: "Fechar" }, "\xD7")), /* @__PURE__ */ import_react24.default.createElement("div", { className: "px-6 pb-6 overflow-y-auto overscroll-contain space-y-4 custom-scrollbar" }, description && /* @__PURE__ */ import_react24.default.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ import_react24.default.createElement("label", { className: "text-xs text-slate-300 font-medium" }, "Descri\xE7\xE3o"), /* @__PURE__ */ import_react24.default.createElement(
|
|
9402
9707
|
"button",
|
|
9403
9708
|
{
|
|
9404
9709
|
onClick: () => setIsReadMode(true),
|
|
9405
9710
|
className: "p-1 text-slate-400 hover:text-white transition-colors",
|
|
9406
9711
|
title: "Modo de Leitura"
|
|
9407
9712
|
},
|
|
9408
|
-
/* @__PURE__ */
|
|
9409
|
-
)), /* @__PURE__ */
|
|
9713
|
+
/* @__PURE__ */ import_react24.default.createElement(import_fi18.FiBookOpen, { size: 14 })
|
|
9714
|
+
)), /* @__PURE__ */ import_react24.default.createElement("div", { className: "bg-slate-800/40 rounded-lg border border-white/10 p-1 relative group" }, /* @__PURE__ */ import_react24.default.createElement(
|
|
9410
9715
|
DescriptionDisplay,
|
|
9411
9716
|
{
|
|
9412
9717
|
description,
|
|
@@ -9415,7 +9720,7 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
9415
9720
|
onMentionClick,
|
|
9416
9721
|
onImageClick: handleImageClickFromText
|
|
9417
9722
|
}
|
|
9418
|
-
))), customProps.length > 0 && /* @__PURE__ */
|
|
9723
|
+
))), customProps.length > 0 && /* @__PURE__ */ import_react24.default.createElement("div", { className: "pt-2" }, /* @__PURE__ */ import_react24.default.createElement("label", { className: "text-xs text-slate-300 font-medium mb-2 block" }, "Propriedades"), /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop) => /* @__PURE__ */ import_react24.default.createElement(
|
|
9419
9724
|
CustomPropertyDisplay,
|
|
9420
9725
|
{
|
|
9421
9726
|
key: prop.id,
|
|
@@ -9424,14 +9729,14 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
9424
9729
|
onOpenImageViewer,
|
|
9425
9730
|
onUploadFile
|
|
9426
9731
|
}
|
|
9427
|
-
)))), !description && customProps.length === 0 && /* @__PURE__ */
|
|
9732
|
+
)))), !description && customProps.length === 0 && /* @__PURE__ */ import_react24.default.createElement("div", { className: "py-8 text-center text-slate-500 text-sm italic border border-dashed border-white/10 rounded-lg" }, "Nenhum detalhe adicional dispon\xEDvel para esta conex\xE3o."), /* @__PURE__ */ import_react24.default.createElement("div", { className: "mt-4 p-3 bg-blue-500/10 border border-blue-500/20 rounded-lg text-xs text-blue-200/80 text-center" }, 'Para editar esta conex\xE3o, utilize o menu "Editar Ancestralidade".')))
|
|
9428
9733
|
)
|
|
9429
9734
|
);
|
|
9430
9735
|
}
|
|
9431
9736
|
|
|
9432
9737
|
// src/components/AncestryBoard.jsx
|
|
9433
|
-
var
|
|
9434
|
-
var
|
|
9738
|
+
var import_react25 = __toESM(require("react"));
|
|
9739
|
+
var import_fi19 = require("react-icons/fi");
|
|
9435
9740
|
var GroupItem = ({
|
|
9436
9741
|
group,
|
|
9437
9742
|
index,
|
|
@@ -9451,7 +9756,7 @@ var GroupItem = ({
|
|
|
9451
9756
|
}) => {
|
|
9452
9757
|
const canIndent = index > 0;
|
|
9453
9758
|
const isPickingForThisGroup = pickingGroupId === group.id;
|
|
9454
|
-
const textareaRef = (0,
|
|
9759
|
+
const textareaRef = (0, import_react25.useRef)(null);
|
|
9455
9760
|
const adjustHeight = () => {
|
|
9456
9761
|
const textarea = textareaRef.current;
|
|
9457
9762
|
if (textarea) {
|
|
@@ -9459,13 +9764,13 @@ var GroupItem = ({
|
|
|
9459
9764
|
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
9460
9765
|
}
|
|
9461
9766
|
};
|
|
9462
|
-
(0,
|
|
9767
|
+
(0, import_react25.useEffect)(() => {
|
|
9463
9768
|
adjustHeight();
|
|
9464
9769
|
}, [group.text]);
|
|
9465
|
-
return /* @__PURE__ */
|
|
9770
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex flex-col gap-2 mb-3 pl-3 border-l border-white/10 relative group/item animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ import_react25.default.createElement("div", { className: "absolute -left-[1px] top-4 w-2 h-px bg-white/20" }), /* @__PURE__ */ import_react25.default.createElement("div", { className: `
|
|
9466
9771
|
flex flex-col gap-2 py-2 px-3 transition-all duration-200
|
|
9467
9772
|
${isPickingForThisGroup ? "bg-indigo-500/10 border-l-2 border-indigo-500" : "hover:bg-white/5 border-l-2 border-transparent hover:border-white/20"}
|
|
9468
|
-
` }, /* @__PURE__ */
|
|
9773
|
+
` }, /* @__PURE__ */ import_react25.default.createElement(
|
|
9469
9774
|
"textarea",
|
|
9470
9775
|
{
|
|
9471
9776
|
ref: textareaRef,
|
|
@@ -9482,9 +9787,9 @@ var GroupItem = ({
|
|
|
9482
9787
|
if (canEdit) onUpdate(group.id, { ...group, text: e.target.value });
|
|
9483
9788
|
}
|
|
9484
9789
|
}
|
|
9485
|
-
), group.ancestries && group.ancestries.length > 0 && /* @__PURE__ */
|
|
9790
|
+
), group.ancestries && group.ancestries.length > 0 && /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex flex-wrap gap-2 mt-1" }, group.ancestries.map((anc) => {
|
|
9486
9791
|
const isValid = availableIds.has(String(anc.ancestry_id));
|
|
9487
|
-
return /* @__PURE__ */
|
|
9792
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
9488
9793
|
"div",
|
|
9489
9794
|
{
|
|
9490
9795
|
key: anc.ancestry_id,
|
|
@@ -9496,28 +9801,28 @@ var GroupItem = ({
|
|
|
9496
9801
|
},
|
|
9497
9802
|
isValid ? (
|
|
9498
9803
|
// [MANTIDO] Botão Play visível para todos
|
|
9499
|
-
/* @__PURE__ */
|
|
9804
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
9500
9805
|
"button",
|
|
9501
9806
|
{
|
|
9502
9807
|
onClick: () => onPlayAncestry(anc.ancestry_id),
|
|
9503
9808
|
className: "text-indigo-400 hover:text-white hover:bg-indigo-500 p-1 rounded-full transition-colors",
|
|
9504
9809
|
title: "Renderizar no cen\xE1rio"
|
|
9505
9810
|
},
|
|
9506
|
-
/* @__PURE__ */
|
|
9811
|
+
/* @__PURE__ */ import_react25.default.createElement(import_fi19.FiPlay, { size: 10, className: "ml-0.5 fill-current" })
|
|
9507
9812
|
)
|
|
9508
|
-
) : /* @__PURE__ */
|
|
9509
|
-
/* @__PURE__ */
|
|
9510
|
-
canEdit && /* @__PURE__ */
|
|
9813
|
+
) : /* @__PURE__ */ import_react25.default.createElement("div", { className: "p-1 text-red-500 cursor-not-allowed" }, /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiAlertTriangle, { size: 10 })),
|
|
9814
|
+
/* @__PURE__ */ import_react25.default.createElement("span", { className: `font-medium truncate max-w-[150px] ${!isValid && "line-through decoration-red-500/50"}` }, anc.name),
|
|
9815
|
+
canEdit && /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", { className: `w-px h-3 mx-0.5 ${isValid ? "bg-white/10" : "bg-red-500/20"}` }), /* @__PURE__ */ import_react25.default.createElement(
|
|
9511
9816
|
"button",
|
|
9512
9817
|
{
|
|
9513
9818
|
onClick: () => onRemoveAncestry(group.id, anc.ancestry_id),
|
|
9514
9819
|
className: `${isValid ? "text-slate-500 hover:text-red-400" : "text-red-400 hover:text-red-200"} p-0.5 rounded transition-colors`,
|
|
9515
9820
|
title: "Remover men\xE7\xE3o"
|
|
9516
9821
|
},
|
|
9517
|
-
/* @__PURE__ */
|
|
9822
|
+
/* @__PURE__ */ import_react25.default.createElement(import_fi19.FiX, { size: 12 })
|
|
9518
9823
|
))
|
|
9519
9824
|
);
|
|
9520
|
-
})), canEdit && /* @__PURE__ */
|
|
9825
|
+
})), canEdit && /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex items-center justify-between pt-2 mt-1 border-t border-white/5 opacity-40 group-hover/item:opacity-100 transition-opacity" }, /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react25.default.createElement(
|
|
9521
9826
|
"button",
|
|
9522
9827
|
{
|
|
9523
9828
|
onClick: () => onRequestPickAncestry(group.id),
|
|
@@ -9527,17 +9832,17 @@ var GroupItem = ({
|
|
|
9527
9832
|
`,
|
|
9528
9833
|
title: "Adicionar Ancestralidade a este grupo"
|
|
9529
9834
|
},
|
|
9530
|
-
isPickingForThisGroup ? /* @__PURE__ */
|
|
9835
|
+
isPickingForThisGroup ? /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiCheckCircle, { size: 12 }) : /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiSearch, { size: 12 }),
|
|
9531
9836
|
isPickingForThisGroup ? "Selecionando..." : "Adicionar"
|
|
9532
|
-
), /* @__PURE__ */
|
|
9837
|
+
), /* @__PURE__ */ import_react25.default.createElement(
|
|
9533
9838
|
"button",
|
|
9534
9839
|
{
|
|
9535
9840
|
onClick: () => onAddSubgroup(group.id),
|
|
9536
9841
|
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
9537
9842
|
title: "Criar Subgrupo"
|
|
9538
9843
|
},
|
|
9539
|
-
/* @__PURE__ */
|
|
9540
|
-
)), /* @__PURE__ */
|
|
9844
|
+
/* @__PURE__ */ import_react25.default.createElement(import_fi19.FiPlus, { size: 14 })
|
|
9845
|
+
)), /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react25.default.createElement(
|
|
9541
9846
|
"button",
|
|
9542
9847
|
{
|
|
9543
9848
|
onClick: () => onIndent(group.id),
|
|
@@ -9545,24 +9850,24 @@ var GroupItem = ({
|
|
|
9545
9850
|
className: `p-1.5 rounded transition-colors ${!canIndent ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`,
|
|
9546
9851
|
title: "Aninhar no grupo acima"
|
|
9547
9852
|
},
|
|
9548
|
-
/* @__PURE__ */
|
|
9549
|
-
), /* @__PURE__ */
|
|
9853
|
+
/* @__PURE__ */ import_react25.default.createElement(import_fi19.FiArrowRight, { size: 14 })
|
|
9854
|
+
), /* @__PURE__ */ import_react25.default.createElement(
|
|
9550
9855
|
"button",
|
|
9551
9856
|
{
|
|
9552
9857
|
onClick: () => onOutdent(group.id),
|
|
9553
9858
|
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
9554
9859
|
title: "Desaninhar"
|
|
9555
9860
|
},
|
|
9556
|
-
/* @__PURE__ */
|
|
9557
|
-
), /* @__PURE__ */
|
|
9861
|
+
/* @__PURE__ */ import_react25.default.createElement(import_fi19.FiArrowLeft, { size: 14 })
|
|
9862
|
+
), /* @__PURE__ */ import_react25.default.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ import_react25.default.createElement(
|
|
9558
9863
|
"button",
|
|
9559
9864
|
{
|
|
9560
9865
|
onClick: () => onDelete(group.id),
|
|
9561
9866
|
className: "p-1.5 text-slate-600 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
9562
9867
|
title: "Remover Grupo"
|
|
9563
9868
|
},
|
|
9564
|
-
/* @__PURE__ */
|
|
9565
|
-
)))), group.children && group.children.length > 0 && /* @__PURE__ */
|
|
9869
|
+
/* @__PURE__ */ import_react25.default.createElement(import_fi19.FiTrash2, { size: 14 })
|
|
9870
|
+
)))), group.children && group.children.length > 0 && /* @__PURE__ */ import_react25.default.createElement("div", { className: "ml-2" }, group.children.map((childGroup, idx) => /* @__PURE__ */ import_react25.default.createElement(
|
|
9566
9871
|
GroupItem,
|
|
9567
9872
|
{
|
|
9568
9873
|
key: childGroup.id,
|
|
@@ -9594,21 +9899,21 @@ function AncestryBoard({
|
|
|
9594
9899
|
userRole
|
|
9595
9900
|
// [NOVO] Recebe a role do usuário
|
|
9596
9901
|
}) {
|
|
9597
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
9598
|
-
const [groups, setGroups] = (0,
|
|
9599
|
-
const [isLoaded, setIsLoaded] = (0,
|
|
9600
|
-
const [pickingGroupId, setPickingGroupId] = (0,
|
|
9601
|
-
const [saveStatus, setSaveStatus] = (0,
|
|
9602
|
-
const canEdit = (0,
|
|
9902
|
+
const [searchTerm, setSearchTerm] = (0, import_react25.useState)("");
|
|
9903
|
+
const [groups, setGroups] = (0, import_react25.useState)([]);
|
|
9904
|
+
const [isLoaded, setIsLoaded] = (0, import_react25.useState)(false);
|
|
9905
|
+
const [pickingGroupId, setPickingGroupId] = (0, import_react25.useState)(null);
|
|
9906
|
+
const [saveStatus, setSaveStatus] = (0, import_react25.useState)("idle");
|
|
9907
|
+
const canEdit = (0, import_react25.useMemo)(() => {
|
|
9603
9908
|
return userRole !== "viewer";
|
|
9604
9909
|
}, [userRole]);
|
|
9605
|
-
(0,
|
|
9910
|
+
(0, import_react25.useEffect)(() => {
|
|
9606
9911
|
if (initialGroups && !isLoaded) {
|
|
9607
9912
|
setGroups(initialGroups);
|
|
9608
9913
|
setIsLoaded(true);
|
|
9609
9914
|
}
|
|
9610
9915
|
}, [initialGroups, isLoaded]);
|
|
9611
|
-
const nodeNamesMap = (0,
|
|
9916
|
+
const nodeNamesMap = (0, import_react25.useMemo)(() => {
|
|
9612
9917
|
const map = /* @__PURE__ */ new Map();
|
|
9613
9918
|
if (availableNodes && Array.isArray(availableNodes)) {
|
|
9614
9919
|
availableNodes.forEach((node) => {
|
|
@@ -9619,7 +9924,7 @@ function AncestryBoard({
|
|
|
9619
9924
|
}
|
|
9620
9925
|
return map;
|
|
9621
9926
|
}, [availableNodes]);
|
|
9622
|
-
const availableIds = (0,
|
|
9927
|
+
const availableIds = (0, import_react25.useMemo)(() => {
|
|
9623
9928
|
return new Set(availableAncestries.map((a) => String(a.ancestry_id)));
|
|
9624
9929
|
}, [availableAncestries]);
|
|
9625
9930
|
const sanitizeGroups = (groupList) => {
|
|
@@ -9633,7 +9938,7 @@ function AncestryBoard({
|
|
|
9633
9938
|
children: sanitizeGroups(g.children || [])
|
|
9634
9939
|
}));
|
|
9635
9940
|
};
|
|
9636
|
-
(0,
|
|
9941
|
+
(0, import_react25.useEffect)(() => {
|
|
9637
9942
|
if (!isLoaded || !onSave) return;
|
|
9638
9943
|
const timeoutId = setTimeout(async () => {
|
|
9639
9944
|
setSaveStatus("saving");
|
|
@@ -9651,7 +9956,7 @@ function AncestryBoard({
|
|
|
9651
9956
|
}, 3e3);
|
|
9652
9957
|
return () => clearTimeout(timeoutId);
|
|
9653
9958
|
}, [groups, isLoaded, onSave]);
|
|
9654
|
-
(0,
|
|
9959
|
+
(0, import_react25.useEffect)(() => {
|
|
9655
9960
|
if (!isOpen) return;
|
|
9656
9961
|
const handleKeyDown = (e) => {
|
|
9657
9962
|
if (e.key === "Escape") {
|
|
@@ -9667,7 +9972,7 @@ function AncestryBoard({
|
|
|
9667
9972
|
window.addEventListener("keydown", handleKeyDown);
|
|
9668
9973
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
9669
9974
|
}, [isOpen, onClose, pickingGroupId]);
|
|
9670
|
-
const filtered = (0,
|
|
9975
|
+
const filtered = (0, import_react25.useMemo)(() => {
|
|
9671
9976
|
const term = searchTerm.toLowerCase().trim();
|
|
9672
9977
|
return availableAncestries.filter((a) => {
|
|
9673
9978
|
if (!term) return true;
|
|
@@ -9806,27 +10111,27 @@ function AncestryBoard({
|
|
|
9806
10111
|
});
|
|
9807
10112
|
};
|
|
9808
10113
|
if (!isOpen) return null;
|
|
9809
|
-
return /* @__PURE__ */
|
|
10114
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
9810
10115
|
"div",
|
|
9811
10116
|
{
|
|
9812
10117
|
className: "fixed inset-0 z-[2200] bg-black/80 backdrop-blur-sm flex items-center justify-center p-2",
|
|
9813
10118
|
onClick: onClose
|
|
9814
10119
|
},
|
|
9815
|
-
/* @__PURE__ */
|
|
10120
|
+
/* @__PURE__ */ import_react25.default.createElement(
|
|
9816
10121
|
"div",
|
|
9817
10122
|
{
|
|
9818
10123
|
className: "bg-slate-950 border border-white/10 rounded-xl w-[98vw] h-[97vh] flex flex-col shadow-2xl overflow-hidden animate-in fade-in zoom-in-95 duration-200",
|
|
9819
10124
|
onClick: (e) => e.stopPropagation()
|
|
9820
10125
|
},
|
|
9821
|
-
/* @__PURE__ */
|
|
10126
|
+
/* @__PURE__ */ import_react25.default.createElement("div", { className: "h-14 px-4 border-b border-white/10 bg-slate-900/90 flex items-center justify-between shrink-0" }, /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ import_react25.default.createElement("h3", { className: "text-base font-semibold text-white flex items-center gap-2 whitespace-nowrap" }, /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiLayers, { className: "text-indigo-400" }), "Ancestry Board"), saveStatus !== "idle" && /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex items-center gap-2 animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ import_react25.default.createElement("div", { className: "w-px h-4 bg-white/10 mx-1" }), /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-slate-900/50 border border-white/5" }, saveStatus === "saving" && /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiLoader, { className: "animate-spin text-indigo-400", size: 12 }), /* @__PURE__ */ import_react25.default.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-indigo-300" }, "Salvando")), saveStatus === "saved" && /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiCheckCircle, { className: "text-emerald-400", size: 12 }), /* @__PURE__ */ import_react25.default.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-slate-400" }, "Salvo")), saveStatus === "error" && /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("span", { className: "w-2 h-2 rounded-full bg-red-500" }), /* @__PURE__ */ import_react25.default.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-red-400" }, "Erro"))))), /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex items-center gap-3" }, pickingGroupId && /* @__PURE__ */ import_react25.default.createElement("span", { className: "text-xs text-indigo-300 font-medium animate-pulse hidden sm:inline-block mr-2" }, "Selecione na lateral..."), canEdit && /* @__PURE__ */ import_react25.default.createElement(
|
|
9822
10127
|
"button",
|
|
9823
10128
|
{
|
|
9824
10129
|
onClick: handleAddRootGroup,
|
|
9825
10130
|
className: "\n flex items-center gap-2 px-3 py-1.5 \n bg-white/5 hover:bg-white/10 \n border border-white/10 hover:border-white/20\n backdrop-blur-sm\n text-slate-200 hover:text-white\n rounded-md transition-all duration-200\n text-xs font-medium shadow-sm\n "
|
|
9826
10131
|
},
|
|
9827
|
-
/* @__PURE__ */
|
|
9828
|
-
/* @__PURE__ */
|
|
9829
|
-
), /* @__PURE__ */
|
|
10132
|
+
/* @__PURE__ */ import_react25.default.createElement(import_fi19.FiPlus, { size: 14, className: "text-indigo-400" }),
|
|
10133
|
+
/* @__PURE__ */ import_react25.default.createElement("span", { className: "hidden sm:inline" }, "Novo Grupo")
|
|
10134
|
+
), /* @__PURE__ */ import_react25.default.createElement(
|
|
9830
10135
|
"button",
|
|
9831
10136
|
{
|
|
9832
10137
|
onClick: onClose,
|
|
@@ -9834,11 +10139,11 @@ function AncestryBoard({
|
|
|
9834
10139
|
},
|
|
9835
10140
|
"\xD7"
|
|
9836
10141
|
))),
|
|
9837
|
-
/* @__PURE__ */
|
|
10142
|
+
/* @__PURE__ */ import_react25.default.createElement("div", { className: "flex flex-1 overflow-hidden" }, /* @__PURE__ */ import_react25.default.createElement("div", { className: `
|
|
9838
10143
|
flex flex-col border-r border-white/10 transition-all duration-300 flex-none
|
|
9839
10144
|
${pickingGroupId ? "w-[25%] border-indigo-500/30" : "w-[20%]"}
|
|
9840
10145
|
min-w-[280px] max-w-[500px] bg-slate-900
|
|
9841
|
-
` }, /* @__PURE__ */
|
|
10146
|
+
` }, /* @__PURE__ */ import_react25.default.createElement("div", { className: "p-3 border-b border-white/5 bg-slate-900/50" }, /* @__PURE__ */ import_react25.default.createElement("div", { className: "relative group" }, /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiSearch, { className: `absolute left-3 top-1/2 -translate-y-1/2 transition-colors ${pickingGroupId ? "text-indigo-400" : "text-slate-500 group-focus-within:text-indigo-400"}` }), /* @__PURE__ */ import_react25.default.createElement(
|
|
9842
10147
|
"input",
|
|
9843
10148
|
{
|
|
9844
10149
|
type: "text",
|
|
@@ -9851,10 +10156,10 @@ function AncestryBoard({
|
|
|
9851
10156
|
onChange: (e) => setSearchTerm(e.target.value),
|
|
9852
10157
|
autoFocus: !pickingGroupId
|
|
9853
10158
|
}
|
|
9854
|
-
))), /* @__PURE__ */
|
|
10159
|
+
))), /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-3 space-y-2" }, filtered.map((anc) => {
|
|
9855
10160
|
const parentNodeName = nodeNamesMap.get(String(anc.ancestral_node)) || "Node Desconhecido";
|
|
9856
10161
|
const isPicking = !!pickingGroupId;
|
|
9857
|
-
return /* @__PURE__ */
|
|
10162
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
9858
10163
|
"div",
|
|
9859
10164
|
{
|
|
9860
10165
|
key: anc.ancestry_id,
|
|
@@ -9866,12 +10171,12 @@ function AncestryBoard({
|
|
|
9866
10171
|
${isPicking ? "border-indigo-500/30 bg-indigo-500/5 hover:bg-indigo-500/20 hover:border-indigo-400 cursor-pointer" : "border-white/5 bg-slate-800/40 hover:bg-indigo-600/10 hover:border-indigo-500/30 cursor-default"}
|
|
9867
10172
|
`
|
|
9868
10173
|
},
|
|
9869
|
-
/* @__PURE__ */
|
|
10174
|
+
/* @__PURE__ */ import_react25.default.createElement("div", { className: `
|
|
9870
10175
|
mt-0.5 w-8 h-8 rounded-md grid place-content-center shrink-0 border transition-all shadow-lg
|
|
9871
10176
|
${isPicking ? "bg-indigo-500 text-white border-indigo-400" : "bg-slate-800 text-indigo-400 border-white/5 group-hover:bg-indigo-500 group-hover:text-white"}
|
|
9872
|
-
` }, isPicking ? /* @__PURE__ */
|
|
9873
|
-
/* @__PURE__ */
|
|
9874
|
-
!isPicking && /* @__PURE__ */
|
|
10177
|
+
` }, isPicking ? /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiPlus, { size: 16 }) : /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiLayers, { size: 14 })),
|
|
10178
|
+
/* @__PURE__ */ import_react25.default.createElement("div", { className: "flex-1 min-w-0 pb-2" }, /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex items-center justify-between gap-2" }, /* @__PURE__ */ import_react25.default.createElement("h4", { className: "text-sm font-medium text-slate-200 group-hover:text-white truncate transition-colors" }, anc.name || "Sem Nome"), anc.is_private && /* @__PURE__ */ import_react25.default.createElement("span", { className: "text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-300 border border-amber-500/20" }, "Priv")), /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex items-center gap-1.5 mt-0.5 text-[11px] text-slate-500 group-hover:text-indigo-200/70 transition-colors" }, /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiCornerUpRight, { size: 10 }), /* @__PURE__ */ import_react25.default.createElement("span", { className: "truncate max-w-[120px]" }, parentNodeName)), anc.description && /* @__PURE__ */ import_react25.default.createElement("p", { className: "mt-1.5 text-[11px] text-slate-400 line-clamp-2 leading-relaxed opacity-80" }, anc.description)),
|
|
10179
|
+
!isPicking && /* @__PURE__ */ import_react25.default.createElement(
|
|
9875
10180
|
"button",
|
|
9876
10181
|
{
|
|
9877
10182
|
onClick: (e) => {
|
|
@@ -9881,10 +10186,10 @@ function AncestryBoard({
|
|
|
9881
10186
|
className: "absolute right-2 bottom-2 opacity-0 group-hover:opacity-100 transition-all duration-300 transform translate-y-2 group-hover:translate-y-0 z-10",
|
|
9882
10187
|
title: "Renderizar Ancestralidade"
|
|
9883
10188
|
},
|
|
9884
|
-
/* @__PURE__ */
|
|
10189
|
+
/* @__PURE__ */ import_react25.default.createElement("div", { className: "bg-indigo-500 text-white p-2 rounded-full shadow-lg hover:bg-indigo-400 hover:scale-110 transition-all" }, /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiPlay, { size: 14, className: "ml-0.5" }))
|
|
9885
10190
|
)
|
|
9886
10191
|
);
|
|
9887
|
-
}))), /* @__PURE__ */
|
|
10192
|
+
}))), /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex flex-col flex-1 bg-slate-950/30" }, /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-6 space-y-4" }, groups.length === 0 ? /* @__PURE__ */ import_react25.default.createElement("div", { className: "flex flex-col items-center justify-center h-full text-slate-500 gap-3 border-2 border-dashed border-white/5 rounded-xl m-4 bg-slate-900/20" }, /* @__PURE__ */ import_react25.default.createElement(import_fi19.FiLayers, { size: 24, className: "opacity-20" }), /* @__PURE__ */ import_react25.default.createElement("p", { className: "text-xs text-center px-4" }, canEdit ? /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, "Nenhum grupo criado.", /* @__PURE__ */ import_react25.default.createElement("br", null), 'Use o bot\xE3o "Novo Grupo" acima.') : /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, "Nenhum grupo dispon\xEDvel para visualiza\xE7\xE3o."))) : groups.map((group, index) => /* @__PURE__ */ import_react25.default.createElement(
|
|
9888
10193
|
GroupItem,
|
|
9889
10194
|
{
|
|
9890
10195
|
key: group.id,
|
|
@@ -9904,7 +10209,7 @@ function AncestryBoard({
|
|
|
9904
10209
|
canEdit
|
|
9905
10210
|
}
|
|
9906
10211
|
))))),
|
|
9907
|
-
/* @__PURE__ */
|
|
10212
|
+
/* @__PURE__ */ import_react25.default.createElement("div", { className: "px-5 py-2 border-t border-white/10 bg-slate-950/50 text-xs text-slate-500 flex justify-between flex-shrink-0" }, /* @__PURE__ */ import_react25.default.createElement("span", null, filtered.length, " itens encontrados"), /* @__PURE__ */ import_react25.default.createElement("span", null, groups.length, " grupos raiz"))
|
|
9908
10213
|
)
|
|
9909
10214
|
);
|
|
9910
10215
|
}
|
|
@@ -9984,12 +10289,12 @@ function XViewScene({
|
|
|
9984
10289
|
check_user_permission
|
|
9985
10290
|
}) {
|
|
9986
10291
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
9987
|
-
const { data: session, status } = (0,
|
|
10292
|
+
const { data: session, status } = (0, import_react27.useSession)();
|
|
9988
10293
|
const router = (0, import_navigation.useRouter)();
|
|
9989
10294
|
const searchParams = (0, import_navigation.useSearchParams)();
|
|
9990
10295
|
const focusNodeId = searchParams == null ? void 0 : searchParams.get("focus");
|
|
9991
10296
|
const focusAncestryId = searchParams == null ? void 0 : searchParams.get("ancestry");
|
|
9992
|
-
const viewParams = (0,
|
|
10297
|
+
const viewParams = (0, import_react26.useMemo)(() => {
|
|
9993
10298
|
if (encryptedConfig) {
|
|
9994
10299
|
const data = decryptData(encryptedConfig);
|
|
9995
10300
|
if (data) {
|
|
@@ -9998,7 +10303,7 @@ function XViewScene({
|
|
|
9998
10303
|
}
|
|
9999
10304
|
return null;
|
|
10000
10305
|
}, [encryptedConfig, session]);
|
|
10001
|
-
(0,
|
|
10306
|
+
(0, import_react26.useEffect)(() => {
|
|
10002
10307
|
async function verifyPermission() {
|
|
10003
10308
|
if (!viewParams || !session || !check_user_permission) return;
|
|
10004
10309
|
const { id, type, owner_id } = viewParams;
|
|
@@ -10028,65 +10333,65 @@ function XViewScene({
|
|
|
10028
10333
|
setIsLoading(false);
|
|
10029
10334
|
}
|
|
10030
10335
|
}, [viewParams, session, status, check_user_permission]);
|
|
10031
|
-
const sceneConfigId = (0,
|
|
10032
|
-
const ownerId = (0,
|
|
10033
|
-
const dbSaveUrl = (0,
|
|
10336
|
+
const sceneConfigId = (0, import_react26.useMemo)(() => (viewParams == null ? void 0 : viewParams.id) || null, [viewParams]);
|
|
10337
|
+
const ownerId = (0, import_react26.useMemo)(() => (viewParams == null ? void 0 : viewParams.owner_id) || null, [viewParams]);
|
|
10338
|
+
const dbSaveUrl = (0, import_react26.useMemo)(() => {
|
|
10034
10339
|
if (ownerId && sceneConfigId) {
|
|
10035
10340
|
return `x_view_dbs/${ownerId}/${sceneConfigId}`;
|
|
10036
10341
|
}
|
|
10037
10342
|
return null;
|
|
10038
10343
|
}, [ownerId, sceneConfigId]);
|
|
10039
|
-
const sceneSaveUrl = (0,
|
|
10344
|
+
const sceneSaveUrl = (0, import_react26.useMemo)(() => {
|
|
10040
10345
|
if (ownerId && sceneConfigId) {
|
|
10041
10346
|
return `x_view_scenes/${ownerId}/${sceneConfigId}`;
|
|
10042
10347
|
}
|
|
10043
10348
|
return null;
|
|
10044
10349
|
}, [ownerId, sceneConfigId]);
|
|
10045
|
-
const ancestry_save_url = (0,
|
|
10350
|
+
const ancestry_save_url = (0, import_react26.useMemo)(() => {
|
|
10046
10351
|
if (ownerId && sceneConfigId) {
|
|
10047
10352
|
return `x_view_ancestry/${ownerId}/${sceneConfigId}`;
|
|
10048
10353
|
}
|
|
10049
10354
|
return null;
|
|
10050
10355
|
}, [ownerId, sceneConfigId]);
|
|
10051
|
-
const sceneDataRef = (0,
|
|
10052
|
-
const parentDataRef = (0,
|
|
10053
|
-
const ancestryDataRef = (0,
|
|
10054
|
-
const [isLoading, setIsLoading] = (0,
|
|
10055
|
-
const [permissionStatus, setPermissionStatus] = (0,
|
|
10056
|
-
const [userPermissionRole, setUserPermissionRole] = (0,
|
|
10057
|
-
const [isInitialized, setIsInitialized] = (0,
|
|
10058
|
-
const [sceneVersion, setSceneVersion] = (0,
|
|
10059
|
-
const [contextMenu, setContextMenu] = (0,
|
|
10060
|
-
const [multiContextMenu, setMultiContextMenu] = (0,
|
|
10061
|
-
const [relationshipMenu, setRelationshipMenu] = (0,
|
|
10062
|
-
const [creationMode, setCreationMode] = (0,
|
|
10063
|
-
const [versionMode, setVersionMode] = (0,
|
|
10064
|
-
const [questMode, setQuestMode] = (0,
|
|
10065
|
-
const [hasFocusedInitial, setHasFocusedInitial] = (0,
|
|
10066
|
-
const [hasOpenedInitialAncestry, setHasOpenedInitialAncestry] = (0,
|
|
10067
|
-
const [ancestryMode, setAncestryMode] = (0,
|
|
10068
|
-
const [readingMode, setReadingMode] = (0,
|
|
10356
|
+
const sceneDataRef = (0, import_react26.useRef)(null);
|
|
10357
|
+
const parentDataRef = (0, import_react26.useRef)(null);
|
|
10358
|
+
const ancestryDataRef = (0, import_react26.useRef)(null);
|
|
10359
|
+
const [isLoading, setIsLoading] = (0, import_react26.useState)(true);
|
|
10360
|
+
const [permissionStatus, setPermissionStatus] = (0, import_react26.useState)("loading");
|
|
10361
|
+
const [userPermissionRole, setUserPermissionRole] = (0, import_react26.useState)(null);
|
|
10362
|
+
const [isInitialized, setIsInitialized] = (0, import_react26.useState)(false);
|
|
10363
|
+
const [sceneVersion, setSceneVersion] = (0, import_react26.useState)(0);
|
|
10364
|
+
const [contextMenu, setContextMenu] = (0, import_react26.useState)({ visible: false, x: 0, y: 0, nodeData: null });
|
|
10365
|
+
const [multiContextMenu, setMultiContextMenu] = (0, import_react26.useState)({ visible: false, x: 0, y: 0, nodeIds: null });
|
|
10366
|
+
const [relationshipMenu, setRelationshipMenu] = (0, import_react26.useState)({ visible: false, x: 0, y: 0, linkObject: null });
|
|
10367
|
+
const [creationMode, setCreationMode] = (0, import_react26.useState)({ isActive: false, sourceNodeData: null });
|
|
10368
|
+
const [versionMode, setVersionMode] = (0, import_react26.useState)({ isActive: false, sourceNodeData: null });
|
|
10369
|
+
const [questMode, setQuestMode] = (0, import_react26.useState)({ isActive: false });
|
|
10370
|
+
const [hasFocusedInitial, setHasFocusedInitial] = (0, import_react26.useState)(false);
|
|
10371
|
+
const [hasOpenedInitialAncestry, setHasOpenedInitialAncestry] = (0, import_react26.useState)(false);
|
|
10372
|
+
const [ancestryMode, setAncestryMode] = (0, import_react26.useState)({ isActive: false, tree: null, selectedParentId: null, isEditMode: false, currentAncestryId: null, ancestryName: "", ancestryDescription: "", ancestryDescriptionSections: [], isAddingNodes: false });
|
|
10373
|
+
const [readingMode, setReadingMode] = (0, import_react26.useState)({
|
|
10069
10374
|
isActive: false,
|
|
10070
10375
|
ancestry: null,
|
|
10071
10376
|
branchStack: [],
|
|
10072
10377
|
autoAbstraction: false
|
|
10073
10378
|
});
|
|
10074
|
-
const [formPosition, setFormPosition] = (0,
|
|
10075
|
-
const [detailsNode, setDetailsNode] = (0,
|
|
10076
|
-
const [detailsLink, setDetailsLink] = (0,
|
|
10077
|
-
const [ancestryLinkDetails, setAncestryLinkDetails] = (0,
|
|
10078
|
-
const [imageViewer, setImageViewer] = (0,
|
|
10079
|
-
const [editingAncestryRel, setEditingAncestryRel] = (0,
|
|
10080
|
-
const [isImportModalOpen, setIsImportModalOpen] = (0,
|
|
10081
|
-
const [importSuccessMessage, setImportSuccessMessage] = (0,
|
|
10082
|
-
const [highlightedNodeId, setHighlightedNodeId] = (0,
|
|
10083
|
-
const [isAncestryBoardOpen, setIsAncestryBoardOpen] = (0,
|
|
10084
|
-
const [ancestryBoardData, setAncestryBoardData] = (0,
|
|
10085
|
-
const [isSidebarOpen, setIsSidebarOpen] = (0,
|
|
10086
|
-
const mountRef = (0,
|
|
10087
|
-
const tooltipRef = (0,
|
|
10088
|
-
const formRef = (0,
|
|
10089
|
-
const stateRef = (0,
|
|
10379
|
+
const [formPosition, setFormPosition] = (0, import_react26.useState)({ left: 16, top: 16, opacity: 0 });
|
|
10380
|
+
const [detailsNode, setDetailsNode] = (0, import_react26.useState)(null);
|
|
10381
|
+
const [detailsLink, setDetailsLink] = (0, import_react26.useState)(null);
|
|
10382
|
+
const [ancestryLinkDetails, setAncestryLinkDetails] = (0, import_react26.useState)(null);
|
|
10383
|
+
const [imageViewer, setImageViewer] = (0, import_react26.useState)({ visible: false, images: [], startIndex: 0 });
|
|
10384
|
+
const [editingAncestryRel, setEditingAncestryRel] = (0, import_react26.useState)({ visible: false, data: null, path: null });
|
|
10385
|
+
const [isImportModalOpen, setIsImportModalOpen] = (0, import_react26.useState)(false);
|
|
10386
|
+
const [importSuccessMessage, setImportSuccessMessage] = (0, import_react26.useState)("");
|
|
10387
|
+
const [highlightedNodeId, setHighlightedNodeId] = (0, import_react26.useState)(null);
|
|
10388
|
+
const [isAncestryBoardOpen, setIsAncestryBoardOpen] = (0, import_react26.useState)(false);
|
|
10389
|
+
const [ancestryBoardData, setAncestryBoardData] = (0, import_react26.useState)([]);
|
|
10390
|
+
const [isSidebarOpen, setIsSidebarOpen] = (0, import_react26.useState)(false);
|
|
10391
|
+
const mountRef = (0, import_react26.useRef)(null);
|
|
10392
|
+
const tooltipRef = (0, import_react26.useRef)(null);
|
|
10393
|
+
const formRef = (0, import_react26.useRef)(null);
|
|
10394
|
+
const stateRef = (0, import_react26.useRef)({
|
|
10090
10395
|
readMode: {
|
|
10091
10396
|
currentMaxIndex: 0,
|
|
10092
10397
|
progressMap: {}
|
|
@@ -10131,10 +10436,10 @@ function XViewScene({
|
|
|
10131
10436
|
minWidth: 320,
|
|
10132
10437
|
maxWidth: maxReadPanelW
|
|
10133
10438
|
});
|
|
10134
|
-
(0,
|
|
10439
|
+
(0, import_react26.useEffect)(() => {
|
|
10135
10440
|
stateRef.current.ancestry = ancestryMode;
|
|
10136
10441
|
}, [ancestryMode]);
|
|
10137
|
-
(0,
|
|
10442
|
+
(0, import_react26.useEffect)(() => {
|
|
10138
10443
|
var _a2;
|
|
10139
10444
|
if (!isInitialized) return;
|
|
10140
10445
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -10155,10 +10460,10 @@ function XViewScene({
|
|
|
10155
10460
|
}
|
|
10156
10461
|
stateRef.current.nodeIdToParentFileMap = map;
|
|
10157
10462
|
}, [isInitialized, sceneVersion]);
|
|
10158
|
-
const handleNavigateBack = (0,
|
|
10463
|
+
const handleNavigateBack = (0, import_react26.useCallback)(() => {
|
|
10159
10464
|
router.push("/dashboard/scenes");
|
|
10160
10465
|
}, [router]);
|
|
10161
|
-
const handleConfirmImport = (0,
|
|
10466
|
+
const handleConfirmImport = (0, import_react26.useCallback)(
|
|
10162
10467
|
async (importPayload) => {
|
|
10163
10468
|
var _a2, _b2;
|
|
10164
10469
|
let files = [];
|
|
@@ -10256,7 +10561,7 @@ function XViewScene({
|
|
|
10256
10561
|
const handleOpenImageViewer = (images, startIndex) => {
|
|
10257
10562
|
setImageViewer({ visible: true, images, startIndex });
|
|
10258
10563
|
};
|
|
10259
|
-
const tweenToTarget = (0,
|
|
10564
|
+
const tweenToTarget = (0, import_react26.useCallback)((target, zoomFactor = 1, forcedDirection = null) => {
|
|
10260
10565
|
const { camera, controls, tweenGroup } = stateRef.current;
|
|
10261
10566
|
if (!camera || !controls || !tweenGroup) return;
|
|
10262
10567
|
const targetPos = target instanceof THREE3.Mesh ? target.getWorldPosition(new THREE3.Vector3()) : target;
|
|
@@ -10279,7 +10584,7 @@ function XViewScene({
|
|
|
10279
10584
|
if (!t || typeof t.closest !== "function") return false;
|
|
10280
10585
|
return !!t.closest(".ui-overlay");
|
|
10281
10586
|
};
|
|
10282
|
-
const buildFullAncestryTree = (0,
|
|
10587
|
+
const buildFullAncestryTree = (0, import_react26.useCallback)((idTree, nodes, ancestries = []) => {
|
|
10283
10588
|
if (!idTree) return null;
|
|
10284
10589
|
const nodeMap = new Map(nodes.map((n) => [String(n.id), n]));
|
|
10285
10590
|
const ancestryMap = new Map(ancestries.map((a) => [String(a.ancestry_id), a]));
|
|
@@ -10355,7 +10660,7 @@ function XViewScene({
|
|
|
10355
10660
|
}
|
|
10356
10661
|
return recursiveBuild(idTree);
|
|
10357
10662
|
}, []);
|
|
10358
|
-
const handleActivateTimeline = (0,
|
|
10663
|
+
const handleActivateTimeline = (0, import_react26.useCallback)(() => {
|
|
10359
10664
|
const { nodeObjects, tweenGroup, timelineIntervalsGroup } = stateRef.current;
|
|
10360
10665
|
if (!nodeObjects || !tweenGroup || !timelineIntervalsGroup) return;
|
|
10361
10666
|
while (timelineIntervalsGroup.children.length > 0) {
|
|
@@ -10508,7 +10813,7 @@ function XViewScene({
|
|
|
10508
10813
|
}
|
|
10509
10814
|
});
|
|
10510
10815
|
}, []);
|
|
10511
|
-
const handleVersionTimeline = (0,
|
|
10816
|
+
const handleVersionTimeline = (0, import_react26.useCallback)((sourceMesh, versionMeshes) => {
|
|
10512
10817
|
const { tweenGroup, timelineIntervalsGroup } = stateRef.current;
|
|
10513
10818
|
if (!tweenGroup || !timelineIntervalsGroup || versionMeshes.length === 0) return;
|
|
10514
10819
|
versionMeshes.forEach((mesh) => {
|
|
@@ -10631,7 +10936,7 @@ function XViewScene({
|
|
|
10631
10936
|
}
|
|
10632
10937
|
});
|
|
10633
10938
|
}, []);
|
|
10634
|
-
(0,
|
|
10939
|
+
(0, import_react26.useEffect)(() => {
|
|
10635
10940
|
async function fetchAllData(configPath, ownerId2) {
|
|
10636
10941
|
var _a2, _b2;
|
|
10637
10942
|
if (!get_scene_view_data) {
|
|
@@ -10703,12 +11008,12 @@ function XViewScene({
|
|
|
10703
11008
|
focusNodeId,
|
|
10704
11009
|
focusAncestryId
|
|
10705
11010
|
]);
|
|
10706
|
-
const isNodeInView = (0,
|
|
11011
|
+
const isNodeInView = (0, import_react26.useCallback)((id) => {
|
|
10707
11012
|
const key = String(id);
|
|
10708
11013
|
const objs = stateRef.current.nodeObjects || {};
|
|
10709
11014
|
return !!objs[key];
|
|
10710
11015
|
}, []);
|
|
10711
|
-
const addOrUpdateNodeMesh = (0,
|
|
11016
|
+
const addOrUpdateNodeMesh = (0, import_react26.useCallback)((nodeData, position, suppressVersionUpdate = false) => {
|
|
10712
11017
|
const { graphGroup, nodeObjects, clickableNodes, glowTexture, tweenGroup } = stateRef.current;
|
|
10713
11018
|
const nodeId = String(nodeData.id);
|
|
10714
11019
|
if (nodeObjects[nodeId]) {
|
|
@@ -10735,7 +11040,7 @@ function XViewScene({
|
|
|
10735
11040
|
}
|
|
10736
11041
|
return mesh;
|
|
10737
11042
|
}, []);
|
|
10738
|
-
(0,
|
|
11043
|
+
(0, import_react26.useEffect)(() => {
|
|
10739
11044
|
if (!isInitialized || !sceneDataRef.current) return;
|
|
10740
11045
|
const currentMount = mountRef.current;
|
|
10741
11046
|
if (!currentMount) return;
|
|
@@ -11345,7 +11650,7 @@ function XViewScene({
|
|
|
11345
11650
|
}
|
|
11346
11651
|
};
|
|
11347
11652
|
}, [isInitialized, tweenToTarget, dbSaveUrl, isNodeInView, addOrUpdateNodeMesh, handleActivateTimeline, get_scene_view_data, save_view_data]);
|
|
11348
|
-
const handleGhostNodeImageChange = (0,
|
|
11653
|
+
const handleGhostNodeImageChange = (0, import_react26.useCallback)((useImage, imageUrl) => {
|
|
11349
11654
|
const { node: ghostNode, line: ghostLine, aura: ghostAura } = stateRef.current.ghostElements;
|
|
11350
11655
|
const { graphGroup, glowTexture } = stateRef.current;
|
|
11351
11656
|
if (!ghostNode || !graphGroup) return;
|
|
@@ -11387,7 +11692,7 @@ function XViewScene({
|
|
|
11387
11692
|
aura: newGhostNode.getObjectByName("aura")
|
|
11388
11693
|
};
|
|
11389
11694
|
}, []);
|
|
11390
|
-
const handleGhostNodeIntensityChange = (0,
|
|
11695
|
+
const handleGhostNodeIntensityChange = (0, import_react26.useCallback)((newIntensity) => {
|
|
11391
11696
|
const { node: ghostNode, aura: ghostAura } = stateRef.current.ghostElements;
|
|
11392
11697
|
if (!ghostNode) return;
|
|
11393
11698
|
const adjustedIntensity = newIntensity + MIN_VISIBILITY_INTENSITY;
|
|
@@ -11408,7 +11713,7 @@ function XViewScene({
|
|
|
11408
11713
|
ghostAura.material.opacity = Math.min(0.8, newIntensity * 0.15);
|
|
11409
11714
|
}
|
|
11410
11715
|
}, []);
|
|
11411
|
-
const handleDetailNodeIntensityChange = (0,
|
|
11716
|
+
const handleDetailNodeIntensityChange = (0, import_react26.useCallback)((nodeId, newIntensity) => {
|
|
11412
11717
|
const mesh = stateRef.current.nodeObjects[String(nodeId)];
|
|
11413
11718
|
if (!mesh) return;
|
|
11414
11719
|
const adjustedIntensity = newIntensity + MIN_VISIBILITY_INTENSITY;
|
|
@@ -11554,7 +11859,7 @@ function XViewScene({
|
|
|
11554
11859
|
mountRef.current.style.cursor = "default";
|
|
11555
11860
|
}
|
|
11556
11861
|
};
|
|
11557
|
-
const handleAncestryTreeUpdate = (0,
|
|
11862
|
+
const handleAncestryTreeUpdate = (0, import_react26.useCallback)((newTree, extraData = null) => {
|
|
11558
11863
|
setAncestryMode((prev) => {
|
|
11559
11864
|
const prevTreeStr = JSON.stringify(prev.tree);
|
|
11560
11865
|
const newTreeStr = JSON.stringify(newTree);
|
|
@@ -11574,7 +11879,7 @@ function XViewScene({
|
|
|
11574
11879
|
};
|
|
11575
11880
|
});
|
|
11576
11881
|
}, []);
|
|
11577
|
-
const actionHandlerContext = (0,
|
|
11882
|
+
const actionHandlerContext = (0, import_react26.useMemo)(
|
|
11578
11883
|
() => {
|
|
11579
11884
|
var _a2;
|
|
11580
11885
|
return {
|
|
@@ -11635,7 +11940,7 @@ function XViewScene({
|
|
|
11635
11940
|
const handleStartVersioning = (nodeData) => {
|
|
11636
11941
|
userActionHandlers.handleStartVersioning(actionHandlerContext, nodeData);
|
|
11637
11942
|
};
|
|
11638
|
-
const handleCancelQuest = (0,
|
|
11943
|
+
const handleCancelQuest = (0, import_react26.useCallback)(() => {
|
|
11639
11944
|
const { graphGroup, ghostElements } = stateRef.current;
|
|
11640
11945
|
if (ghostElements.node && graphGroup) {
|
|
11641
11946
|
if (ghostElements.node.userData.labelObject) {
|
|
@@ -11745,7 +12050,7 @@ function XViewScene({
|
|
|
11745
12050
|
}
|
|
11746
12051
|
userActionHandlers.handleCancelConnection(context);
|
|
11747
12052
|
};
|
|
11748
|
-
const handleClearAncestryVisuals = (0,
|
|
12053
|
+
const handleClearAncestryVisuals = (0, import_react26.useCallback)((ancestryId) => {
|
|
11749
12054
|
const { renderedAncestries, ancestryGroup } = stateRef.current;
|
|
11750
12055
|
const renderIndex = renderedAncestries.findIndex((a) => String(a.id) === String(ancestryId));
|
|
11751
12056
|
if (renderIndex !== -1) {
|
|
@@ -11759,7 +12064,7 @@ function XViewScene({
|
|
|
11759
12064
|
stateRef.current.ancestryLinks = renderedAncestries.flatMap((a) => a.lines);
|
|
11760
12065
|
}
|
|
11761
12066
|
}, []);
|
|
11762
|
-
const handleRenderAncestry = (0,
|
|
12067
|
+
const handleRenderAncestry = (0, import_react26.useCallback)(
|
|
11763
12068
|
async (ancestryObject, allowedSectionIds = null, activeSectionIdForFocus = null, baseRotation = 0, forceReprocess = true) => {
|
|
11764
12069
|
setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
|
|
11765
12070
|
if (!ancestryObject || !ancestryObject.tree) {
|
|
@@ -12175,7 +12480,7 @@ function XViewScene({
|
|
|
12175
12480
|
},
|
|
12176
12481
|
[addOrUpdateNodeMesh, tweenToTarget, buildFullAncestryTree, readingMode.isActive, ancestryMode.isActive]
|
|
12177
12482
|
);
|
|
12178
|
-
const handleRenderAbstractionTree = (0,
|
|
12483
|
+
const handleRenderAbstractionTree = (0, import_react26.useCallback)((ancestryObject, targetNodeId = null) => {
|
|
12179
12484
|
setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
|
|
12180
12485
|
if (!ancestryObject || !ancestryObject.abstraction_tree) return;
|
|
12181
12486
|
const { ancestryGroup, nodeObjects, renderer, renderedAncestries } = stateRef.current;
|
|
@@ -12236,7 +12541,7 @@ function XViewScene({
|
|
|
12236
12541
|
stateRef.current.ancestryLinks = renderedAncestries.flatMap((a) => a.lines);
|
|
12237
12542
|
tweenToTarget(rootTargetPos, 0.7);
|
|
12238
12543
|
}, [addOrUpdateNodeMesh, tweenToTarget, buildFullAncestryTree, handleClearAncestryVisuals]);
|
|
12239
|
-
const handleReadModeBranchNav = (0,
|
|
12544
|
+
const handleReadModeBranchNav = (0, import_react26.useCallback)((nodeId, action, direction = "right") => {
|
|
12240
12545
|
const { ancestry, branchStack } = readingMode;
|
|
12241
12546
|
if (!ancestry || !ancestry.tree) return;
|
|
12242
12547
|
const allAncestries = ancestryDataRef.current || [];
|
|
@@ -12377,13 +12682,13 @@ function XViewScene({
|
|
|
12377
12682
|
}));
|
|
12378
12683
|
}
|
|
12379
12684
|
}, [readingMode, handleRenderAncestry, buildFullAncestryTree, tweenToTarget]);
|
|
12380
|
-
const handleReadModeHighlight = (0,
|
|
12685
|
+
const handleReadModeHighlight = (0, import_react26.useCallback)((nodeId) => {
|
|
12381
12686
|
if (stateRef.current.highlightedNodeId !== nodeId) {
|
|
12382
12687
|
stateRef.current.highlightedNodeId = nodeId;
|
|
12383
12688
|
}
|
|
12384
12689
|
setHighlightedNodeId(nodeId);
|
|
12385
12690
|
}, []);
|
|
12386
|
-
const activeNodeBranches = (0,
|
|
12691
|
+
const activeNodeBranches = (0, import_react26.useMemo)(() => {
|
|
12387
12692
|
if (!highlightedNodeId || !readingMode.ancestry || !readingMode.ancestry.tree) return null;
|
|
12388
12693
|
const fullTree = buildFullAncestryTree(
|
|
12389
12694
|
readingMode.ancestry.tree,
|
|
@@ -12420,7 +12725,7 @@ function XViewScene({
|
|
|
12420
12725
|
}
|
|
12421
12726
|
return null;
|
|
12422
12727
|
}, [highlightedNodeId, readingMode.ancestry, buildFullAncestryTree, readingMode.branchStack, ancestryDataRef.current]);
|
|
12423
|
-
const backNavigationInfo = (0,
|
|
12728
|
+
const backNavigationInfo = (0, import_react26.useMemo)(() => {
|
|
12424
12729
|
const { branchStack } = readingMode;
|
|
12425
12730
|
if (!branchStack || branchStack.length === 0) return null;
|
|
12426
12731
|
const lastStep = branchStack[branchStack.length - 1];
|
|
@@ -12431,7 +12736,7 @@ function XViewScene({
|
|
|
12431
12736
|
name: "Voltar para anterior"
|
|
12432
12737
|
};
|
|
12433
12738
|
}, [readingMode.branchStack]);
|
|
12434
|
-
const getReadModeDisplayContext = (0,
|
|
12739
|
+
const getReadModeDisplayContext = (0, import_react26.useMemo)(() => {
|
|
12435
12740
|
const { ancestry, branchStack } = readingMode;
|
|
12436
12741
|
if (!ancestry) return null;
|
|
12437
12742
|
if (branchStack.length === 0) {
|
|
@@ -12472,7 +12777,7 @@ function XViewScene({
|
|
|
12472
12777
|
customProperties: branchProps
|
|
12473
12778
|
};
|
|
12474
12779
|
}, [readingMode, buildFullAncestryTree, ancestryDataRef.current]);
|
|
12475
|
-
const readModeAbstractionTree = (0,
|
|
12780
|
+
const readModeAbstractionTree = (0, import_react26.useMemo)(() => {
|
|
12476
12781
|
if (!readingMode.isActive || !readingMode.ancestry || !readingMode.ancestry.abstraction_tree) {
|
|
12477
12782
|
return null;
|
|
12478
12783
|
}
|
|
@@ -12484,7 +12789,7 @@ function XViewScene({
|
|
|
12484
12789
|
allAncestries
|
|
12485
12790
|
);
|
|
12486
12791
|
}, [readingMode.isActive, readingMode.ancestry, buildFullAncestryTree, sceneVersion]);
|
|
12487
|
-
const handleStartReadingAncestry = (0,
|
|
12792
|
+
const handleStartReadingAncestry = (0, import_react26.useCallback)(
|
|
12488
12793
|
async (ancestryObject) => {
|
|
12489
12794
|
setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
|
|
12490
12795
|
if (!ancestryObject || !ancestryObject.tree) {
|
|
@@ -12519,7 +12824,7 @@ function XViewScene({
|
|
|
12519
12824
|
},
|
|
12520
12825
|
[handleRenderAncestry, handleRenderAbstractionTree]
|
|
12521
12826
|
);
|
|
12522
|
-
const handleReadModeSectionChange = (0,
|
|
12827
|
+
const handleReadModeSectionChange = (0, import_react26.useCallback)((activeSectionId) => {
|
|
12523
12828
|
const { ancestry, branchStack } = readingMode;
|
|
12524
12829
|
if (!ancestry || !readingMode.isActive) return;
|
|
12525
12830
|
let targetObj = ancestry;
|
|
@@ -12588,10 +12893,10 @@ function XViewScene({
|
|
|
12588
12893
|
}, 0);
|
|
12589
12894
|
handleRenderAncestry(renderPayload, allowedIds, focusTargetId, rotation);
|
|
12590
12895
|
}, [readingMode, handleRenderAncestry, buildFullAncestryTree, ancestryDataRef.current]);
|
|
12591
|
-
const handleCloseReadMode = (0,
|
|
12896
|
+
const handleCloseReadMode = (0, import_react26.useCallback)(() => {
|
|
12592
12897
|
setReadingMode({ isActive: false, ancestry: null, branchStack: [] });
|
|
12593
12898
|
}, []);
|
|
12594
|
-
const handleAncestrySectionChange = (0,
|
|
12899
|
+
const handleAncestrySectionChange = (0, import_react26.useCallback)((activeSectionId, ancestryOverride = null, rotation = 0) => {
|
|
12595
12900
|
var _a2, _b2;
|
|
12596
12901
|
const currentMode = stateRef.current.ancestry;
|
|
12597
12902
|
let targetObj = ancestryOverride;
|
|
@@ -12643,7 +12948,7 @@ function XViewScene({
|
|
|
12643
12948
|
const renderPayload = { ...targetObj, tree: treeToRender };
|
|
12644
12949
|
handleRenderAncestry(renderPayload, allowedIds, focusTargetId, rotation);
|
|
12645
12950
|
}, [handleRenderAncestry]);
|
|
12646
|
-
const handleEditAncestry = (0,
|
|
12951
|
+
const handleEditAncestry = (0, import_react26.useCallback)(
|
|
12647
12952
|
async (ancestryObject) => {
|
|
12648
12953
|
setContextMenu((prev) => prev.visible ? { ...prev, visible: false } : prev);
|
|
12649
12954
|
if (!ancestryObject || !ancestryObject.tree) {
|
|
@@ -12682,7 +12987,7 @@ function XViewScene({
|
|
|
12682
12987
|
const handleSelectAncestryParent = (nodeId) => {
|
|
12683
12988
|
setAncestryMode((prev) => ({ ...prev, selectedParentId: nodeId }));
|
|
12684
12989
|
};
|
|
12685
|
-
const handleRemoveFromAncestry = (0,
|
|
12990
|
+
const handleRemoveFromAncestry = (0, import_react26.useCallback)((pathToRemove) => {
|
|
12686
12991
|
if (!Array.isArray(pathToRemove) || pathToRemove.length === 0) {
|
|
12687
12992
|
console.warn("Tentativa de remover a raiz ou caminho inv\xE1lido.");
|
|
12688
12993
|
return;
|
|
@@ -12707,7 +13012,7 @@ function XViewScene({
|
|
|
12707
13012
|
return { ...prev, tree: newTree };
|
|
12708
13013
|
});
|
|
12709
13014
|
}, []);
|
|
12710
|
-
const handleSaveAncestry = (0,
|
|
13015
|
+
const handleSaveAncestry = (0, import_react26.useCallback)(
|
|
12711
13016
|
async (ancestryName, ancestryDescription, ancestrySections, keepOpen = false, treeOverride = null, ancestryCustomProps = {}) => {
|
|
12712
13017
|
const treeToUse = treeOverride || ancestryMode.tree;
|
|
12713
13018
|
const { isEditMode, currentAncestryId } = ancestryMode;
|
|
@@ -12911,7 +13216,7 @@ function XViewScene({
|
|
|
12911
13216
|
});
|
|
12912
13217
|
setEditingAncestryRel({ visible: false, data: null, path: null });
|
|
12913
13218
|
};
|
|
12914
|
-
const handleDeleteAncestry = (0,
|
|
13219
|
+
const handleDeleteAncestry = (0, import_react26.useCallback)(
|
|
12915
13220
|
async (ancestryIdToDelete) => {
|
|
12916
13221
|
if (!ancestryIdToDelete) {
|
|
12917
13222
|
alert("ID da ancestralidade n\xE3o encontrado.");
|
|
@@ -12973,20 +13278,20 @@ function XViewScene({
|
|
|
12973
13278
|
},
|
|
12974
13279
|
[save_view_data, delete_file_action]
|
|
12975
13280
|
);
|
|
12976
|
-
const handleOpenAncestryBoard = (0,
|
|
13281
|
+
const handleOpenAncestryBoard = (0, import_react26.useCallback)(() => {
|
|
12977
13282
|
setIsAncestryBoardOpen(true);
|
|
12978
13283
|
}, []);
|
|
12979
|
-
const handleSelectAncestryFromBoard = (0,
|
|
13284
|
+
const handleSelectAncestryFromBoard = (0, import_react26.useCallback)((ancestry) => {
|
|
12980
13285
|
setIsAncestryBoardOpen(false);
|
|
12981
13286
|
setIsSidebarOpen(false);
|
|
12982
13287
|
handleStartReadingAncestry(ancestry);
|
|
12983
13288
|
}, [handleStartReadingAncestry]);
|
|
12984
|
-
const handleSaveAncestryBoard = (0,
|
|
13289
|
+
const handleSaveAncestryBoard = (0, import_react26.useCallback)(async (groups) => {
|
|
12985
13290
|
if (!sceneConfigId || !viewParams || !session) return;
|
|
12986
13291
|
const sceneType = (viewParams.type || "").toLowerCase().includes("database") ? "database" : "view";
|
|
12987
13292
|
await save_ancestry_board_action(sceneConfigId, sceneType, groups, session, ownerId);
|
|
12988
13293
|
}, [sceneConfigId, viewParams, session, save_ancestry_board_action, ownerId]);
|
|
12989
|
-
const existingNodeTypes = (0,
|
|
13294
|
+
const existingNodeTypes = (0, import_react26.useMemo)(() => {
|
|
12990
13295
|
if (!parentDataRef.current) {
|
|
12991
13296
|
return [];
|
|
12992
13297
|
}
|
|
@@ -12996,7 +13301,7 @@ function XViewScene({
|
|
|
12996
13301
|
})).filter((t) => Boolean(t) && String(t).toLowerCase() !== "quest");
|
|
12997
13302
|
return [...new Set(allTypes)];
|
|
12998
13303
|
}, [parentDataRef.current, sceneVersion]);
|
|
12999
|
-
const searchableDbNodes = (0,
|
|
13304
|
+
const searchableDbNodes = (0, import_react26.useMemo)(() => {
|
|
13000
13305
|
if (!parentDataRef.current) {
|
|
13001
13306
|
return [];
|
|
13002
13307
|
}
|
|
@@ -13005,13 +13310,13 @@ function XViewScene({
|
|
|
13005
13310
|
return !((_a2 = node.version_node) == null ? void 0 : _a2.is_version);
|
|
13006
13311
|
});
|
|
13007
13312
|
}, [parentDataRef.current, sceneVersion]);
|
|
13008
|
-
const handleAddExistingNode = (0,
|
|
13313
|
+
const handleAddExistingNode = (0, import_react26.useCallback)(
|
|
13009
13314
|
(nodeId) => {
|
|
13010
13315
|
return userActionHandlers.handleAddExistingNodeById(actionHandlerContext, nodeId);
|
|
13011
13316
|
},
|
|
13012
13317
|
[actionHandlerContext]
|
|
13013
13318
|
);
|
|
13014
|
-
const handleSaveCurrentView = (0,
|
|
13319
|
+
const handleSaveCurrentView = (0, import_react26.useCallback)(async () => {
|
|
13015
13320
|
var _a2, _b2, _c2;
|
|
13016
13321
|
const { nodeObjects, allLinks } = stateRef.current;
|
|
13017
13322
|
if (!nodeObjects || !allLinks || !sceneSaveUrl || !parentDataRef.current) {
|
|
@@ -13050,14 +13355,14 @@ function XViewScene({
|
|
|
13050
13355
|
console.error("Erro na chamada de save_view_data:", error);
|
|
13051
13356
|
}
|
|
13052
13357
|
}, [sceneSaveUrl, save_view_data, sceneConfigId, viewParams == null ? void 0 : viewParams.type]);
|
|
13053
|
-
const allAvailableNodes = (0,
|
|
13358
|
+
const allAvailableNodes = (0, import_react26.useMemo)(() => {
|
|
13054
13359
|
if (!parentDataRef.current) return [];
|
|
13055
13360
|
return Object.values(parentDataRef.current).flatMap((fileData) => fileData.nodes || []);
|
|
13056
13361
|
}, [sceneVersion, isInitialized]);
|
|
13057
|
-
const allAvailableAncestries = (0,
|
|
13362
|
+
const allAvailableAncestries = (0, import_react26.useMemo)(() => {
|
|
13058
13363
|
return ancestryDataRef.current || [];
|
|
13059
13364
|
}, [sceneVersion, isInitialized]);
|
|
13060
|
-
const handleOpenReference = (0,
|
|
13365
|
+
const handleOpenReference = (0, import_react26.useCallback)((referenceData) => {
|
|
13061
13366
|
const { type, id } = referenceData;
|
|
13062
13367
|
if (type === "node") {
|
|
13063
13368
|
const targetNode = allAvailableNodes.find((n) => String(n.id) === String(id));
|
|
@@ -13084,17 +13389,17 @@ function XViewScene({
|
|
|
13084
13389
|
}
|
|
13085
13390
|
}
|
|
13086
13391
|
}, [allAvailableNodes, allAvailableAncestries, handleEditAncestry, tweenToTarget]);
|
|
13087
|
-
const handleToggleAncestryAddMode = (0,
|
|
13392
|
+
const handleToggleAncestryAddMode = (0, import_react26.useCallback)(() => {
|
|
13088
13393
|
setAncestryMode((prev) => ({ ...prev, isAddingNodes: !prev.isAddingNodes }));
|
|
13089
13394
|
}, []);
|
|
13090
|
-
const handleFocusNode = (0,
|
|
13395
|
+
const handleFocusNode = (0, import_react26.useCallback)((nodeData) => {
|
|
13091
13396
|
if (!nodeData) return;
|
|
13092
13397
|
const nodeMesh = stateRef.current.nodeObjects[String(nodeData.id)];
|
|
13093
13398
|
if (nodeMesh) {
|
|
13094
13399
|
tweenToTarget(nodeMesh, 1.2);
|
|
13095
13400
|
}
|
|
13096
13401
|
}, [tweenToTarget]);
|
|
13097
|
-
const availableDatasets = (0,
|
|
13402
|
+
const availableDatasets = (0, import_react26.useMemo)(() => {
|
|
13098
13403
|
if (!sceneDataRef.current || !parentDataRef.current) return [];
|
|
13099
13404
|
return sceneDataRef.current.parent_dbs.map((db) => {
|
|
13100
13405
|
var _a2;
|
|
@@ -13106,7 +13411,7 @@ function XViewScene({
|
|
|
13106
13411
|
}, [sceneVersion, isInitialized]);
|
|
13107
13412
|
const sourceNodeDatasetId = creationMode.sourceNodeData ? (_b = stateRef.current.nodeIdToParentFileMap.get(String(creationMode.sourceNodeData.id))) == null ? void 0 : _b.parentFileId : null;
|
|
13108
13413
|
const detailsNodeDatasetInfo = detailsNode ? stateRef.current.nodeIdToParentFileMap.get(String(detailsNode.id)) : null;
|
|
13109
|
-
(0,
|
|
13414
|
+
(0, import_react26.useEffect)(() => {
|
|
13110
13415
|
if (isInitialized && focusNodeId && !hasFocusedInitial) {
|
|
13111
13416
|
const nodeObjects = stateRef.current.nodeObjects || {};
|
|
13112
13417
|
const targetMesh = nodeObjects[String(focusNodeId)];
|
|
@@ -13120,7 +13425,7 @@ function XViewScene({
|
|
|
13120
13425
|
}
|
|
13121
13426
|
}
|
|
13122
13427
|
}, [isInitialized, sceneVersion, focusNodeId, hasFocusedInitial, tweenToTarget]);
|
|
13123
|
-
(0,
|
|
13428
|
+
(0, import_react26.useEffect)(() => {
|
|
13124
13429
|
if (isInitialized && focusAncestryId && !hasOpenedInitialAncestry) {
|
|
13125
13430
|
const ancestries = ancestryDataRef.current || [];
|
|
13126
13431
|
const targetAncestry = ancestries.find((a) => String(a.ancestry_id) === String(focusAncestryId));
|
|
@@ -13134,7 +13439,7 @@ function XViewScene({
|
|
|
13134
13439
|
}
|
|
13135
13440
|
}
|
|
13136
13441
|
}, [isInitialized, sceneVersion, focusAncestryId, hasOpenedInitialAncestry, handleStartReadingAncestry]);
|
|
13137
|
-
(0,
|
|
13442
|
+
(0, import_react26.useEffect)(() => {
|
|
13138
13443
|
function handleKeyDown(event) {
|
|
13139
13444
|
var _a2, _b2, _c2;
|
|
13140
13445
|
const context = actionHandlerContext;
|
|
@@ -13235,20 +13540,20 @@ function XViewScene({
|
|
|
13235
13540
|
// <-- handleCancelQuest adicionado aqui
|
|
13236
13541
|
]);
|
|
13237
13542
|
if (isLoading || status === "loading" || permissionStatus === "loading") {
|
|
13238
|
-
return /* @__PURE__ */
|
|
13543
|
+
return /* @__PURE__ */ import_react26.default.createElement(LoadingScreen, null);
|
|
13239
13544
|
}
|
|
13240
13545
|
if (permissionStatus === "denied") {
|
|
13241
|
-
return /* @__PURE__ */
|
|
13546
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", { className: "flex flex-col items-center justify-center min-h-screen w-full bg-slate-950 text-white" }, /* @__PURE__ */ import_react26.default.createElement("div", { className: "bg-slate-900/50 p-8 rounded-2xl border border-slate-800 shadow-2xl text-center max-w-md" }, /* @__PURE__ */ import_react26.default.createElement("div", { className: "mb-4 text-red-500" }, /* @__PURE__ */ import_react26.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-16 h-16 mx-auto" }, /* @__PURE__ */ import_react26.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z" }))), /* @__PURE__ */ import_react26.default.createElement("h2", { className: "text-2xl font-bold mb-2" }, "Acesso Negado"), /* @__PURE__ */ import_react26.default.createElement("p", { className: "text-slate-400 mb-6" }, "Voc\xEA n\xE3o tem permiss\xE3o para acessar este conte\xFAdo. Solicite acesso ao propriet\xE1rio ou verifique se est\xE1 na conta correta."), /* @__PURE__ */ import_react26.default.createElement(
|
|
13242
13547
|
"button",
|
|
13243
13548
|
{
|
|
13244
13549
|
onClick: () => router.push("/dashboard/scenes"),
|
|
13245
13550
|
className: "flex items-center justify-center gap-2 w-full py-3 px-4 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors font-medium"
|
|
13246
13551
|
},
|
|
13247
|
-
/* @__PURE__ */
|
|
13552
|
+
/* @__PURE__ */ import_react26.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", className: "w-5 h-5" }, /* @__PURE__ */ import_react26.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18" })),
|
|
13248
13553
|
"Voltar para Scenes"
|
|
13249
13554
|
)));
|
|
13250
13555
|
}
|
|
13251
|
-
return /* @__PURE__ */
|
|
13556
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
13252
13557
|
"div",
|
|
13253
13558
|
{
|
|
13254
13559
|
ref: mountRef,
|
|
@@ -13260,7 +13565,7 @@ function XViewScene({
|
|
|
13260
13565
|
cursor: stateRef.current.connection.isActive || stateRef.current.relink.isActive || ancestryMode.isActive ? "crosshair" : creationMode.isActive ? "default" : "grab"
|
|
13261
13566
|
}
|
|
13262
13567
|
},
|
|
13263
|
-
userPermissionRole !== "link_viewer" && /* @__PURE__ */
|
|
13568
|
+
userPermissionRole !== "link_viewer" && /* @__PURE__ */ import_react26.default.createElement(
|
|
13264
13569
|
XViewSidebar,
|
|
13265
13570
|
{
|
|
13266
13571
|
dbNodes: searchableDbNodes,
|
|
@@ -13280,7 +13585,7 @@ function XViewScene({
|
|
|
13280
13585
|
userRole: userPermissionRole
|
|
13281
13586
|
}
|
|
13282
13587
|
),
|
|
13283
|
-
creationMode.isActive && /* @__PURE__ */
|
|
13588
|
+
creationMode.isActive && /* @__PURE__ */ import_react26.default.createElement(
|
|
13284
13589
|
InSceneCreationForm,
|
|
13285
13590
|
{
|
|
13286
13591
|
onSave: (data) => userActionHandlers.handleSaveNode(actionHandlerContext, data),
|
|
@@ -13305,7 +13610,7 @@ function XViewScene({
|
|
|
13305
13610
|
availableAncestries: allAvailableAncestries
|
|
13306
13611
|
}
|
|
13307
13612
|
),
|
|
13308
|
-
versionMode.isActive && /* @__PURE__ */
|
|
13613
|
+
versionMode.isActive && /* @__PURE__ */ import_react26.default.createElement(
|
|
13309
13614
|
InSceneVersionForm,
|
|
13310
13615
|
{
|
|
13311
13616
|
onSave: (data) => userActionHandlers.handleSaveVersionNode(actionHandlerContext, data),
|
|
@@ -13324,7 +13629,7 @@ function XViewScene({
|
|
|
13324
13629
|
availableAncestries: allAvailableAncestries
|
|
13325
13630
|
}
|
|
13326
13631
|
),
|
|
13327
|
-
questMode.isActive && /* @__PURE__ */
|
|
13632
|
+
questMode.isActive && /* @__PURE__ */ import_react26.default.createElement(
|
|
13328
13633
|
InSceneQuestForm,
|
|
13329
13634
|
{
|
|
13330
13635
|
onSave: (data) => handleSaveQuestNode(actionHandlerContext, data),
|
|
@@ -13341,13 +13646,13 @@ function XViewScene({
|
|
|
13341
13646
|
availableAncestries: allAvailableAncestries
|
|
13342
13647
|
}
|
|
13343
13648
|
),
|
|
13344
|
-
readingMode.isActive && readingMode.ancestry && /* @__PURE__ */
|
|
13649
|
+
readingMode.isActive && readingMode.ancestry && /* @__PURE__ */ import_react26.default.createElement(
|
|
13345
13650
|
"div",
|
|
13346
13651
|
{
|
|
13347
13652
|
className: `ui-overlay absolute group rounded-2xl border border-white/10 bg-slate-950/70 backdrop-blur-xl shadow-[0_20px_80px_rgba(0,0,0,0.6)] ring-1 ring-white/10 text-white overflow-hidden flex flex-col ${isReadModeResizing ? "transition-none" : "transition-all duration-300 ease-out"}`,
|
|
13348
13653
|
style: { top: 16, right: 16, zIndex: 1100, maxHeight: "calc(100vh - 32px)", width: `${readModeWidth}px`, maxWidth: "92vw" }
|
|
13349
13654
|
},
|
|
13350
|
-
/* @__PURE__ */
|
|
13655
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
13351
13656
|
"div",
|
|
13352
13657
|
{
|
|
13353
13658
|
onPointerDown: (e) => {
|
|
@@ -13358,7 +13663,7 @@ function XViewScene({
|
|
|
13358
13663
|
title: "Arraste para redimensionar"
|
|
13359
13664
|
}
|
|
13360
13665
|
),
|
|
13361
|
-
/* @__PURE__ */
|
|
13666
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
13362
13667
|
DescriptionReadModePanel,
|
|
13363
13668
|
{
|
|
13364
13669
|
key: readingMode.branchStack.length > 0 ? readingMode.branchStack[readingMode.branchStack.length - 1].branchId : readingMode.ancestry.ancestry_id,
|
|
@@ -13393,7 +13698,7 @@ function XViewScene({
|
|
|
13393
13698
|
}
|
|
13394
13699
|
)
|
|
13395
13700
|
),
|
|
13396
|
-
ancestryMode.isActive && ancestryMode.tree && /* @__PURE__ */
|
|
13701
|
+
ancestryMode.isActive && ancestryMode.tree && /* @__PURE__ */ import_react26.default.createElement(
|
|
13397
13702
|
CreateAncestryPanel,
|
|
13398
13703
|
{
|
|
13399
13704
|
ancestryMode,
|
|
@@ -13420,7 +13725,7 @@ function XViewScene({
|
|
|
13420
13725
|
onRenderAbstractionTree: (data, targetId) => handleRenderAbstractionTree(data, targetId)
|
|
13421
13726
|
}
|
|
13422
13727
|
),
|
|
13423
|
-
editingAncestryRel.visible && /* @__PURE__ */
|
|
13728
|
+
editingAncestryRel.visible && /* @__PURE__ */ import_react26.default.createElement(
|
|
13424
13729
|
AncestryRelationshipPanel,
|
|
13425
13730
|
{
|
|
13426
13731
|
data: editingAncestryRel.data,
|
|
@@ -13434,7 +13739,28 @@ function XViewScene({
|
|
|
13434
13739
|
onUploadFile: upload_file_action
|
|
13435
13740
|
}
|
|
13436
13741
|
),
|
|
13437
|
-
detailsNode && /* @__PURE__ */
|
|
13742
|
+
detailsNode && detailsNode.is_quest && /* @__PURE__ */ import_react26.default.createElement(
|
|
13743
|
+
QuestDetailsPanel,
|
|
13744
|
+
{
|
|
13745
|
+
node: detailsNode,
|
|
13746
|
+
onClose: () => setDetailsNode(null),
|
|
13747
|
+
onSave: (data) => userActionHandlers.handleSaveNodeDetails(actionHandlerContext, data),
|
|
13748
|
+
onNameChange: handleDetailNodeNameChange,
|
|
13749
|
+
onColorChange: handleDetailNodeColorChange,
|
|
13750
|
+
onSizeChange: handleDetailNodeSizeChange,
|
|
13751
|
+
onDataUpdate: setDetailsNode,
|
|
13752
|
+
onOpenImageViewer: handleOpenImageViewer,
|
|
13753
|
+
existingTypes: existingNodeTypes,
|
|
13754
|
+
availableNodes: allAvailableNodes,
|
|
13755
|
+
availableAncestries: allAvailableAncestries,
|
|
13756
|
+
onOpenReference: handleOpenReference,
|
|
13757
|
+
onMentionClick: handleAddExistingNode,
|
|
13758
|
+
onUploadFile: upload_file_action,
|
|
13759
|
+
userRole: userPermissionRole,
|
|
13760
|
+
currentDatasetName: detailsNodeDatasetInfo == null ? void 0 : detailsNodeDatasetInfo.datasetName
|
|
13761
|
+
}
|
|
13762
|
+
),
|
|
13763
|
+
detailsNode && !detailsNode.is_quest && /* @__PURE__ */ import_react26.default.createElement(
|
|
13438
13764
|
NodeDetailsPanel,
|
|
13439
13765
|
{
|
|
13440
13766
|
node: detailsNode,
|
|
@@ -13461,7 +13787,7 @@ function XViewScene({
|
|
|
13461
13787
|
currentDatasetName: detailsNodeDatasetInfo == null ? void 0 : detailsNodeDatasetInfo.datasetName
|
|
13462
13788
|
}
|
|
13463
13789
|
),
|
|
13464
|
-
detailsLink && /* @__PURE__ */
|
|
13790
|
+
detailsLink && /* @__PURE__ */ import_react26.default.createElement(
|
|
13465
13791
|
RelationshipDetailsPanel,
|
|
13466
13792
|
{
|
|
13467
13793
|
link: detailsLink,
|
|
@@ -13475,7 +13801,7 @@ function XViewScene({
|
|
|
13475
13801
|
userRole: userPermissionRole
|
|
13476
13802
|
}
|
|
13477
13803
|
),
|
|
13478
|
-
ancestryLinkDetails && /* @__PURE__ */
|
|
13804
|
+
ancestryLinkDetails && /* @__PURE__ */ import_react26.default.createElement(
|
|
13479
13805
|
AncestryLinkDetailsPanel,
|
|
13480
13806
|
{
|
|
13481
13807
|
data: ancestryLinkDetails,
|
|
@@ -13486,7 +13812,7 @@ function XViewScene({
|
|
|
13486
13812
|
onUploadFile: upload_file_action
|
|
13487
13813
|
}
|
|
13488
13814
|
),
|
|
13489
|
-
/* @__PURE__ */
|
|
13815
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
13490
13816
|
"div",
|
|
13491
13817
|
{
|
|
13492
13818
|
ref: tooltipRef,
|
|
@@ -13513,7 +13839,7 @@ function XViewScene({
|
|
|
13513
13839
|
}
|
|
13514
13840
|
}
|
|
13515
13841
|
),
|
|
13516
|
-
/* @__PURE__ */
|
|
13842
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
13517
13843
|
ContextMenu,
|
|
13518
13844
|
{
|
|
13519
13845
|
data: contextMenu,
|
|
@@ -13536,7 +13862,7 @@ function XViewScene({
|
|
|
13536
13862
|
onFocusNode: handleFocusNode
|
|
13537
13863
|
}
|
|
13538
13864
|
),
|
|
13539
|
-
/* @__PURE__ */
|
|
13865
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
13540
13866
|
MultiNodeContextMenu,
|
|
13541
13867
|
{
|
|
13542
13868
|
data: multiContextMenu,
|
|
@@ -13547,7 +13873,7 @@ function XViewScene({
|
|
|
13547
13873
|
onDeleteNodes: (ids) => userActionHandlers.handleDeleteMultipleNodes(actionHandlerContext, ids)
|
|
13548
13874
|
}
|
|
13549
13875
|
),
|
|
13550
|
-
/* @__PURE__ */
|
|
13876
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
13551
13877
|
RelationshipContextMenu,
|
|
13552
13878
|
{
|
|
13553
13879
|
data: relationshipMenu,
|
|
@@ -13565,8 +13891,8 @@ function XViewScene({
|
|
|
13565
13891
|
onDelete: (data) => userActionHandlers.handleDeleteLink(actionHandlerContext, data)
|
|
13566
13892
|
}
|
|
13567
13893
|
),
|
|
13568
|
-
/* @__PURE__ */
|
|
13569
|
-
/* @__PURE__ */
|
|
13894
|
+
/* @__PURE__ */ import_react26.default.createElement(ImageViewer, { data: imageViewer, onClose: () => setImageViewer({ ...imageViewer, visible: false }) }),
|
|
13895
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
13570
13896
|
AncestryBoard,
|
|
13571
13897
|
{
|
|
13572
13898
|
isOpen: isAncestryBoardOpen,
|
|
@@ -13579,7 +13905,7 @@ function XViewScene({
|
|
|
13579
13905
|
userRole: userPermissionRole
|
|
13580
13906
|
}
|
|
13581
13907
|
),
|
|
13582
|
-
/* @__PURE__ */
|
|
13908
|
+
/* @__PURE__ */ import_react26.default.createElement(
|
|
13583
13909
|
ImportParentFileModal,
|
|
13584
13910
|
{
|
|
13585
13911
|
isOpen: isImportModalOpen,
|