@lv-x-software-house/x_view 1.2.6-dev.13 → 1.2.6-dev.15
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 +168 -34
- package/dist/index.mjs +171 -35
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13282,8 +13282,8 @@ function RichGroupEditor({
|
|
|
13282
13282
|
}
|
|
13283
13283
|
|
|
13284
13284
|
// src/components/AncestryBoard.jsx
|
|
13285
|
-
var
|
|
13286
|
-
|
|
13285
|
+
var BoardItem = ({
|
|
13286
|
+
item,
|
|
13287
13287
|
index,
|
|
13288
13288
|
onUpdate,
|
|
13289
13289
|
onDelete,
|
|
@@ -13292,16 +13292,55 @@ var GroupItem = ({
|
|
|
13292
13292
|
onOutdent,
|
|
13293
13293
|
searchItems,
|
|
13294
13294
|
onMentionClick,
|
|
13295
|
+
onEnterFolder,
|
|
13295
13296
|
canEdit
|
|
13296
13297
|
}) => {
|
|
13298
|
+
var _a;
|
|
13299
|
+
const isFolder = item.type === "folder";
|
|
13297
13300
|
const canIndent = index > 0;
|
|
13298
13301
|
const handleContentChange = (content) => {
|
|
13299
|
-
onUpdate(
|
|
13302
|
+
onUpdate(item.id, { ...item, content });
|
|
13303
|
+
};
|
|
13304
|
+
const handleNameChange = (e) => {
|
|
13305
|
+
onUpdate(item.id, { ...item, name: e.target.value });
|
|
13300
13306
|
};
|
|
13307
|
+
if (isFolder) {
|
|
13308
|
+
return /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex flex-col gap-2 mb-3 relative group/item animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
13309
|
+
"div",
|
|
13310
|
+
{
|
|
13311
|
+
onClick: () => onEnterFolder(item.id),
|
|
13312
|
+
className: "flex items-center gap-3 py-3 px-4 bg-white/5 hover:bg-white/10 border border-white/10 hover:border-white/20 rounded-xl cursor-pointer transition-all duration-200 group/folder"
|
|
13313
|
+
},
|
|
13314
|
+
/* @__PURE__ */ import_react29.default.createElement("div", { className: "w-10 h-10 rounded-lg bg-indigo-500/10 flex items-center justify-center text-indigo-400 group-hover/folder:scale-110 transition-transform" }, /* @__PURE__ */ import_react29.default.createElement(import_fi23.FiFolder, { size: 20 })),
|
|
13315
|
+
/* @__PURE__ */ import_react29.default.createElement("div", { className: "flex-1 min-w-0" }, canEdit ? /* @__PURE__ */ import_react29.default.createElement(
|
|
13316
|
+
"input",
|
|
13317
|
+
{
|
|
13318
|
+
type: "text",
|
|
13319
|
+
value: item.name,
|
|
13320
|
+
onChange: handleNameChange,
|
|
13321
|
+
onClick: (e) => e.stopPropagation(),
|
|
13322
|
+
className: "bg-transparent border-none outline-none text-sm font-medium text-slate-200 w-full focus:text-white",
|
|
13323
|
+
placeholder: "Nome da pasta..."
|
|
13324
|
+
}
|
|
13325
|
+
) : /* @__PURE__ */ import_react29.default.createElement("span", { className: "text-sm font-medium text-slate-200" }, item.name), /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-2 mt-0.5" }, /* @__PURE__ */ import_react29.default.createElement("span", { className: "text-[10px] text-slate-500 uppercase tracking-wider font-semibold" }, ((_a = item.children) == null ? void 0 : _a.length) || 0, " itens"))),
|
|
13326
|
+
/* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-2 opacity-0 group-hover/folder:opacity-100 transition-opacity" }, canEdit && /* @__PURE__ */ import_react29.default.createElement(
|
|
13327
|
+
"button",
|
|
13328
|
+
{
|
|
13329
|
+
onClick: (e) => {
|
|
13330
|
+
e.stopPropagation();
|
|
13331
|
+
onDelete(item.id);
|
|
13332
|
+
},
|
|
13333
|
+
className: "p-1.5 text-slate-500 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
13334
|
+
title: "Remover Pasta"
|
|
13335
|
+
},
|
|
13336
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiTrash2, { size: 14 })
|
|
13337
|
+
), /* @__PURE__ */ import_react29.default.createElement(import_fi23.FiChevronRight, { className: "text-slate-500 group-hover/folder:translate-x-1 transition-transform" }))
|
|
13338
|
+
));
|
|
13339
|
+
}
|
|
13301
13340
|
return /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex flex-col gap-2 mb-3 pl-3 border-l border-white/10 relative group/item animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ import_react29.default.createElement("div", { className: "absolute -left-[1px] top-4 w-2 h-px bg-white/20" }), /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex flex-col gap-2 py-2 px-3 transition-all duration-200 hover:bg-white/5 border-l-2 border-transparent hover:border-white/20" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
13302
13341
|
RichGroupEditor,
|
|
13303
13342
|
{
|
|
13304
|
-
content:
|
|
13343
|
+
content: item.content,
|
|
13305
13344
|
onChange: handleContentChange,
|
|
13306
13345
|
onMentionClick,
|
|
13307
13346
|
searchItems,
|
|
@@ -13311,15 +13350,16 @@ var GroupItem = ({
|
|
|
13311
13350
|
), canEdit && /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center justify-between pt-2 mt-1 border-t border-white/5 opacity-40 group-hover/item:opacity-100 transition-opacity" }, /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
13312
13351
|
"button",
|
|
13313
13352
|
{
|
|
13314
|
-
onClick: () => onAddSubgroup(
|
|
13315
|
-
className: "
|
|
13353
|
+
onClick: () => onAddSubgroup(item.id, "group"),
|
|
13354
|
+
className: "flex items-center gap-1 px-1.5 py-1 text-[10px] uppercase font-bold tracking-wider text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13316
13355
|
title: "Criar Subgrupo"
|
|
13317
13356
|
},
|
|
13318
|
-
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiPlus, { size:
|
|
13357
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiPlus, { size: 12 }),
|
|
13358
|
+
/* @__PURE__ */ import_react29.default.createElement("span", null, "Subgrupo")
|
|
13319
13359
|
)), /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
13320
13360
|
"button",
|
|
13321
13361
|
{
|
|
13322
|
-
onClick: () => onIndent(
|
|
13362
|
+
onClick: () => onIndent(item.id),
|
|
13323
13363
|
disabled: !canIndent,
|
|
13324
13364
|
className: `p-1.5 rounded transition-colors ${!canIndent ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`,
|
|
13325
13365
|
title: "Aninhar no grupo acima"
|
|
@@ -13328,7 +13368,7 @@ var GroupItem = ({
|
|
|
13328
13368
|
), /* @__PURE__ */ import_react29.default.createElement(
|
|
13329
13369
|
"button",
|
|
13330
13370
|
{
|
|
13331
|
-
onClick: () => onOutdent(
|
|
13371
|
+
onClick: () => onOutdent(item.id),
|
|
13332
13372
|
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13333
13373
|
title: "Desaninhar"
|
|
13334
13374
|
},
|
|
@@ -13336,17 +13376,17 @@ var GroupItem = ({
|
|
|
13336
13376
|
), /* @__PURE__ */ import_react29.default.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ import_react29.default.createElement(
|
|
13337
13377
|
"button",
|
|
13338
13378
|
{
|
|
13339
|
-
onClick: () => onDelete(
|
|
13379
|
+
onClick: () => onDelete(item.id),
|
|
13340
13380
|
className: "p-1.5 text-slate-600 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
13341
13381
|
title: "Remover Grupo"
|
|
13342
13382
|
},
|
|
13343
13383
|
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiTrash2, { size: 14 })
|
|
13344
|
-
)))),
|
|
13345
|
-
|
|
13384
|
+
)))), item.children && item.children.length > 0 && /* @__PURE__ */ import_react29.default.createElement("div", { className: "ml-2" }, item.children.map((child, idx) => /* @__PURE__ */ import_react29.default.createElement(
|
|
13385
|
+
BoardItem,
|
|
13346
13386
|
{
|
|
13347
13387
|
key: child.id,
|
|
13348
13388
|
index: idx,
|
|
13349
|
-
|
|
13389
|
+
item: child,
|
|
13350
13390
|
onUpdate,
|
|
13351
13391
|
onDelete,
|
|
13352
13392
|
onAddSubgroup,
|
|
@@ -13354,6 +13394,7 @@ var GroupItem = ({
|
|
|
13354
13394
|
onOutdent,
|
|
13355
13395
|
searchItems,
|
|
13356
13396
|
onMentionClick,
|
|
13397
|
+
onEnterFolder,
|
|
13357
13398
|
canEdit
|
|
13358
13399
|
}
|
|
13359
13400
|
))));
|
|
@@ -13371,13 +13412,15 @@ function AncestryBoard({
|
|
|
13371
13412
|
const [groups, setGroups] = (0, import_react29.useState)([]);
|
|
13372
13413
|
const [isLoaded, setIsLoaded] = (0, import_react29.useState)(false);
|
|
13373
13414
|
const [saveStatus, setSaveStatus] = (0, import_react29.useState)("idle");
|
|
13415
|
+
const [navigationStack, setNavigationStack] = (0, import_react29.useState)([]);
|
|
13374
13416
|
const canEdit = (0, import_react29.useMemo)(() => userRole !== "viewer", [userRole]);
|
|
13375
13417
|
(0, import_react29.useEffect)(() => {
|
|
13376
13418
|
if (initialGroups && !isLoaded) {
|
|
13377
13419
|
const migrate = (list) => list.map((g) => ({
|
|
13378
13420
|
id: g.id || (0, import_uuid11.v4)(),
|
|
13421
|
+
type: g.type || "group",
|
|
13422
|
+
name: g.name || "",
|
|
13379
13423
|
content: Array.isArray(g.content) ? g.content : [],
|
|
13380
|
-
// descarta dados legados
|
|
13381
13424
|
children: migrate(g.children || [])
|
|
13382
13425
|
}));
|
|
13383
13426
|
setGroups(migrate(initialGroups));
|
|
@@ -13412,6 +13455,8 @@ function AncestryBoard({
|
|
|
13412
13455
|
}, [availableAncestries, availableNodes]);
|
|
13413
13456
|
const sanitizeGroups = (list) => list.map((g) => ({
|
|
13414
13457
|
id: g.id,
|
|
13458
|
+
type: g.type || "group",
|
|
13459
|
+
name: g.name || "",
|
|
13415
13460
|
content: g.content || [],
|
|
13416
13461
|
children: sanitizeGroups(g.children || [])
|
|
13417
13462
|
}));
|
|
@@ -13442,23 +13487,76 @@ function AncestryBoard({
|
|
|
13442
13487
|
window.addEventListener("keydown", handler);
|
|
13443
13488
|
return () => window.removeEventListener("keydown", handler);
|
|
13444
13489
|
}, [isOpen, onClose]);
|
|
13445
|
-
const
|
|
13446
|
-
|
|
13490
|
+
const currentPath = (0, import_react29.useMemo)(() => {
|
|
13491
|
+
const path = [];
|
|
13492
|
+
let currentLevel = groups;
|
|
13493
|
+
for (const folderId of navigationStack) {
|
|
13494
|
+
const folder = currentLevel.find((f) => f.id === folderId);
|
|
13495
|
+
if (folder) {
|
|
13496
|
+
path.push(folder);
|
|
13497
|
+
currentLevel = folder.children;
|
|
13498
|
+
}
|
|
13499
|
+
}
|
|
13500
|
+
return path;
|
|
13501
|
+
}, [groups, navigationStack]);
|
|
13502
|
+
const currentGroups = (0, import_react29.useMemo)(() => {
|
|
13503
|
+
const lastFolder = currentPath[currentPath.length - 1];
|
|
13504
|
+
return lastFolder ? lastFolder.children : groups;
|
|
13505
|
+
}, [groups, currentPath]);
|
|
13506
|
+
const navigateUp = () => {
|
|
13507
|
+
setNavigationStack((prev) => prev.slice(0, -1));
|
|
13447
13508
|
};
|
|
13448
|
-
const
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13452
|
-
);
|
|
13509
|
+
const navigateTo = (folderId) => {
|
|
13510
|
+
setNavigationStack((prev) => [...prev, folderId]);
|
|
13511
|
+
};
|
|
13512
|
+
const navigateToBreadcrumb = (index) => {
|
|
13513
|
+
setNavigationStack((prev) => prev.slice(0, index + 1));
|
|
13514
|
+
};
|
|
13515
|
+
const navigateHome = () => {
|
|
13516
|
+
setNavigationStack([]);
|
|
13517
|
+
};
|
|
13518
|
+
const handleAddItem = (type = "group") => {
|
|
13519
|
+
const newItem = {
|
|
13520
|
+
id: (0, import_uuid11.v4)(),
|
|
13521
|
+
type,
|
|
13522
|
+
name: type === "folder" ? "Nova Pasta" : "",
|
|
13523
|
+
content: [],
|
|
13524
|
+
children: []
|
|
13525
|
+
};
|
|
13526
|
+
if (navigationStack.length === 0) {
|
|
13527
|
+
setGroups((prev) => [newItem, ...prev]);
|
|
13528
|
+
} else {
|
|
13529
|
+
const parentId = navigationStack[navigationStack.length - 1];
|
|
13530
|
+
const add = (list) => list.map(
|
|
13531
|
+
(g) => g.id === parentId ? { ...g, children: [newItem, ...g.children] } : { ...g, children: add(g.children) }
|
|
13532
|
+
);
|
|
13533
|
+
setGroups((prev) => add(prev));
|
|
13534
|
+
}
|
|
13535
|
+
};
|
|
13536
|
+
const handleAddSubgroup = (parentId, type = "group") => {
|
|
13537
|
+
const add = (list) => list.map((g) => {
|
|
13538
|
+
if (g.id === parentId) {
|
|
13539
|
+
if (g.type === "group" && type === "folder") return g;
|
|
13540
|
+
const newItem = {
|
|
13541
|
+
id: (0, import_uuid11.v4)(),
|
|
13542
|
+
type,
|
|
13543
|
+
name: type === "folder" ? "Nova Pasta" : "",
|
|
13544
|
+
content: [],
|
|
13545
|
+
children: []
|
|
13546
|
+
};
|
|
13547
|
+
return { ...g, children: [newItem, ...g.children] };
|
|
13548
|
+
}
|
|
13549
|
+
return { ...g, children: add(g.children) };
|
|
13550
|
+
});
|
|
13453
13551
|
setGroups((prev) => add(prev));
|
|
13454
13552
|
};
|
|
13455
|
-
const
|
|
13553
|
+
const handleUpdateItem = (id, newData) => {
|
|
13456
13554
|
const update = (list) => list.map(
|
|
13457
13555
|
(g) => g.id === id ? newData : { ...g, children: update(g.children) }
|
|
13458
13556
|
);
|
|
13459
13557
|
setGroups((prev) => update(prev));
|
|
13460
13558
|
};
|
|
13461
|
-
const
|
|
13559
|
+
const handleDeleteItem = (id) => {
|
|
13462
13560
|
const del = (list) => list.filter((g) => g.id !== id).map((g) => ({ ...g, children: del(g.children) }));
|
|
13463
13561
|
setGroups((prev) => del(prev));
|
|
13464
13562
|
};
|
|
@@ -13479,8 +13577,12 @@ function AncestryBoard({
|
|
|
13479
13577
|
const found = findGroupAndParent(next, id);
|
|
13480
13578
|
if (!found || found.index === 0) return prev;
|
|
13481
13579
|
const { group, siblings, index } = found;
|
|
13580
|
+
const targetParent = siblings[index - 1];
|
|
13581
|
+
if (group.type === "folder" && targetParent.type === "group") {
|
|
13582
|
+
return prev;
|
|
13583
|
+
}
|
|
13482
13584
|
siblings.splice(index, 1);
|
|
13483
|
-
|
|
13585
|
+
targetParent.children.push(group);
|
|
13484
13586
|
return next;
|
|
13485
13587
|
});
|
|
13486
13588
|
};
|
|
@@ -13516,15 +13618,23 @@ function AncestryBoard({
|
|
|
13516
13618
|
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",
|
|
13517
13619
|
onClick: (e) => e.stopPropagation()
|
|
13518
13620
|
},
|
|
13519
|
-
/* @__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" }), "Ancestry Board"), 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(
|
|
13621
|
+
/* @__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" }), "Ancestry Board"), 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(
|
|
13622
|
+
"button",
|
|
13623
|
+
{
|
|
13624
|
+
onClick: () => handleAddItem("folder"),
|
|
13625
|
+
className: "flex items-center gap-2 px-3 py-1.5 bg-white/5 hover:bg-white/10 border border-white/10 hover:border-white/20 backdrop-blur-sm text-slate-200 hover:text-white rounded-md transition-all duration-200 text-xs font-medium shadow-sm"
|
|
13626
|
+
},
|
|
13627
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiPlus, { size: 14, className: "text-amber-400" }),
|
|
13628
|
+
/* @__PURE__ */ import_react29.default.createElement("span", { className: "hidden sm:inline" }, "Nova Pasta")
|
|
13629
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
13520
13630
|
"button",
|
|
13521
13631
|
{
|
|
13522
|
-
onClick:
|
|
13632
|
+
onClick: () => handleAddItem("group"),
|
|
13523
13633
|
className: "flex items-center gap-2 px-3 py-1.5 bg-white/5 hover:bg-white/10 border border-white/10 hover:border-white/20 backdrop-blur-sm text-slate-200 hover:text-white rounded-md transition-all duration-200 text-xs font-medium shadow-sm"
|
|
13524
13634
|
},
|
|
13525
13635
|
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiPlus, { size: 14, className: "text-indigo-400" }),
|
|
13526
13636
|
/* @__PURE__ */ import_react29.default.createElement("span", { className: "hidden sm:inline" }, "Novo Grupo")
|
|
13527
|
-
), /* @__PURE__ */ import_react29.default.createElement(
|
|
13637
|
+
)), /* @__PURE__ */ import_react29.default.createElement(
|
|
13528
13638
|
"button",
|
|
13529
13639
|
{
|
|
13530
13640
|
onClick: onClose,
|
|
@@ -13532,23 +13642,47 @@ function AncestryBoard({
|
|
|
13532
13642
|
},
|
|
13533
13643
|
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiX, { size: 16 })
|
|
13534
13644
|
))),
|
|
13535
|
-
/* @__PURE__ */ import_react29.default.createElement("div", { className: "
|
|
13536
|
-
|
|
13645
|
+
/* @__PURE__ */ import_react29.default.createElement("div", { className: "h-10 px-6 bg-slate-900/40 border-b border-white/5 flex items-center gap-2 text-[10px] uppercase font-bold tracking-widest text-slate-500 overflow-x-auto no-scrollbar whitespace-nowrap" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
13646
|
+
"button",
|
|
13647
|
+
{
|
|
13648
|
+
onClick: navigateHome,
|
|
13649
|
+
className: `hover:text-white transition-colors flex items-center gap-1 ${navigationStack.length === 0 ? "text-indigo-400" : ""}`
|
|
13650
|
+
},
|
|
13651
|
+
"Home"
|
|
13652
|
+
), currentPath.map((folder, idx) => /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, { key: folder.id }, /* @__PURE__ */ import_react29.default.createElement(import_fi23.FiChevronRight, { size: 10, className: "shrink-0" }), /* @__PURE__ */ import_react29.default.createElement(
|
|
13653
|
+
"button",
|
|
13654
|
+
{
|
|
13655
|
+
onClick: () => navigateToBreadcrumb(idx),
|
|
13656
|
+
className: `hover:text-white transition-colors ${idx === currentPath.length - 1 ? "text-indigo-400" : ""}`
|
|
13657
|
+
},
|
|
13658
|
+
folder.name || "Sem Nome"
|
|
13659
|
+
))), navigationStack.length > 0 && /* @__PURE__ */ import_react29.default.createElement("div", { className: "ml-auto" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
13660
|
+
"button",
|
|
13661
|
+
{
|
|
13662
|
+
onClick: navigateUp,
|
|
13663
|
+
className: "flex items-center gap-1 px-2 py-1 rounded bg-white/5 hover:bg-white/10 text-slate-400 hover:text-white transition-all"
|
|
13664
|
+
},
|
|
13665
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiArrowLeft, { size: 10 }),
|
|
13666
|
+
/* @__PURE__ */ import_react29.default.createElement("span", null, "Voltar")
|
|
13667
|
+
))),
|
|
13668
|
+
/* @__PURE__ */ import_react29.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar bg-slate-950/30 p-6 space-y-4" }, currentGroups.length === 0 ? /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex flex-col items-center justify-center h-full text-slate-500 gap-3 border-2 border-dashed border-white/5 rounded-xl bg-slate-900/20" }, /* @__PURE__ */ import_react29.default.createElement(import_fi23.FiLayers, { size: 24, className: "opacity-20" }), /* @__PURE__ */ import_react29.default.createElement("p", { className: "text-xs text-center px-4" }, canEdit ? /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, "Esta pasta est\xE1 vazia.", /* @__PURE__ */ import_react29.default.createElement("br", null), "Use os bot\xF5es acima para criar conte\xFAdo.") : /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, "Nenhum conte\xFAdo dispon\xEDvel nesta pasta."))) : currentGroups.map((item, index) => /* @__PURE__ */ import_react29.default.createElement(
|
|
13669
|
+
BoardItem,
|
|
13537
13670
|
{
|
|
13538
|
-
key:
|
|
13671
|
+
key: item.id,
|
|
13539
13672
|
index,
|
|
13540
|
-
|
|
13541
|
-
onUpdate:
|
|
13542
|
-
onDelete:
|
|
13673
|
+
item,
|
|
13674
|
+
onUpdate: handleUpdateItem,
|
|
13675
|
+
onDelete: handleDeleteItem,
|
|
13543
13676
|
onAddSubgroup: handleAddSubgroup,
|
|
13544
13677
|
onIndent: handleIndent,
|
|
13545
13678
|
onOutdent: handleOutdent,
|
|
13546
13679
|
searchItems: allSearchableItems,
|
|
13547
13680
|
onMentionClick: handleMentionClick,
|
|
13681
|
+
onEnterFolder: navigateTo,
|
|
13548
13682
|
canEdit
|
|
13549
13683
|
}
|
|
13550
13684
|
))),
|
|
13551
|
-
/* @__PURE__ */ import_react29.default.createElement("div", { className: "px-5 py-2 border-t border-white/10 bg-slate-950/50 text-xs text-slate-500 flex justify-end flex-shrink-0" }, /* @__PURE__ */ import_react29.default.createElement("span", null,
|
|
13685
|
+
/* @__PURE__ */ import_react29.default.createElement("div", { className: "px-5 py-2 border-t border-white/10 bg-slate-950/50 text-xs text-slate-500 flex justify-end flex-shrink-0" }, /* @__PURE__ */ import_react29.default.createElement("span", null, currentGroups.length, " itens nesta visualiza\xE7\xE3o"))
|
|
13552
13686
|
)
|
|
13553
13687
|
);
|
|
13554
13688
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -12965,7 +12965,9 @@ import {
|
|
|
12965
12965
|
FiX as FiX8,
|
|
12966
12966
|
FiBox as FiBox2,
|
|
12967
12967
|
FiCheckSquare as FiCheckSquare4,
|
|
12968
|
-
FiGitBranch as FiGitBranch4
|
|
12968
|
+
FiGitBranch as FiGitBranch4,
|
|
12969
|
+
FiFolder as FiFolder3,
|
|
12970
|
+
FiChevronRight as FiChevronRight7
|
|
12969
12971
|
} from "react-icons/fi";
|
|
12970
12972
|
import { v4 as uuidv411 } from "uuid";
|
|
12971
12973
|
|
|
@@ -13328,8 +13330,8 @@ function RichGroupEditor({
|
|
|
13328
13330
|
}
|
|
13329
13331
|
|
|
13330
13332
|
// src/components/AncestryBoard.jsx
|
|
13331
|
-
var
|
|
13332
|
-
|
|
13333
|
+
var BoardItem = ({
|
|
13334
|
+
item,
|
|
13333
13335
|
index,
|
|
13334
13336
|
onUpdate,
|
|
13335
13337
|
onDelete,
|
|
@@ -13338,16 +13340,55 @@ var GroupItem = ({
|
|
|
13338
13340
|
onOutdent,
|
|
13339
13341
|
searchItems,
|
|
13340
13342
|
onMentionClick,
|
|
13343
|
+
onEnterFolder,
|
|
13341
13344
|
canEdit
|
|
13342
13345
|
}) => {
|
|
13346
|
+
var _a;
|
|
13347
|
+
const isFolder = item.type === "folder";
|
|
13343
13348
|
const canIndent = index > 0;
|
|
13344
13349
|
const handleContentChange = (content) => {
|
|
13345
|
-
onUpdate(
|
|
13350
|
+
onUpdate(item.id, { ...item, content });
|
|
13351
|
+
};
|
|
13352
|
+
const handleNameChange = (e) => {
|
|
13353
|
+
onUpdate(item.id, { ...item, name: e.target.value });
|
|
13346
13354
|
};
|
|
13355
|
+
if (isFolder) {
|
|
13356
|
+
return /* @__PURE__ */ React28.createElement("div", { className: "flex flex-col gap-2 mb-3 relative group/item animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ React28.createElement(
|
|
13357
|
+
"div",
|
|
13358
|
+
{
|
|
13359
|
+
onClick: () => onEnterFolder(item.id),
|
|
13360
|
+
className: "flex items-center gap-3 py-3 px-4 bg-white/5 hover:bg-white/10 border border-white/10 hover:border-white/20 rounded-xl cursor-pointer transition-all duration-200 group/folder"
|
|
13361
|
+
},
|
|
13362
|
+
/* @__PURE__ */ React28.createElement("div", { className: "w-10 h-10 rounded-lg bg-indigo-500/10 flex items-center justify-center text-indigo-400 group-hover/folder:scale-110 transition-transform" }, /* @__PURE__ */ React28.createElement(FiFolder3, { size: 20 })),
|
|
13363
|
+
/* @__PURE__ */ React28.createElement("div", { className: "flex-1 min-w-0" }, canEdit ? /* @__PURE__ */ React28.createElement(
|
|
13364
|
+
"input",
|
|
13365
|
+
{
|
|
13366
|
+
type: "text",
|
|
13367
|
+
value: item.name,
|
|
13368
|
+
onChange: handleNameChange,
|
|
13369
|
+
onClick: (e) => e.stopPropagation(),
|
|
13370
|
+
className: "bg-transparent border-none outline-none text-sm font-medium text-slate-200 w-full focus:text-white",
|
|
13371
|
+
placeholder: "Nome da pasta..."
|
|
13372
|
+
}
|
|
13373
|
+
) : /* @__PURE__ */ React28.createElement("span", { className: "text-sm font-medium text-slate-200" }, item.name), /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-2 mt-0.5" }, /* @__PURE__ */ React28.createElement("span", { className: "text-[10px] text-slate-500 uppercase tracking-wider font-semibold" }, ((_a = item.children) == null ? void 0 : _a.length) || 0, " itens"))),
|
|
13374
|
+
/* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-2 opacity-0 group-hover/folder:opacity-100 transition-opacity" }, canEdit && /* @__PURE__ */ React28.createElement(
|
|
13375
|
+
"button",
|
|
13376
|
+
{
|
|
13377
|
+
onClick: (e) => {
|
|
13378
|
+
e.stopPropagation();
|
|
13379
|
+
onDelete(item.id);
|
|
13380
|
+
},
|
|
13381
|
+
className: "p-1.5 text-slate-500 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
13382
|
+
title: "Remover Pasta"
|
|
13383
|
+
},
|
|
13384
|
+
/* @__PURE__ */ React28.createElement(FiTrash23, { size: 14 })
|
|
13385
|
+
), /* @__PURE__ */ React28.createElement(FiChevronRight7, { className: "text-slate-500 group-hover/folder:translate-x-1 transition-transform" }))
|
|
13386
|
+
));
|
|
13387
|
+
}
|
|
13347
13388
|
return /* @__PURE__ */ React28.createElement("div", { className: "flex flex-col gap-2 mb-3 pl-3 border-l border-white/10 relative group/item animate-in fade-in slide-in-from-left-2 duration-300" }, /* @__PURE__ */ React28.createElement("div", { className: "absolute -left-[1px] top-4 w-2 h-px bg-white/20" }), /* @__PURE__ */ React28.createElement("div", { className: "flex flex-col gap-2 py-2 px-3 transition-all duration-200 hover:bg-white/5 border-l-2 border-transparent hover:border-white/20" }, /* @__PURE__ */ React28.createElement(
|
|
13348
13389
|
RichGroupEditor,
|
|
13349
13390
|
{
|
|
13350
|
-
content:
|
|
13391
|
+
content: item.content,
|
|
13351
13392
|
onChange: handleContentChange,
|
|
13352
13393
|
onMentionClick,
|
|
13353
13394
|
searchItems,
|
|
@@ -13357,15 +13398,16 @@ var GroupItem = ({
|
|
|
13357
13398
|
), canEdit && /* @__PURE__ */ React28.createElement("div", { className: "flex items-center justify-between pt-2 mt-1 border-t border-white/5 opacity-40 group-hover/item:opacity-100 transition-opacity" }, /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React28.createElement(
|
|
13358
13399
|
"button",
|
|
13359
13400
|
{
|
|
13360
|
-
onClick: () => onAddSubgroup(
|
|
13361
|
-
className: "
|
|
13401
|
+
onClick: () => onAddSubgroup(item.id, "group"),
|
|
13402
|
+
className: "flex items-center gap-1 px-1.5 py-1 text-[10px] uppercase font-bold tracking-wider text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13362
13403
|
title: "Criar Subgrupo"
|
|
13363
13404
|
},
|
|
13364
|
-
/* @__PURE__ */ React28.createElement(FiPlus10, { size:
|
|
13405
|
+
/* @__PURE__ */ React28.createElement(FiPlus10, { size: 12 }),
|
|
13406
|
+
/* @__PURE__ */ React28.createElement("span", null, "Subgrupo")
|
|
13365
13407
|
)), /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React28.createElement(
|
|
13366
13408
|
"button",
|
|
13367
13409
|
{
|
|
13368
|
-
onClick: () => onIndent(
|
|
13410
|
+
onClick: () => onIndent(item.id),
|
|
13369
13411
|
disabled: !canIndent,
|
|
13370
13412
|
className: `p-1.5 rounded transition-colors ${!canIndent ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`,
|
|
13371
13413
|
title: "Aninhar no grupo acima"
|
|
@@ -13374,7 +13416,7 @@ var GroupItem = ({
|
|
|
13374
13416
|
), /* @__PURE__ */ React28.createElement(
|
|
13375
13417
|
"button",
|
|
13376
13418
|
{
|
|
13377
|
-
onClick: () => onOutdent(
|
|
13419
|
+
onClick: () => onOutdent(item.id),
|
|
13378
13420
|
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13379
13421
|
title: "Desaninhar"
|
|
13380
13422
|
},
|
|
@@ -13382,17 +13424,17 @@ var GroupItem = ({
|
|
|
13382
13424
|
), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ React28.createElement(
|
|
13383
13425
|
"button",
|
|
13384
13426
|
{
|
|
13385
|
-
onClick: () => onDelete(
|
|
13427
|
+
onClick: () => onDelete(item.id),
|
|
13386
13428
|
className: "p-1.5 text-slate-600 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
13387
13429
|
title: "Remover Grupo"
|
|
13388
13430
|
},
|
|
13389
13431
|
/* @__PURE__ */ React28.createElement(FiTrash23, { size: 14 })
|
|
13390
|
-
)))),
|
|
13391
|
-
|
|
13432
|
+
)))), item.children && item.children.length > 0 && /* @__PURE__ */ React28.createElement("div", { className: "ml-2" }, item.children.map((child, idx) => /* @__PURE__ */ React28.createElement(
|
|
13433
|
+
BoardItem,
|
|
13392
13434
|
{
|
|
13393
13435
|
key: child.id,
|
|
13394
13436
|
index: idx,
|
|
13395
|
-
|
|
13437
|
+
item: child,
|
|
13396
13438
|
onUpdate,
|
|
13397
13439
|
onDelete,
|
|
13398
13440
|
onAddSubgroup,
|
|
@@ -13400,6 +13442,7 @@ var GroupItem = ({
|
|
|
13400
13442
|
onOutdent,
|
|
13401
13443
|
searchItems,
|
|
13402
13444
|
onMentionClick,
|
|
13445
|
+
onEnterFolder,
|
|
13403
13446
|
canEdit
|
|
13404
13447
|
}
|
|
13405
13448
|
))));
|
|
@@ -13417,13 +13460,15 @@ function AncestryBoard({
|
|
|
13417
13460
|
const [groups, setGroups] = useState27([]);
|
|
13418
13461
|
const [isLoaded, setIsLoaded] = useState27(false);
|
|
13419
13462
|
const [saveStatus, setSaveStatus] = useState27("idle");
|
|
13463
|
+
const [navigationStack, setNavigationStack] = useState27([]);
|
|
13420
13464
|
const canEdit = useMemo12(() => userRole !== "viewer", [userRole]);
|
|
13421
13465
|
useEffect23(() => {
|
|
13422
13466
|
if (initialGroups && !isLoaded) {
|
|
13423
13467
|
const migrate = (list) => list.map((g) => ({
|
|
13424
13468
|
id: g.id || uuidv411(),
|
|
13469
|
+
type: g.type || "group",
|
|
13470
|
+
name: g.name || "",
|
|
13425
13471
|
content: Array.isArray(g.content) ? g.content : [],
|
|
13426
|
-
// descarta dados legados
|
|
13427
13472
|
children: migrate(g.children || [])
|
|
13428
13473
|
}));
|
|
13429
13474
|
setGroups(migrate(initialGroups));
|
|
@@ -13458,6 +13503,8 @@ function AncestryBoard({
|
|
|
13458
13503
|
}, [availableAncestries, availableNodes]);
|
|
13459
13504
|
const sanitizeGroups = (list) => list.map((g) => ({
|
|
13460
13505
|
id: g.id,
|
|
13506
|
+
type: g.type || "group",
|
|
13507
|
+
name: g.name || "",
|
|
13461
13508
|
content: g.content || [],
|
|
13462
13509
|
children: sanitizeGroups(g.children || [])
|
|
13463
13510
|
}));
|
|
@@ -13488,23 +13535,76 @@ function AncestryBoard({
|
|
|
13488
13535
|
window.addEventListener("keydown", handler);
|
|
13489
13536
|
return () => window.removeEventListener("keydown", handler);
|
|
13490
13537
|
}, [isOpen, onClose]);
|
|
13491
|
-
const
|
|
13492
|
-
|
|
13538
|
+
const currentPath = useMemo12(() => {
|
|
13539
|
+
const path = [];
|
|
13540
|
+
let currentLevel = groups;
|
|
13541
|
+
for (const folderId of navigationStack) {
|
|
13542
|
+
const folder = currentLevel.find((f) => f.id === folderId);
|
|
13543
|
+
if (folder) {
|
|
13544
|
+
path.push(folder);
|
|
13545
|
+
currentLevel = folder.children;
|
|
13546
|
+
}
|
|
13547
|
+
}
|
|
13548
|
+
return path;
|
|
13549
|
+
}, [groups, navigationStack]);
|
|
13550
|
+
const currentGroups = useMemo12(() => {
|
|
13551
|
+
const lastFolder = currentPath[currentPath.length - 1];
|
|
13552
|
+
return lastFolder ? lastFolder.children : groups;
|
|
13553
|
+
}, [groups, currentPath]);
|
|
13554
|
+
const navigateUp = () => {
|
|
13555
|
+
setNavigationStack((prev) => prev.slice(0, -1));
|
|
13493
13556
|
};
|
|
13494
|
-
const
|
|
13495
|
-
|
|
13496
|
-
|
|
13497
|
-
|
|
13498
|
-
);
|
|
13557
|
+
const navigateTo = (folderId) => {
|
|
13558
|
+
setNavigationStack((prev) => [...prev, folderId]);
|
|
13559
|
+
};
|
|
13560
|
+
const navigateToBreadcrumb = (index) => {
|
|
13561
|
+
setNavigationStack((prev) => prev.slice(0, index + 1));
|
|
13562
|
+
};
|
|
13563
|
+
const navigateHome = () => {
|
|
13564
|
+
setNavigationStack([]);
|
|
13565
|
+
};
|
|
13566
|
+
const handleAddItem = (type = "group") => {
|
|
13567
|
+
const newItem = {
|
|
13568
|
+
id: uuidv411(),
|
|
13569
|
+
type,
|
|
13570
|
+
name: type === "folder" ? "Nova Pasta" : "",
|
|
13571
|
+
content: [],
|
|
13572
|
+
children: []
|
|
13573
|
+
};
|
|
13574
|
+
if (navigationStack.length === 0) {
|
|
13575
|
+
setGroups((prev) => [newItem, ...prev]);
|
|
13576
|
+
} else {
|
|
13577
|
+
const parentId = navigationStack[navigationStack.length - 1];
|
|
13578
|
+
const add = (list) => list.map(
|
|
13579
|
+
(g) => g.id === parentId ? { ...g, children: [newItem, ...g.children] } : { ...g, children: add(g.children) }
|
|
13580
|
+
);
|
|
13581
|
+
setGroups((prev) => add(prev));
|
|
13582
|
+
}
|
|
13583
|
+
};
|
|
13584
|
+
const handleAddSubgroup = (parentId, type = "group") => {
|
|
13585
|
+
const add = (list) => list.map((g) => {
|
|
13586
|
+
if (g.id === parentId) {
|
|
13587
|
+
if (g.type === "group" && type === "folder") return g;
|
|
13588
|
+
const newItem = {
|
|
13589
|
+
id: uuidv411(),
|
|
13590
|
+
type,
|
|
13591
|
+
name: type === "folder" ? "Nova Pasta" : "",
|
|
13592
|
+
content: [],
|
|
13593
|
+
children: []
|
|
13594
|
+
};
|
|
13595
|
+
return { ...g, children: [newItem, ...g.children] };
|
|
13596
|
+
}
|
|
13597
|
+
return { ...g, children: add(g.children) };
|
|
13598
|
+
});
|
|
13499
13599
|
setGroups((prev) => add(prev));
|
|
13500
13600
|
};
|
|
13501
|
-
const
|
|
13601
|
+
const handleUpdateItem = (id, newData) => {
|
|
13502
13602
|
const update = (list) => list.map(
|
|
13503
13603
|
(g) => g.id === id ? newData : { ...g, children: update(g.children) }
|
|
13504
13604
|
);
|
|
13505
13605
|
setGroups((prev) => update(prev));
|
|
13506
13606
|
};
|
|
13507
|
-
const
|
|
13607
|
+
const handleDeleteItem = (id) => {
|
|
13508
13608
|
const del = (list) => list.filter((g) => g.id !== id).map((g) => ({ ...g, children: del(g.children) }));
|
|
13509
13609
|
setGroups((prev) => del(prev));
|
|
13510
13610
|
};
|
|
@@ -13525,8 +13625,12 @@ function AncestryBoard({
|
|
|
13525
13625
|
const found = findGroupAndParent(next, id);
|
|
13526
13626
|
if (!found || found.index === 0) return prev;
|
|
13527
13627
|
const { group, siblings, index } = found;
|
|
13628
|
+
const targetParent = siblings[index - 1];
|
|
13629
|
+
if (group.type === "folder" && targetParent.type === "group") {
|
|
13630
|
+
return prev;
|
|
13631
|
+
}
|
|
13528
13632
|
siblings.splice(index, 1);
|
|
13529
|
-
|
|
13633
|
+
targetParent.children.push(group);
|
|
13530
13634
|
return next;
|
|
13531
13635
|
});
|
|
13532
13636
|
};
|
|
@@ -13562,15 +13666,23 @@ function AncestryBoard({
|
|
|
13562
13666
|
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",
|
|
13563
13667
|
onClick: (e) => e.stopPropagation()
|
|
13564
13668
|
},
|
|
13565
|
-
/* @__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" }), "Ancestry Board"), 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(
|
|
13669
|
+
/* @__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" }), "Ancestry Board"), 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(
|
|
13670
|
+
"button",
|
|
13671
|
+
{
|
|
13672
|
+
onClick: () => handleAddItem("folder"),
|
|
13673
|
+
className: "flex items-center gap-2 px-3 py-1.5 bg-white/5 hover:bg-white/10 border border-white/10 hover:border-white/20 backdrop-blur-sm text-slate-200 hover:text-white rounded-md transition-all duration-200 text-xs font-medium shadow-sm"
|
|
13674
|
+
},
|
|
13675
|
+
/* @__PURE__ */ React28.createElement(FiPlus10, { size: 14, className: "text-amber-400" }),
|
|
13676
|
+
/* @__PURE__ */ React28.createElement("span", { className: "hidden sm:inline" }, "Nova Pasta")
|
|
13677
|
+
), /* @__PURE__ */ React28.createElement(
|
|
13566
13678
|
"button",
|
|
13567
13679
|
{
|
|
13568
|
-
onClick:
|
|
13680
|
+
onClick: () => handleAddItem("group"),
|
|
13569
13681
|
className: "flex items-center gap-2 px-3 py-1.5 bg-white/5 hover:bg-white/10 border border-white/10 hover:border-white/20 backdrop-blur-sm text-slate-200 hover:text-white rounded-md transition-all duration-200 text-xs font-medium shadow-sm"
|
|
13570
13682
|
},
|
|
13571
13683
|
/* @__PURE__ */ React28.createElement(FiPlus10, { size: 14, className: "text-indigo-400" }),
|
|
13572
13684
|
/* @__PURE__ */ React28.createElement("span", { className: "hidden sm:inline" }, "Novo Grupo")
|
|
13573
|
-
), /* @__PURE__ */ React28.createElement(
|
|
13685
|
+
)), /* @__PURE__ */ React28.createElement(
|
|
13574
13686
|
"button",
|
|
13575
13687
|
{
|
|
13576
13688
|
onClick: onClose,
|
|
@@ -13578,23 +13690,47 @@ function AncestryBoard({
|
|
|
13578
13690
|
},
|
|
13579
13691
|
/* @__PURE__ */ React28.createElement(FiX8, { size: 16 })
|
|
13580
13692
|
))),
|
|
13581
|
-
/* @__PURE__ */ React28.createElement("div", { className: "
|
|
13582
|
-
|
|
13693
|
+
/* @__PURE__ */ React28.createElement("div", { className: "h-10 px-6 bg-slate-900/40 border-b border-white/5 flex items-center gap-2 text-[10px] uppercase font-bold tracking-widest text-slate-500 overflow-x-auto no-scrollbar whitespace-nowrap" }, /* @__PURE__ */ React28.createElement(
|
|
13694
|
+
"button",
|
|
13695
|
+
{
|
|
13696
|
+
onClick: navigateHome,
|
|
13697
|
+
className: `hover:text-white transition-colors flex items-center gap-1 ${navigationStack.length === 0 ? "text-indigo-400" : ""}`
|
|
13698
|
+
},
|
|
13699
|
+
"Home"
|
|
13700
|
+
), currentPath.map((folder, idx) => /* @__PURE__ */ React28.createElement(React28.Fragment, { key: folder.id }, /* @__PURE__ */ React28.createElement(FiChevronRight7, { size: 10, className: "shrink-0" }), /* @__PURE__ */ React28.createElement(
|
|
13701
|
+
"button",
|
|
13702
|
+
{
|
|
13703
|
+
onClick: () => navigateToBreadcrumb(idx),
|
|
13704
|
+
className: `hover:text-white transition-colors ${idx === currentPath.length - 1 ? "text-indigo-400" : ""}`
|
|
13705
|
+
},
|
|
13706
|
+
folder.name || "Sem Nome"
|
|
13707
|
+
))), navigationStack.length > 0 && /* @__PURE__ */ React28.createElement("div", { className: "ml-auto" }, /* @__PURE__ */ React28.createElement(
|
|
13708
|
+
"button",
|
|
13709
|
+
{
|
|
13710
|
+
onClick: navigateUp,
|
|
13711
|
+
className: "flex items-center gap-1 px-2 py-1 rounded bg-white/5 hover:bg-white/10 text-slate-400 hover:text-white transition-all"
|
|
13712
|
+
},
|
|
13713
|
+
/* @__PURE__ */ React28.createElement(FiArrowLeft3, { size: 10 }),
|
|
13714
|
+
/* @__PURE__ */ React28.createElement("span", null, "Voltar")
|
|
13715
|
+
))),
|
|
13716
|
+
/* @__PURE__ */ React28.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar bg-slate-950/30 p-6 space-y-4" }, currentGroups.length === 0 ? /* @__PURE__ */ React28.createElement("div", { className: "flex flex-col items-center justify-center h-full text-slate-500 gap-3 border-2 border-dashed border-white/5 rounded-xl bg-slate-900/20" }, /* @__PURE__ */ React28.createElement(FiLayers7, { size: 24, className: "opacity-20" }), /* @__PURE__ */ React28.createElement("p", { className: "text-xs text-center px-4" }, canEdit ? /* @__PURE__ */ React28.createElement(React28.Fragment, null, "Esta pasta est\xE1 vazia.", /* @__PURE__ */ React28.createElement("br", null), "Use os bot\xF5es acima para criar conte\xFAdo.") : /* @__PURE__ */ React28.createElement(React28.Fragment, null, "Nenhum conte\xFAdo dispon\xEDvel nesta pasta."))) : currentGroups.map((item, index) => /* @__PURE__ */ React28.createElement(
|
|
13717
|
+
BoardItem,
|
|
13583
13718
|
{
|
|
13584
|
-
key:
|
|
13719
|
+
key: item.id,
|
|
13585
13720
|
index,
|
|
13586
|
-
|
|
13587
|
-
onUpdate:
|
|
13588
|
-
onDelete:
|
|
13721
|
+
item,
|
|
13722
|
+
onUpdate: handleUpdateItem,
|
|
13723
|
+
onDelete: handleDeleteItem,
|
|
13589
13724
|
onAddSubgroup: handleAddSubgroup,
|
|
13590
13725
|
onIndent: handleIndent,
|
|
13591
13726
|
onOutdent: handleOutdent,
|
|
13592
13727
|
searchItems: allSearchableItems,
|
|
13593
13728
|
onMentionClick: handleMentionClick,
|
|
13729
|
+
onEnterFolder: navigateTo,
|
|
13594
13730
|
canEdit
|
|
13595
13731
|
}
|
|
13596
13732
|
))),
|
|
13597
|
-
/* @__PURE__ */ React28.createElement("div", { className: "px-5 py-2 border-t border-white/10 bg-slate-950/50 text-xs text-slate-500 flex justify-end flex-shrink-0" }, /* @__PURE__ */ React28.createElement("span", null,
|
|
13733
|
+
/* @__PURE__ */ React28.createElement("div", { className: "px-5 py-2 border-t border-white/10 bg-slate-950/50 text-xs text-slate-500 flex justify-end flex-shrink-0" }, /* @__PURE__ */ React28.createElement("span", null, currentGroups.length, " itens nesta visualiza\xE7\xE3o"))
|
|
13598
13734
|
)
|
|
13599
13735
|
);
|
|
13600
13736
|
}
|
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.15",
|
|
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",
|