@lv-x-software-house/x_view 1.2.4-dev.22 → 1.2.4-dev.24
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 +623 -282
- package/dist/index.mjs +563 -222
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/XViewScene.jsx
|
|
2
|
-
import
|
|
2
|
+
import React25, { useCallback as useCallback4, useEffect as useEffect22, useRef as useRef19, useState as useState25, useMemo as useMemo12 } from "react";
|
|
3
3
|
import { useRouter, useSearchParams } from "next/navigation";
|
|
4
4
|
import { useSession } from "next-auth/react";
|
|
5
5
|
import CryptoJS from "crypto-js";
|
|
@@ -2849,7 +2849,9 @@ var IGNORED_KEYS = [
|
|
|
2849
2849
|
"is_private",
|
|
2850
2850
|
"abstraction_tree",
|
|
2851
2851
|
"selectedAbstractionParentId",
|
|
2852
|
-
"isAddingAbstractionNodes"
|
|
2852
|
+
"isAddingAbstractionNodes",
|
|
2853
|
+
"status",
|
|
2854
|
+
"is_quest"
|
|
2853
2855
|
];
|
|
2854
2856
|
function extractCustomPropsFromNode(node) {
|
|
2855
2857
|
const customPropTypes = node._customPropTypes || {};
|
|
@@ -8641,8 +8643,326 @@ function NodeDetailsPanel({
|
|
|
8641
8643
|
));
|
|
8642
8644
|
}
|
|
8643
8645
|
|
|
8646
|
+
// src/components/QuestDetailsPanel.jsx
|
|
8647
|
+
import React17, { useState as useState18, useEffect as useEffect16, useRef as useRef14 } from "react";
|
|
8648
|
+
import { FiPlus as FiPlus7, FiX as FiX6, FiCheck as FiCheck11, FiEdit2 as FiEdit28, FiLoader as FiLoader3, FiBookOpen as FiBookOpen4, FiLink as FiLink6, FiTarget as FiTarget2, FiChevronDown as FiChevronDown6 } from "react-icons/fi";
|
|
8649
|
+
var QUEST_STATUS_COLORS2 = {
|
|
8650
|
+
"Backlog": "#64748b",
|
|
8651
|
+
"In Progress": "#eab308",
|
|
8652
|
+
"Review": "#a855f7",
|
|
8653
|
+
"Done": "#22c55e"
|
|
8654
|
+
};
|
|
8655
|
+
function QuestDetailsPanel({
|
|
8656
|
+
node,
|
|
8657
|
+
onClose,
|
|
8658
|
+
onSave,
|
|
8659
|
+
onNameChange,
|
|
8660
|
+
onColorChange,
|
|
8661
|
+
onSizeChange,
|
|
8662
|
+
onDataUpdate,
|
|
8663
|
+
onOpenImageViewer,
|
|
8664
|
+
existingTypes = [],
|
|
8665
|
+
availableNodes = [],
|
|
8666
|
+
availableAncestries = [],
|
|
8667
|
+
onOpenReference,
|
|
8668
|
+
onMentionClick,
|
|
8669
|
+
onUploadFile,
|
|
8670
|
+
userRole,
|
|
8671
|
+
currentDatasetName
|
|
8672
|
+
}) {
|
|
8673
|
+
const [name, setName] = useState18((node == null ? void 0 : node.name) ?? "");
|
|
8674
|
+
const [types, setTypes] = useState18((node == null ? void 0 : node.type) ? Array.isArray(node.type) ? node.type : [node.type] : ["quest"]);
|
|
8675
|
+
const [typeInput, setTypeInput] = useState18("");
|
|
8676
|
+
const [status, setStatus] = useState18((node == null ? void 0 : node.status) ?? "Backlog");
|
|
8677
|
+
const [size, setSize] = useState18((node == null ? void 0 : node.size) ?? "medium");
|
|
8678
|
+
const [description, setDescription] = useState18((node == null ? void 0 : node.description) ?? "");
|
|
8679
|
+
const [intensity, setIntensity] = useState18((node == null ? void 0 : node.intensity) !== void 0 ? node.intensity : 0);
|
|
8680
|
+
const [isStatusDropdownOpen, setIsStatusDropdownOpen] = useState18(false);
|
|
8681
|
+
const [customProps, setCustomProps] = useState18(() => extractCustomPropsFromNode(node || {}));
|
|
8682
|
+
const [showTypeSuggestions, setShowTypeSuggestions] = useState18(false);
|
|
8683
|
+
const [filteredTypes, setFilteredTypes] = useState18([]);
|
|
8684
|
+
const [isDescriptionModalOpen, setIsDescriptionModalOpen] = useState18(false);
|
|
8685
|
+
const [isReadMode, setIsReadMode] = useState18(false);
|
|
8686
|
+
const [existingSections, setExistingSections] = useState18((node == null ? void 0 : node.description_sections) || []);
|
|
8687
|
+
const [isSaving, setIsSaving] = useState18(false);
|
|
8688
|
+
const [isLinkCopied, setIsLinkCopied] = useState18(false);
|
|
8689
|
+
const maxPanelW = typeof window !== "undefined" ? window.innerWidth * 0.92 : 1200;
|
|
8690
|
+
const { width: panelWidth, isResizing, handlePointerDown: handleResize, setWidth } = useResizablePanel({
|
|
8691
|
+
initialWidth: isReadMode ? 700 : 440,
|
|
8692
|
+
minWidth: 320,
|
|
8693
|
+
maxWidth: maxPanelW
|
|
8694
|
+
});
|
|
8695
|
+
useEffect16(() => {
|
|
8696
|
+
setWidth(isReadMode ? 700 : 440);
|
|
8697
|
+
}, [isReadMode, setWidth]);
|
|
8698
|
+
const prevNodeIdRef = useRef14(null);
|
|
8699
|
+
const propsEndRef = useRef14(null);
|
|
8700
|
+
const canEdit = userRole !== "viewer";
|
|
8701
|
+
const availableImages = customProps.filter((p) => p.type === "images").flatMap((p) => Array.isArray(p.value) ? p.value : []).filter((img) => img.value && img.value.trim() !== "");
|
|
8702
|
+
const handleImageClickFromText = (url, name2) => {
|
|
8703
|
+
if (onOpenImageViewer) {
|
|
8704
|
+
onOpenImageViewer([{ name: name2 || "Imagem", value: url }], 0);
|
|
8705
|
+
}
|
|
8706
|
+
};
|
|
8707
|
+
useEffect16(() => {
|
|
8708
|
+
if ((node == null ? void 0 : node.id) !== prevNodeIdRef.current) {
|
|
8709
|
+
prevNodeIdRef.current = node == null ? void 0 : node.id;
|
|
8710
|
+
setName((node == null ? void 0 : node.name) ?? "");
|
|
8711
|
+
setTypes((node == null ? void 0 : node.type) ? Array.isArray(node.type) ? node.type : [node.type] : ["quest"]);
|
|
8712
|
+
setStatus((node == null ? void 0 : node.status) ?? "Backlog");
|
|
8713
|
+
setSize((node == null ? void 0 : node.size) ?? "medium");
|
|
8714
|
+
setDescription((node == null ? void 0 : node.description) ?? "");
|
|
8715
|
+
setIntensity((node == null ? void 0 : node.intensity) !== void 0 ? node.intensity : 0);
|
|
8716
|
+
setExistingSections((node == null ? void 0 : node.description_sections) || []);
|
|
8717
|
+
setCustomProps(extractCustomPropsFromNode(node || {}));
|
|
8718
|
+
}
|
|
8719
|
+
}, [node]);
|
|
8720
|
+
useEffect16(() => {
|
|
8721
|
+
if (typeInput.trim() === "") {
|
|
8722
|
+
setFilteredTypes(existingTypes.filter((t) => !types.includes(t)));
|
|
8723
|
+
} else {
|
|
8724
|
+
const lowercasedInput = typeInput.toLowerCase();
|
|
8725
|
+
setFilteredTypes(
|
|
8726
|
+
existingTypes.filter(
|
|
8727
|
+
(t) => t.toLowerCase().includes(lowercasedInput) && !types.includes(t)
|
|
8728
|
+
)
|
|
8729
|
+
);
|
|
8730
|
+
}
|
|
8731
|
+
}, [typeInput, existingTypes, types]);
|
|
8732
|
+
const handleCopyLink = () => {
|
|
8733
|
+
if (!(node == null ? void 0 : node.id)) return;
|
|
8734
|
+
const baseUrl = window.location.origin + window.location.pathname;
|
|
8735
|
+
const fullUrl = `${baseUrl}?focus=${node.id}`;
|
|
8736
|
+
navigator.clipboard.writeText(fullUrl).then(() => {
|
|
8737
|
+
setIsLinkCopied(true);
|
|
8738
|
+
setTimeout(() => setIsLinkCopied(false), 2e3);
|
|
8739
|
+
}).catch((err) => {
|
|
8740
|
+
console.error("Erro ao copiar link:", err);
|
|
8741
|
+
});
|
|
8742
|
+
};
|
|
8743
|
+
const swallow = (e) => e.stopPropagation();
|
|
8744
|
+
const handleNameChange = (e) => {
|
|
8745
|
+
const v = e.target.value;
|
|
8746
|
+
setName(v);
|
|
8747
|
+
onNameChange == null ? void 0 : onNameChange(node.id, v);
|
|
8748
|
+
};
|
|
8749
|
+
const handleSizeChange = (newSize) => {
|
|
8750
|
+
setSize(newSize);
|
|
8751
|
+
onSizeChange == null ? void 0 : onSizeChange(node.id, newSize);
|
|
8752
|
+
};
|
|
8753
|
+
const handleStatusChange = (newStatus) => {
|
|
8754
|
+
setStatus(newStatus);
|
|
8755
|
+
const newColor = QUEST_STATUS_COLORS2[newStatus];
|
|
8756
|
+
onColorChange == null ? void 0 : onColorChange(node.id, newColor);
|
|
8757
|
+
onDataUpdate == null ? void 0 : onDataUpdate({ ...node, status: newStatus, color: newColor });
|
|
8758
|
+
};
|
|
8759
|
+
const handleAddType = (newType) => {
|
|
8760
|
+
const trimmed = newType.trim();
|
|
8761
|
+
if (trimmed && !types.includes(trimmed)) {
|
|
8762
|
+
setTypes([...types, trimmed]);
|
|
8763
|
+
setTypeInput("");
|
|
8764
|
+
setShowTypeSuggestions(false);
|
|
8765
|
+
}
|
|
8766
|
+
};
|
|
8767
|
+
const handleRemoveType = (indexToRemove) => {
|
|
8768
|
+
if (types[indexToRemove] === "quest") return;
|
|
8769
|
+
setTypes(types.filter((_, index) => index !== indexToRemove));
|
|
8770
|
+
};
|
|
8771
|
+
const handleTypeInputKeyDown = (e) => {
|
|
8772
|
+
if (e.key === "Enter") {
|
|
8773
|
+
e.preventDefault();
|
|
8774
|
+
handleAddType(typeInput);
|
|
8775
|
+
} else if (e.key === "Backspace" && typeInput === "" && types.length > 1) {
|
|
8776
|
+
handleRemoveType(types.length - 1);
|
|
8777
|
+
}
|
|
8778
|
+
};
|
|
8779
|
+
const handleAddProp = () => {
|
|
8780
|
+
const newProp = createNewCustomProperty(customProps);
|
|
8781
|
+
setCustomProps((p) => [...p, newProp]);
|
|
8782
|
+
setTimeout(() => {
|
|
8783
|
+
var _a;
|
|
8784
|
+
(_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
8785
|
+
}, 100);
|
|
8786
|
+
};
|
|
8787
|
+
const handleRemoveProp = (i) => {
|
|
8788
|
+
const newProps = customProps.filter((_, idx) => idx !== i);
|
|
8789
|
+
setCustomProps(newProps);
|
|
8790
|
+
triggerAutoSave({ customProps: newProps });
|
|
8791
|
+
};
|
|
8792
|
+
const handleUpdateProp = (index, updatedProp) => {
|
|
8793
|
+
const newProps = [...customProps];
|
|
8794
|
+
newProps[index] = updatedProp;
|
|
8795
|
+
setCustomProps(newProps);
|
|
8796
|
+
if (!updatedProp.isEditing) {
|
|
8797
|
+
triggerAutoSave({ customProps: newProps });
|
|
8798
|
+
}
|
|
8799
|
+
};
|
|
8800
|
+
const handleSaveDescriptionInline = (newDescription) => {
|
|
8801
|
+
setDescription(newDescription);
|
|
8802
|
+
onDataUpdate({ ...node, description: newDescription });
|
|
8803
|
+
triggerAutoSave({ description: newDescription });
|
|
8804
|
+
};
|
|
8805
|
+
const handleSave = async (keepOpen = false, overrides = {}) => {
|
|
8806
|
+
const currentName = overrides.name !== void 0 ? overrides.name : name;
|
|
8807
|
+
const currentTypes = overrides.types !== void 0 ? overrides.types : types;
|
|
8808
|
+
const currentDescription = overrides.description !== void 0 ? overrides.description : description;
|
|
8809
|
+
const currentCustomProps = overrides.customProps !== void 0 ? overrides.customProps : customProps;
|
|
8810
|
+
const currentExistingSections = overrides.existingSections !== void 0 ? overrides.existingSections : existingSections;
|
|
8811
|
+
const currentStatus = overrides.status !== void 0 ? overrides.status : status;
|
|
8812
|
+
if (!currentName.trim() || currentTypes.length === 0) {
|
|
8813
|
+
alert("O campo 'Nome' e pelo menos um 'Tipo' s\xE3o obrigat\xF3rios.");
|
|
8814
|
+
return;
|
|
8815
|
+
}
|
|
8816
|
+
setIsSaving(true);
|
|
8817
|
+
try {
|
|
8818
|
+
const extrasObj = toObjectFromCustomProps(currentCustomProps.filter((p) => !p.isEditing));
|
|
8819
|
+
const processedSections = processDescriptionForSave(currentDescription, currentExistingSections);
|
|
8820
|
+
const dataToSave = {
|
|
8821
|
+
id: node.id,
|
|
8822
|
+
name: currentName.trim(),
|
|
8823
|
+
type: currentTypes,
|
|
8824
|
+
color: QUEST_STATUS_COLORS2[currentStatus],
|
|
8825
|
+
status: currentStatus,
|
|
8826
|
+
size,
|
|
8827
|
+
description: currentDescription,
|
|
8828
|
+
description_sections: processedSections,
|
|
8829
|
+
useImageAsTexture: false,
|
|
8830
|
+
textureImageUrl: null,
|
|
8831
|
+
intensity,
|
|
8832
|
+
is_quest: true,
|
|
8833
|
+
...extrasObj,
|
|
8834
|
+
version_node: node.version_node
|
|
8835
|
+
};
|
|
8836
|
+
await onSave(dataToSave, keepOpen);
|
|
8837
|
+
onDataUpdate(dataToSave);
|
|
8838
|
+
if (!keepOpen) {
|
|
8839
|
+
onClose();
|
|
8840
|
+
}
|
|
8841
|
+
} finally {
|
|
8842
|
+
setIsSaving(false);
|
|
8843
|
+
}
|
|
8844
|
+
};
|
|
8845
|
+
const triggerAutoSave = (overrides = {}) => {
|
|
8846
|
+
handleSave(true, overrides);
|
|
8847
|
+
};
|
|
8848
|
+
const handleCancel = () => {
|
|
8849
|
+
if (node) {
|
|
8850
|
+
onNameChange == null ? void 0 : onNameChange(node.id, node.name);
|
|
8851
|
+
onColorChange == null ? void 0 : onColorChange(node.id, node.color);
|
|
8852
|
+
onSizeChange == null ? void 0 : onSizeChange(node.id, node.size || "medium");
|
|
8853
|
+
}
|
|
8854
|
+
onClose();
|
|
8855
|
+
};
|
|
8856
|
+
const currentUsedTypes = customProps.map((p) => p.type).filter((t) => UNIQUE_PROP_TYPES.includes(t));
|
|
8857
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
8858
|
+
"div",
|
|
8859
|
+
{
|
|
8860
|
+
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"}`,
|
|
8861
|
+
style: { top: 16, right: 16, zIndex: 1100, maxHeight: "calc(100vh - 32px)", width: `${panelWidth}px`, maxWidth: "92vw" },
|
|
8862
|
+
onPointerDown: swallow,
|
|
8863
|
+
onPointerMove: swallow,
|
|
8864
|
+
onPointerUp: swallow,
|
|
8865
|
+
onClick: swallow,
|
|
8866
|
+
onWheel: swallow,
|
|
8867
|
+
onContextMenu: swallow,
|
|
8868
|
+
onDoubleClick: swallow
|
|
8869
|
+
},
|
|
8870
|
+
/* @__PURE__ */ React17.createElement("div", { onPointerDown: (e) => {
|
|
8871
|
+
e.stopPropagation();
|
|
8872
|
+
handleResize(e);
|
|
8873
|
+
}, 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" }),
|
|
8874
|
+
isReadMode ? /* @__PURE__ */ React17.createElement(
|
|
8875
|
+
DescriptionReadModePanel,
|
|
8876
|
+
{
|
|
8877
|
+
title: name || (node == null ? void 0 : node.name),
|
|
8878
|
+
description,
|
|
8879
|
+
savedSections: existingSections,
|
|
8880
|
+
onBack: () => setIsReadMode(false),
|
|
8881
|
+
onEdit: () => {
|
|
8882
|
+
if (canEdit) {
|
|
8883
|
+
setIsReadMode(false);
|
|
8884
|
+
setIsDescriptionModalOpen(true);
|
|
8885
|
+
}
|
|
8886
|
+
},
|
|
8887
|
+
onClose: handleCancel,
|
|
8888
|
+
availableNodes,
|
|
8889
|
+
availableAncestries,
|
|
8890
|
+
onOpenReference,
|
|
8891
|
+
onMentionClick,
|
|
8892
|
+
onImageClick: handleImageClickFromText,
|
|
8893
|
+
onSaveDescription: handleSaveDescriptionInline
|
|
8894
|
+
}
|
|
8895
|
+
) : /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("div", { className: "h-[2px]", style: { background: `linear-gradient(to right, transparent, ${QUEST_STATUS_COLORS2[status]}, transparent)` } }), /* @__PURE__ */ React17.createElement("div", { className: "px-6 pt-5 pb-3 flex items-start justify-between gap-4" }, /* @__PURE__ */ React17.createElement("div", null, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-2 mb-1" }, /* @__PURE__ */ React17.createElement(FiTarget2, { className: "text-sky-400", size: 14 }), /* @__PURE__ */ React17.createElement("p", { className: "text-xs/relaxed text-slate-300" }, "Detalhes da Quest"), /* @__PURE__ */ React17.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__ */ React17.createElement(FiCheck11, { size: 12 }) : /* @__PURE__ */ React17.createElement(FiLink6, { size: 12 }))), /* @__PURE__ */ React17.createElement("h2", { className: "text-xl sm:text-2xl font-semibold tracking-tight" }, name || (node == null ? void 0 : node.name))), /* @__PURE__ */ React17.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__ */ React17.createElement("div", { className: "px-6 pb-28 overflow-y-auto overscroll-contain space-y-4 max-h-[68vh] custom-scrollbar" }, /* @__PURE__ */ React17.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React17.createElement("label", { className: "text-xs text-slate-300" }, "Status da Quest"), /* @__PURE__ */ React17.createElement("div", { className: "relative" }, /* @__PURE__ */ React17.createElement(
|
|
8896
|
+
"button",
|
|
8897
|
+
{
|
|
8898
|
+
type: "button",
|
|
8899
|
+
onClick: () => canEdit && setIsStatusDropdownOpen(!isStatusDropdownOpen),
|
|
8900
|
+
disabled: !canEdit,
|
|
8901
|
+
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"}`
|
|
8902
|
+
},
|
|
8903
|
+
/* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React17.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__ */ React17.createElement("span", { className: "text-slate-200 font-medium" }, status)),
|
|
8904
|
+
canEdit && /* @__PURE__ */ React17.createElement(FiChevronDown6, { className: `text-slate-400 transition-transform duration-200 ${isStatusDropdownOpen ? "rotate-180" : ""}` })
|
|
8905
|
+
), isStatusDropdownOpen && canEdit && /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsStatusDropdownOpen(false) }), /* @__PURE__ */ React17.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__ */ React17.createElement(
|
|
8906
|
+
"li",
|
|
8907
|
+
{
|
|
8908
|
+
key: s,
|
|
8909
|
+
onClick: () => {
|
|
8910
|
+
handleStatusChange(s);
|
|
8911
|
+
setIsStatusDropdownOpen(false);
|
|
8912
|
+
},
|
|
8913
|
+
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"}`
|
|
8914
|
+
},
|
|
8915
|
+
/* @__PURE__ */ React17.createElement("span", { className: "w-3 h-3 rounded-full", style: { backgroundColor: QUEST_STATUS_COLORS2[s] } }),
|
|
8916
|
+
s
|
|
8917
|
+
)))))), /* @__PURE__ */ React17.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React17.createElement("label", { className: "text-xs text-slate-300" }, "Nome"), /* @__PURE__ */ React17.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__ */ React17.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React17.createElement("label", { className: "text-xs text-slate-300" }, "Tipos Adicionais"), /* @__PURE__ */ React17.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__ */ React17.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__ */ React17.createElement("button", { type: "button", onClick: () => handleRemoveType(index), className: "hover:text-white transition-colors" }, /* @__PURE__ */ React17.createElement(FiX6, { size: 12 })))), canEdit && /* @__PURE__ */ React17.createElement(
|
|
8918
|
+
"input",
|
|
8919
|
+
{
|
|
8920
|
+
type: "text",
|
|
8921
|
+
value: typeInput,
|
|
8922
|
+
onChange: (e) => {
|
|
8923
|
+
setTypeInput(e.target.value);
|
|
8924
|
+
setShowTypeSuggestions(true);
|
|
8925
|
+
},
|
|
8926
|
+
onKeyDown: handleTypeInputKeyDown,
|
|
8927
|
+
onClick: () => setShowTypeSuggestions(true),
|
|
8928
|
+
onBlur: () => {
|
|
8929
|
+
if (typeInput.trim()) {
|
|
8930
|
+
handleAddType(typeInput);
|
|
8931
|
+
}
|
|
8932
|
+
setTimeout(() => setShowTypeSuggestions(false), 150);
|
|
8933
|
+
},
|
|
8934
|
+
className: "flex-1 bg-transparent text-sm min-w-[80px] focus:outline-none text-slate-200",
|
|
8935
|
+
placeholder: "",
|
|
8936
|
+
autoComplete: "off"
|
|
8937
|
+
}
|
|
8938
|
+
), canEdit && showTypeSuggestions && filteredTypes.length > 0 && /* @__PURE__ */ React17.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__ */ React17.createElement("li", { key: index, className: "px-3 py-2 text-sm text-slate-200 cursor-pointer hover:bg-indigo-600/50", onMouseDown: (e) => {
|
|
8939
|
+
e.preventDefault();
|
|
8940
|
+
handleAddType(suggestedType);
|
|
8941
|
+
} }, suggestedType))))), /* @__PURE__ */ React17.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React17.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o"), /* @__PURE__ */ React17.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__ */ React17.createElement(DescriptionDisplay, { description, savedSections: existingSections, availableNodes, availableAncestries, onOpenReference, onMentionClick, onImageClick: handleImageClickFromText, onSaveDescription: handleSaveDescriptionInline }), /* @__PURE__ */ React17.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__ */ React17.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__ */ React17.createElement(FiBookOpen4, { size: 14 })), canEdit && /* @__PURE__ */ React17.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__ */ React17.createElement(FiEdit28, { size: 14 }))), canEdit && !description && /* @__PURE__ */ React17.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__ */ React17.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React17.createElement("label", { className: "text-xs text-slate-300" }, "Tamanho no Node (Size)"), /* @__PURE__ */ React17.createElement("div", { className: "flex items-center gap-5" }, ["small", "medium", "large"].map((s) => {
|
|
8942
|
+
const isSelected = size === s;
|
|
8943
|
+
return /* @__PURE__ */ React17.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__ */ React17.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__ */ React17.createElement(FiCheck11, { size: 12, className: "text-white" })), /* @__PURE__ */ React17.createElement("span", { className: `text-sm capitalize transition-colors ${isSelected ? "text-white font-medium" : "text-slate-400 " + (canEdit ? "group-hover:text-slate-300" : "")}` }, s));
|
|
8944
|
+
}))), /* @__PURE__ */ React17.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React17.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React17.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais"), canEdit && /* @__PURE__ */ React17.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__ */ React17.createElement(FiPlus7, { size: 14 }), " Adicionar")), /* @__PURE__ */ React17.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, idx) => /* @__PURE__ */ React17.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__ */ React17.createElement("div", { ref: propsEndRef }))), currentDatasetName && /* @__PURE__ */ React17.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__ */ React17.createElement("span", { className: "truncate text-right" }, /* @__PURE__ */ React17.createElement("span", { className: "text-slate-200 font-medium" }, currentDatasetName)))), /* @__PURE__ */ React17.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__ */ React17.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__ */ React17.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__ */ React17.createElement(FiLoader3, { className: "animate-spin" }), isSaving ? "Salvando..." : "Salvar Quest")))
|
|
8945
|
+
), isDescriptionModalOpen && canEdit && /* @__PURE__ */ React17.createElement(
|
|
8946
|
+
DescriptionEditModal,
|
|
8947
|
+
{
|
|
8948
|
+
isOpen: isDescriptionModalOpen,
|
|
8949
|
+
title: "Editar Descri\xE7\xE3o da Quest",
|
|
8950
|
+
initialValue: description,
|
|
8951
|
+
onSave: (newDescription) => {
|
|
8952
|
+
setDescription(newDescription);
|
|
8953
|
+
onDataUpdate((prev) => ({ ...prev, description: newDescription }));
|
|
8954
|
+
triggerAutoSave({ description: newDescription });
|
|
8955
|
+
},
|
|
8956
|
+
onClose: () => setIsDescriptionModalOpen(false),
|
|
8957
|
+
availableNodes,
|
|
8958
|
+
availableAncestries,
|
|
8959
|
+
availableImages
|
|
8960
|
+
}
|
|
8961
|
+
));
|
|
8962
|
+
}
|
|
8963
|
+
|
|
8644
8964
|
// src/components/MultiNodeContextMenu.jsx
|
|
8645
|
-
import
|
|
8965
|
+
import React18, { useLayoutEffect as useLayoutEffect3, useRef as useRef15, useState as useState19, useEffect as useEffect17 } from "react";
|
|
8646
8966
|
function MultiNodeContextMenu({
|
|
8647
8967
|
data,
|
|
8648
8968
|
userRole,
|
|
@@ -8651,9 +8971,9 @@ function MultiNodeContextMenu({
|
|
|
8651
8971
|
onDismissOtherNodes,
|
|
8652
8972
|
onDeleteNodes
|
|
8653
8973
|
}) {
|
|
8654
|
-
const menuRef =
|
|
8655
|
-
const [menuPos, setMenuPos] =
|
|
8656
|
-
const [isConfirmingDelete, setIsConfirmingDelete] =
|
|
8974
|
+
const menuRef = useRef15(null);
|
|
8975
|
+
const [menuPos, setMenuPos] = useState19({ left: 0, top: 0 });
|
|
8976
|
+
const [isConfirmingDelete, setIsConfirmingDelete] = useState19(false);
|
|
8657
8977
|
const ability = defineAbilityFor(userRole);
|
|
8658
8978
|
const canDelete = ability.can("delete", "Node");
|
|
8659
8979
|
useLayoutEffect3(() => {
|
|
@@ -8669,7 +8989,7 @@ function MultiNodeContextMenu({
|
|
|
8669
8989
|
if (top + h + 8 > vh) top = Math.max(8, vh - h - 8);
|
|
8670
8990
|
setMenuPos({ left, top });
|
|
8671
8991
|
}, [data]);
|
|
8672
|
-
|
|
8992
|
+
useEffect17(() => {
|
|
8673
8993
|
if (data.visible) {
|
|
8674
8994
|
setIsConfirmingDelete(false);
|
|
8675
8995
|
}
|
|
@@ -8684,7 +9004,7 @@ function MultiNodeContextMenu({
|
|
|
8684
9004
|
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";
|
|
8685
9005
|
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";
|
|
8686
9006
|
const nodeCount = data.nodeIds.size;
|
|
8687
|
-
return /* @__PURE__ */
|
|
9007
|
+
return /* @__PURE__ */ React18.createElement(
|
|
8688
9008
|
"div",
|
|
8689
9009
|
{
|
|
8690
9010
|
ref: menuRef,
|
|
@@ -8698,28 +9018,28 @@ function MultiNodeContextMenu({
|
|
|
8698
9018
|
onContextMenu: swallow,
|
|
8699
9019
|
onDoubleClick: swallow
|
|
8700
9020
|
},
|
|
8701
|
-
/* @__PURE__ */
|
|
8702
|
-
/* @__PURE__ */
|
|
9021
|
+
/* @__PURE__ */ React18.createElement("div", { className: "h-[2px] bg-gradient-to-r from-indigo-400/0 via-indigo-400/70 to-indigo-400/0" }),
|
|
9022
|
+
/* @__PURE__ */ React18.createElement("div", { className: "p-1.5" }, isConfirmingDelete ? /* @__PURE__ */ React18.createElement("div", { className: "flex flex-col gap-3 p-2" }, /* @__PURE__ */ React18.createElement("div", { className: "flex flex-col items-center text-center gap-2" }, /* @__PURE__ */ React18.createElement("div", { className: "w-10 h-10 rounded-full bg-red-500/20 flex items-center justify-center text-red-400 mb-1" }, /* @__PURE__ */ React18.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__ */ React18.createElement("polyline", { points: "3 6 5 6 21 6" }), /* @__PURE__ */ React18.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__ */ React18.createElement("p", { className: "text-sm text-slate-200" }, "Excluir ", /* @__PURE__ */ React18.createElement("strong", null, nodeCount, " Nodes"), "?"), /* @__PURE__ */ React18.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__ */ React18.createElement("div", { className: "flex gap-2 mt-1" }, /* @__PURE__ */ React18.createElement(
|
|
8703
9023
|
"button",
|
|
8704
9024
|
{
|
|
8705
9025
|
onClick: () => setIsConfirmingDelete(false),
|
|
8706
9026
|
className: "flex-1 px-2 py-2 text-xs font-medium bg-white/10 hover:bg-white/20 rounded-md text-white transition-colors"
|
|
8707
9027
|
},
|
|
8708
9028
|
"Cancelar"
|
|
8709
|
-
), /* @__PURE__ */
|
|
9029
|
+
), /* @__PURE__ */ React18.createElement(
|
|
8710
9030
|
"button",
|
|
8711
9031
|
{
|
|
8712
9032
|
onClick: () => onDeleteNodes(data.nodeIds),
|
|
8713
9033
|
className: "flex-1 px-2 py-2 text-xs font-medium bg-red-500 hover:bg-red-600 rounded-md text-white transition-colors"
|
|
8714
9034
|
},
|
|
8715
9035
|
"Excluir"
|
|
8716
|
-
))) : /* @__PURE__ */
|
|
9036
|
+
))) : /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement("div", { className: "flex items-center gap-2 px-2 pt-1 pb-2" }, /* @__PURE__ */ React18.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__ */ React18.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "A\xE7\xF5es em Grupo (", nodeCount, " Nodes)")), /* @__PURE__ */ React18.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React18.createElement("button", { onClick: () => onDismissNodes(data.nodeIds), className: baseButtonClass, title: "Remover da visualiza\xE7\xE3o" }, /* @__PURE__ */ React18.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__ */ React18.createElement("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }), /* @__PURE__ */ React18.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__ */ React18.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__ */ React18.createElement("line", { x1: "2", y1: "2", x2: "22", y2: "22" })), /* @__PURE__ */ React18.createElement("span", null, "Dismiss (", nodeCount, ")")), /* @__PURE__ */ React18.createElement("button", { onClick: () => onDismissOtherNodes(data.nodeIds), className: baseButtonClass, title: "Remover outros da visualiza\xE7\xE3o" }, /* @__PURE__ */ React18.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__ */ React18.createElement("circle", { cx: "12", cy: "12", r: "3" }), /* @__PURE__ */ React18.createElement("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }), /* @__PURE__ */ React18.createElement("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ React18.createElement("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }), /* @__PURE__ */ React18.createElement("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })), /* @__PURE__ */ React18.createElement("span", null, "Dismiss other nodes")), canDelete && /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ React18.createElement("button", { onClick: () => setIsConfirmingDelete(true), className: deleteButtonClass, title: "Excluir Nodes" }, /* @__PURE__ */ React18.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__ */ React18.createElement("polyline", { points: "3 6 5 6 21 6" }), /* @__PURE__ */ React18.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__ */ React18.createElement("line", { x1: "10", y1: "11", x2: "10", y2: "17" }), /* @__PURE__ */ React18.createElement("line", { x1: "14", y1: "11", x2: "14", y2: "17" })), /* @__PURE__ */ React18.createElement("span", null, "Excluir Nodes (", nodeCount, ")"))))))
|
|
8717
9037
|
);
|
|
8718
9038
|
}
|
|
8719
9039
|
|
|
8720
9040
|
// src/components/RelationshipDetailsPanel.jsx
|
|
8721
|
-
import
|
|
8722
|
-
import { FiPlus as
|
|
9041
|
+
import React19, { useState as useState20, useEffect as useEffect18, useRef as useRef16, useMemo as useMemo9 } from "react";
|
|
9042
|
+
import { FiPlus as FiPlus8, FiEdit2 as FiEdit29, FiLoader as FiLoader4, FiBookOpen as FiBookOpen5 } from "react-icons/fi";
|
|
8723
9043
|
function RelationshipDetailsPanel({
|
|
8724
9044
|
link,
|
|
8725
9045
|
onClose,
|
|
@@ -8733,19 +9053,19 @@ function RelationshipDetailsPanel({
|
|
|
8733
9053
|
onUploadFile,
|
|
8734
9054
|
userRole
|
|
8735
9055
|
}) {
|
|
8736
|
-
const [name, setName] =
|
|
8737
|
-
const [description, setDescription] =
|
|
8738
|
-
const [customProps, setCustomProps] =
|
|
8739
|
-
const [existingSections, setExistingSections] =
|
|
8740
|
-
const [isDescriptionModalOpen, setIsDescriptionModalOpen] =
|
|
8741
|
-
const [isSaving, setIsSaving] =
|
|
8742
|
-
const [isReadMode, setIsReadMode] =
|
|
8743
|
-
const propsEndRef =
|
|
9056
|
+
const [name, setName] = useState20((link == null ? void 0 : link.name) ?? "");
|
|
9057
|
+
const [description, setDescription] = useState20((link == null ? void 0 : link.description) ?? "");
|
|
9058
|
+
const [customProps, setCustomProps] = useState20(() => extractCustomPropsFromNode(link || {}));
|
|
9059
|
+
const [existingSections, setExistingSections] = useState20((link == null ? void 0 : link.description_sections) || []);
|
|
9060
|
+
const [isDescriptionModalOpen, setIsDescriptionModalOpen] = useState20(false);
|
|
9061
|
+
const [isSaving, setIsSaving] = useState20(false);
|
|
9062
|
+
const [isReadMode, setIsReadMode] = useState20(false);
|
|
9063
|
+
const propsEndRef = useRef16(null);
|
|
8744
9064
|
const canEdit = useMemo9(() => {
|
|
8745
9065
|
const ability = defineAbilityFor(userRole);
|
|
8746
9066
|
return ability.can("update", "Connection");
|
|
8747
9067
|
}, [userRole]);
|
|
8748
|
-
|
|
9068
|
+
useEffect18(() => {
|
|
8749
9069
|
setName((link == null ? void 0 : link.name) ?? "");
|
|
8750
9070
|
setDescription((link == null ? void 0 : link.description) ?? "");
|
|
8751
9071
|
setExistingSections((link == null ? void 0 : link.description_sections) || []);
|
|
@@ -8820,7 +9140,7 @@ function RelationshipDetailsPanel({
|
|
|
8820
9140
|
onOpenImageViewer([{ name: name2 || "Imagem", value: url }], 0);
|
|
8821
9141
|
}
|
|
8822
9142
|
};
|
|
8823
|
-
return /* @__PURE__ */
|
|
9143
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
|
|
8824
9144
|
"div",
|
|
8825
9145
|
{
|
|
8826
9146
|
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
|
|
@@ -8835,7 +9155,7 @@ function RelationshipDetailsPanel({
|
|
|
8835
9155
|
onContextMenu: swallow,
|
|
8836
9156
|
onDoubleClick: swallow
|
|
8837
9157
|
},
|
|
8838
|
-
isReadMode ? /* @__PURE__ */
|
|
9158
|
+
isReadMode ? /* @__PURE__ */ React19.createElement(
|
|
8839
9159
|
DescriptionReadModePanel,
|
|
8840
9160
|
{
|
|
8841
9161
|
title: name || "Rela\xE7\xE3o",
|
|
@@ -8856,7 +9176,7 @@ function RelationshipDetailsPanel({
|
|
|
8856
9176
|
onImageClick: handleImageClickFromText,
|
|
8857
9177
|
onSaveDescription: handleSaveDescriptionInline
|
|
8858
9178
|
}
|
|
8859
|
-
) : /* @__PURE__ */
|
|
9179
|
+
) : /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement("div", { className: "h-[2px] bg-gradient-to-r from-teal-400/0 via-teal-400/70 to-teal-400/0" }), /* @__PURE__ */ React19.createElement("div", { className: "px-6 pt-5 pb-3 flex items-start justify-between gap-4" }, /* @__PURE__ */ React19.createElement("div", null, /* @__PURE__ */ React19.createElement("div", { className: "flex items-center gap-2 mb-1" }, /* @__PURE__ */ React19.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__ */ React19.createElement("p", { className: "text-xs/relaxed text-slate-300" }, "Detalhes da Rela\xE7\xE3o")), /* @__PURE__ */ React19.createElement("h2", { className: "text-xl sm:text-2xl font-semibold tracking-tight" }, name || "Rela\xE7\xE3o")), /* @__PURE__ */ React19.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__ */ React19.createElement("div", { className: "px-6 pb-28 overflow-y-auto overscroll-contain space-y-4 max-h-[68vh] custom-scrollbar" }, /* @__PURE__ */ React19.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React19.createElement("label", { className: "text-xs text-slate-300" }, "Nome da Rela\xE7\xE3o (Opcional)"), /* @__PURE__ */ React19.createElement(
|
|
8860
9180
|
"input",
|
|
8861
9181
|
{
|
|
8862
9182
|
type: "text",
|
|
@@ -8868,7 +9188,7 @@ function RelationshipDetailsPanel({
|
|
|
8868
9188
|
${!canEdit ? "opacity-50 cursor-not-allowed" : ""}
|
|
8869
9189
|
`
|
|
8870
9190
|
}
|
|
8871
|
-
)), /* @__PURE__ */
|
|
9191
|
+
)), /* @__PURE__ */ React19.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React19.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o"), /* @__PURE__ */ React19.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__ */ React19.createElement(
|
|
8872
9192
|
DescriptionDisplay,
|
|
8873
9193
|
{
|
|
8874
9194
|
description,
|
|
@@ -8880,7 +9200,7 @@ function RelationshipDetailsPanel({
|
|
|
8880
9200
|
onImageClick: handleImageClickFromText,
|
|
8881
9201
|
onSaveDescription: handleSaveDescriptionInline
|
|
8882
9202
|
}
|
|
8883
|
-
), /* @__PURE__ */
|
|
9203
|
+
), /* @__PURE__ */ React19.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__ */ React19.createElement(
|
|
8884
9204
|
"button",
|
|
8885
9205
|
{
|
|
8886
9206
|
type: "button",
|
|
@@ -8888,8 +9208,8 @@ function RelationshipDetailsPanel({
|
|
|
8888
9208
|
className: "p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors border-r border-white/5",
|
|
8889
9209
|
title: "Modo de Leitura"
|
|
8890
9210
|
},
|
|
8891
|
-
/* @__PURE__ */
|
|
8892
|
-
), canEdit && /* @__PURE__ */
|
|
9211
|
+
/* @__PURE__ */ React19.createElement(FiBookOpen5, { size: 14 })
|
|
9212
|
+
), canEdit && /* @__PURE__ */ React19.createElement(
|
|
8893
9213
|
"button",
|
|
8894
9214
|
{
|
|
8895
9215
|
type: "button",
|
|
@@ -8897,15 +9217,15 @@ function RelationshipDetailsPanel({
|
|
|
8897
9217
|
className: "p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors",
|
|
8898
9218
|
title: "Editar descri\xE7\xE3o"
|
|
8899
9219
|
},
|
|
8900
|
-
/* @__PURE__ */
|
|
8901
|
-
)), !description && canEdit && /* @__PURE__ */
|
|
9220
|
+
/* @__PURE__ */ React19.createElement(FiEdit29, { size: 14 })
|
|
9221
|
+
)), !description && canEdit && /* @__PURE__ */ React19.createElement(
|
|
8902
9222
|
"div",
|
|
8903
9223
|
{
|
|
8904
9224
|
onClick: () => setIsDescriptionModalOpen(true),
|
|
8905
9225
|
className: "absolute inset-0 flex items-center justify-center text-xs text-slate-500 cursor-text"
|
|
8906
9226
|
},
|
|
8907
9227
|
"Adicionar descri\xE7\xE3o..."
|
|
8908
|
-
))), /* @__PURE__ */
|
|
9228
|
+
))), /* @__PURE__ */ React19.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React19.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React19.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais"), canEdit && /* @__PURE__ */ React19.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__ */ React19.createElement(FiPlus8, { size: 14 }), " Adicionar")), /* @__PURE__ */ React19.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, idx) => /* @__PURE__ */ React19.createElement(
|
|
8909
9229
|
CustomPropertyDisplay,
|
|
8910
9230
|
{
|
|
8911
9231
|
key: prop.id,
|
|
@@ -8917,7 +9237,7 @@ function RelationshipDetailsPanel({
|
|
|
8917
9237
|
onUploadFile,
|
|
8918
9238
|
disabled: !canEdit
|
|
8919
9239
|
}
|
|
8920
|
-
)), /* @__PURE__ */
|
|
9240
|
+
)), /* @__PURE__ */ React19.createElement("div", { ref: propsEndRef })))), /* @__PURE__ */ React19.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__ */ React19.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__ */ React19.createElement(
|
|
8921
9241
|
"button",
|
|
8922
9242
|
{
|
|
8923
9243
|
onClick: () => handleSave(false),
|
|
@@ -8926,10 +9246,10 @@ function RelationshipDetailsPanel({
|
|
|
8926
9246
|
${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"}
|
|
8927
9247
|
`
|
|
8928
9248
|
},
|
|
8929
|
-
isSaving && /* @__PURE__ */
|
|
9249
|
+
isSaving && /* @__PURE__ */ React19.createElement(FiLoader4, { className: "animate-spin" }),
|
|
8930
9250
|
isSaving ? "Salvando..." : "Salvar"
|
|
8931
9251
|
)))
|
|
8932
|
-
), isDescriptionModalOpen && /* @__PURE__ */
|
|
9252
|
+
), isDescriptionModalOpen && /* @__PURE__ */ React19.createElement(
|
|
8933
9253
|
DescriptionEditModal,
|
|
8934
9254
|
{
|
|
8935
9255
|
isOpen: isDescriptionModalOpen,
|
|
@@ -8950,7 +9270,7 @@ function RelationshipDetailsPanel({
|
|
|
8950
9270
|
}
|
|
8951
9271
|
|
|
8952
9272
|
// src/components/RelationshipContextMenu.jsx
|
|
8953
|
-
import
|
|
9273
|
+
import React20, { useLayoutEffect as useLayoutEffect4, useRef as useRef17, useState as useState21, useEffect as useEffect19, useMemo as useMemo10 } from "react";
|
|
8954
9274
|
function RelationshipContextMenu({
|
|
8955
9275
|
data,
|
|
8956
9276
|
userRole,
|
|
@@ -8960,9 +9280,9 @@ function RelationshipContextMenu({
|
|
|
8960
9280
|
onDelete,
|
|
8961
9281
|
onClose
|
|
8962
9282
|
}) {
|
|
8963
|
-
const menuRef =
|
|
8964
|
-
const [menuPos, setMenuPos] =
|
|
8965
|
-
const [isConfirmingDelete, setIsConfirmingDelete] =
|
|
9283
|
+
const menuRef = useRef17(null);
|
|
9284
|
+
const [menuPos, setMenuPos] = useState21({ left: 0, top: 0 });
|
|
9285
|
+
const [isConfirmingDelete, setIsConfirmingDelete] = useState21(false);
|
|
8966
9286
|
const ability = useMemo10(() => defineAbilityFor(userRole), [userRole]);
|
|
8967
9287
|
const sourceName = useMemo10(
|
|
8968
9288
|
() => {
|
|
@@ -8991,7 +9311,7 @@ function RelationshipContextMenu({
|
|
|
8991
9311
|
if (top + h + 8 > vh) top = Math.max(8, vh - h - 8);
|
|
8992
9312
|
setMenuPos({ left, top });
|
|
8993
9313
|
}, [data]);
|
|
8994
|
-
|
|
9314
|
+
useEffect19(() => {
|
|
8995
9315
|
if (data.visible) {
|
|
8996
9316
|
setIsConfirmingDelete(false);
|
|
8997
9317
|
}
|
|
@@ -9007,7 +9327,7 @@ function RelationshipContextMenu({
|
|
|
9007
9327
|
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";
|
|
9008
9328
|
const canUpdate = ability.can("update", "Connection");
|
|
9009
9329
|
const canDelete = ability.can("delete", "Connection");
|
|
9010
|
-
return /* @__PURE__ */
|
|
9330
|
+
return /* @__PURE__ */ React20.createElement(
|
|
9011
9331
|
"div",
|
|
9012
9332
|
{
|
|
9013
9333
|
ref: menuRef,
|
|
@@ -9021,29 +9341,29 @@ function RelationshipContextMenu({
|
|
|
9021
9341
|
onContextMenu: swallow,
|
|
9022
9342
|
onDoubleClick: swallow
|
|
9023
9343
|
},
|
|
9024
|
-
/* @__PURE__ */
|
|
9025
|
-
/* @__PURE__ */
|
|
9344
|
+
/* @__PURE__ */ React20.createElement("div", { className: "h-[2px] bg-gradient-to-r from-teal-400/0 via-teal-400/70 to-teal-400/0" }),
|
|
9345
|
+
/* @__PURE__ */ React20.createElement("div", { className: "p-1.5" }, isConfirmingDelete ? /* @__PURE__ */ React20.createElement("div", { className: "flex flex-col gap-3 p-2" }, /* @__PURE__ */ React20.createElement("div", { className: "flex flex-col items-center text-center gap-2" }, /* @__PURE__ */ React20.createElement("div", { className: "w-10 h-10 rounded-full bg-rose-500/20 flex items-center justify-center text-rose-400 mb-1" }, /* @__PURE__ */ React20.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__ */ React20.createElement("polyline", { points: "3 6 5 6 21 6" }), /* @__PURE__ */ React20.createElement("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), /* @__PURE__ */ React20.createElement("path", { d: "M10 11v6" }), /* @__PURE__ */ React20.createElement("path", { d: "M14 11v6" }), /* @__PURE__ */ React20.createElement("path", { d: "M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2" }))), /* @__PURE__ */ React20.createElement("p", { className: "text-sm text-slate-200" }, "Excluir rela\xE7\xE3o?"), /* @__PURE__ */ React20.createElement("p", { className: "text-[11px] text-slate-400 leading-tight break-words" }, "Desconectar ", /* @__PURE__ */ React20.createElement("strong", null, sourceName), " de ", /* @__PURE__ */ React20.createElement("strong", null, targetName), ".")), /* @__PURE__ */ React20.createElement("div", { className: "flex gap-2 mt-1" }, /* @__PURE__ */ React20.createElement(
|
|
9026
9346
|
"button",
|
|
9027
9347
|
{
|
|
9028
9348
|
onClick: () => setIsConfirmingDelete(false),
|
|
9029
9349
|
className: "flex-1 px-2 py-2 text-xs font-medium bg-white/10 hover:bg-white/20 rounded-md text-white transition-colors"
|
|
9030
9350
|
},
|
|
9031
9351
|
"Cancelar"
|
|
9032
|
-
), /* @__PURE__ */
|
|
9352
|
+
), /* @__PURE__ */ React20.createElement(
|
|
9033
9353
|
"button",
|
|
9034
9354
|
{
|
|
9035
9355
|
onClick: () => onDelete == null ? void 0 : onDelete(data.linkObject),
|
|
9036
9356
|
className: "flex-1 px-2 py-2 text-xs font-medium bg-rose-600 hover:bg-rose-500 rounded-md text-white transition-colors"
|
|
9037
9357
|
},
|
|
9038
9358
|
"Excluir"
|
|
9039
|
-
))) : /* @__PURE__ */
|
|
9359
|
+
))) : /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("div", { className: "flex items-center gap-2 px-2 pt-1 pb-2" }, /* @__PURE__ */ React20.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__ */ React20.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "Rela\xE7\xE3o")), /* @__PURE__ */ React20.createElement("div", { className: "flex flex-col gap-1" }, canUpdate && /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
9040
9360
|
"button",
|
|
9041
9361
|
{
|
|
9042
9362
|
onClick: () => onRelinkSource == null ? void 0 : onRelinkSource(data.linkObject),
|
|
9043
9363
|
className: baseButtonClass,
|
|
9044
9364
|
title: "Desconectar ponta ligada ao Source"
|
|
9045
9365
|
},
|
|
9046
|
-
/* @__PURE__ */
|
|
9366
|
+
/* @__PURE__ */ React20.createElement(
|
|
9047
9367
|
"svg",
|
|
9048
9368
|
{
|
|
9049
9369
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9056,18 +9376,18 @@ function RelationshipContextMenu({
|
|
|
9056
9376
|
strokeLinecap: "round",
|
|
9057
9377
|
strokeLinejoin: "round"
|
|
9058
9378
|
},
|
|
9059
|
-
/* @__PURE__ */
|
|
9060
|
-
/* @__PURE__ */
|
|
9379
|
+
/* @__PURE__ */ React20.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" }),
|
|
9380
|
+
/* @__PURE__ */ React20.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" })
|
|
9061
9381
|
),
|
|
9062
|
-
/* @__PURE__ */
|
|
9063
|
-
), /* @__PURE__ */
|
|
9382
|
+
/* @__PURE__ */ React20.createElement("span", null, "Desconectar Source (", sourceName, ")")
|
|
9383
|
+
), /* @__PURE__ */ React20.createElement(
|
|
9064
9384
|
"button",
|
|
9065
9385
|
{
|
|
9066
9386
|
onClick: () => onRelinkTarget == null ? void 0 : onRelinkTarget(data.linkObject),
|
|
9067
9387
|
className: baseButtonClass,
|
|
9068
9388
|
title: "Desconectar ponta ligada ao Target"
|
|
9069
9389
|
},
|
|
9070
|
-
/* @__PURE__ */
|
|
9390
|
+
/* @__PURE__ */ React20.createElement(
|
|
9071
9391
|
"svg",
|
|
9072
9392
|
{
|
|
9073
9393
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9080,21 +9400,21 @@ function RelationshipContextMenu({
|
|
|
9080
9400
|
strokeLinecap: "round",
|
|
9081
9401
|
strokeLinejoin: "round"
|
|
9082
9402
|
},
|
|
9083
|
-
/* @__PURE__ */
|
|
9084
|
-
/* @__PURE__ */
|
|
9085
|
-
/* @__PURE__ */
|
|
9086
|
-
/* @__PURE__ */
|
|
9087
|
-
/* @__PURE__ */
|
|
9403
|
+
/* @__PURE__ */ React20.createElement("polyline", { points: "16 3 21 3 21 8" }),
|
|
9404
|
+
/* @__PURE__ */ React20.createElement("line", { x1: "4", y1: "20", x2: "21", y2: "3" }),
|
|
9405
|
+
/* @__PURE__ */ React20.createElement("polyline", { points: "21 16 21 21 16 21" }),
|
|
9406
|
+
/* @__PURE__ */ React20.createElement("line", { x1: "15", y1: "15", x2: "21", y2: "21" }),
|
|
9407
|
+
/* @__PURE__ */ React20.createElement("line", { x1: "4", y1: "4", x2: "9", y2: "9" })
|
|
9088
9408
|
),
|
|
9089
|
-
/* @__PURE__ */
|
|
9090
|
-
), /* @__PURE__ */
|
|
9409
|
+
/* @__PURE__ */ React20.createElement("span", null, "Desconectar Target (", targetName, ")")
|
|
9410
|
+
), /* @__PURE__ */ React20.createElement("div", { className: "h-[1px] my-1 mx-1 bg-white/10" })), /* @__PURE__ */ React20.createElement(
|
|
9091
9411
|
"button",
|
|
9092
9412
|
{
|
|
9093
9413
|
onClick: () => onOpenDetails == null ? void 0 : onOpenDetails(data.linkObject),
|
|
9094
9414
|
className: baseButtonClass,
|
|
9095
9415
|
title: "Abrir detalhes da rela\xE7\xE3o"
|
|
9096
9416
|
},
|
|
9097
|
-
/* @__PURE__ */
|
|
9417
|
+
/* @__PURE__ */ React20.createElement(
|
|
9098
9418
|
"svg",
|
|
9099
9419
|
{
|
|
9100
9420
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9107,19 +9427,19 @@ function RelationshipContextMenu({
|
|
|
9107
9427
|
strokeLinecap: "round",
|
|
9108
9428
|
strokeLinejoin: "round"
|
|
9109
9429
|
},
|
|
9110
|
-
/* @__PURE__ */
|
|
9111
|
-
/* @__PURE__ */
|
|
9112
|
-
/* @__PURE__ */
|
|
9430
|
+
/* @__PURE__ */ React20.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
9431
|
+
/* @__PURE__ */ React20.createElement("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
9432
|
+
/* @__PURE__ */ React20.createElement("line", { x1: "12", y1: "8", x2: "12", y2: "8" })
|
|
9113
9433
|
),
|
|
9114
|
-
/* @__PURE__ */
|
|
9115
|
-
), canDelete && /* @__PURE__ */
|
|
9434
|
+
/* @__PURE__ */ React20.createElement("span", null, "Abrir Detalhes")
|
|
9435
|
+
), canDelete && /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("div", { className: "h-[1px] my-1 mx-1 bg-white/10" }), /* @__PURE__ */ React20.createElement(
|
|
9116
9436
|
"button",
|
|
9117
9437
|
{
|
|
9118
9438
|
onClick: () => setIsConfirmingDelete(true),
|
|
9119
9439
|
className: dangerButtonClass,
|
|
9120
9440
|
title: "Excluir esta conex\xE3o"
|
|
9121
9441
|
},
|
|
9122
|
-
/* @__PURE__ */
|
|
9442
|
+
/* @__PURE__ */ React20.createElement(
|
|
9123
9443
|
"svg",
|
|
9124
9444
|
{
|
|
9125
9445
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -9132,19 +9452,19 @@ function RelationshipContextMenu({
|
|
|
9132
9452
|
strokeLinecap: "round",
|
|
9133
9453
|
strokeLinejoin: "round"
|
|
9134
9454
|
},
|
|
9135
|
-
/* @__PURE__ */
|
|
9136
|
-
/* @__PURE__ */
|
|
9137
|
-
/* @__PURE__ */
|
|
9138
|
-
/* @__PURE__ */
|
|
9139
|
-
/* @__PURE__ */
|
|
9455
|
+
/* @__PURE__ */ React20.createElement("polyline", { points: "3 6 5 6 21 6" }),
|
|
9456
|
+
/* @__PURE__ */ React20.createElement("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }),
|
|
9457
|
+
/* @__PURE__ */ React20.createElement("path", { d: "M10 11v6" }),
|
|
9458
|
+
/* @__PURE__ */ React20.createElement("path", { d: "M14 11v6" }),
|
|
9459
|
+
/* @__PURE__ */ React20.createElement("path", { d: "M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2" })
|
|
9140
9460
|
),
|
|
9141
|
-
/* @__PURE__ */
|
|
9461
|
+
/* @__PURE__ */ React20.createElement("span", null, "Excluir conex\xE3o (", sourceName, " \u2192 ", targetName, ")")
|
|
9142
9462
|
)))))
|
|
9143
9463
|
);
|
|
9144
9464
|
}
|
|
9145
9465
|
|
|
9146
9466
|
// src/components/LoadingScreen.jsx
|
|
9147
|
-
import
|
|
9467
|
+
import React21 from "react";
|
|
9148
9468
|
var styles = {
|
|
9149
9469
|
loadingOverlay: {
|
|
9150
9470
|
position: "fixed",
|
|
@@ -9176,11 +9496,11 @@ var styles = {
|
|
|
9176
9496
|
`
|
|
9177
9497
|
};
|
|
9178
9498
|
function LoadingScreen() {
|
|
9179
|
-
return /* @__PURE__ */
|
|
9499
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement("style", null, styles.keyframes), /* @__PURE__ */ React21.createElement("div", { style: styles.loadingOverlay }, /* @__PURE__ */ React21.createElement("div", { style: styles.spinner })));
|
|
9180
9500
|
}
|
|
9181
9501
|
|
|
9182
9502
|
// src/components/ImportParentFileModal.jsx
|
|
9183
|
-
import
|
|
9503
|
+
import React22, { useEffect as useEffect20, useState as useState22 } from "react";
|
|
9184
9504
|
function ImportParentFileModal({
|
|
9185
9505
|
isOpen,
|
|
9186
9506
|
onClose,
|
|
@@ -9191,12 +9511,12 @@ function ImportParentFileModal({
|
|
|
9191
9511
|
onFetchAvailableFiles,
|
|
9192
9512
|
currentViewName
|
|
9193
9513
|
}) {
|
|
9194
|
-
const [activeTab, setActiveTab] =
|
|
9195
|
-
const [availableDbs, setAvailableDbs] =
|
|
9196
|
-
const [availableViews, setAvailableViews] =
|
|
9197
|
-
const [selectedItem, setSelectedItem] =
|
|
9198
|
-
const [isLoading, setIsLoading] =
|
|
9199
|
-
|
|
9514
|
+
const [activeTab, setActiveTab] = useState22("databases");
|
|
9515
|
+
const [availableDbs, setAvailableDbs] = useState22([]);
|
|
9516
|
+
const [availableViews, setAvailableViews] = useState22([]);
|
|
9517
|
+
const [selectedItem, setSelectedItem] = useState22(null);
|
|
9518
|
+
const [isLoading, setIsLoading] = useState22(false);
|
|
9519
|
+
useEffect20(() => {
|
|
9200
9520
|
if (isOpen && session && onFetchAvailableFiles) {
|
|
9201
9521
|
const fetchData = async () => {
|
|
9202
9522
|
setIsLoading(true);
|
|
@@ -9232,7 +9552,7 @@ function ImportParentFileModal({
|
|
|
9232
9552
|
fetchData();
|
|
9233
9553
|
}
|
|
9234
9554
|
}, [isOpen, session, parentDbs, onFetchAvailableFiles, currentViewName]);
|
|
9235
|
-
|
|
9555
|
+
useEffect20(() => {
|
|
9236
9556
|
setSelectedItem(null);
|
|
9237
9557
|
}, [activeTab]);
|
|
9238
9558
|
if (!isOpen) {
|
|
@@ -9261,13 +9581,13 @@ function ImportParentFileModal({
|
|
|
9261
9581
|
const swallow = (e) => e.stopPropagation();
|
|
9262
9582
|
const currentList = activeTab === "databases" ? availableDbs : availableViews;
|
|
9263
9583
|
const emptyMessage = activeTab === "databases" ? "Nenhum novo arquivo parent dispon\xEDvel." : "Nenhuma view dispon\xEDvel para importa\xE7\xE3o.";
|
|
9264
|
-
return /* @__PURE__ */
|
|
9584
|
+
return /* @__PURE__ */ React22.createElement(
|
|
9265
9585
|
"div",
|
|
9266
9586
|
{
|
|
9267
9587
|
className: "ui-overlay fixed inset-0 z-[1200] flex items-center justify-center bg-black/60 backdrop-blur-sm",
|
|
9268
9588
|
onClick: onClose
|
|
9269
9589
|
},
|
|
9270
|
-
/* @__PURE__ */
|
|
9590
|
+
/* @__PURE__ */ React22.createElement(
|
|
9271
9591
|
"div",
|
|
9272
9592
|
{
|
|
9273
9593
|
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]",
|
|
@@ -9279,14 +9599,14 @@ function ImportParentFileModal({
|
|
|
9279
9599
|
onContextMenu: swallow,
|
|
9280
9600
|
onDoubleClick: swallow
|
|
9281
9601
|
},
|
|
9282
|
-
/* @__PURE__ */
|
|
9602
|
+
/* @__PURE__ */ React22.createElement("div", { className: "flex items-center justify-between px-6 py-4 border-b border-white/10 flex-shrink-0" }, /* @__PURE__ */ React22.createElement("h2", { className: "text-lg font-semibold" }, "Importar"), /* @__PURE__ */ React22.createElement(
|
|
9283
9603
|
"button",
|
|
9284
9604
|
{
|
|
9285
9605
|
onClick: onClose,
|
|
9286
9606
|
className: "p-2 rounded-md text-slate-400 hover:text-white hover:bg-white/10 transition-colors",
|
|
9287
9607
|
title: "Fechar"
|
|
9288
9608
|
},
|
|
9289
|
-
/* @__PURE__ */
|
|
9609
|
+
/* @__PURE__ */ React22.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5", viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React22.createElement(
|
|
9290
9610
|
"path",
|
|
9291
9611
|
{
|
|
9292
9612
|
fillRule: "evenodd",
|
|
@@ -9295,14 +9615,14 @@ function ImportParentFileModal({
|
|
|
9295
9615
|
}
|
|
9296
9616
|
))
|
|
9297
9617
|
)),
|
|
9298
|
-
/* @__PURE__ */
|
|
9618
|
+
/* @__PURE__ */ React22.createElement("div", { className: "flex px-6 border-b border-white/10 bg-white/5 flex-shrink-0" }, /* @__PURE__ */ React22.createElement(
|
|
9299
9619
|
"button",
|
|
9300
9620
|
{
|
|
9301
9621
|
onClick: () => setActiveTab("databases"),
|
|
9302
9622
|
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"}`
|
|
9303
9623
|
},
|
|
9304
9624
|
"Arquivos Parent"
|
|
9305
|
-
), /* @__PURE__ */
|
|
9625
|
+
), /* @__PURE__ */ React22.createElement(
|
|
9306
9626
|
"button",
|
|
9307
9627
|
{
|
|
9308
9628
|
onClick: () => setActiveTab("views"),
|
|
@@ -9310,24 +9630,24 @@ function ImportParentFileModal({
|
|
|
9310
9630
|
},
|
|
9311
9631
|
"Views (Ancestralidades)"
|
|
9312
9632
|
)),
|
|
9313
|
-
/* @__PURE__ */
|
|
9633
|
+
/* @__PURE__ */ React22.createElement("div", { className: "p-6 overflow-y-auto custom-scrollbar flex-grow min-h-[200px]" }, isLoading ? /* @__PURE__ */ React22.createElement("div", { className: "flex items-center justify-center h-40" }, /* @__PURE__ */ React22.createElement("div", { className: "w-8 h-8 border-4 border-t-indigo-500 border-slate-700 rounded-full animate-spin" })) : /* @__PURE__ */ React22.createElement("div", { className: "space-y-2" }, currentList.length > 0 ? currentList.map((item) => /* @__PURE__ */ React22.createElement(
|
|
9314
9634
|
"div",
|
|
9315
9635
|
{
|
|
9316
9636
|
key: item.id,
|
|
9317
9637
|
onClick: () => setSelectedItem(item),
|
|
9318
9638
|
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"}`
|
|
9319
9639
|
},
|
|
9320
|
-
/* @__PURE__ */
|
|
9321
|
-
item.description && /* @__PURE__ */
|
|
9322
|
-
)) : /* @__PURE__ */
|
|
9323
|
-
/* @__PURE__ */
|
|
9640
|
+
/* @__PURE__ */ React22.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React22.createElement("span", { className: "font-medium text-slate-100" }, item.name), activeTab === "views" && /* @__PURE__ */ React22.createElement("span", { className: "text-[10px] px-1.5 py-0.5 rounded bg-black/30 text-indigo-300 border border-indigo-500/30" }, "VIEW")),
|
|
9641
|
+
item.description && /* @__PURE__ */ React22.createElement("p", { className: `text-xs ${(selectedItem == null ? void 0 : selectedItem.id) === item.id ? "text-indigo-200" : "text-slate-400"}` }, item.description)
|
|
9642
|
+
)) : /* @__PURE__ */ React22.createElement("p", { className: "text-slate-400 text-center py-10" }, emptyMessage))),
|
|
9643
|
+
/* @__PURE__ */ React22.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__ */ React22.createElement(
|
|
9324
9644
|
"button",
|
|
9325
9645
|
{
|
|
9326
9646
|
onClick: onClose,
|
|
9327
9647
|
className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm text-slate-300"
|
|
9328
9648
|
},
|
|
9329
9649
|
"Cancelar"
|
|
9330
|
-
), /* @__PURE__ */
|
|
9650
|
+
), /* @__PURE__ */ React22.createElement(
|
|
9331
9651
|
"button",
|
|
9332
9652
|
{
|
|
9333
9653
|
onClick: handleConfirm,
|
|
@@ -9341,8 +9661,8 @@ function ImportParentFileModal({
|
|
|
9341
9661
|
}
|
|
9342
9662
|
|
|
9343
9663
|
// src/components/AncestryLinkDetailsPanel.jsx
|
|
9344
|
-
import
|
|
9345
|
-
import { FiBookOpen as
|
|
9664
|
+
import React23, { useState as useState23 } from "react";
|
|
9665
|
+
import { FiBookOpen as FiBookOpen6 } from "react-icons/fi";
|
|
9346
9666
|
function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenReference, onMentionClick, onUploadFile }) {
|
|
9347
9667
|
var _a, _b, _c, _d;
|
|
9348
9668
|
const relationshipData = data.relationship || {};
|
|
@@ -9351,21 +9671,21 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
9351
9671
|
const customProps = extractCustomPropsFromNode(relationshipData);
|
|
9352
9672
|
const sourceName = ((_b = (_a = data.sourceNode) == null ? void 0 : _a.userData) == null ? void 0 : _b.name) || "Origem";
|
|
9353
9673
|
const targetName = ((_d = (_c = data.targetNode) == null ? void 0 : _c.userData) == null ? void 0 : _d.name) || "Destino";
|
|
9354
|
-
const [isReadMode, setIsReadMode] =
|
|
9674
|
+
const [isReadMode, setIsReadMode] = useState23(false);
|
|
9355
9675
|
const swallow = (e) => e.stopPropagation();
|
|
9356
9676
|
const handleImageClickFromText = (url, name) => {
|
|
9357
9677
|
if (onOpenImageViewer) {
|
|
9358
9678
|
onOpenImageViewer([{ name: name || "Imagem", value: url }], 0);
|
|
9359
9679
|
}
|
|
9360
9680
|
};
|
|
9361
|
-
return /* @__PURE__ */
|
|
9681
|
+
return /* @__PURE__ */ React23.createElement(
|
|
9362
9682
|
"div",
|
|
9363
9683
|
{
|
|
9364
9684
|
className: "ui-overlay fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[1200]",
|
|
9365
9685
|
onClick: onClose,
|
|
9366
9686
|
onPointerDown: swallow
|
|
9367
9687
|
},
|
|
9368
|
-
/* @__PURE__ */
|
|
9688
|
+
/* @__PURE__ */ React23.createElement(
|
|
9369
9689
|
"div",
|
|
9370
9690
|
{
|
|
9371
9691
|
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
|
|
@@ -9373,7 +9693,7 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
9373
9693
|
`,
|
|
9374
9694
|
onClick: swallow
|
|
9375
9695
|
},
|
|
9376
|
-
isReadMode ? /* @__PURE__ */
|
|
9696
|
+
isReadMode ? /* @__PURE__ */ React23.createElement(
|
|
9377
9697
|
DescriptionReadModePanel,
|
|
9378
9698
|
{
|
|
9379
9699
|
title: `${sourceName} \u2794 ${targetName}`,
|
|
@@ -9385,15 +9705,15 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
9385
9705
|
onMentionClick,
|
|
9386
9706
|
onImageClick: handleImageClickFromText
|
|
9387
9707
|
}
|
|
9388
|
-
) : /* @__PURE__ */
|
|
9708
|
+
) : /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("div", { className: "h-[2px] bg-gradient-to-r from-blue-500/0 via-blue-500/70 to-blue-500/0" }), /* @__PURE__ */ React23.createElement("div", { className: "px-6 pt-5 pb-3 flex items-start justify-between gap-4" }, /* @__PURE__ */ React23.createElement("div", null, /* @__PURE__ */ React23.createElement("div", { className: "flex items-center gap-2 mb-1" }, /* @__PURE__ */ React23.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__ */ React23.createElement("p", { className: "text-xs/relaxed text-slate-300" }, "Detalhes da Ancestralidade")), /* @__PURE__ */ React23.createElement("h2", { className: "text-lg font-semibold tracking-tight flex items-center gap-2" }, /* @__PURE__ */ React23.createElement("span", { className: "truncate max-w-[150px]" }, sourceName), /* @__PURE__ */ React23.createElement("span", { className: "text-slate-500 text-sm" }, "\u2794"), /* @__PURE__ */ React23.createElement("span", { className: "truncate max-w-[150px]" }, targetName))), /* @__PURE__ */ React23.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__ */ React23.createElement("div", { className: "px-6 pb-6 overflow-y-auto overscroll-contain space-y-4 custom-scrollbar" }, description && /* @__PURE__ */ React23.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React23.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React23.createElement("label", { className: "text-xs text-slate-300 font-medium" }, "Descri\xE7\xE3o"), /* @__PURE__ */ React23.createElement(
|
|
9389
9709
|
"button",
|
|
9390
9710
|
{
|
|
9391
9711
|
onClick: () => setIsReadMode(true),
|
|
9392
9712
|
className: "p-1 text-slate-400 hover:text-white transition-colors",
|
|
9393
9713
|
title: "Modo de Leitura"
|
|
9394
9714
|
},
|
|
9395
|
-
/* @__PURE__ */
|
|
9396
|
-
)), /* @__PURE__ */
|
|
9715
|
+
/* @__PURE__ */ React23.createElement(FiBookOpen6, { size: 14 })
|
|
9716
|
+
)), /* @__PURE__ */ React23.createElement("div", { className: "bg-slate-800/40 rounded-lg border border-white/10 p-1 relative group" }, /* @__PURE__ */ React23.createElement(
|
|
9397
9717
|
DescriptionDisplay,
|
|
9398
9718
|
{
|
|
9399
9719
|
description,
|
|
@@ -9402,7 +9722,7 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
9402
9722
|
onMentionClick,
|
|
9403
9723
|
onImageClick: handleImageClickFromText
|
|
9404
9724
|
}
|
|
9405
|
-
))), customProps.length > 0 && /* @__PURE__ */
|
|
9725
|
+
))), customProps.length > 0 && /* @__PURE__ */ React23.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React23.createElement("label", { className: "text-xs text-slate-300 font-medium mb-2 block" }, "Propriedades"), /* @__PURE__ */ React23.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop) => /* @__PURE__ */ React23.createElement(
|
|
9406
9726
|
CustomPropertyDisplay,
|
|
9407
9727
|
{
|
|
9408
9728
|
key: prop.id,
|
|
@@ -9411,25 +9731,25 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
9411
9731
|
onOpenImageViewer,
|
|
9412
9732
|
onUploadFile
|
|
9413
9733
|
}
|
|
9414
|
-
)))), !description && customProps.length === 0 && /* @__PURE__ */
|
|
9734
|
+
)))), !description && customProps.length === 0 && /* @__PURE__ */ React23.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__ */ React23.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".')))
|
|
9415
9735
|
)
|
|
9416
9736
|
);
|
|
9417
9737
|
}
|
|
9418
9738
|
|
|
9419
9739
|
// src/components/AncestryBoard.jsx
|
|
9420
|
-
import
|
|
9740
|
+
import React24, { useState as useState24, useMemo as useMemo11, useEffect as useEffect21, useRef as useRef18 } from "react";
|
|
9421
9741
|
import {
|
|
9422
9742
|
FiSearch as FiSearch4,
|
|
9423
9743
|
FiLayers as FiLayers6,
|
|
9424
9744
|
FiCornerUpRight as FiCornerUpRight4,
|
|
9425
9745
|
FiPlay,
|
|
9426
|
-
FiPlus as
|
|
9746
|
+
FiPlus as FiPlus9,
|
|
9427
9747
|
FiTrash2 as FiTrash23,
|
|
9428
9748
|
FiArrowLeft as FiArrowLeft3,
|
|
9429
9749
|
FiArrowRight,
|
|
9430
9750
|
FiCheckCircle,
|
|
9431
|
-
FiLoader as
|
|
9432
|
-
FiX as
|
|
9751
|
+
FiLoader as FiLoader5,
|
|
9752
|
+
FiX as FiX7,
|
|
9433
9753
|
FiAlertTriangle
|
|
9434
9754
|
} from "react-icons/fi";
|
|
9435
9755
|
var GroupItem = ({
|
|
@@ -9451,7 +9771,7 @@ var GroupItem = ({
|
|
|
9451
9771
|
}) => {
|
|
9452
9772
|
const canIndent = index > 0;
|
|
9453
9773
|
const isPickingForThisGroup = pickingGroupId === group.id;
|
|
9454
|
-
const textareaRef =
|
|
9774
|
+
const textareaRef = useRef18(null);
|
|
9455
9775
|
const adjustHeight = () => {
|
|
9456
9776
|
const textarea = textareaRef.current;
|
|
9457
9777
|
if (textarea) {
|
|
@@ -9459,13 +9779,13 @@ var GroupItem = ({
|
|
|
9459
9779
|
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
9460
9780
|
}
|
|
9461
9781
|
};
|
|
9462
|
-
|
|
9782
|
+
useEffect21(() => {
|
|
9463
9783
|
adjustHeight();
|
|
9464
9784
|
}, [group.text]);
|
|
9465
|
-
return /* @__PURE__ */
|
|
9785
|
+
return /* @__PURE__ */ React24.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__ */ React24.createElement("div", { className: "absolute -left-[1px] top-4 w-2 h-px bg-white/20" }), /* @__PURE__ */ React24.createElement("div", { className: `
|
|
9466
9786
|
flex flex-col gap-2 py-2 px-3 transition-all duration-200
|
|
9467
9787
|
${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__ */
|
|
9788
|
+
` }, /* @__PURE__ */ React24.createElement(
|
|
9469
9789
|
"textarea",
|
|
9470
9790
|
{
|
|
9471
9791
|
ref: textareaRef,
|
|
@@ -9482,9 +9802,9 @@ var GroupItem = ({
|
|
|
9482
9802
|
if (canEdit) onUpdate(group.id, { ...group, text: e.target.value });
|
|
9483
9803
|
}
|
|
9484
9804
|
}
|
|
9485
|
-
), group.ancestries && group.ancestries.length > 0 && /* @__PURE__ */
|
|
9805
|
+
), group.ancestries && group.ancestries.length > 0 && /* @__PURE__ */ React24.createElement("div", { className: "flex flex-wrap gap-2 mt-1" }, group.ancestries.map((anc) => {
|
|
9486
9806
|
const isValid = availableIds.has(String(anc.ancestry_id));
|
|
9487
|
-
return /* @__PURE__ */
|
|
9807
|
+
return /* @__PURE__ */ React24.createElement(
|
|
9488
9808
|
"div",
|
|
9489
9809
|
{
|
|
9490
9810
|
key: anc.ancestry_id,
|
|
@@ -9496,28 +9816,28 @@ var GroupItem = ({
|
|
|
9496
9816
|
},
|
|
9497
9817
|
isValid ? (
|
|
9498
9818
|
// [MANTIDO] Botão Play visível para todos
|
|
9499
|
-
/* @__PURE__ */
|
|
9819
|
+
/* @__PURE__ */ React24.createElement(
|
|
9500
9820
|
"button",
|
|
9501
9821
|
{
|
|
9502
9822
|
onClick: () => onPlayAncestry(anc.ancestry_id),
|
|
9503
9823
|
className: "text-indigo-400 hover:text-white hover:bg-indigo-500 p-1 rounded-full transition-colors",
|
|
9504
9824
|
title: "Renderizar no cen\xE1rio"
|
|
9505
9825
|
},
|
|
9506
|
-
/* @__PURE__ */
|
|
9826
|
+
/* @__PURE__ */ React24.createElement(FiPlay, { size: 10, className: "ml-0.5 fill-current" })
|
|
9507
9827
|
)
|
|
9508
|
-
) : /* @__PURE__ */
|
|
9509
|
-
/* @__PURE__ */
|
|
9510
|
-
canEdit && /* @__PURE__ */
|
|
9828
|
+
) : /* @__PURE__ */ React24.createElement("div", { className: "p-1 text-red-500 cursor-not-allowed" }, /* @__PURE__ */ React24.createElement(FiAlertTriangle, { size: 10 })),
|
|
9829
|
+
/* @__PURE__ */ React24.createElement("span", { className: `font-medium truncate max-w-[150px] ${!isValid && "line-through decoration-red-500/50"}` }, anc.name),
|
|
9830
|
+
canEdit && /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", { className: `w-px h-3 mx-0.5 ${isValid ? "bg-white/10" : "bg-red-500/20"}` }), /* @__PURE__ */ React24.createElement(
|
|
9511
9831
|
"button",
|
|
9512
9832
|
{
|
|
9513
9833
|
onClick: () => onRemoveAncestry(group.id, anc.ancestry_id),
|
|
9514
9834
|
className: `${isValid ? "text-slate-500 hover:text-red-400" : "text-red-400 hover:text-red-200"} p-0.5 rounded transition-colors`,
|
|
9515
9835
|
title: "Remover men\xE7\xE3o"
|
|
9516
9836
|
},
|
|
9517
|
-
/* @__PURE__ */
|
|
9837
|
+
/* @__PURE__ */ React24.createElement(FiX7, { size: 12 })
|
|
9518
9838
|
))
|
|
9519
9839
|
);
|
|
9520
|
-
})), canEdit && /* @__PURE__ */
|
|
9840
|
+
})), canEdit && /* @__PURE__ */ React24.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__ */ React24.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React24.createElement(
|
|
9521
9841
|
"button",
|
|
9522
9842
|
{
|
|
9523
9843
|
onClick: () => onRequestPickAncestry(group.id),
|
|
@@ -9527,17 +9847,17 @@ var GroupItem = ({
|
|
|
9527
9847
|
`,
|
|
9528
9848
|
title: "Adicionar Ancestralidade a este grupo"
|
|
9529
9849
|
},
|
|
9530
|
-
isPickingForThisGroup ? /* @__PURE__ */
|
|
9850
|
+
isPickingForThisGroup ? /* @__PURE__ */ React24.createElement(FiCheckCircle, { size: 12 }) : /* @__PURE__ */ React24.createElement(FiSearch4, { size: 12 }),
|
|
9531
9851
|
isPickingForThisGroup ? "Selecionando..." : "Adicionar"
|
|
9532
|
-
), /* @__PURE__ */
|
|
9852
|
+
), /* @__PURE__ */ React24.createElement(
|
|
9533
9853
|
"button",
|
|
9534
9854
|
{
|
|
9535
9855
|
onClick: () => onAddSubgroup(group.id),
|
|
9536
9856
|
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
9537
9857
|
title: "Criar Subgrupo"
|
|
9538
9858
|
},
|
|
9539
|
-
/* @__PURE__ */
|
|
9540
|
-
)), /* @__PURE__ */
|
|
9859
|
+
/* @__PURE__ */ React24.createElement(FiPlus9, { size: 14 })
|
|
9860
|
+
)), /* @__PURE__ */ React24.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React24.createElement(
|
|
9541
9861
|
"button",
|
|
9542
9862
|
{
|
|
9543
9863
|
onClick: () => onIndent(group.id),
|
|
@@ -9545,24 +9865,24 @@ var GroupItem = ({
|
|
|
9545
9865
|
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
9866
|
title: "Aninhar no grupo acima"
|
|
9547
9867
|
},
|
|
9548
|
-
/* @__PURE__ */
|
|
9549
|
-
), /* @__PURE__ */
|
|
9868
|
+
/* @__PURE__ */ React24.createElement(FiArrowRight, { size: 14 })
|
|
9869
|
+
), /* @__PURE__ */ React24.createElement(
|
|
9550
9870
|
"button",
|
|
9551
9871
|
{
|
|
9552
9872
|
onClick: () => onOutdent(group.id),
|
|
9553
9873
|
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
9554
9874
|
title: "Desaninhar"
|
|
9555
9875
|
},
|
|
9556
|
-
/* @__PURE__ */
|
|
9557
|
-
), /* @__PURE__ */
|
|
9876
|
+
/* @__PURE__ */ React24.createElement(FiArrowLeft3, { size: 14 })
|
|
9877
|
+
), /* @__PURE__ */ React24.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ React24.createElement(
|
|
9558
9878
|
"button",
|
|
9559
9879
|
{
|
|
9560
9880
|
onClick: () => onDelete(group.id),
|
|
9561
9881
|
className: "p-1.5 text-slate-600 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
9562
9882
|
title: "Remover Grupo"
|
|
9563
9883
|
},
|
|
9564
|
-
/* @__PURE__ */
|
|
9565
|
-
)))), group.children && group.children.length > 0 && /* @__PURE__ */
|
|
9884
|
+
/* @__PURE__ */ React24.createElement(FiTrash23, { size: 14 })
|
|
9885
|
+
)))), group.children && group.children.length > 0 && /* @__PURE__ */ React24.createElement("div", { className: "ml-2" }, group.children.map((childGroup, idx) => /* @__PURE__ */ React24.createElement(
|
|
9566
9886
|
GroupItem,
|
|
9567
9887
|
{
|
|
9568
9888
|
key: childGroup.id,
|
|
@@ -9594,15 +9914,15 @@ function AncestryBoard({
|
|
|
9594
9914
|
userRole
|
|
9595
9915
|
// [NOVO] Recebe a role do usuário
|
|
9596
9916
|
}) {
|
|
9597
|
-
const [searchTerm, setSearchTerm] =
|
|
9598
|
-
const [groups, setGroups] =
|
|
9599
|
-
const [isLoaded, setIsLoaded] =
|
|
9600
|
-
const [pickingGroupId, setPickingGroupId] =
|
|
9601
|
-
const [saveStatus, setSaveStatus] =
|
|
9917
|
+
const [searchTerm, setSearchTerm] = useState24("");
|
|
9918
|
+
const [groups, setGroups] = useState24([]);
|
|
9919
|
+
const [isLoaded, setIsLoaded] = useState24(false);
|
|
9920
|
+
const [pickingGroupId, setPickingGroupId] = useState24(null);
|
|
9921
|
+
const [saveStatus, setSaveStatus] = useState24("idle");
|
|
9602
9922
|
const canEdit = useMemo11(() => {
|
|
9603
9923
|
return userRole !== "viewer";
|
|
9604
9924
|
}, [userRole]);
|
|
9605
|
-
|
|
9925
|
+
useEffect21(() => {
|
|
9606
9926
|
if (initialGroups && !isLoaded) {
|
|
9607
9927
|
setGroups(initialGroups);
|
|
9608
9928
|
setIsLoaded(true);
|
|
@@ -9633,7 +9953,7 @@ function AncestryBoard({
|
|
|
9633
9953
|
children: sanitizeGroups(g.children || [])
|
|
9634
9954
|
}));
|
|
9635
9955
|
};
|
|
9636
|
-
|
|
9956
|
+
useEffect21(() => {
|
|
9637
9957
|
if (!isLoaded || !onSave) return;
|
|
9638
9958
|
const timeoutId = setTimeout(async () => {
|
|
9639
9959
|
setSaveStatus("saving");
|
|
@@ -9651,7 +9971,7 @@ function AncestryBoard({
|
|
|
9651
9971
|
}, 3e3);
|
|
9652
9972
|
return () => clearTimeout(timeoutId);
|
|
9653
9973
|
}, [groups, isLoaded, onSave]);
|
|
9654
|
-
|
|
9974
|
+
useEffect21(() => {
|
|
9655
9975
|
if (!isOpen) return;
|
|
9656
9976
|
const handleKeyDown = (e) => {
|
|
9657
9977
|
if (e.key === "Escape") {
|
|
@@ -9806,27 +10126,27 @@ function AncestryBoard({
|
|
|
9806
10126
|
});
|
|
9807
10127
|
};
|
|
9808
10128
|
if (!isOpen) return null;
|
|
9809
|
-
return /* @__PURE__ */
|
|
10129
|
+
return /* @__PURE__ */ React24.createElement(
|
|
9810
10130
|
"div",
|
|
9811
10131
|
{
|
|
9812
10132
|
className: "fixed inset-0 z-[2200] bg-black/80 backdrop-blur-sm flex items-center justify-center p-2",
|
|
9813
10133
|
onClick: onClose
|
|
9814
10134
|
},
|
|
9815
|
-
/* @__PURE__ */
|
|
10135
|
+
/* @__PURE__ */ React24.createElement(
|
|
9816
10136
|
"div",
|
|
9817
10137
|
{
|
|
9818
10138
|
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
10139
|
onClick: (e) => e.stopPropagation()
|
|
9820
10140
|
},
|
|
9821
|
-
/* @__PURE__ */
|
|
10141
|
+
/* @__PURE__ */ React24.createElement("div", { className: "h-14 px-4 border-b border-white/10 bg-slate-900/90 flex items-center justify-between shrink-0" }, /* @__PURE__ */ React24.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React24.createElement("h3", { className: "text-base font-semibold text-white flex items-center gap-2 whitespace-nowrap" }, /* @__PURE__ */ React24.createElement(FiLayers6, { className: "text-indigo-400" }), "Ancestry Board"), saveStatus !== "idle" && /* @__PURE__ */ React24.createElement("div", { className: "flex items-center gap-2 animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ React24.createElement("div", { className: "w-px h-4 bg-white/10 mx-1" }), /* @__PURE__ */ React24.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__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(FiLoader5, { className: "animate-spin text-indigo-400", size: 12 }), /* @__PURE__ */ React24.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-indigo-300" }, "Salvando")), saveStatus === "saved" && /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(FiCheckCircle, { className: "text-emerald-400", size: 12 }), /* @__PURE__ */ React24.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-slate-400" }, "Salvo")), saveStatus === "error" && /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("span", { className: "w-2 h-2 rounded-full bg-red-500" }), /* @__PURE__ */ React24.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-red-400" }, "Erro"))))), /* @__PURE__ */ React24.createElement("div", { className: "flex items-center gap-3" }, pickingGroupId && /* @__PURE__ */ React24.createElement("span", { className: "text-xs text-indigo-300 font-medium animate-pulse hidden sm:inline-block mr-2" }, "Selecione na lateral..."), canEdit && /* @__PURE__ */ React24.createElement(
|
|
9822
10142
|
"button",
|
|
9823
10143
|
{
|
|
9824
10144
|
onClick: handleAddRootGroup,
|
|
9825
10145
|
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
10146
|
},
|
|
9827
|
-
/* @__PURE__ */
|
|
9828
|
-
/* @__PURE__ */
|
|
9829
|
-
), /* @__PURE__ */
|
|
10147
|
+
/* @__PURE__ */ React24.createElement(FiPlus9, { size: 14, className: "text-indigo-400" }),
|
|
10148
|
+
/* @__PURE__ */ React24.createElement("span", { className: "hidden sm:inline" }, "Novo Grupo")
|
|
10149
|
+
), /* @__PURE__ */ React24.createElement(
|
|
9830
10150
|
"button",
|
|
9831
10151
|
{
|
|
9832
10152
|
onClick: onClose,
|
|
@@ -9834,11 +10154,11 @@ function AncestryBoard({
|
|
|
9834
10154
|
},
|
|
9835
10155
|
"\xD7"
|
|
9836
10156
|
))),
|
|
9837
|
-
/* @__PURE__ */
|
|
10157
|
+
/* @__PURE__ */ React24.createElement("div", { className: "flex flex-1 overflow-hidden" }, /* @__PURE__ */ React24.createElement("div", { className: `
|
|
9838
10158
|
flex flex-col border-r border-white/10 transition-all duration-300 flex-none
|
|
9839
10159
|
${pickingGroupId ? "w-[25%] border-indigo-500/30" : "w-[20%]"}
|
|
9840
10160
|
min-w-[280px] max-w-[500px] bg-slate-900
|
|
9841
|
-
` }, /* @__PURE__ */
|
|
10161
|
+
` }, /* @__PURE__ */ React24.createElement("div", { className: "p-3 border-b border-white/5 bg-slate-900/50" }, /* @__PURE__ */ React24.createElement("div", { className: "relative group" }, /* @__PURE__ */ React24.createElement(FiSearch4, { 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__ */ React24.createElement(
|
|
9842
10162
|
"input",
|
|
9843
10163
|
{
|
|
9844
10164
|
type: "text",
|
|
@@ -9851,10 +10171,10 @@ function AncestryBoard({
|
|
|
9851
10171
|
onChange: (e) => setSearchTerm(e.target.value),
|
|
9852
10172
|
autoFocus: !pickingGroupId
|
|
9853
10173
|
}
|
|
9854
|
-
))), /* @__PURE__ */
|
|
10174
|
+
))), /* @__PURE__ */ React24.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-3 space-y-2" }, filtered.map((anc) => {
|
|
9855
10175
|
const parentNodeName = nodeNamesMap.get(String(anc.ancestral_node)) || "Node Desconhecido";
|
|
9856
10176
|
const isPicking = !!pickingGroupId;
|
|
9857
|
-
return /* @__PURE__ */
|
|
10177
|
+
return /* @__PURE__ */ React24.createElement(
|
|
9858
10178
|
"div",
|
|
9859
10179
|
{
|
|
9860
10180
|
key: anc.ancestry_id,
|
|
@@ -9866,12 +10186,12 @@ function AncestryBoard({
|
|
|
9866
10186
|
${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
10187
|
`
|
|
9868
10188
|
},
|
|
9869
|
-
/* @__PURE__ */
|
|
10189
|
+
/* @__PURE__ */ React24.createElement("div", { className: `
|
|
9870
10190
|
mt-0.5 w-8 h-8 rounded-md grid place-content-center shrink-0 border transition-all shadow-lg
|
|
9871
10191
|
${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__ */
|
|
10192
|
+
` }, isPicking ? /* @__PURE__ */ React24.createElement(FiPlus9, { size: 16 }) : /* @__PURE__ */ React24.createElement(FiLayers6, { size: 14 })),
|
|
10193
|
+
/* @__PURE__ */ React24.createElement("div", { className: "flex-1 min-w-0 pb-2" }, /* @__PURE__ */ React24.createElement("div", { className: "flex items-center justify-between gap-2" }, /* @__PURE__ */ React24.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__ */ React24.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__ */ React24.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__ */ React24.createElement(FiCornerUpRight4, { size: 10 }), /* @__PURE__ */ React24.createElement("span", { className: "truncate max-w-[120px]" }, parentNodeName)), anc.description && /* @__PURE__ */ React24.createElement("p", { className: "mt-1.5 text-[11px] text-slate-400 line-clamp-2 leading-relaxed opacity-80" }, anc.description)),
|
|
10194
|
+
!isPicking && /* @__PURE__ */ React24.createElement(
|
|
9875
10195
|
"button",
|
|
9876
10196
|
{
|
|
9877
10197
|
onClick: (e) => {
|
|
@@ -9881,10 +10201,10 @@ function AncestryBoard({
|
|
|
9881
10201
|
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
10202
|
title: "Renderizar Ancestralidade"
|
|
9883
10203
|
},
|
|
9884
|
-
/* @__PURE__ */
|
|
10204
|
+
/* @__PURE__ */ React24.createElement("div", { className: "bg-indigo-500 text-white p-2 rounded-full shadow-lg hover:bg-indigo-400 hover:scale-110 transition-all" }, /* @__PURE__ */ React24.createElement(FiPlay, { size: 14, className: "ml-0.5" }))
|
|
9885
10205
|
)
|
|
9886
10206
|
);
|
|
9887
|
-
}))), /* @__PURE__ */
|
|
10207
|
+
}))), /* @__PURE__ */ React24.createElement("div", { className: "flex flex-col flex-1 bg-slate-950/30" }, /* @__PURE__ */ React24.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-6 space-y-4" }, groups.length === 0 ? /* @__PURE__ */ React24.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__ */ React24.createElement(FiLayers6, { size: 24, className: "opacity-20" }), /* @__PURE__ */ React24.createElement("p", { className: "text-xs text-center px-4" }, canEdit ? /* @__PURE__ */ React24.createElement(React24.Fragment, null, "Nenhum grupo criado.", /* @__PURE__ */ React24.createElement("br", null), 'Use o bot\xE3o "Novo Grupo" acima.') : /* @__PURE__ */ React24.createElement(React24.Fragment, null, "Nenhum grupo dispon\xEDvel para visualiza\xE7\xE3o."))) : groups.map((group, index) => /* @__PURE__ */ React24.createElement(
|
|
9888
10208
|
GroupItem,
|
|
9889
10209
|
{
|
|
9890
10210
|
key: group.id,
|
|
@@ -9904,7 +10224,7 @@ function AncestryBoard({
|
|
|
9904
10224
|
canEdit
|
|
9905
10225
|
}
|
|
9906
10226
|
))))),
|
|
9907
|
-
/* @__PURE__ */
|
|
10227
|
+
/* @__PURE__ */ React24.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__ */ React24.createElement("span", null, filtered.length, " itens encontrados"), /* @__PURE__ */ React24.createElement("span", null, groups.length, " grupos raiz"))
|
|
9908
10228
|
)
|
|
9909
10229
|
);
|
|
9910
10230
|
}
|
|
@@ -9998,7 +10318,7 @@ function XViewScene({
|
|
|
9998
10318
|
}
|
|
9999
10319
|
return null;
|
|
10000
10320
|
}, [encryptedConfig, session]);
|
|
10001
|
-
|
|
10321
|
+
useEffect22(() => {
|
|
10002
10322
|
async function verifyPermission() {
|
|
10003
10323
|
if (!viewParams || !session || !check_user_permission) return;
|
|
10004
10324
|
const { id, type, owner_id } = viewParams;
|
|
@@ -10048,45 +10368,45 @@ function XViewScene({
|
|
|
10048
10368
|
}
|
|
10049
10369
|
return null;
|
|
10050
10370
|
}, [ownerId, sceneConfigId]);
|
|
10051
|
-
const sceneDataRef =
|
|
10052
|
-
const parentDataRef =
|
|
10053
|
-
const ancestryDataRef =
|
|
10054
|
-
const [isLoading, setIsLoading] =
|
|
10055
|
-
const [permissionStatus, setPermissionStatus] =
|
|
10056
|
-
const [userPermissionRole, setUserPermissionRole] =
|
|
10057
|
-
const [isInitialized, setIsInitialized] =
|
|
10058
|
-
const [sceneVersion, setSceneVersion] =
|
|
10059
|
-
const [contextMenu, setContextMenu] =
|
|
10060
|
-
const [multiContextMenu, setMultiContextMenu] =
|
|
10061
|
-
const [relationshipMenu, setRelationshipMenu] =
|
|
10062
|
-
const [creationMode, setCreationMode] =
|
|
10063
|
-
const [versionMode, setVersionMode] =
|
|
10064
|
-
const [questMode, setQuestMode] =
|
|
10065
|
-
const [hasFocusedInitial, setHasFocusedInitial] =
|
|
10066
|
-
const [hasOpenedInitialAncestry, setHasOpenedInitialAncestry] =
|
|
10067
|
-
const [ancestryMode, setAncestryMode] =
|
|
10068
|
-
const [readingMode, setReadingMode] =
|
|
10371
|
+
const sceneDataRef = useRef19(null);
|
|
10372
|
+
const parentDataRef = useRef19(null);
|
|
10373
|
+
const ancestryDataRef = useRef19(null);
|
|
10374
|
+
const [isLoading, setIsLoading] = useState25(true);
|
|
10375
|
+
const [permissionStatus, setPermissionStatus] = useState25("loading");
|
|
10376
|
+
const [userPermissionRole, setUserPermissionRole] = useState25(null);
|
|
10377
|
+
const [isInitialized, setIsInitialized] = useState25(false);
|
|
10378
|
+
const [sceneVersion, setSceneVersion] = useState25(0);
|
|
10379
|
+
const [contextMenu, setContextMenu] = useState25({ visible: false, x: 0, y: 0, nodeData: null });
|
|
10380
|
+
const [multiContextMenu, setMultiContextMenu] = useState25({ visible: false, x: 0, y: 0, nodeIds: null });
|
|
10381
|
+
const [relationshipMenu, setRelationshipMenu] = useState25({ visible: false, x: 0, y: 0, linkObject: null });
|
|
10382
|
+
const [creationMode, setCreationMode] = useState25({ isActive: false, sourceNodeData: null });
|
|
10383
|
+
const [versionMode, setVersionMode] = useState25({ isActive: false, sourceNodeData: null });
|
|
10384
|
+
const [questMode, setQuestMode] = useState25({ isActive: false });
|
|
10385
|
+
const [hasFocusedInitial, setHasFocusedInitial] = useState25(false);
|
|
10386
|
+
const [hasOpenedInitialAncestry, setHasOpenedInitialAncestry] = useState25(false);
|
|
10387
|
+
const [ancestryMode, setAncestryMode] = useState25({ isActive: false, tree: null, selectedParentId: null, isEditMode: false, currentAncestryId: null, ancestryName: "", ancestryDescription: "", ancestryDescriptionSections: [], isAddingNodes: false });
|
|
10388
|
+
const [readingMode, setReadingMode] = useState25({
|
|
10069
10389
|
isActive: false,
|
|
10070
10390
|
ancestry: null,
|
|
10071
10391
|
branchStack: [],
|
|
10072
10392
|
autoAbstraction: false
|
|
10073
10393
|
});
|
|
10074
|
-
const [formPosition, setFormPosition] =
|
|
10075
|
-
const [detailsNode, setDetailsNode] =
|
|
10076
|
-
const [detailsLink, setDetailsLink] =
|
|
10077
|
-
const [ancestryLinkDetails, setAncestryLinkDetails] =
|
|
10078
|
-
const [imageViewer, setImageViewer] =
|
|
10079
|
-
const [editingAncestryRel, setEditingAncestryRel] =
|
|
10080
|
-
const [isImportModalOpen, setIsImportModalOpen] =
|
|
10081
|
-
const [importSuccessMessage, setImportSuccessMessage] =
|
|
10082
|
-
const [highlightedNodeId, setHighlightedNodeId] =
|
|
10083
|
-
const [isAncestryBoardOpen, setIsAncestryBoardOpen] =
|
|
10084
|
-
const [ancestryBoardData, setAncestryBoardData] =
|
|
10085
|
-
const [isSidebarOpen, setIsSidebarOpen] =
|
|
10086
|
-
const mountRef =
|
|
10087
|
-
const tooltipRef =
|
|
10088
|
-
const formRef =
|
|
10089
|
-
const stateRef =
|
|
10394
|
+
const [formPosition, setFormPosition] = useState25({ left: 16, top: 16, opacity: 0 });
|
|
10395
|
+
const [detailsNode, setDetailsNode] = useState25(null);
|
|
10396
|
+
const [detailsLink, setDetailsLink] = useState25(null);
|
|
10397
|
+
const [ancestryLinkDetails, setAncestryLinkDetails] = useState25(null);
|
|
10398
|
+
const [imageViewer, setImageViewer] = useState25({ visible: false, images: [], startIndex: 0 });
|
|
10399
|
+
const [editingAncestryRel, setEditingAncestryRel] = useState25({ visible: false, data: null, path: null });
|
|
10400
|
+
const [isImportModalOpen, setIsImportModalOpen] = useState25(false);
|
|
10401
|
+
const [importSuccessMessage, setImportSuccessMessage] = useState25("");
|
|
10402
|
+
const [highlightedNodeId, setHighlightedNodeId] = useState25(null);
|
|
10403
|
+
const [isAncestryBoardOpen, setIsAncestryBoardOpen] = useState25(false);
|
|
10404
|
+
const [ancestryBoardData, setAncestryBoardData] = useState25([]);
|
|
10405
|
+
const [isSidebarOpen, setIsSidebarOpen] = useState25(false);
|
|
10406
|
+
const mountRef = useRef19(null);
|
|
10407
|
+
const tooltipRef = useRef19(null);
|
|
10408
|
+
const formRef = useRef19(null);
|
|
10409
|
+
const stateRef = useRef19({
|
|
10090
10410
|
readMode: {
|
|
10091
10411
|
currentMaxIndex: 0,
|
|
10092
10412
|
progressMap: {}
|
|
@@ -10131,10 +10451,10 @@ function XViewScene({
|
|
|
10131
10451
|
minWidth: 320,
|
|
10132
10452
|
maxWidth: maxReadPanelW
|
|
10133
10453
|
});
|
|
10134
|
-
|
|
10454
|
+
useEffect22(() => {
|
|
10135
10455
|
stateRef.current.ancestry = ancestryMode;
|
|
10136
10456
|
}, [ancestryMode]);
|
|
10137
|
-
|
|
10457
|
+
useEffect22(() => {
|
|
10138
10458
|
var _a2;
|
|
10139
10459
|
if (!isInitialized) return;
|
|
10140
10460
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -10631,7 +10951,7 @@ function XViewScene({
|
|
|
10631
10951
|
}
|
|
10632
10952
|
});
|
|
10633
10953
|
}, []);
|
|
10634
|
-
|
|
10954
|
+
useEffect22(() => {
|
|
10635
10955
|
async function fetchAllData(configPath, ownerId2) {
|
|
10636
10956
|
var _a2, _b2;
|
|
10637
10957
|
if (!get_scene_view_data) {
|
|
@@ -10735,7 +11055,7 @@ function XViewScene({
|
|
|
10735
11055
|
}
|
|
10736
11056
|
return mesh;
|
|
10737
11057
|
}, []);
|
|
10738
|
-
|
|
11058
|
+
useEffect22(() => {
|
|
10739
11059
|
if (!isInitialized || !sceneDataRef.current) return;
|
|
10740
11060
|
const currentMount = mountRef.current;
|
|
10741
11061
|
if (!currentMount) return;
|
|
@@ -13106,7 +13426,7 @@ function XViewScene({
|
|
|
13106
13426
|
}, [sceneVersion, isInitialized]);
|
|
13107
13427
|
const sourceNodeDatasetId = creationMode.sourceNodeData ? (_b = stateRef.current.nodeIdToParentFileMap.get(String(creationMode.sourceNodeData.id))) == null ? void 0 : _b.parentFileId : null;
|
|
13108
13428
|
const detailsNodeDatasetInfo = detailsNode ? stateRef.current.nodeIdToParentFileMap.get(String(detailsNode.id)) : null;
|
|
13109
|
-
|
|
13429
|
+
useEffect22(() => {
|
|
13110
13430
|
if (isInitialized && focusNodeId && !hasFocusedInitial) {
|
|
13111
13431
|
const nodeObjects = stateRef.current.nodeObjects || {};
|
|
13112
13432
|
const targetMesh = nodeObjects[String(focusNodeId)];
|
|
@@ -13120,7 +13440,7 @@ function XViewScene({
|
|
|
13120
13440
|
}
|
|
13121
13441
|
}
|
|
13122
13442
|
}, [isInitialized, sceneVersion, focusNodeId, hasFocusedInitial, tweenToTarget]);
|
|
13123
|
-
|
|
13443
|
+
useEffect22(() => {
|
|
13124
13444
|
if (isInitialized && focusAncestryId && !hasOpenedInitialAncestry) {
|
|
13125
13445
|
const ancestries = ancestryDataRef.current || [];
|
|
13126
13446
|
const targetAncestry = ancestries.find((a) => String(a.ancestry_id) === String(focusAncestryId));
|
|
@@ -13134,7 +13454,7 @@ function XViewScene({
|
|
|
13134
13454
|
}
|
|
13135
13455
|
}
|
|
13136
13456
|
}, [isInitialized, sceneVersion, focusAncestryId, hasOpenedInitialAncestry, handleStartReadingAncestry]);
|
|
13137
|
-
|
|
13457
|
+
useEffect22(() => {
|
|
13138
13458
|
function handleKeyDown(event) {
|
|
13139
13459
|
var _a2, _b2, _c2;
|
|
13140
13460
|
const context = actionHandlerContext;
|
|
@@ -13235,20 +13555,20 @@ function XViewScene({
|
|
|
13235
13555
|
// <-- handleCancelQuest adicionado aqui
|
|
13236
13556
|
]);
|
|
13237
13557
|
if (isLoading || status === "loading" || permissionStatus === "loading") {
|
|
13238
|
-
return /* @__PURE__ */
|
|
13558
|
+
return /* @__PURE__ */ React25.createElement(LoadingScreen, null);
|
|
13239
13559
|
}
|
|
13240
13560
|
if (permissionStatus === "denied") {
|
|
13241
|
-
return /* @__PURE__ */
|
|
13561
|
+
return /* @__PURE__ */ React25.createElement("div", { className: "flex flex-col items-center justify-center min-h-screen w-full bg-slate-950 text-white" }, /* @__PURE__ */ React25.createElement("div", { className: "bg-slate-900/50 p-8 rounded-2xl border border-slate-800 shadow-2xl text-center max-w-md" }, /* @__PURE__ */ React25.createElement("div", { className: "mb-4 text-red-500" }, /* @__PURE__ */ React25.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__ */ React25.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__ */ React25.createElement("h2", { className: "text-2xl font-bold mb-2" }, "Acesso Negado"), /* @__PURE__ */ React25.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__ */ React25.createElement(
|
|
13242
13562
|
"button",
|
|
13243
13563
|
{
|
|
13244
13564
|
onClick: () => router.push("/dashboard/scenes"),
|
|
13245
13565
|
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
13566
|
},
|
|
13247
|
-
/* @__PURE__ */
|
|
13567
|
+
/* @__PURE__ */ React25.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__ */ React25.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18" })),
|
|
13248
13568
|
"Voltar para Scenes"
|
|
13249
13569
|
)));
|
|
13250
13570
|
}
|
|
13251
|
-
return /* @__PURE__ */
|
|
13571
|
+
return /* @__PURE__ */ React25.createElement(
|
|
13252
13572
|
"div",
|
|
13253
13573
|
{
|
|
13254
13574
|
ref: mountRef,
|
|
@@ -13260,7 +13580,7 @@ function XViewScene({
|
|
|
13260
13580
|
cursor: stateRef.current.connection.isActive || stateRef.current.relink.isActive || ancestryMode.isActive ? "crosshair" : creationMode.isActive ? "default" : "grab"
|
|
13261
13581
|
}
|
|
13262
13582
|
},
|
|
13263
|
-
userPermissionRole !== "link_viewer" && /* @__PURE__ */
|
|
13583
|
+
userPermissionRole !== "link_viewer" && /* @__PURE__ */ React25.createElement(
|
|
13264
13584
|
XViewSidebar,
|
|
13265
13585
|
{
|
|
13266
13586
|
dbNodes: searchableDbNodes,
|
|
@@ -13280,7 +13600,7 @@ function XViewScene({
|
|
|
13280
13600
|
userRole: userPermissionRole
|
|
13281
13601
|
}
|
|
13282
13602
|
),
|
|
13283
|
-
creationMode.isActive && /* @__PURE__ */
|
|
13603
|
+
creationMode.isActive && /* @__PURE__ */ React25.createElement(
|
|
13284
13604
|
InSceneCreationForm,
|
|
13285
13605
|
{
|
|
13286
13606
|
onSave: (data) => userActionHandlers.handleSaveNode(actionHandlerContext, data),
|
|
@@ -13305,7 +13625,7 @@ function XViewScene({
|
|
|
13305
13625
|
availableAncestries: allAvailableAncestries
|
|
13306
13626
|
}
|
|
13307
13627
|
),
|
|
13308
|
-
versionMode.isActive && /* @__PURE__ */
|
|
13628
|
+
versionMode.isActive && /* @__PURE__ */ React25.createElement(
|
|
13309
13629
|
InSceneVersionForm,
|
|
13310
13630
|
{
|
|
13311
13631
|
onSave: (data) => userActionHandlers.handleSaveVersionNode(actionHandlerContext, data),
|
|
@@ -13324,7 +13644,7 @@ function XViewScene({
|
|
|
13324
13644
|
availableAncestries: allAvailableAncestries
|
|
13325
13645
|
}
|
|
13326
13646
|
),
|
|
13327
|
-
questMode.isActive && /* @__PURE__ */
|
|
13647
|
+
questMode.isActive && /* @__PURE__ */ React25.createElement(
|
|
13328
13648
|
InSceneQuestForm,
|
|
13329
13649
|
{
|
|
13330
13650
|
onSave: (data) => handleSaveQuestNode(actionHandlerContext, data),
|
|
@@ -13341,13 +13661,13 @@ function XViewScene({
|
|
|
13341
13661
|
availableAncestries: allAvailableAncestries
|
|
13342
13662
|
}
|
|
13343
13663
|
),
|
|
13344
|
-
readingMode.isActive && readingMode.ancestry && /* @__PURE__ */
|
|
13664
|
+
readingMode.isActive && readingMode.ancestry && /* @__PURE__ */ React25.createElement(
|
|
13345
13665
|
"div",
|
|
13346
13666
|
{
|
|
13347
13667
|
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
13668
|
style: { top: 16, right: 16, zIndex: 1100, maxHeight: "calc(100vh - 32px)", width: `${readModeWidth}px`, maxWidth: "92vw" }
|
|
13349
13669
|
},
|
|
13350
|
-
/* @__PURE__ */
|
|
13670
|
+
/* @__PURE__ */ React25.createElement(
|
|
13351
13671
|
"div",
|
|
13352
13672
|
{
|
|
13353
13673
|
onPointerDown: (e) => {
|
|
@@ -13358,7 +13678,7 @@ function XViewScene({
|
|
|
13358
13678
|
title: "Arraste para redimensionar"
|
|
13359
13679
|
}
|
|
13360
13680
|
),
|
|
13361
|
-
/* @__PURE__ */
|
|
13681
|
+
/* @__PURE__ */ React25.createElement(
|
|
13362
13682
|
DescriptionReadModePanel,
|
|
13363
13683
|
{
|
|
13364
13684
|
key: readingMode.branchStack.length > 0 ? readingMode.branchStack[readingMode.branchStack.length - 1].branchId : readingMode.ancestry.ancestry_id,
|
|
@@ -13393,7 +13713,7 @@ function XViewScene({
|
|
|
13393
13713
|
}
|
|
13394
13714
|
)
|
|
13395
13715
|
),
|
|
13396
|
-
ancestryMode.isActive && ancestryMode.tree && /* @__PURE__ */
|
|
13716
|
+
ancestryMode.isActive && ancestryMode.tree && /* @__PURE__ */ React25.createElement(
|
|
13397
13717
|
CreateAncestryPanel,
|
|
13398
13718
|
{
|
|
13399
13719
|
ancestryMode,
|
|
@@ -13420,7 +13740,7 @@ function XViewScene({
|
|
|
13420
13740
|
onRenderAbstractionTree: (data, targetId) => handleRenderAbstractionTree(data, targetId)
|
|
13421
13741
|
}
|
|
13422
13742
|
),
|
|
13423
|
-
editingAncestryRel.visible && /* @__PURE__ */
|
|
13743
|
+
editingAncestryRel.visible && /* @__PURE__ */ React25.createElement(
|
|
13424
13744
|
AncestryRelationshipPanel,
|
|
13425
13745
|
{
|
|
13426
13746
|
data: editingAncestryRel.data,
|
|
@@ -13434,7 +13754,28 @@ function XViewScene({
|
|
|
13434
13754
|
onUploadFile: upload_file_action
|
|
13435
13755
|
}
|
|
13436
13756
|
),
|
|
13437
|
-
detailsNode && /* @__PURE__ */
|
|
13757
|
+
detailsNode && detailsNode.is_quest && /* @__PURE__ */ React25.createElement(
|
|
13758
|
+
QuestDetailsPanel,
|
|
13759
|
+
{
|
|
13760
|
+
node: detailsNode,
|
|
13761
|
+
onClose: () => setDetailsNode(null),
|
|
13762
|
+
onSave: (data) => userActionHandlers.handleSaveNodeDetails(actionHandlerContext, data),
|
|
13763
|
+
onNameChange: handleDetailNodeNameChange,
|
|
13764
|
+
onColorChange: handleDetailNodeColorChange,
|
|
13765
|
+
onSizeChange: handleDetailNodeSizeChange,
|
|
13766
|
+
onDataUpdate: setDetailsNode,
|
|
13767
|
+
onOpenImageViewer: handleOpenImageViewer,
|
|
13768
|
+
existingTypes: existingNodeTypes,
|
|
13769
|
+
availableNodes: allAvailableNodes,
|
|
13770
|
+
availableAncestries: allAvailableAncestries,
|
|
13771
|
+
onOpenReference: handleOpenReference,
|
|
13772
|
+
onMentionClick: handleAddExistingNode,
|
|
13773
|
+
onUploadFile: upload_file_action,
|
|
13774
|
+
userRole: userPermissionRole,
|
|
13775
|
+
currentDatasetName: detailsNodeDatasetInfo == null ? void 0 : detailsNodeDatasetInfo.datasetName
|
|
13776
|
+
}
|
|
13777
|
+
),
|
|
13778
|
+
detailsNode && !detailsNode.is_quest && /* @__PURE__ */ React25.createElement(
|
|
13438
13779
|
NodeDetailsPanel,
|
|
13439
13780
|
{
|
|
13440
13781
|
node: detailsNode,
|
|
@@ -13461,7 +13802,7 @@ function XViewScene({
|
|
|
13461
13802
|
currentDatasetName: detailsNodeDatasetInfo == null ? void 0 : detailsNodeDatasetInfo.datasetName
|
|
13462
13803
|
}
|
|
13463
13804
|
),
|
|
13464
|
-
detailsLink && /* @__PURE__ */
|
|
13805
|
+
detailsLink && /* @__PURE__ */ React25.createElement(
|
|
13465
13806
|
RelationshipDetailsPanel,
|
|
13466
13807
|
{
|
|
13467
13808
|
link: detailsLink,
|
|
@@ -13475,7 +13816,7 @@ function XViewScene({
|
|
|
13475
13816
|
userRole: userPermissionRole
|
|
13476
13817
|
}
|
|
13477
13818
|
),
|
|
13478
|
-
ancestryLinkDetails && /* @__PURE__ */
|
|
13819
|
+
ancestryLinkDetails && /* @__PURE__ */ React25.createElement(
|
|
13479
13820
|
AncestryLinkDetailsPanel,
|
|
13480
13821
|
{
|
|
13481
13822
|
data: ancestryLinkDetails,
|
|
@@ -13486,7 +13827,7 @@ function XViewScene({
|
|
|
13486
13827
|
onUploadFile: upload_file_action
|
|
13487
13828
|
}
|
|
13488
13829
|
),
|
|
13489
|
-
/* @__PURE__ */
|
|
13830
|
+
/* @__PURE__ */ React25.createElement(
|
|
13490
13831
|
"div",
|
|
13491
13832
|
{
|
|
13492
13833
|
ref: tooltipRef,
|
|
@@ -13513,7 +13854,7 @@ function XViewScene({
|
|
|
13513
13854
|
}
|
|
13514
13855
|
}
|
|
13515
13856
|
),
|
|
13516
|
-
/* @__PURE__ */
|
|
13857
|
+
/* @__PURE__ */ React25.createElement(
|
|
13517
13858
|
ContextMenu,
|
|
13518
13859
|
{
|
|
13519
13860
|
data: contextMenu,
|
|
@@ -13536,7 +13877,7 @@ function XViewScene({
|
|
|
13536
13877
|
onFocusNode: handleFocusNode
|
|
13537
13878
|
}
|
|
13538
13879
|
),
|
|
13539
|
-
/* @__PURE__ */
|
|
13880
|
+
/* @__PURE__ */ React25.createElement(
|
|
13540
13881
|
MultiNodeContextMenu,
|
|
13541
13882
|
{
|
|
13542
13883
|
data: multiContextMenu,
|
|
@@ -13547,7 +13888,7 @@ function XViewScene({
|
|
|
13547
13888
|
onDeleteNodes: (ids) => userActionHandlers.handleDeleteMultipleNodes(actionHandlerContext, ids)
|
|
13548
13889
|
}
|
|
13549
13890
|
),
|
|
13550
|
-
/* @__PURE__ */
|
|
13891
|
+
/* @__PURE__ */ React25.createElement(
|
|
13551
13892
|
RelationshipContextMenu,
|
|
13552
13893
|
{
|
|
13553
13894
|
data: relationshipMenu,
|
|
@@ -13565,8 +13906,8 @@ function XViewScene({
|
|
|
13565
13906
|
onDelete: (data) => userActionHandlers.handleDeleteLink(actionHandlerContext, data)
|
|
13566
13907
|
}
|
|
13567
13908
|
),
|
|
13568
|
-
/* @__PURE__ */
|
|
13569
|
-
/* @__PURE__ */
|
|
13909
|
+
/* @__PURE__ */ React25.createElement(ImageViewer, { data: imageViewer, onClose: () => setImageViewer({ ...imageViewer, visible: false }) }),
|
|
13910
|
+
/* @__PURE__ */ React25.createElement(
|
|
13570
13911
|
AncestryBoard,
|
|
13571
13912
|
{
|
|
13572
13913
|
isOpen: isAncestryBoardOpen,
|
|
@@ -13579,7 +13920,7 @@ function XViewScene({
|
|
|
13579
13920
|
userRole: userPermissionRole
|
|
13580
13921
|
}
|
|
13581
13922
|
),
|
|
13582
|
-
/* @__PURE__ */
|
|
13923
|
+
/* @__PURE__ */ React25.createElement(
|
|
13583
13924
|
ImportParentFileModal,
|
|
13584
13925
|
{
|
|
13585
13926
|
isOpen: isImportModalOpen,
|