@lv-x-software-house/x_view 1.2.6-dev.26 → 1.2.6-dev.27
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 +58 -55
- package/dist/index.mjs +56 -53
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,13 +31,13 @@ var index_exports = {};
|
|
|
31
31
|
__export(index_exports, {
|
|
32
32
|
XViewScene: () => XViewScene,
|
|
33
33
|
delete_uploaded_file_logic: () => delete_uploaded_file_logic,
|
|
34
|
-
get_ancestry_board_logic: () => get_ancestry_board_logic,
|
|
35
34
|
get_ancestry_file_logic: () => get_ancestry_file_logic,
|
|
35
|
+
get_boards_logic: () => get_boards_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
38
|
get_view_members_logic: () => get_view_members_logic,
|
|
39
39
|
import_parent_file_modal_get_logic: () => import_parent_file_modal_get_logic,
|
|
40
|
-
|
|
40
|
+
save_boards_logic: () => save_boards_logic,
|
|
41
41
|
save_view_data_logic: () => save_view_data_logic,
|
|
42
42
|
x_view_add_new_parent_file_to_scene_at_firebase: () => x_view_add_new_parent_file_to_scene_at_firebase
|
|
43
43
|
});
|
|
@@ -77,8 +77,8 @@ function defineAbilityFor(role) {
|
|
|
77
77
|
can("read", "Versioning");
|
|
78
78
|
can("read", "Node");
|
|
79
79
|
can("read", "Scene");
|
|
80
|
-
can("read", "
|
|
81
|
-
can("read", "
|
|
80
|
+
can("read", "Boards");
|
|
81
|
+
can("read", "BoardGroups");
|
|
82
82
|
can("dismiss", "Node");
|
|
83
83
|
cannot("update", "Scene");
|
|
84
84
|
cannot("import", "File");
|
|
@@ -91,10 +91,10 @@ function defineAbilityFor(role) {
|
|
|
91
91
|
cannot("create", "Ancestry");
|
|
92
92
|
cannot("update", "Ancestry");
|
|
93
93
|
cannot("delete", "Ancestry");
|
|
94
|
-
cannot("create", "
|
|
95
|
-
cannot("update", "
|
|
96
|
-
cannot("delete", "
|
|
97
|
-
cannot("manage", "
|
|
94
|
+
cannot("create", "BoardGroups");
|
|
95
|
+
cannot("update", "BoardGroups");
|
|
96
|
+
cannot("delete", "BoardGroups");
|
|
97
|
+
cannot("manage", "Boards");
|
|
98
98
|
cannot("update", "Node");
|
|
99
99
|
break;
|
|
100
100
|
case "link_viewer":
|
|
@@ -103,8 +103,8 @@ function defineAbilityFor(role) {
|
|
|
103
103
|
can("read", "Versioning");
|
|
104
104
|
cannot("read", "Scene");
|
|
105
105
|
cannot("read", "Connection");
|
|
106
|
-
cannot("read", "
|
|
107
|
-
cannot("read", "
|
|
106
|
+
cannot("read", "Boards");
|
|
107
|
+
cannot("read", "BoardGroups");
|
|
108
108
|
cannot("dismiss", "Node");
|
|
109
109
|
cannot("manage", "all");
|
|
110
110
|
break;
|
|
@@ -3882,7 +3882,7 @@ function XViewSidebar({
|
|
|
3882
3882
|
importSuccessMessage = "",
|
|
3883
3883
|
onActivateTimeline = () => {
|
|
3884
3884
|
},
|
|
3885
|
-
|
|
3885
|
+
onOpenBoards = () => {
|
|
3886
3886
|
},
|
|
3887
3887
|
viewType,
|
|
3888
3888
|
viewName,
|
|
@@ -4383,12 +4383,12 @@ function XViewSidebar({
|
|
|
4383
4383
|
), /* @__PURE__ */ import_react3.default.createElement(
|
|
4384
4384
|
"button",
|
|
4385
4385
|
{
|
|
4386
|
-
onClick:
|
|
4386
|
+
onClick: onOpenBoards,
|
|
4387
4387
|
className: buttonBaseClass,
|
|
4388
|
-
title: "Abrir painel de
|
|
4388
|
+
title: "Abrir painel de Boards"
|
|
4389
4389
|
},
|
|
4390
|
-
/* @__PURE__ */ import_react3.default.createElement(
|
|
4391
|
-
"
|
|
4390
|
+
/* @__PURE__ */ import_react3.default.createElement(import_fi2.FiLayers, { size: 16 }),
|
|
4391
|
+
"Boards"
|
|
4392
4392
|
)), /* @__PURE__ */ import_react3.default.createElement("div", { className: "h-px bg-white/10" }), /* @__PURE__ */ import_react3.default.createElement("section", { className: "space-y-3" }, /* @__PURE__ */ import_react3.default.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "Milestones"), /* @__PURE__ */ import_react3.default.createElement(
|
|
4393
4393
|
"button",
|
|
4394
4394
|
{
|
|
@@ -12918,7 +12918,7 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
12918
12918
|
);
|
|
12919
12919
|
}
|
|
12920
12920
|
|
|
12921
|
-
// src/components/
|
|
12921
|
+
// src/components/Boards.jsx
|
|
12922
12922
|
var import_react29 = __toESM(require("react"));
|
|
12923
12923
|
var import_fi23 = require("react-icons/fi");
|
|
12924
12924
|
var import_uuid11 = require("uuid");
|
|
@@ -13281,7 +13281,7 @@ function RichGroupEditor({
|
|
|
13281
13281
|
));
|
|
13282
13282
|
}
|
|
13283
13283
|
|
|
13284
|
-
// src/components/
|
|
13284
|
+
// src/components/Boards.jsx
|
|
13285
13285
|
var Tooltip = ({ text, children }) => {
|
|
13286
13286
|
if (!text) return children;
|
|
13287
13287
|
return /* @__PURE__ */ import_react29.default.createElement("div", { className: "relative group/tooltip" }, children, /* @__PURE__ */ import_react29.default.createElement("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-slate-900 border border-white/10 text-white text-[10px] rounded opacity-0 group-hover/tooltip:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-[3000] shadow-2xl" }, text));
|
|
@@ -13500,7 +13500,7 @@ var BoardItem = ({
|
|
|
13500
13500
|
}
|
|
13501
13501
|
))));
|
|
13502
13502
|
};
|
|
13503
|
-
function
|
|
13503
|
+
function Boards({
|
|
13504
13504
|
isOpen,
|
|
13505
13505
|
onClose,
|
|
13506
13506
|
onSelect,
|
|
@@ -13516,12 +13516,20 @@ function AncestryBoard({
|
|
|
13516
13516
|
const [navigationStack, setNavigationStack] = (0, import_react29.useState)([]);
|
|
13517
13517
|
const lastSavedBoardItemsRef = (0, import_react29.useRef)(null);
|
|
13518
13518
|
const canEdit = (0, import_react29.useMemo)(() => userRole !== "viewer", [userRole]);
|
|
13519
|
+
const sanitizeBoardItems = (list) => list.map((g) => ({
|
|
13520
|
+
id: g.id,
|
|
13521
|
+
type: g.type || "text_group",
|
|
13522
|
+
name: g.name || "",
|
|
13523
|
+
content: g.content || [],
|
|
13524
|
+
children: sanitizeBoardItems(g.children || [])
|
|
13525
|
+
}));
|
|
13519
13526
|
(0, import_react29.useEffect)(() => {
|
|
13520
13527
|
if (initialBoardItems && !isLoaded) {
|
|
13521
13528
|
const hasLegacyTypes = (list) => list.some((g) => g.type === "group" || hasLegacyTypes(g.children || []));
|
|
13529
|
+
let preparedItems = [];
|
|
13522
13530
|
if (hasLegacyTypes(initialBoardItems)) {
|
|
13523
|
-
console.warn("Legacy
|
|
13524
|
-
|
|
13531
|
+
console.warn("Legacy Boards detected. Resetting board to empty list.");
|
|
13532
|
+
preparedItems = [];
|
|
13525
13533
|
} else {
|
|
13526
13534
|
const prepare = (list) => list.map((g) => ({
|
|
13527
13535
|
id: g.id || (0, import_uuid11.v4)(),
|
|
@@ -13530,8 +13538,10 @@ function AncestryBoard({
|
|
|
13530
13538
|
content: Array.isArray(g.content) ? g.content : [],
|
|
13531
13539
|
children: prepare(g.children || [])
|
|
13532
13540
|
}));
|
|
13533
|
-
|
|
13541
|
+
preparedItems = prepare(initialBoardItems);
|
|
13534
13542
|
}
|
|
13543
|
+
setBoardItems(preparedItems);
|
|
13544
|
+
lastSavedBoardItemsRef.current = JSON.stringify(sanitizeBoardItems(preparedItems));
|
|
13535
13545
|
setIsLoaded(true);
|
|
13536
13546
|
}
|
|
13537
13547
|
}, [initialBoardItems, isLoaded]);
|
|
@@ -13561,13 +13571,6 @@ function AncestryBoard({
|
|
|
13561
13571
|
});
|
|
13562
13572
|
return items;
|
|
13563
13573
|
}, [availableAncestries, availableNodes]);
|
|
13564
|
-
const sanitizeBoardItems = (list) => list.map((g) => ({
|
|
13565
|
-
id: g.id,
|
|
13566
|
-
type: g.type || "text_group",
|
|
13567
|
-
name: g.name || "",
|
|
13568
|
-
content: g.content || [],
|
|
13569
|
-
children: sanitizeBoardItems(g.children || [])
|
|
13570
|
-
}));
|
|
13571
13574
|
(0, import_react29.useEffect)(() => {
|
|
13572
13575
|
if (!isLoaded || !onSave) return;
|
|
13573
13576
|
const id = setTimeout(async () => {
|
|
@@ -13779,7 +13782,7 @@ function AncestryBoard({
|
|
|
13779
13782
|
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",
|
|
13780
13783
|
onClick: (e) => e.stopPropagation()
|
|
13781
13784
|
},
|
|
13782
|
-
/* @__PURE__ */ import_react29.default.createElement("div", { className: "h-14 px-4 border-b border-white/10 bg-slate-900/90 flex items-center justify-between shrink-0" }, /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ import_react29.default.createElement("h3", { className: "text-base font-semibold text-white flex items-center gap-2 whitespace-nowrap" }, /* @__PURE__ */ import_react29.default.createElement(import_fi23.FiLayers, { className: "text-indigo-400" }), "
|
|
13785
|
+
/* @__PURE__ */ import_react29.default.createElement("div", { className: "h-14 px-4 border-b border-white/10 bg-slate-900/90 flex items-center justify-between shrink-0" }, /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ import_react29.default.createElement("h3", { className: "text-base font-semibold text-white flex items-center gap-2 whitespace-nowrap" }, /* @__PURE__ */ import_react29.default.createElement(import_fi23.FiLayers, { className: "text-indigo-400" }), "Boards"), saveStatus !== "idle" && /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-2 animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ import_react29.default.createElement("div", { className: "w-px h-4 bg-white/10 mx-1" }), /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-slate-900/50 border border-white/5" }, saveStatus === "saving" && /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, /* @__PURE__ */ import_react29.default.createElement(import_fi23.FiLoader, { className: "animate-spin text-indigo-400", size: 12 }), /* @__PURE__ */ import_react29.default.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-indigo-300" }, "Salvando")), saveStatus === "saved" && /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, /* @__PURE__ */ import_react29.default.createElement(import_fi23.FiCheckCircle, { className: "text-emerald-400", size: 12 }), /* @__PURE__ */ import_react29.default.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-slate-400" }, "Salvo")), saveStatus === "error" && /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, /* @__PURE__ */ import_react29.default.createElement("span", { className: "w-2 h-2 rounded-full bg-red-500" }), /* @__PURE__ */ import_react29.default.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-red-400" }, "Erro"))))), /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-3" }, canEdit && /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, /* @__PURE__ */ import_react29.default.createElement(
|
|
13783
13786
|
"button",
|
|
13784
13787
|
{
|
|
13785
13788
|
onClick: () => handleAddItem("folder"),
|
|
@@ -14038,8 +14041,8 @@ function XViewScene({
|
|
|
14038
14041
|
get_ancestry_file,
|
|
14039
14042
|
import_parent_file_modal_get,
|
|
14040
14043
|
add_new_parent_file_to_scene_at_firebase_action,
|
|
14041
|
-
|
|
14042
|
-
|
|
14044
|
+
get_boards_action,
|
|
14045
|
+
save_boards_action,
|
|
14043
14046
|
upload_file_action,
|
|
14044
14047
|
delete_file_action,
|
|
14045
14048
|
check_user_permission,
|
|
@@ -14194,7 +14197,7 @@ function XViewScene({
|
|
|
14194
14197
|
const [importSuccessMessage, setImportSuccessMessage] = (0, import_react31.useState)("");
|
|
14195
14198
|
const [invalidTargetError, setInvalidTargetError] = (0, import_react31.useState)(null);
|
|
14196
14199
|
const [highlightedNodeId, setHighlightedNodeId] = (0, import_react31.useState)(null);
|
|
14197
|
-
const [
|
|
14200
|
+
const [isBoardsOpen, setIsBoardsOpen] = (0, import_react31.useState)(false);
|
|
14198
14201
|
const [boardItems, setBoardItems] = (0, import_react31.useState)([]);
|
|
14199
14202
|
const [isSidebarOpen, setIsSidebarOpen] = (0, import_react31.useState)(false);
|
|
14200
14203
|
const [isMilestoneManagerOpen, setIsMilestoneManagerOpen] = (0, import_react31.useState)(false);
|
|
@@ -14849,7 +14852,7 @@ function XViewScene({
|
|
|
14849
14852
|
focusNodeId,
|
|
14850
14853
|
focusAncestryId
|
|
14851
14854
|
);
|
|
14852
|
-
const boardPromise =
|
|
14855
|
+
const boardPromise = get_boards_action && session ? get_boards_action(configPath, sceneType, session, ownerId2) : Promise.resolve({ success: false, data: [] });
|
|
14853
14856
|
const [sceneResponse, boardResponse] = await Promise.all([
|
|
14854
14857
|
scenePromise,
|
|
14855
14858
|
boardPromise
|
|
@@ -14929,7 +14932,7 @@ function XViewScene({
|
|
|
14929
14932
|
ownerId,
|
|
14930
14933
|
viewParams,
|
|
14931
14934
|
get_scene_view_data,
|
|
14932
|
-
|
|
14935
|
+
get_boards_action,
|
|
14933
14936
|
isInitialized,
|
|
14934
14937
|
permissionStatus,
|
|
14935
14938
|
focusNodeId,
|
|
@@ -18018,8 +18021,8 @@ function XViewScene({
|
|
|
18018
18021
|
},
|
|
18019
18022
|
[save_view_data, delete_file_action]
|
|
18020
18023
|
);
|
|
18021
|
-
const
|
|
18022
|
-
|
|
18024
|
+
const handleOpenBoards = (0, import_react31.useCallback)(() => {
|
|
18025
|
+
setIsBoardsOpen(true);
|
|
18023
18026
|
}, []);
|
|
18024
18027
|
const allAvailableNodes = (0, import_react31.useMemo)(() => {
|
|
18025
18028
|
if (!parentDataRef.current) return [];
|
|
@@ -18071,7 +18074,7 @@ function XViewScene({
|
|
|
18071
18074
|
);
|
|
18072
18075
|
const handleSelectAncestryFromBoard = (0, import_react31.useCallback)(
|
|
18073
18076
|
(item) => {
|
|
18074
|
-
|
|
18077
|
+
setIsBoardsOpen(false);
|
|
18075
18078
|
setIsSidebarOpen(false);
|
|
18076
18079
|
if (item.type === "ancestry") {
|
|
18077
18080
|
handleStartReadingAncestry(item);
|
|
@@ -18081,11 +18084,11 @@ function XViewScene({
|
|
|
18081
18084
|
},
|
|
18082
18085
|
[handleStartReadingAncestry, handleOpenReference]
|
|
18083
18086
|
);
|
|
18084
|
-
const
|
|
18087
|
+
const handleSaveBoards = (0, import_react31.useCallback)(
|
|
18085
18088
|
async (boardItems2) => {
|
|
18086
18089
|
if (!sceneConfigId || !viewParams || !session) return;
|
|
18087
18090
|
const sceneType = (viewParams.type || "").toLowerCase().includes("database") ? "database" : "view";
|
|
18088
|
-
await
|
|
18091
|
+
await save_boards_action(
|
|
18089
18092
|
sceneConfigId,
|
|
18090
18093
|
sceneType,
|
|
18091
18094
|
boardItems2,
|
|
@@ -18093,7 +18096,7 @@ function XViewScene({
|
|
|
18093
18096
|
ownerId
|
|
18094
18097
|
);
|
|
18095
18098
|
},
|
|
18096
|
-
[sceneConfigId, viewParams, session,
|
|
18099
|
+
[sceneConfigId, viewParams, session, save_boards_action, ownerId]
|
|
18097
18100
|
);
|
|
18098
18101
|
const existingNodeTypes = (0, import_react31.useMemo)(() => {
|
|
18099
18102
|
if (!parentDataRef.current) {
|
|
@@ -18344,7 +18347,7 @@ function XViewScene({
|
|
|
18344
18347
|
setRelationshipMenu((prev) => ({ ...prev, visible: false }));
|
|
18345
18348
|
}
|
|
18346
18349
|
if (event.key.toLowerCase() === "q") {
|
|
18347
|
-
const isUiClear = !stateRef.current.creation.isActive && !stateRef.current.connection.isActive && !stateRef.current.relink.isActive && !stateRef.current.ancestry.isActive && !((_b2 = context.versionMode) == null ? void 0 : _b2.isActive) && !contextMenu.visible && !multiContextMenu.visible && !relationshipMenu.visible && !readingMode.isActive && !isImportModalOpen && !
|
|
18350
|
+
const isUiClear = !stateRef.current.creation.isActive && !stateRef.current.connection.isActive && !stateRef.current.relink.isActive && !stateRef.current.ancestry.isActive && !((_b2 = context.versionMode) == null ? void 0 : _b2.isActive) && !contextMenu.visible && !multiContextMenu.visible && !relationshipMenu.visible && !readingMode.isActive && !isImportModalOpen && !isBoardsOpen && !isSidebarOpen && !detailsNode && !detailsLink && !ancestryLinkDetails && !imageViewer.visible && !editingAncestryRel.visible && !questMode.isActive;
|
|
18348
18351
|
if (isUiClear) {
|
|
18349
18352
|
const isView = ((_c2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _c2.toLowerCase()) === "view";
|
|
18350
18353
|
if (!isView) return;
|
|
@@ -18413,7 +18416,7 @@ function XViewScene({
|
|
|
18413
18416
|
relationshipMenu.visible,
|
|
18414
18417
|
readingMode.isActive,
|
|
18415
18418
|
isImportModalOpen,
|
|
18416
|
-
|
|
18419
|
+
isBoardsOpen,
|
|
18417
18420
|
isSidebarOpen,
|
|
18418
18421
|
detailsNode,
|
|
18419
18422
|
detailsLink,
|
|
@@ -18500,7 +18503,7 @@ function XViewScene({
|
|
|
18500
18503
|
importSuccessMessage,
|
|
18501
18504
|
onActivateTimeline: handleActivateTimeline,
|
|
18502
18505
|
onActivateQuestLens: handleActivateQuestLens,
|
|
18503
|
-
|
|
18506
|
+
onOpenBoards: handleOpenBoards,
|
|
18504
18507
|
viewType: viewParams == null ? void 0 : viewParams.type,
|
|
18505
18508
|
viewName: viewParams == null ? void 0 : viewParams.name,
|
|
18506
18509
|
onNavigateBack: handleNavigateBack,
|
|
@@ -18896,15 +18899,15 @@ function XViewScene({
|
|
|
18896
18899
|
}
|
|
18897
18900
|
),
|
|
18898
18901
|
/* @__PURE__ */ import_react31.default.createElement(
|
|
18899
|
-
|
|
18902
|
+
Boards,
|
|
18900
18903
|
{
|
|
18901
|
-
isOpen:
|
|
18902
|
-
onClose: () =>
|
|
18904
|
+
isOpen: isBoardsOpen,
|
|
18905
|
+
onClose: () => setIsBoardsOpen(false),
|
|
18903
18906
|
onSelect: handleSelectAncestryFromBoard,
|
|
18904
18907
|
availableAncestries: allAvailableAncestries,
|
|
18905
18908
|
availableNodes: allAvailableNodes,
|
|
18906
18909
|
initialBoardItems: boardItems,
|
|
18907
|
-
onSave:
|
|
18910
|
+
onSave: handleSaveBoards,
|
|
18908
18911
|
userRole: userPermissionRole
|
|
18909
18912
|
}
|
|
18910
18913
|
),
|
|
@@ -19402,21 +19405,21 @@ async function get_ancestry_file_logic(db_services, file_id, owner_id) {
|
|
|
19402
19405
|
return { success: false, error: error.message };
|
|
19403
19406
|
}
|
|
19404
19407
|
}
|
|
19405
|
-
async function
|
|
19408
|
+
async function save_boards_logic(db_services, scene_id, type, boardItems, session, owner_id) {
|
|
19406
19409
|
try {
|
|
19407
19410
|
const targetOwnerId = owner_id || session.user.id;
|
|
19408
|
-
return await db_services.
|
|
19411
|
+
return await db_services.save_boards(session, scene_id, type, boardItems, targetOwnerId);
|
|
19409
19412
|
} catch (error) {
|
|
19410
|
-
console.error("Erro em
|
|
19413
|
+
console.error("Erro em save_boards_logic:", error);
|
|
19411
19414
|
return { success: false, error: error.message };
|
|
19412
19415
|
}
|
|
19413
19416
|
}
|
|
19414
|
-
async function
|
|
19417
|
+
async function get_boards_logic(db_services, scene_id, type, session, owner_id) {
|
|
19415
19418
|
try {
|
|
19416
19419
|
const targetOwnerId = owner_id || session.user.id;
|
|
19417
|
-
return await db_services.
|
|
19420
|
+
return await db_services.get_boards(session, scene_id, type, targetOwnerId);
|
|
19418
19421
|
} catch (error) {
|
|
19419
|
-
console.error("Erro em
|
|
19422
|
+
console.error("Erro em get_boards_logic:", error);
|
|
19420
19423
|
return { success: false, error: error.message };
|
|
19421
19424
|
}
|
|
19422
19425
|
}
|
|
@@ -19446,13 +19449,13 @@ async function get_view_members_logic(db_services, ownerId, type, itemId) {
|
|
|
19446
19449
|
0 && (module.exports = {
|
|
19447
19450
|
XViewScene,
|
|
19448
19451
|
delete_uploaded_file_logic,
|
|
19449
|
-
get_ancestry_board_logic,
|
|
19450
19452
|
get_ancestry_file_logic,
|
|
19453
|
+
get_boards_logic,
|
|
19451
19454
|
get_scene_view_data_logic,
|
|
19452
19455
|
get_single_parent_file_logic,
|
|
19453
19456
|
get_view_members_logic,
|
|
19454
19457
|
import_parent_file_modal_get_logic,
|
|
19455
|
-
|
|
19458
|
+
save_boards_logic,
|
|
19456
19459
|
save_view_data_logic,
|
|
19457
19460
|
x_view_add_new_parent_file_to_scene_at_firebase
|
|
19458
19461
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -38,8 +38,8 @@ function defineAbilityFor(role) {
|
|
|
38
38
|
can("read", "Versioning");
|
|
39
39
|
can("read", "Node");
|
|
40
40
|
can("read", "Scene");
|
|
41
|
-
can("read", "
|
|
42
|
-
can("read", "
|
|
41
|
+
can("read", "Boards");
|
|
42
|
+
can("read", "BoardGroups");
|
|
43
43
|
can("dismiss", "Node");
|
|
44
44
|
cannot("update", "Scene");
|
|
45
45
|
cannot("import", "File");
|
|
@@ -52,10 +52,10 @@ function defineAbilityFor(role) {
|
|
|
52
52
|
cannot("create", "Ancestry");
|
|
53
53
|
cannot("update", "Ancestry");
|
|
54
54
|
cannot("delete", "Ancestry");
|
|
55
|
-
cannot("create", "
|
|
56
|
-
cannot("update", "
|
|
57
|
-
cannot("delete", "
|
|
58
|
-
cannot("manage", "
|
|
55
|
+
cannot("create", "BoardGroups");
|
|
56
|
+
cannot("update", "BoardGroups");
|
|
57
|
+
cannot("delete", "BoardGroups");
|
|
58
|
+
cannot("manage", "Boards");
|
|
59
59
|
cannot("update", "Node");
|
|
60
60
|
break;
|
|
61
61
|
case "link_viewer":
|
|
@@ -64,8 +64,8 @@ function defineAbilityFor(role) {
|
|
|
64
64
|
can("read", "Versioning");
|
|
65
65
|
cannot("read", "Scene");
|
|
66
66
|
cannot("read", "Connection");
|
|
67
|
-
cannot("read", "
|
|
68
|
-
cannot("read", "
|
|
67
|
+
cannot("read", "Boards");
|
|
68
|
+
cannot("read", "BoardGroups");
|
|
69
69
|
cannot("dismiss", "Node");
|
|
70
70
|
cannot("manage", "all");
|
|
71
71
|
break;
|
|
@@ -3843,7 +3843,7 @@ function XViewSidebar({
|
|
|
3843
3843
|
importSuccessMessage = "",
|
|
3844
3844
|
onActivateTimeline = () => {
|
|
3845
3845
|
},
|
|
3846
|
-
|
|
3846
|
+
onOpenBoards = () => {
|
|
3847
3847
|
},
|
|
3848
3848
|
viewType,
|
|
3849
3849
|
viewName,
|
|
@@ -4344,12 +4344,12 @@ function XViewSidebar({
|
|
|
4344
4344
|
), /* @__PURE__ */ React2.createElement(
|
|
4345
4345
|
"button",
|
|
4346
4346
|
{
|
|
4347
|
-
onClick:
|
|
4347
|
+
onClick: onOpenBoards,
|
|
4348
4348
|
className: buttonBaseClass,
|
|
4349
|
-
title: "Abrir painel de
|
|
4349
|
+
title: "Abrir painel de Boards"
|
|
4350
4350
|
},
|
|
4351
|
-
/* @__PURE__ */ React2.createElement(
|
|
4352
|
-
"
|
|
4351
|
+
/* @__PURE__ */ React2.createElement(FiLayers, { size: 16 }),
|
|
4352
|
+
"Boards"
|
|
4353
4353
|
)), /* @__PURE__ */ React2.createElement("div", { className: "h-px bg-white/10" }), /* @__PURE__ */ React2.createElement("section", { className: "space-y-3" }, /* @__PURE__ */ React2.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "Milestones"), /* @__PURE__ */ React2.createElement(
|
|
4354
4354
|
"button",
|
|
4355
4355
|
{
|
|
@@ -12949,7 +12949,7 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
12949
12949
|
);
|
|
12950
12950
|
}
|
|
12951
12951
|
|
|
12952
|
-
// src/components/
|
|
12952
|
+
// src/components/Boards.jsx
|
|
12953
12953
|
import React28, { useState as useState27, useMemo as useMemo12, useEffect as useEffect23, useRef as useRef20 } from "react";
|
|
12954
12954
|
import {
|
|
12955
12955
|
FiSearch as FiSearch8,
|
|
@@ -13331,7 +13331,7 @@ function RichGroupEditor({
|
|
|
13331
13331
|
));
|
|
13332
13332
|
}
|
|
13333
13333
|
|
|
13334
|
-
// src/components/
|
|
13334
|
+
// src/components/Boards.jsx
|
|
13335
13335
|
var Tooltip = ({ text, children }) => {
|
|
13336
13336
|
if (!text) return children;
|
|
13337
13337
|
return /* @__PURE__ */ React28.createElement("div", { className: "relative group/tooltip" }, children, /* @__PURE__ */ React28.createElement("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-slate-900 border border-white/10 text-white text-[10px] rounded opacity-0 group-hover/tooltip:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-[3000] shadow-2xl" }, text));
|
|
@@ -13550,7 +13550,7 @@ var BoardItem = ({
|
|
|
13550
13550
|
}
|
|
13551
13551
|
))));
|
|
13552
13552
|
};
|
|
13553
|
-
function
|
|
13553
|
+
function Boards({
|
|
13554
13554
|
isOpen,
|
|
13555
13555
|
onClose,
|
|
13556
13556
|
onSelect,
|
|
@@ -13566,12 +13566,20 @@ function AncestryBoard({
|
|
|
13566
13566
|
const [navigationStack, setNavigationStack] = useState27([]);
|
|
13567
13567
|
const lastSavedBoardItemsRef = useRef20(null);
|
|
13568
13568
|
const canEdit = useMemo12(() => userRole !== "viewer", [userRole]);
|
|
13569
|
+
const sanitizeBoardItems = (list) => list.map((g) => ({
|
|
13570
|
+
id: g.id,
|
|
13571
|
+
type: g.type || "text_group",
|
|
13572
|
+
name: g.name || "",
|
|
13573
|
+
content: g.content || [],
|
|
13574
|
+
children: sanitizeBoardItems(g.children || [])
|
|
13575
|
+
}));
|
|
13569
13576
|
useEffect23(() => {
|
|
13570
13577
|
if (initialBoardItems && !isLoaded) {
|
|
13571
13578
|
const hasLegacyTypes = (list) => list.some((g) => g.type === "group" || hasLegacyTypes(g.children || []));
|
|
13579
|
+
let preparedItems = [];
|
|
13572
13580
|
if (hasLegacyTypes(initialBoardItems)) {
|
|
13573
|
-
console.warn("Legacy
|
|
13574
|
-
|
|
13581
|
+
console.warn("Legacy Boards detected. Resetting board to empty list.");
|
|
13582
|
+
preparedItems = [];
|
|
13575
13583
|
} else {
|
|
13576
13584
|
const prepare = (list) => list.map((g) => ({
|
|
13577
13585
|
id: g.id || uuidv411(),
|
|
@@ -13580,8 +13588,10 @@ function AncestryBoard({
|
|
|
13580
13588
|
content: Array.isArray(g.content) ? g.content : [],
|
|
13581
13589
|
children: prepare(g.children || [])
|
|
13582
13590
|
}));
|
|
13583
|
-
|
|
13591
|
+
preparedItems = prepare(initialBoardItems);
|
|
13584
13592
|
}
|
|
13593
|
+
setBoardItems(preparedItems);
|
|
13594
|
+
lastSavedBoardItemsRef.current = JSON.stringify(sanitizeBoardItems(preparedItems));
|
|
13585
13595
|
setIsLoaded(true);
|
|
13586
13596
|
}
|
|
13587
13597
|
}, [initialBoardItems, isLoaded]);
|
|
@@ -13611,13 +13621,6 @@ function AncestryBoard({
|
|
|
13611
13621
|
});
|
|
13612
13622
|
return items;
|
|
13613
13623
|
}, [availableAncestries, availableNodes]);
|
|
13614
|
-
const sanitizeBoardItems = (list) => list.map((g) => ({
|
|
13615
|
-
id: g.id,
|
|
13616
|
-
type: g.type || "text_group",
|
|
13617
|
-
name: g.name || "",
|
|
13618
|
-
content: g.content || [],
|
|
13619
|
-
children: sanitizeBoardItems(g.children || [])
|
|
13620
|
-
}));
|
|
13621
13624
|
useEffect23(() => {
|
|
13622
13625
|
if (!isLoaded || !onSave) return;
|
|
13623
13626
|
const id = setTimeout(async () => {
|
|
@@ -13829,7 +13832,7 @@ function AncestryBoard({
|
|
|
13829
13832
|
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",
|
|
13830
13833
|
onClick: (e) => e.stopPropagation()
|
|
13831
13834
|
},
|
|
13832
|
-
/* @__PURE__ */ React28.createElement("div", { className: "h-14 px-4 border-b border-white/10 bg-slate-900/90 flex items-center justify-between shrink-0" }, /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React28.createElement("h3", { className: "text-base font-semibold text-white flex items-center gap-2 whitespace-nowrap" }, /* @__PURE__ */ React28.createElement(FiLayers7, { className: "text-indigo-400" }), "
|
|
13835
|
+
/* @__PURE__ */ React28.createElement("div", { className: "h-14 px-4 border-b border-white/10 bg-slate-900/90 flex items-center justify-between shrink-0" }, /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React28.createElement("h3", { className: "text-base font-semibold text-white flex items-center gap-2 whitespace-nowrap" }, /* @__PURE__ */ React28.createElement(FiLayers7, { className: "text-indigo-400" }), "Boards"), saveStatus !== "idle" && /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-2 animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ React28.createElement("div", { className: "w-px h-4 bg-white/10 mx-1" }), /* @__PURE__ */ React28.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__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(FiLoader5, { className: "animate-spin text-indigo-400", size: 12 }), /* @__PURE__ */ React28.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-indigo-300" }, "Salvando")), saveStatus === "saved" && /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(FiCheckCircle, { className: "text-emerald-400", size: 12 }), /* @__PURE__ */ React28.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-slate-400" }, "Salvo")), saveStatus === "error" && /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement("span", { className: "w-2 h-2 rounded-full bg-red-500" }), /* @__PURE__ */ React28.createElement("span", { className: "text-[10px] uppercase tracking-wide font-medium text-red-400" }, "Erro"))))), /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-3" }, canEdit && /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(
|
|
13833
13836
|
"button",
|
|
13834
13837
|
{
|
|
13835
13838
|
onClick: () => handleAddItem("folder"),
|
|
@@ -14088,8 +14091,8 @@ function XViewScene({
|
|
|
14088
14091
|
get_ancestry_file,
|
|
14089
14092
|
import_parent_file_modal_get,
|
|
14090
14093
|
add_new_parent_file_to_scene_at_firebase_action,
|
|
14091
|
-
|
|
14092
|
-
|
|
14094
|
+
get_boards_action,
|
|
14095
|
+
save_boards_action,
|
|
14093
14096
|
upload_file_action,
|
|
14094
14097
|
delete_file_action,
|
|
14095
14098
|
check_user_permission,
|
|
@@ -14244,7 +14247,7 @@ function XViewScene({
|
|
|
14244
14247
|
const [importSuccessMessage, setImportSuccessMessage] = useState29("");
|
|
14245
14248
|
const [invalidTargetError, setInvalidTargetError] = useState29(null);
|
|
14246
14249
|
const [highlightedNodeId, setHighlightedNodeId] = useState29(null);
|
|
14247
|
-
const [
|
|
14250
|
+
const [isBoardsOpen, setIsBoardsOpen] = useState29(false);
|
|
14248
14251
|
const [boardItems, setBoardItems] = useState29([]);
|
|
14249
14252
|
const [isSidebarOpen, setIsSidebarOpen] = useState29(false);
|
|
14250
14253
|
const [isMilestoneManagerOpen, setIsMilestoneManagerOpen] = useState29(false);
|
|
@@ -14899,7 +14902,7 @@ function XViewScene({
|
|
|
14899
14902
|
focusNodeId,
|
|
14900
14903
|
focusAncestryId
|
|
14901
14904
|
);
|
|
14902
|
-
const boardPromise =
|
|
14905
|
+
const boardPromise = get_boards_action && session ? get_boards_action(configPath, sceneType, session, ownerId2) : Promise.resolve({ success: false, data: [] });
|
|
14903
14906
|
const [sceneResponse, boardResponse] = await Promise.all([
|
|
14904
14907
|
scenePromise,
|
|
14905
14908
|
boardPromise
|
|
@@ -14979,7 +14982,7 @@ function XViewScene({
|
|
|
14979
14982
|
ownerId,
|
|
14980
14983
|
viewParams,
|
|
14981
14984
|
get_scene_view_data,
|
|
14982
|
-
|
|
14985
|
+
get_boards_action,
|
|
14983
14986
|
isInitialized,
|
|
14984
14987
|
permissionStatus,
|
|
14985
14988
|
focusNodeId,
|
|
@@ -18068,8 +18071,8 @@ function XViewScene({
|
|
|
18068
18071
|
},
|
|
18069
18072
|
[save_view_data, delete_file_action]
|
|
18070
18073
|
);
|
|
18071
|
-
const
|
|
18072
|
-
|
|
18074
|
+
const handleOpenBoards = useCallback5(() => {
|
|
18075
|
+
setIsBoardsOpen(true);
|
|
18073
18076
|
}, []);
|
|
18074
18077
|
const allAvailableNodes = useMemo13(() => {
|
|
18075
18078
|
if (!parentDataRef.current) return [];
|
|
@@ -18121,7 +18124,7 @@ function XViewScene({
|
|
|
18121
18124
|
);
|
|
18122
18125
|
const handleSelectAncestryFromBoard = useCallback5(
|
|
18123
18126
|
(item) => {
|
|
18124
|
-
|
|
18127
|
+
setIsBoardsOpen(false);
|
|
18125
18128
|
setIsSidebarOpen(false);
|
|
18126
18129
|
if (item.type === "ancestry") {
|
|
18127
18130
|
handleStartReadingAncestry(item);
|
|
@@ -18131,11 +18134,11 @@ function XViewScene({
|
|
|
18131
18134
|
},
|
|
18132
18135
|
[handleStartReadingAncestry, handleOpenReference]
|
|
18133
18136
|
);
|
|
18134
|
-
const
|
|
18137
|
+
const handleSaveBoards = useCallback5(
|
|
18135
18138
|
async (boardItems2) => {
|
|
18136
18139
|
if (!sceneConfigId || !viewParams || !session) return;
|
|
18137
18140
|
const sceneType = (viewParams.type || "").toLowerCase().includes("database") ? "database" : "view";
|
|
18138
|
-
await
|
|
18141
|
+
await save_boards_action(
|
|
18139
18142
|
sceneConfigId,
|
|
18140
18143
|
sceneType,
|
|
18141
18144
|
boardItems2,
|
|
@@ -18143,7 +18146,7 @@ function XViewScene({
|
|
|
18143
18146
|
ownerId
|
|
18144
18147
|
);
|
|
18145
18148
|
},
|
|
18146
|
-
[sceneConfigId, viewParams, session,
|
|
18149
|
+
[sceneConfigId, viewParams, session, save_boards_action, ownerId]
|
|
18147
18150
|
);
|
|
18148
18151
|
const existingNodeTypes = useMemo13(() => {
|
|
18149
18152
|
if (!parentDataRef.current) {
|
|
@@ -18394,7 +18397,7 @@ function XViewScene({
|
|
|
18394
18397
|
setRelationshipMenu((prev) => ({ ...prev, visible: false }));
|
|
18395
18398
|
}
|
|
18396
18399
|
if (event.key.toLowerCase() === "q") {
|
|
18397
|
-
const isUiClear = !stateRef.current.creation.isActive && !stateRef.current.connection.isActive && !stateRef.current.relink.isActive && !stateRef.current.ancestry.isActive && !((_b2 = context.versionMode) == null ? void 0 : _b2.isActive) && !contextMenu.visible && !multiContextMenu.visible && !relationshipMenu.visible && !readingMode.isActive && !isImportModalOpen && !
|
|
18400
|
+
const isUiClear = !stateRef.current.creation.isActive && !stateRef.current.connection.isActive && !stateRef.current.relink.isActive && !stateRef.current.ancestry.isActive && !((_b2 = context.versionMode) == null ? void 0 : _b2.isActive) && !contextMenu.visible && !multiContextMenu.visible && !relationshipMenu.visible && !readingMode.isActive && !isImportModalOpen && !isBoardsOpen && !isSidebarOpen && !detailsNode && !detailsLink && !ancestryLinkDetails && !imageViewer.visible && !editingAncestryRel.visible && !questMode.isActive;
|
|
18398
18401
|
if (isUiClear) {
|
|
18399
18402
|
const isView = ((_c2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _c2.toLowerCase()) === "view";
|
|
18400
18403
|
if (!isView) return;
|
|
@@ -18463,7 +18466,7 @@ function XViewScene({
|
|
|
18463
18466
|
relationshipMenu.visible,
|
|
18464
18467
|
readingMode.isActive,
|
|
18465
18468
|
isImportModalOpen,
|
|
18466
|
-
|
|
18469
|
+
isBoardsOpen,
|
|
18467
18470
|
isSidebarOpen,
|
|
18468
18471
|
detailsNode,
|
|
18469
18472
|
detailsLink,
|
|
@@ -18550,7 +18553,7 @@ function XViewScene({
|
|
|
18550
18553
|
importSuccessMessage,
|
|
18551
18554
|
onActivateTimeline: handleActivateTimeline,
|
|
18552
18555
|
onActivateQuestLens: handleActivateQuestLens,
|
|
18553
|
-
|
|
18556
|
+
onOpenBoards: handleOpenBoards,
|
|
18554
18557
|
viewType: viewParams == null ? void 0 : viewParams.type,
|
|
18555
18558
|
viewName: viewParams == null ? void 0 : viewParams.name,
|
|
18556
18559
|
onNavigateBack: handleNavigateBack,
|
|
@@ -18946,15 +18949,15 @@ function XViewScene({
|
|
|
18946
18949
|
}
|
|
18947
18950
|
),
|
|
18948
18951
|
/* @__PURE__ */ React30.createElement(
|
|
18949
|
-
|
|
18952
|
+
Boards,
|
|
18950
18953
|
{
|
|
18951
|
-
isOpen:
|
|
18952
|
-
onClose: () =>
|
|
18954
|
+
isOpen: isBoardsOpen,
|
|
18955
|
+
onClose: () => setIsBoardsOpen(false),
|
|
18953
18956
|
onSelect: handleSelectAncestryFromBoard,
|
|
18954
18957
|
availableAncestries: allAvailableAncestries,
|
|
18955
18958
|
availableNodes: allAvailableNodes,
|
|
18956
18959
|
initialBoardItems: boardItems,
|
|
18957
|
-
onSave:
|
|
18960
|
+
onSave: handleSaveBoards,
|
|
18958
18961
|
userRole: userPermissionRole
|
|
18959
18962
|
}
|
|
18960
18963
|
),
|
|
@@ -19452,21 +19455,21 @@ async function get_ancestry_file_logic(db_services, file_id, owner_id) {
|
|
|
19452
19455
|
return { success: false, error: error.message };
|
|
19453
19456
|
}
|
|
19454
19457
|
}
|
|
19455
|
-
async function
|
|
19458
|
+
async function save_boards_logic(db_services, scene_id, type, boardItems, session, owner_id) {
|
|
19456
19459
|
try {
|
|
19457
19460
|
const targetOwnerId = owner_id || session.user.id;
|
|
19458
|
-
return await db_services.
|
|
19461
|
+
return await db_services.save_boards(session, scene_id, type, boardItems, targetOwnerId);
|
|
19459
19462
|
} catch (error) {
|
|
19460
|
-
console.error("Erro em
|
|
19463
|
+
console.error("Erro em save_boards_logic:", error);
|
|
19461
19464
|
return { success: false, error: error.message };
|
|
19462
19465
|
}
|
|
19463
19466
|
}
|
|
19464
|
-
async function
|
|
19467
|
+
async function get_boards_logic(db_services, scene_id, type, session, owner_id) {
|
|
19465
19468
|
try {
|
|
19466
19469
|
const targetOwnerId = owner_id || session.user.id;
|
|
19467
|
-
return await db_services.
|
|
19470
|
+
return await db_services.get_boards(session, scene_id, type, targetOwnerId);
|
|
19468
19471
|
} catch (error) {
|
|
19469
|
-
console.error("Erro em
|
|
19472
|
+
console.error("Erro em get_boards_logic:", error);
|
|
19470
19473
|
return { success: false, error: error.message };
|
|
19471
19474
|
}
|
|
19472
19475
|
}
|
|
@@ -19495,13 +19498,13 @@ async function get_view_members_logic(db_services, ownerId, type, itemId) {
|
|
|
19495
19498
|
export {
|
|
19496
19499
|
XViewScene,
|
|
19497
19500
|
delete_uploaded_file_logic,
|
|
19498
|
-
get_ancestry_board_logic,
|
|
19499
19501
|
get_ancestry_file_logic,
|
|
19502
|
+
get_boards_logic,
|
|
19500
19503
|
get_scene_view_data_logic,
|
|
19501
19504
|
get_single_parent_file_logic,
|
|
19502
19505
|
get_view_members_logic,
|
|
19503
19506
|
import_parent_file_modal_get_logic,
|
|
19504
|
-
|
|
19507
|
+
save_boards_logic,
|
|
19505
19508
|
save_view_data_logic,
|
|
19506
19509
|
x_view_add_new_parent_file_to_scene_at_firebase
|
|
19507
19510
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lv-x-software-house/x_view",
|
|
3
|
-
"version": "1.2.6-dev.
|
|
3
|
+
"version": "1.2.6-dev.27",
|
|
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",
|