@lv-x-software-house/x_view 1.2.5-dev.10 → 1.2.5-dev.12
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 +97 -10
- package/dist/index.mjs +96 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
get_ancestry_file_logic: () => get_ancestry_file_logic,
|
|
36
36
|
get_scene_view_data_logic: () => get_scene_view_data_logic,
|
|
37
37
|
get_single_parent_file_logic: () => get_single_parent_file_logic,
|
|
38
|
+
get_view_members_logic: () => get_view_members_logic,
|
|
38
39
|
import_parent_file_modal_get_logic: () => import_parent_file_modal_get_logic,
|
|
39
40
|
save_ancestry_board_logic: () => save_ancestry_board_logic,
|
|
40
41
|
save_view_data_logic: () => save_view_data_logic,
|
|
@@ -141,7 +142,10 @@ function ContextMenu({
|
|
|
141
142
|
onEditAncestry,
|
|
142
143
|
onDeleteAncestry,
|
|
143
144
|
onFocusNode,
|
|
144
|
-
onClose
|
|
145
|
+
onClose,
|
|
146
|
+
viewMembers,
|
|
147
|
+
currentUser,
|
|
148
|
+
onStartQuest
|
|
145
149
|
}) {
|
|
146
150
|
var _a, _b, _c;
|
|
147
151
|
const menuRef = (0, import_react.useRef)(null);
|
|
@@ -342,12 +346,25 @@ function ContextMenu({
|
|
|
342
346
|
});
|
|
343
347
|
};
|
|
344
348
|
const renderMainView = () => {
|
|
345
|
-
var _a2;
|
|
349
|
+
var _a2, _b2, _c2;
|
|
346
350
|
const hasVersions = computedVersions.length > 0;
|
|
347
351
|
const canCreateVersion = ability.can("create", "Versioning");
|
|
348
352
|
const canReadVersion = ability.can("read", "Versioning");
|
|
349
353
|
const shouldShowVersioningBtn = canCreateVersion || canReadVersion && hasVersions;
|
|
350
|
-
|
|
354
|
+
const canStartQuest = isCurrentNodeQuest && (((_a2 = data.nodeData) == null ? void 0 : _a2.status) !== "In Progress" || ((_b2 = data.nodeData) == null ? void 0 : _b2.assignee_id) !== (currentUser == null ? void 0 : currentUser.id));
|
|
355
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "flex items-center gap-2 px-2 pt-1 pb-2" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "inline-flex h-2 w-2 rounded-full bg-indigo-400/80 shadow-[0_0_12px_1px_rgba(99,102,241,0.5)]" }), /* @__PURE__ */ import_react.default.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "A\xE7\xF5es R\xE1pidas")), /* @__PURE__ */ import_react.default.createElement("div", { className: "flex flex-col gap-1" }, canStartQuest && /* @__PURE__ */ import_react.default.createElement(
|
|
356
|
+
"button",
|
|
357
|
+
{
|
|
358
|
+
onClick: () => {
|
|
359
|
+
onStartQuest == null ? void 0 : onStartQuest(data.nodeData);
|
|
360
|
+
onClose();
|
|
361
|
+
},
|
|
362
|
+
className: `w-full flex items-center gap-2.5 px-2 py-1.5 text-left text-sm rounded-md bg-yellow-500/10 text-yellow-400 hover:bg-yellow-500/20 hover:text-yellow-300 transition-colors duration-150 truncate font-semibold shadow-inner`,
|
|
363
|
+
title: "Atribuir a mim e iniciar"
|
|
364
|
+
},
|
|
365
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, "\u{1F680}"),
|
|
366
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, "Iniciar Quest")
|
|
367
|
+
), ability.can("create", "Connection") && /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => onStartConnection == null ? void 0 : onStartConnection(data.nodeData), className: baseButtonClass, title: "Conectar" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Conectar")), ability.can("create", "Node") && !((_c2 = data.nodeData) == null ? void 0 : _c2.is_quest) && /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => onStartCreation == null ? void 0 : onStartCreation(data.nodeData), className: baseButtonClass, title: "Criar e Conectar" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react.default.createElement("line", { x1: "12", y1: "8", x2: "12", y2: "16" }), /* @__PURE__ */ import_react.default.createElement("line", { x1: "8", y1: "12", x2: "16", y2: "12" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Criar e Conectar")), ability.can("create", "Ancestry") && /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => onStartAncestryCreation == null ? void 0 : onStartAncestryCreation(data.nodeData), className: baseButtonClass, title: "Criar Ancestralidade" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M10 20.5c.5-.5.8-1.2.8-2s-.3-1.5-.8-2c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8c-.5.5-.8 1.2-.8 2s.3 1.5.8 2c.5.5 1.2-.8 2 .8s1.5-.3 2-.8c-.5-.5-.8-1.2-.8-2s.3-1.5.8-2c.5.5 1.2-.8 2 .8s1.5.3 2 .8Z" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M10 16v-3a2 2 0 0 1 2-2h4" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M14 3.5c.5.5.8 1.2.8 2s-.3 1.5-.8 2c-.5-.5-1.2-.8-2 .8s1.5.3-2-.8c-.5-.5-.8-1.2-.8-2s.3-1.5.8-2c.5.5 1.2-.8 2 .8s1.5.3 2 .8Z" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M14 8v3a2 2 0 0 0 2 2h4" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Criar Ancestralidade")), shouldShowVersioningBtn && /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => setMenuView("versioning"), className: baseButtonClass, title: hasVersions ? "Versionamento" : "Criar Versionamento" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("line", { x1: "6", y1: "3", x2: "6", y2: "15" }), /* @__PURE__ */ import_react.default.createElement("circle", { cx: "18", cy: "6", r: "3" }), /* @__PURE__ */ import_react.default.createElement("circle", { cx: "6", cy: "18", r: "3" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M18 9a9 9 0 0 1-9 9" })), /* @__PURE__ */ import_react.default.createElement("span", null, hasVersions || !canCreateVersion ? "Versionamento" : "Criar Versionamento")), (connections.length > 0 || availableAncestries.length > 0) && ability.can("read", "Connection") && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => setMenuView("connections"), className: baseButtonClass, title: "Conex\xF5es" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2z" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M8 12h8" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M12 8v8" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Conex\xF5es (", totalConnectionsCount, ")"))), /* @__PURE__ */ import_react.default.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => {
|
|
351
368
|
onFocusNode == null ? void 0 : onFocusNode(data.nodeData);
|
|
352
369
|
onClose();
|
|
353
370
|
}, className: baseButtonClass, title: "Focar na c\xE2mera" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react.default.createElement("circle", { cx: "12", cy: "12", r: "3" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Focar neste Node")), /* @__PURE__ */ import_react.default.createElement("button", { onClick: (e) => handleCopyLink(e, data.nodeData), className: baseButtonClass, title: "Copiar Link para Compartilhar" }, isLinkCopied ? /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#4ade80", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("polyline", { points: "20 6 9 17 4 12" })) : /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72" })), /* @__PURE__ */ import_react.default.createElement("span", { className: isLinkCopied ? "text-green-400" : "" }, isLinkCopied ? "Copiado!" : "Copiar Link")), ability.can("dismiss", "Node") && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => onDismissNode == null ? void 0 : onDismissNode(data.nodeData), className: baseButtonClass, title: "Remover da visualiza\xE7\xE3o" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }), /* @__PURE__ */ import_react.default.createElement("line", { x1: "2", y1: "2", x2: "22", y2: "22" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Dismiss")), /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => onDismissOtherNodes == null ? void 0 : onDismissOtherNodes(data.nodeData), className: baseButtonClass, title: "Remover outros da visualiza\xE7\xE3o" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("circle", { cx: "12", cy: "12", r: "3" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Dismiss other nodes"))), ability.can("delete", "Node") && /* @__PURE__ */ import_react.default.createElement("button", { onClick: () => setMenuView("deleteConfirmation"), className: deleteButtonClass, title: "Excluir Node" }, /* @__PURE__ */ import_react.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react.default.createElement("polyline", { points: "3 6 5 6 21 6" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ import_react.default.createElement("line", { x1: "10", y1: "11", x2: "10", y2: "17" }), /* @__PURE__ */ import_react.default.createElement("line", { x1: "14", y1: "11", x2: "14", y2: "17" })), /* @__PURE__ */ import_react.default.createElement("span", null, "Excluir Node"))));
|
|
@@ -8155,10 +8172,12 @@ function InSceneQuestForm({
|
|
|
8155
8172
|
onSizeChange,
|
|
8156
8173
|
viewName = "Projeto",
|
|
8157
8174
|
// NOVA PROP
|
|
8158
|
-
questCounter = 1
|
|
8175
|
+
questCounter = 1,
|
|
8159
8176
|
// NOVA PROP
|
|
8177
|
+
viewMembers = []
|
|
8160
8178
|
}) {
|
|
8161
8179
|
const [name, setName] = (0, import_react16.useState)("");
|
|
8180
|
+
const [assigneeId, setAssigneeId] = (0, import_react16.useState)("");
|
|
8162
8181
|
const [types, setTypes] = (0, import_react16.useState)(["quest"]);
|
|
8163
8182
|
const [typeInput, setTypeInput] = (0, import_react16.useState)("");
|
|
8164
8183
|
const [status, setStatus] = (0, import_react16.useState)("Backlog");
|
|
@@ -8221,6 +8240,7 @@ function InSceneQuestForm({
|
|
|
8221
8240
|
type: types,
|
|
8222
8241
|
color: QUEST_STATUS_COLORS2[status],
|
|
8223
8242
|
status,
|
|
8243
|
+
assignee_id: assigneeId || null,
|
|
8224
8244
|
size,
|
|
8225
8245
|
intensity,
|
|
8226
8246
|
description: description.trim(),
|
|
@@ -8292,7 +8312,16 @@ function InSceneQuestForm({
|
|
|
8292
8312
|
},
|
|
8293
8313
|
/* @__PURE__ */ import_react16.default.createElement("span", { className: "w-3 h-3 rounded-full", style: { backgroundColor: QUEST_STATUS_COLORS2[s] } }),
|
|
8294
8314
|
s
|
|
8295
|
-
)))))), /* @__PURE__ */ import_react16.default.createElement("div", { className: "space-y-1.5
|
|
8315
|
+
)))))), /* @__PURE__ */ import_react16.default.createElement("div", { className: "space-y-1.5 relative mt-2" }, /* @__PURE__ */ import_react16.default.createElement("label", { className: "text-xs text-slate-300" }, "Assignee (Respons\xE1vel)"), /* @__PURE__ */ import_react16.default.createElement(
|
|
8316
|
+
"select",
|
|
8317
|
+
{
|
|
8318
|
+
value: assigneeId,
|
|
8319
|
+
onChange: (e) => setAssigneeId(e.target.value),
|
|
8320
|
+
className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 hover:border-white/20 focus:outline-none focus:ring-2 focus:ring-indigo-400/60 transition-colors text-slate-200"
|
|
8321
|
+
},
|
|
8322
|
+
/* @__PURE__ */ import_react16.default.createElement("option", { value: "" }, "Nenhum"),
|
|
8323
|
+
viewMembers.map((member) => /* @__PURE__ */ import_react16.default.createElement("option", { key: member.id, value: member.id }, member.name || member.email || member.id))
|
|
8324
|
+
)), /* @__PURE__ */ import_react16.default.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ import_react16.default.createElement("label", { className: "text-xs text-slate-300" }, "Tipos Adicionais"), /* @__PURE__ */ import_react16.default.createElement("div", { className: "relative w-full bg-slate-800/70 p-1.5 min-h-[42px] flex flex-wrap gap-1.5 rounded-lg border border-white/10 focus-within:ring-2 focus-within:ring-indigo-400/60 transition-all" }, types.map((t, index) => /* @__PURE__ */ import_react16.default.createElement("span", { key: index, className: `flex items-center gap-1 px-1.5 py-0.5 rounded-md text-xs font-medium border ${t === "quest" ? "bg-sky-500/20 text-sky-200 border-sky-500/30" : "bg-indigo-500/30 text-indigo-100 border-indigo-500/20"}` }, t, t !== "quest" && /* @__PURE__ */ import_react16.default.createElement("button", { type: "button", onClick: () => handleRemoveType(index), className: "hover:text-white transition-colors" }, /* @__PURE__ */ import_react16.default.createElement(import_fi14.FiX, { size: 12 })))), /* @__PURE__ */ import_react16.default.createElement(
|
|
8296
8325
|
"input",
|
|
8297
8326
|
{
|
|
8298
8327
|
type: "text",
|
|
@@ -8887,7 +8916,8 @@ function QuestDetailsPanel({
|
|
|
8887
8916
|
onMentionClick,
|
|
8888
8917
|
onUploadFile,
|
|
8889
8918
|
userRole,
|
|
8890
|
-
currentDatasetName
|
|
8919
|
+
currentDatasetName,
|
|
8920
|
+
viewMembers = []
|
|
8891
8921
|
}) {
|
|
8892
8922
|
var _a;
|
|
8893
8923
|
const initialRawTitle = (node == null ? void 0 : node.raw_title) || (((_a = node == null ? void 0 : node.name) == null ? void 0 : _a.includes(" - \xBB ")) ? node.name.split(" - \xBB ")[1] : node == null ? void 0 : node.name) || "";
|
|
@@ -8899,6 +8929,7 @@ function QuestDetailsPanel({
|
|
|
8899
8929
|
const [typeInput, setTypeInput] = (0, import_react18.useState)("");
|
|
8900
8930
|
const [status, setStatus] = (0, import_react18.useState)((node == null ? void 0 : node.status) ?? "Backlog");
|
|
8901
8931
|
const [size, setSize] = (0, import_react18.useState)((node == null ? void 0 : node.size) ?? "medium");
|
|
8932
|
+
const [assigneeId, setAssigneeId] = (0, import_react18.useState)((node == null ? void 0 : node.assignee_id) || "");
|
|
8902
8933
|
const [description, setDescription] = (0, import_react18.useState)((node == null ? void 0 : node.description) ?? "");
|
|
8903
8934
|
const [intensity, setIntensity] = (0, import_react18.useState)((node == null ? void 0 : node.intensity) !== void 0 ? node.intensity : 0);
|
|
8904
8935
|
const [isStatusDropdownOpen, setIsStatusDropdownOpen] = (0, import_react18.useState)(false);
|
|
@@ -8938,6 +8969,7 @@ function QuestDetailsPanel({
|
|
|
8938
8969
|
setTypes((node == null ? void 0 : node.type) ? Array.isArray(node.type) ? node.type : [node.type] : ["quest"]);
|
|
8939
8970
|
setStatus((node == null ? void 0 : node.status) ?? "Backlog");
|
|
8940
8971
|
setSize((node == null ? void 0 : node.size) ?? "medium");
|
|
8972
|
+
setAssigneeId((node == null ? void 0 : node.assignee_id) || "");
|
|
8941
8973
|
setDescription((node == null ? void 0 : node.description) ?? "");
|
|
8942
8974
|
setIntensity((node == null ? void 0 : node.intensity) !== void 0 ? node.intensity : 0);
|
|
8943
8975
|
setExistingSections((node == null ? void 0 : node.description_sections) || []);
|
|
@@ -9044,6 +9076,7 @@ function QuestDetailsPanel({
|
|
|
9044
9076
|
const currentRawTitle = overrides.rawTitle !== void 0 ? overrides.rawTitle : rawTitle;
|
|
9045
9077
|
const currentStandardName = questPrefix ? `${questPrefix} - \xBB ${currentRawTitle || "Sem t\xEDtulo"}` : currentRawTitle;
|
|
9046
9078
|
const currentTypes = overrides.types !== void 0 ? overrides.types : types;
|
|
9079
|
+
const currentAssigneeId = overrides.assigneeId !== void 0 ? overrides.assigneeId : assigneeId;
|
|
9047
9080
|
const currentDescription = overrides.description !== void 0 ? overrides.description : description;
|
|
9048
9081
|
const currentCustomProps = overrides.customProps !== void 0 ? overrides.customProps : customProps;
|
|
9049
9082
|
const currentExistingSections = overrides.existingSections !== void 0 ? overrides.existingSections : existingSections;
|
|
@@ -9069,6 +9102,7 @@ function QuestDetailsPanel({
|
|
|
9069
9102
|
type: currentTypes,
|
|
9070
9103
|
color: QUEST_STATUS_COLORS3[currentStatus],
|
|
9071
9104
|
status: currentStatus,
|
|
9105
|
+
assignee_id: currentAssigneeId || null,
|
|
9072
9106
|
size,
|
|
9073
9107
|
description: currentDescription,
|
|
9074
9108
|
description_sections: processedSections,
|
|
@@ -9101,6 +9135,8 @@ function QuestDetailsPanel({
|
|
|
9101
9135
|
onClose();
|
|
9102
9136
|
};
|
|
9103
9137
|
const currentUsedTypes = customProps.map((p) => p.type).filter((t) => UNIQUE_PROP_TYPES.includes(t));
|
|
9138
|
+
const assigneeMember = viewMembers.find((m) => m.id === assigneeId);
|
|
9139
|
+
const isAssigneeUndefined = assigneeId && !assigneeMember;
|
|
9104
9140
|
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(
|
|
9105
9141
|
"div",
|
|
9106
9142
|
{
|
|
@@ -9170,7 +9206,20 @@ function QuestDetailsPanel({
|
|
|
9170
9206
|
},
|
|
9171
9207
|
/* @__PURE__ */ import_react18.default.createElement("span", { className: "w-3 h-3 rounded-full", style: { backgroundColor: QUEST_STATUS_COLORS3[s] } }),
|
|
9172
9208
|
s
|
|
9173
|
-
)))))), /* @__PURE__ */ import_react18.default.createElement("div", { className: "space-y-1.5
|
|
9209
|
+
)))))), /* @__PURE__ */ import_react18.default.createElement("div", { className: "space-y-1.5 relative mt-2" }, /* @__PURE__ */ import_react18.default.createElement("label", { className: "text-xs text-slate-300" }, "Assignee (Respons\xE1vel)"), canEdit ? /* @__PURE__ */ import_react18.default.createElement(
|
|
9210
|
+
"select",
|
|
9211
|
+
{
|
|
9212
|
+
value: assigneeId,
|
|
9213
|
+
onChange: (e) => {
|
|
9214
|
+
setAssigneeId(e.target.value);
|
|
9215
|
+
setHasUnsavedChanges(true);
|
|
9216
|
+
},
|
|
9217
|
+
className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 hover:border-white/20 focus:outline-none focus:ring-2 focus:ring-indigo-400/60 transition-colors text-slate-200"
|
|
9218
|
+
},
|
|
9219
|
+
/* @__PURE__ */ import_react18.default.createElement("option", { value: "" }, "Nenhum"),
|
|
9220
|
+
isAssigneeUndefined && /* @__PURE__ */ import_react18.default.createElement("option", { value: assigneeId }, "Undefined"),
|
|
9221
|
+
viewMembers.map((member) => /* @__PURE__ */ import_react18.default.createElement("option", { key: member.id, value: member.id }, member.name || member.email || member.id))
|
|
9222
|
+
) : /* @__PURE__ */ import_react18.default.createElement("div", { className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 text-slate-400" }, assigneeId ? assigneeMember ? assigneeMember.name || assigneeMember.email : "Undefined" : "Nenhum")), /* @__PURE__ */ import_react18.default.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ import_react18.default.createElement("label", { className: "text-xs text-slate-300" }, "Tipos Adicionais"), /* @__PURE__ */ import_react18.default.createElement("div", { className: `relative w-full bg-slate-800/70 p-1.5 min-h-[42px] flex flex-wrap gap-1.5 rounded-lg border border-white/10 ${canEdit ? "focus-within:ring-2 focus-within:ring-indigo-400/60" : ""} transition-all` }, types.map((t, index) => /* @__PURE__ */ import_react18.default.createElement("span", { key: index, className: `flex items-center gap-1 px-1.5 py-0.5 rounded-md text-xs font-medium border ${t === "quest" ? "bg-sky-500/20 text-sky-200 border-sky-500/30" : "bg-indigo-500/30 text-indigo-100 border-indigo-500/20"}` }, t, canEdit && t !== "quest" && /* @__PURE__ */ import_react18.default.createElement("button", { type: "button", onClick: () => handleRemoveType(index), className: "hover:text-white transition-colors" }, /* @__PURE__ */ import_react18.default.createElement(import_fi16.FiX, { size: 12 })))), canEdit && /* @__PURE__ */ import_react18.default.createElement(
|
|
9174
9223
|
"input",
|
|
9175
9224
|
{
|
|
9176
9225
|
type: "text",
|
|
@@ -10653,7 +10702,8 @@ function XViewScene({
|
|
|
10653
10702
|
save_ancestry_board_action,
|
|
10654
10703
|
upload_file_action,
|
|
10655
10704
|
delete_file_action,
|
|
10656
|
-
check_user_permission
|
|
10705
|
+
check_user_permission,
|
|
10706
|
+
get_view_members
|
|
10657
10707
|
}) {
|
|
10658
10708
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
10659
10709
|
const { data: session, status } = (0, import_react27.useSession)();
|
|
@@ -10686,6 +10736,13 @@ function XViewScene({
|
|
|
10686
10736
|
} else {
|
|
10687
10737
|
setPermissionStatus("denied");
|
|
10688
10738
|
setIsLoading(false);
|
|
10739
|
+
return;
|
|
10740
|
+
}
|
|
10741
|
+
if (get_view_members) {
|
|
10742
|
+
const membersRes = await get_view_members(owner_id, type, id);
|
|
10743
|
+
if (membersRes.success && membersRes.members) {
|
|
10744
|
+
setViewMembers(membersRes.members);
|
|
10745
|
+
}
|
|
10689
10746
|
}
|
|
10690
10747
|
} catch (error) {
|
|
10691
10748
|
console.error("Erro ao verificar permiss\xE3o:", error);
|
|
@@ -10726,6 +10783,7 @@ function XViewScene({
|
|
|
10726
10783
|
const [isLoading, setIsLoading] = (0, import_react26.useState)(true);
|
|
10727
10784
|
const [permissionStatus, setPermissionStatus] = (0, import_react26.useState)("loading");
|
|
10728
10785
|
const [userPermissionRole, setUserPermissionRole] = (0, import_react26.useState)(null);
|
|
10786
|
+
const [viewMembers, setViewMembers] = (0, import_react26.useState)([]);
|
|
10729
10787
|
const [isInitialized, setIsInitialized] = (0, import_react26.useState)(false);
|
|
10730
10788
|
const [sceneVersion, setSceneVersion] = (0, import_react26.useState)(0);
|
|
10731
10789
|
const [contextMenu, setContextMenu] = (0, import_react26.useState)({
|
|
@@ -10869,6 +10927,19 @@ function XViewScene({
|
|
|
10869
10927
|
(0, import_react26.useEffect)(() => {
|
|
10870
10928
|
stateRef.current.ancestry = ancestryMode;
|
|
10871
10929
|
}, [ancestryMode]);
|
|
10930
|
+
const handleStartQuestQuick = (0, import_react26.useCallback)((questNode) => {
|
|
10931
|
+
var _a2;
|
|
10932
|
+
if (!questNode || !actionHandlerContext) return;
|
|
10933
|
+
const updatedNode = {
|
|
10934
|
+
...questNode,
|
|
10935
|
+
status: "In Progress",
|
|
10936
|
+
color: "#eab308",
|
|
10937
|
+
assignee_id: (_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.id
|
|
10938
|
+
};
|
|
10939
|
+
if (userActionHandlers.handleSaveNodeDetails) {
|
|
10940
|
+
userActionHandlers.handleSaveNodeDetails(actionHandlerContext, updatedNode);
|
|
10941
|
+
}
|
|
10942
|
+
}, [session, actionHandlerContext]);
|
|
10872
10943
|
(0, import_react26.useEffect)(() => {
|
|
10873
10944
|
var _a2;
|
|
10874
10945
|
if (!isInitialized) return;
|
|
@@ -14792,7 +14863,8 @@ function XViewScene({
|
|
|
14792
14863
|
availableNodes: allAvailableNodes,
|
|
14793
14864
|
availableAncestries: allAvailableAncestries,
|
|
14794
14865
|
viewName: viewParams == null ? void 0 : viewParams.name,
|
|
14795
|
-
questCounter: ((_g = sceneDataRef.current) == null ? void 0 : _g.quest_counter) || 1
|
|
14866
|
+
questCounter: ((_g = sceneDataRef.current) == null ? void 0 : _g.quest_counter) || 1,
|
|
14867
|
+
viewMembers
|
|
14796
14868
|
}
|
|
14797
14869
|
),
|
|
14798
14870
|
readingMode.isActive && readingMode.ancestry && /* @__PURE__ */ import_react26.default.createElement(
|
|
@@ -15035,7 +15107,10 @@ function XViewScene({
|
|
|
15035
15107
|
onRenderAncestry: handleStartReadingAncestry,
|
|
15036
15108
|
onEditAncestry: handleEditAncestry,
|
|
15037
15109
|
onDeleteAncestry: (ancestryId) => handleDeleteAncestry(ancestryId),
|
|
15038
|
-
onFocusNode: handleFocusNode
|
|
15110
|
+
onFocusNode: handleFocusNode,
|
|
15111
|
+
viewMembers,
|
|
15112
|
+
currentUser: session == null ? void 0 : session.user,
|
|
15113
|
+
onStartQuest: handleStartQuestQuick
|
|
15039
15114
|
}
|
|
15040
15115
|
),
|
|
15041
15116
|
/* @__PURE__ */ import_react26.default.createElement(
|
|
@@ -15611,6 +15686,17 @@ async function delete_uploaded_file_logic(db_services, fileUrl) {
|
|
|
15611
15686
|
return { success: false, error: error.message };
|
|
15612
15687
|
}
|
|
15613
15688
|
}
|
|
15689
|
+
async function get_view_members_logic(db_services, ownerId, type, itemId) {
|
|
15690
|
+
try {
|
|
15691
|
+
if (!db_services.get_view_members) {
|
|
15692
|
+
return { success: false, error: "Servi\xE7o de busca de membros n\xE3o configurado." };
|
|
15693
|
+
}
|
|
15694
|
+
return await db_services.get_view_members(ownerId, type, itemId);
|
|
15695
|
+
} catch (error) {
|
|
15696
|
+
console.error("Erro em get_view_members_logic:", error);
|
|
15697
|
+
return { success: false, error: error.message };
|
|
15698
|
+
}
|
|
15699
|
+
}
|
|
15614
15700
|
// Annotate the CommonJS export names for ESM import in node:
|
|
15615
15701
|
0 && (module.exports = {
|
|
15616
15702
|
XViewScene,
|
|
@@ -15619,6 +15705,7 @@ async function delete_uploaded_file_logic(db_services, fileUrl) {
|
|
|
15619
15705
|
get_ancestry_file_logic,
|
|
15620
15706
|
get_scene_view_data_logic,
|
|
15621
15707
|
get_single_parent_file_logic,
|
|
15708
|
+
get_view_members_logic,
|
|
15622
15709
|
import_parent_file_modal_get_logic,
|
|
15623
15710
|
save_ancestry_board_logic,
|
|
15624
15711
|
save_view_data_logic,
|
package/dist/index.mjs
CHANGED
|
@@ -103,7 +103,10 @@ function ContextMenu({
|
|
|
103
103
|
onEditAncestry,
|
|
104
104
|
onDeleteAncestry,
|
|
105
105
|
onFocusNode,
|
|
106
|
-
onClose
|
|
106
|
+
onClose,
|
|
107
|
+
viewMembers,
|
|
108
|
+
currentUser,
|
|
109
|
+
onStartQuest
|
|
107
110
|
}) {
|
|
108
111
|
var _a, _b, _c;
|
|
109
112
|
const menuRef = useRef(null);
|
|
@@ -304,12 +307,25 @@ function ContextMenu({
|
|
|
304
307
|
});
|
|
305
308
|
};
|
|
306
309
|
const renderMainView = () => {
|
|
307
|
-
var _a2;
|
|
310
|
+
var _a2, _b2, _c2;
|
|
308
311
|
const hasVersions = computedVersions.length > 0;
|
|
309
312
|
const canCreateVersion = ability.can("create", "Versioning");
|
|
310
313
|
const canReadVersion = ability.can("read", "Versioning");
|
|
311
314
|
const shouldShowVersioningBtn = canCreateVersion || canReadVersion && hasVersions;
|
|
312
|
-
|
|
315
|
+
const canStartQuest = isCurrentNodeQuest && (((_a2 = data.nodeData) == null ? void 0 : _a2.status) !== "In Progress" || ((_b2 = data.nodeData) == null ? void 0 : _b2.assignee_id) !== (currentUser == null ? void 0 : currentUser.id));
|
|
316
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 px-2 pt-1 pb-2" }, /* @__PURE__ */ React.createElement("span", { className: "inline-flex h-2 w-2 rounded-full bg-indigo-400/80 shadow-[0_0_12px_1px_rgba(99,102,241,0.5)]" }), /* @__PURE__ */ React.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "A\xE7\xF5es R\xE1pidas")), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-1" }, canStartQuest && /* @__PURE__ */ React.createElement(
|
|
317
|
+
"button",
|
|
318
|
+
{
|
|
319
|
+
onClick: () => {
|
|
320
|
+
onStartQuest == null ? void 0 : onStartQuest(data.nodeData);
|
|
321
|
+
onClose();
|
|
322
|
+
},
|
|
323
|
+
className: `w-full flex items-center gap-2.5 px-2 py-1.5 text-left text-sm rounded-md bg-yellow-500/10 text-yellow-400 hover:bg-yellow-500/20 hover:text-yellow-300 transition-colors duration-150 truncate font-semibold shadow-inner`,
|
|
324
|
+
title: "Atribuir a mim e iniciar"
|
|
325
|
+
},
|
|
326
|
+
/* @__PURE__ */ React.createElement("span", null, "\u{1F680}"),
|
|
327
|
+
/* @__PURE__ */ React.createElement("span", null, "Iniciar Quest")
|
|
328
|
+
), ability.can("create", "Connection") && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartConnection == null ? void 0 : onStartConnection(data.nodeData), className: baseButtonClass, title: "Conectar" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72" }), /* @__PURE__ */ React.createElement("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72" })), /* @__PURE__ */ React.createElement("span", null, "Conectar")), ability.can("create", "Node") && !((_c2 = data.nodeData) == null ? void 0 : _c2.is_quest) && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartCreation == null ? void 0 : onStartCreation(data.nodeData), className: baseButtonClass, title: "Criar e Conectar" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React.createElement("line", { x1: "12", y1: "8", x2: "12", y2: "16" }), /* @__PURE__ */ React.createElement("line", { x1: "8", y1: "12", x2: "16", y2: "12" })), /* @__PURE__ */ React.createElement("span", null, "Criar e Conectar")), ability.can("create", "Ancestry") && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartAncestryCreation == null ? void 0 : onStartAncestryCreation(data.nodeData), className: baseButtonClass, title: "Criar Ancestralidade" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M10 20.5c.5-.5.8-1.2.8-2s-.3-1.5-.8-2c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8c-.5.5-.8 1.2-.8 2s.3 1.5.8 2c.5.5 1.2-.8 2 .8s1.5-.3 2-.8c-.5-.5-.8-1.2-.8-2s.3-1.5.8-2c.5.5 1.2-.8 2 .8s1.5.3 2 .8Z" }), /* @__PURE__ */ React.createElement("path", { d: "M10 16v-3a2 2 0 0 1 2-2h4" }), /* @__PURE__ */ React.createElement("path", { d: "M14 3.5c.5.5.8 1.2.8 2s-.3 1.5-.8 2c-.5-.5-1.2-.8-2 .8s1.5.3-2-.8c-.5-.5-.8-1.2-.8-2s.3-1.5.8-2c.5.5 1.2-.8 2 .8s1.5.3 2 .8Z" }), /* @__PURE__ */ React.createElement("path", { d: "M14 8v3a2 2 0 0 0 2 2h4" })), /* @__PURE__ */ React.createElement("span", null, "Criar Ancestralidade")), shouldShowVersioningBtn && /* @__PURE__ */ React.createElement("button", { onClick: () => setMenuView("versioning"), className: baseButtonClass, title: hasVersions ? "Versionamento" : "Criar Versionamento" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("line", { x1: "6", y1: "3", x2: "6", y2: "15" }), /* @__PURE__ */ React.createElement("circle", { cx: "18", cy: "6", r: "3" }), /* @__PURE__ */ React.createElement("circle", { cx: "6", cy: "18", r: "3" }), /* @__PURE__ */ React.createElement("path", { d: "M18 9a9 9 0 0 1-9 9" })), /* @__PURE__ */ React.createElement("span", null, hasVersions || !canCreateVersion ? "Versionamento" : "Criar Versionamento")), (connections.length > 0 || availableAncestries.length > 0) && ability.can("read", "Connection") && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ React.createElement("button", { onClick: () => setMenuView("connections"), className: baseButtonClass, title: "Conex\xF5es" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2z" }), /* @__PURE__ */ React.createElement("path", { d: "M8 12h8" }), /* @__PURE__ */ React.createElement("path", { d: "M12 8v8" })), /* @__PURE__ */ React.createElement("span", null, "Conex\xF5es (", totalConnectionsCount, ")"))), /* @__PURE__ */ React.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ React.createElement("button", { onClick: () => {
|
|
313
329
|
onFocusNode == null ? void 0 : onFocusNode(data.nodeData);
|
|
314
330
|
onClose();
|
|
315
331
|
}, className: baseButtonClass, title: "Focar na c\xE2mera" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "3" })), /* @__PURE__ */ React.createElement("span", null, "Focar neste Node")), /* @__PURE__ */ React.createElement("button", { onClick: (e) => handleCopyLink(e, data.nodeData), className: baseButtonClass, title: "Copiar Link para Compartilhar" }, isLinkCopied ? /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#4ade80", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("polyline", { points: "20 6 9 17 4 12" })) : /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72" }), /* @__PURE__ */ React.createElement("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72" })), /* @__PURE__ */ React.createElement("span", { className: isLinkCopied ? "text-green-400" : "" }, isLinkCopied ? "Copiado!" : "Copiar Link")), ability.can("dismiss", "Node") && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("button", { onClick: () => onDismissNode == null ? void 0 : onDismissNode(data.nodeData), className: baseButtonClass, title: "Remover da visualiza\xE7\xE3o" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }), /* @__PURE__ */ React.createElement("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }), /* @__PURE__ */ React.createElement("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }), /* @__PURE__ */ React.createElement("line", { x1: "2", y1: "2", x2: "22", y2: "22" })), /* @__PURE__ */ React.createElement("span", null, "Dismiss")), /* @__PURE__ */ React.createElement("button", { onClick: () => onDismissOtherNodes == null ? void 0 : onDismissOtherNodes(data.nodeData), className: baseButtonClass, title: "Remover outros da visualiza\xE7\xE3o" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "3" }), /* @__PURE__ */ React.createElement("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }), /* @__PURE__ */ React.createElement("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ React.createElement("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }), /* @__PURE__ */ React.createElement("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })), /* @__PURE__ */ React.createElement("span", null, "Dismiss other nodes"))), ability.can("delete", "Node") && /* @__PURE__ */ React.createElement("button", { onClick: () => setMenuView("deleteConfirmation"), className: deleteButtonClass, title: "Excluir Node" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("polyline", { points: "3 6 5 6 21 6" }), /* @__PURE__ */ React.createElement("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ React.createElement("line", { x1: "10", y1: "11", x2: "10", y2: "17" }), /* @__PURE__ */ React.createElement("line", { x1: "14", y1: "11", x2: "14", y2: "17" })), /* @__PURE__ */ React.createElement("span", null, "Excluir Node"))));
|
|
@@ -8148,10 +8164,12 @@ function InSceneQuestForm({
|
|
|
8148
8164
|
onSizeChange,
|
|
8149
8165
|
viewName = "Projeto",
|
|
8150
8166
|
// NOVA PROP
|
|
8151
|
-
questCounter = 1
|
|
8167
|
+
questCounter = 1,
|
|
8152
8168
|
// NOVA PROP
|
|
8169
|
+
viewMembers = []
|
|
8153
8170
|
}) {
|
|
8154
8171
|
const [name, setName] = useState16("");
|
|
8172
|
+
const [assigneeId, setAssigneeId] = useState16("");
|
|
8155
8173
|
const [types, setTypes] = useState16(["quest"]);
|
|
8156
8174
|
const [typeInput, setTypeInput] = useState16("");
|
|
8157
8175
|
const [status, setStatus] = useState16("Backlog");
|
|
@@ -8214,6 +8232,7 @@ function InSceneQuestForm({
|
|
|
8214
8232
|
type: types,
|
|
8215
8233
|
color: QUEST_STATUS_COLORS2[status],
|
|
8216
8234
|
status,
|
|
8235
|
+
assignee_id: assigneeId || null,
|
|
8217
8236
|
size,
|
|
8218
8237
|
intensity,
|
|
8219
8238
|
description: description.trim(),
|
|
@@ -8285,7 +8304,16 @@ function InSceneQuestForm({
|
|
|
8285
8304
|
},
|
|
8286
8305
|
/* @__PURE__ */ React15.createElement("span", { className: "w-3 h-3 rounded-full", style: { backgroundColor: QUEST_STATUS_COLORS2[s] } }),
|
|
8287
8306
|
s
|
|
8288
|
-
)))))), /* @__PURE__ */ React15.createElement("div", { className: "space-y-1.5
|
|
8307
|
+
)))))), /* @__PURE__ */ React15.createElement("div", { className: "space-y-1.5 relative mt-2" }, /* @__PURE__ */ React15.createElement("label", { className: "text-xs text-slate-300" }, "Assignee (Respons\xE1vel)"), /* @__PURE__ */ React15.createElement(
|
|
8308
|
+
"select",
|
|
8309
|
+
{
|
|
8310
|
+
value: assigneeId,
|
|
8311
|
+
onChange: (e) => setAssigneeId(e.target.value),
|
|
8312
|
+
className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 hover:border-white/20 focus:outline-none focus:ring-2 focus:ring-indigo-400/60 transition-colors text-slate-200"
|
|
8313
|
+
},
|
|
8314
|
+
/* @__PURE__ */ React15.createElement("option", { value: "" }, "Nenhum"),
|
|
8315
|
+
viewMembers.map((member) => /* @__PURE__ */ React15.createElement("option", { key: member.id, value: member.id }, member.name || member.email || member.id))
|
|
8316
|
+
)), /* @__PURE__ */ React15.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React15.createElement("label", { className: "text-xs text-slate-300" }, "Tipos Adicionais"), /* @__PURE__ */ React15.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 focus-within:ring-2 focus-within:ring-indigo-400/60 transition-all" }, types.map((t, index) => /* @__PURE__ */ React15.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, t !== "quest" && /* @__PURE__ */ React15.createElement("button", { type: "button", onClick: () => handleRemoveType(index), className: "hover:text-white transition-colors" }, /* @__PURE__ */ React15.createElement(FiX4, { size: 12 })))), /* @__PURE__ */ React15.createElement(
|
|
8289
8317
|
"input",
|
|
8290
8318
|
{
|
|
8291
8319
|
type: "text",
|
|
@@ -8880,7 +8908,8 @@ function QuestDetailsPanel({
|
|
|
8880
8908
|
onMentionClick,
|
|
8881
8909
|
onUploadFile,
|
|
8882
8910
|
userRole,
|
|
8883
|
-
currentDatasetName
|
|
8911
|
+
currentDatasetName,
|
|
8912
|
+
viewMembers = []
|
|
8884
8913
|
}) {
|
|
8885
8914
|
var _a;
|
|
8886
8915
|
const initialRawTitle = (node == null ? void 0 : node.raw_title) || (((_a = node == null ? void 0 : node.name) == null ? void 0 : _a.includes(" - \xBB ")) ? node.name.split(" - \xBB ")[1] : node == null ? void 0 : node.name) || "";
|
|
@@ -8892,6 +8921,7 @@ function QuestDetailsPanel({
|
|
|
8892
8921
|
const [typeInput, setTypeInput] = useState18("");
|
|
8893
8922
|
const [status, setStatus] = useState18((node == null ? void 0 : node.status) ?? "Backlog");
|
|
8894
8923
|
const [size, setSize] = useState18((node == null ? void 0 : node.size) ?? "medium");
|
|
8924
|
+
const [assigneeId, setAssigneeId] = useState18((node == null ? void 0 : node.assignee_id) || "");
|
|
8895
8925
|
const [description, setDescription] = useState18((node == null ? void 0 : node.description) ?? "");
|
|
8896
8926
|
const [intensity, setIntensity] = useState18((node == null ? void 0 : node.intensity) !== void 0 ? node.intensity : 0);
|
|
8897
8927
|
const [isStatusDropdownOpen, setIsStatusDropdownOpen] = useState18(false);
|
|
@@ -8931,6 +8961,7 @@ function QuestDetailsPanel({
|
|
|
8931
8961
|
setTypes((node == null ? void 0 : node.type) ? Array.isArray(node.type) ? node.type : [node.type] : ["quest"]);
|
|
8932
8962
|
setStatus((node == null ? void 0 : node.status) ?? "Backlog");
|
|
8933
8963
|
setSize((node == null ? void 0 : node.size) ?? "medium");
|
|
8964
|
+
setAssigneeId((node == null ? void 0 : node.assignee_id) || "");
|
|
8934
8965
|
setDescription((node == null ? void 0 : node.description) ?? "");
|
|
8935
8966
|
setIntensity((node == null ? void 0 : node.intensity) !== void 0 ? node.intensity : 0);
|
|
8936
8967
|
setExistingSections((node == null ? void 0 : node.description_sections) || []);
|
|
@@ -9037,6 +9068,7 @@ function QuestDetailsPanel({
|
|
|
9037
9068
|
const currentRawTitle = overrides.rawTitle !== void 0 ? overrides.rawTitle : rawTitle;
|
|
9038
9069
|
const currentStandardName = questPrefix ? `${questPrefix} - \xBB ${currentRawTitle || "Sem t\xEDtulo"}` : currentRawTitle;
|
|
9039
9070
|
const currentTypes = overrides.types !== void 0 ? overrides.types : types;
|
|
9071
|
+
const currentAssigneeId = overrides.assigneeId !== void 0 ? overrides.assigneeId : assigneeId;
|
|
9040
9072
|
const currentDescription = overrides.description !== void 0 ? overrides.description : description;
|
|
9041
9073
|
const currentCustomProps = overrides.customProps !== void 0 ? overrides.customProps : customProps;
|
|
9042
9074
|
const currentExistingSections = overrides.existingSections !== void 0 ? overrides.existingSections : existingSections;
|
|
@@ -9062,6 +9094,7 @@ function QuestDetailsPanel({
|
|
|
9062
9094
|
type: currentTypes,
|
|
9063
9095
|
color: QUEST_STATUS_COLORS3[currentStatus],
|
|
9064
9096
|
status: currentStatus,
|
|
9097
|
+
assignee_id: currentAssigneeId || null,
|
|
9065
9098
|
size,
|
|
9066
9099
|
description: currentDescription,
|
|
9067
9100
|
description_sections: processedSections,
|
|
@@ -9094,6 +9127,8 @@ function QuestDetailsPanel({
|
|
|
9094
9127
|
onClose();
|
|
9095
9128
|
};
|
|
9096
9129
|
const currentUsedTypes = customProps.map((p) => p.type).filter((t) => UNIQUE_PROP_TYPES.includes(t));
|
|
9130
|
+
const assigneeMember = viewMembers.find((m) => m.id === assigneeId);
|
|
9131
|
+
const isAssigneeUndefined = assigneeId && !assigneeMember;
|
|
9097
9132
|
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
9098
9133
|
"div",
|
|
9099
9134
|
{
|
|
@@ -9163,7 +9198,20 @@ function QuestDetailsPanel({
|
|
|
9163
9198
|
},
|
|
9164
9199
|
/* @__PURE__ */ React17.createElement("span", { className: "w-3 h-3 rounded-full", style: { backgroundColor: QUEST_STATUS_COLORS3[s] } }),
|
|
9165
9200
|
s
|
|
9166
|
-
)))))), /* @__PURE__ */ React17.createElement("div", { className: "space-y-1.5
|
|
9201
|
+
)))))), /* @__PURE__ */ React17.createElement("div", { className: "space-y-1.5 relative mt-2" }, /* @__PURE__ */ React17.createElement("label", { className: "text-xs text-slate-300" }, "Assignee (Respons\xE1vel)"), canEdit ? /* @__PURE__ */ React17.createElement(
|
|
9202
|
+
"select",
|
|
9203
|
+
{
|
|
9204
|
+
value: assigneeId,
|
|
9205
|
+
onChange: (e) => {
|
|
9206
|
+
setAssigneeId(e.target.value);
|
|
9207
|
+
setHasUnsavedChanges(true);
|
|
9208
|
+
},
|
|
9209
|
+
className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 hover:border-white/20 focus:outline-none focus:ring-2 focus:ring-indigo-400/60 transition-colors text-slate-200"
|
|
9210
|
+
},
|
|
9211
|
+
/* @__PURE__ */ React17.createElement("option", { value: "" }, "Nenhum"),
|
|
9212
|
+
isAssigneeUndefined && /* @__PURE__ */ React17.createElement("option", { value: assigneeId }, "Undefined"),
|
|
9213
|
+
viewMembers.map((member) => /* @__PURE__ */ React17.createElement("option", { key: member.id, value: member.id }, member.name || member.email || member.id))
|
|
9214
|
+
) : /* @__PURE__ */ React17.createElement("div", { className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 text-slate-400" }, assigneeId ? assigneeMember ? assigneeMember.name || assigneeMember.email : "Undefined" : "Nenhum")), /* @__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(
|
|
9167
9215
|
"input",
|
|
9168
9216
|
{
|
|
9169
9217
|
type: "text",
|
|
@@ -10659,7 +10707,8 @@ function XViewScene({
|
|
|
10659
10707
|
save_ancestry_board_action,
|
|
10660
10708
|
upload_file_action,
|
|
10661
10709
|
delete_file_action,
|
|
10662
|
-
check_user_permission
|
|
10710
|
+
check_user_permission,
|
|
10711
|
+
get_view_members
|
|
10663
10712
|
}) {
|
|
10664
10713
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
10665
10714
|
const { data: session, status } = useSession();
|
|
@@ -10692,6 +10741,13 @@ function XViewScene({
|
|
|
10692
10741
|
} else {
|
|
10693
10742
|
setPermissionStatus("denied");
|
|
10694
10743
|
setIsLoading(false);
|
|
10744
|
+
return;
|
|
10745
|
+
}
|
|
10746
|
+
if (get_view_members) {
|
|
10747
|
+
const membersRes = await get_view_members(owner_id, type, id);
|
|
10748
|
+
if (membersRes.success && membersRes.members) {
|
|
10749
|
+
setViewMembers(membersRes.members);
|
|
10750
|
+
}
|
|
10695
10751
|
}
|
|
10696
10752
|
} catch (error) {
|
|
10697
10753
|
console.error("Erro ao verificar permiss\xE3o:", error);
|
|
@@ -10732,6 +10788,7 @@ function XViewScene({
|
|
|
10732
10788
|
const [isLoading, setIsLoading] = useState25(true);
|
|
10733
10789
|
const [permissionStatus, setPermissionStatus] = useState25("loading");
|
|
10734
10790
|
const [userPermissionRole, setUserPermissionRole] = useState25(null);
|
|
10791
|
+
const [viewMembers, setViewMembers] = useState25([]);
|
|
10735
10792
|
const [isInitialized, setIsInitialized] = useState25(false);
|
|
10736
10793
|
const [sceneVersion, setSceneVersion] = useState25(0);
|
|
10737
10794
|
const [contextMenu, setContextMenu] = useState25({
|
|
@@ -10875,6 +10932,19 @@ function XViewScene({
|
|
|
10875
10932
|
useEffect22(() => {
|
|
10876
10933
|
stateRef.current.ancestry = ancestryMode;
|
|
10877
10934
|
}, [ancestryMode]);
|
|
10935
|
+
const handleStartQuestQuick = useCallback4((questNode) => {
|
|
10936
|
+
var _a2;
|
|
10937
|
+
if (!questNode || !actionHandlerContext) return;
|
|
10938
|
+
const updatedNode = {
|
|
10939
|
+
...questNode,
|
|
10940
|
+
status: "In Progress",
|
|
10941
|
+
color: "#eab308",
|
|
10942
|
+
assignee_id: (_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.id
|
|
10943
|
+
};
|
|
10944
|
+
if (userActionHandlers.handleSaveNodeDetails) {
|
|
10945
|
+
userActionHandlers.handleSaveNodeDetails(actionHandlerContext, updatedNode);
|
|
10946
|
+
}
|
|
10947
|
+
}, [session, actionHandlerContext]);
|
|
10878
10948
|
useEffect22(() => {
|
|
10879
10949
|
var _a2;
|
|
10880
10950
|
if (!isInitialized) return;
|
|
@@ -14798,7 +14868,8 @@ function XViewScene({
|
|
|
14798
14868
|
availableNodes: allAvailableNodes,
|
|
14799
14869
|
availableAncestries: allAvailableAncestries,
|
|
14800
14870
|
viewName: viewParams == null ? void 0 : viewParams.name,
|
|
14801
|
-
questCounter: ((_g = sceneDataRef.current) == null ? void 0 : _g.quest_counter) || 1
|
|
14871
|
+
questCounter: ((_g = sceneDataRef.current) == null ? void 0 : _g.quest_counter) || 1,
|
|
14872
|
+
viewMembers
|
|
14802
14873
|
}
|
|
14803
14874
|
),
|
|
14804
14875
|
readingMode.isActive && readingMode.ancestry && /* @__PURE__ */ React25.createElement(
|
|
@@ -15041,7 +15112,10 @@ function XViewScene({
|
|
|
15041
15112
|
onRenderAncestry: handleStartReadingAncestry,
|
|
15042
15113
|
onEditAncestry: handleEditAncestry,
|
|
15043
15114
|
onDeleteAncestry: (ancestryId) => handleDeleteAncestry(ancestryId),
|
|
15044
|
-
onFocusNode: handleFocusNode
|
|
15115
|
+
onFocusNode: handleFocusNode,
|
|
15116
|
+
viewMembers,
|
|
15117
|
+
currentUser: session == null ? void 0 : session.user,
|
|
15118
|
+
onStartQuest: handleStartQuestQuick
|
|
15045
15119
|
}
|
|
15046
15120
|
),
|
|
15047
15121
|
/* @__PURE__ */ React25.createElement(
|
|
@@ -15617,6 +15691,17 @@ async function delete_uploaded_file_logic(db_services, fileUrl) {
|
|
|
15617
15691
|
return { success: false, error: error.message };
|
|
15618
15692
|
}
|
|
15619
15693
|
}
|
|
15694
|
+
async function get_view_members_logic(db_services, ownerId, type, itemId) {
|
|
15695
|
+
try {
|
|
15696
|
+
if (!db_services.get_view_members) {
|
|
15697
|
+
return { success: false, error: "Servi\xE7o de busca de membros n\xE3o configurado." };
|
|
15698
|
+
}
|
|
15699
|
+
return await db_services.get_view_members(ownerId, type, itemId);
|
|
15700
|
+
} catch (error) {
|
|
15701
|
+
console.error("Erro em get_view_members_logic:", error);
|
|
15702
|
+
return { success: false, error: error.message };
|
|
15703
|
+
}
|
|
15704
|
+
}
|
|
15620
15705
|
export {
|
|
15621
15706
|
XViewScene,
|
|
15622
15707
|
delete_uploaded_file_logic,
|
|
@@ -15624,6 +15709,7 @@ export {
|
|
|
15624
15709
|
get_ancestry_file_logic,
|
|
15625
15710
|
get_scene_view_data_logic,
|
|
15626
15711
|
get_single_parent_file_logic,
|
|
15712
|
+
get_view_members_logic,
|
|
15627
15713
|
import_parent_file_modal_get_logic,
|
|
15628
15714
|
save_ancestry_board_logic,
|
|
15629
15715
|
save_view_data_logic,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lv-x-software-house/x_view",
|
|
3
|
-
"version": "1.2.5-dev.
|
|
3
|
+
"version": "1.2.5-dev.12",
|
|
4
4
|
"description": "Pacote privado contendo os componentes e lógica de renderização 3D do X View.",
|
|
5
5
|
"author": "iv.x - Engenharia de Software - ivxsoftwarehouse@gmail.com",
|
|
6
6
|
"license": "UNLICENSED",
|