@lv-x-software-house/x_view 1.2.6-dev.13 → 1.2.6-dev.14
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 +166 -31
- package/dist/index.mjs +169 -32
- 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,25 @@ 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")
|
|
13359
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
13360
|
+
"button",
|
|
13361
|
+
{
|
|
13362
|
+
onClick: () => onAddSubgroup(item.id, "folder"),
|
|
13363
|
+
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",
|
|
13364
|
+
title: "Criar Subpasta"
|
|
13365
|
+
},
|
|
13366
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiFolder, { size: 12 }),
|
|
13367
|
+
/* @__PURE__ */ import_react29.default.createElement("span", null, "Pasta")
|
|
13319
13368
|
)), /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
13320
13369
|
"button",
|
|
13321
13370
|
{
|
|
13322
|
-
onClick: () => onIndent(
|
|
13371
|
+
onClick: () => onIndent(item.id),
|
|
13323
13372
|
disabled: !canIndent,
|
|
13324
13373
|
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
13374
|
title: "Aninhar no grupo acima"
|
|
@@ -13328,7 +13377,7 @@ var GroupItem = ({
|
|
|
13328
13377
|
), /* @__PURE__ */ import_react29.default.createElement(
|
|
13329
13378
|
"button",
|
|
13330
13379
|
{
|
|
13331
|
-
onClick: () => onOutdent(
|
|
13380
|
+
onClick: () => onOutdent(item.id),
|
|
13332
13381
|
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13333
13382
|
title: "Desaninhar"
|
|
13334
13383
|
},
|
|
@@ -13336,17 +13385,17 @@ var GroupItem = ({
|
|
|
13336
13385
|
), /* @__PURE__ */ import_react29.default.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ import_react29.default.createElement(
|
|
13337
13386
|
"button",
|
|
13338
13387
|
{
|
|
13339
|
-
onClick: () => onDelete(
|
|
13388
|
+
onClick: () => onDelete(item.id),
|
|
13340
13389
|
className: "p-1.5 text-slate-600 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
13341
13390
|
title: "Remover Grupo"
|
|
13342
13391
|
},
|
|
13343
13392
|
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiTrash2, { size: 14 })
|
|
13344
|
-
)))),
|
|
13345
|
-
|
|
13393
|
+
)))), 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(
|
|
13394
|
+
BoardItem,
|
|
13346
13395
|
{
|
|
13347
13396
|
key: child.id,
|
|
13348
13397
|
index: idx,
|
|
13349
|
-
|
|
13398
|
+
item: child,
|
|
13350
13399
|
onUpdate,
|
|
13351
13400
|
onDelete,
|
|
13352
13401
|
onAddSubgroup,
|
|
@@ -13354,6 +13403,7 @@ var GroupItem = ({
|
|
|
13354
13403
|
onOutdent,
|
|
13355
13404
|
searchItems,
|
|
13356
13405
|
onMentionClick,
|
|
13406
|
+
onEnterFolder,
|
|
13357
13407
|
canEdit
|
|
13358
13408
|
}
|
|
13359
13409
|
))));
|
|
@@ -13371,13 +13421,15 @@ function AncestryBoard({
|
|
|
13371
13421
|
const [groups, setGroups] = (0, import_react29.useState)([]);
|
|
13372
13422
|
const [isLoaded, setIsLoaded] = (0, import_react29.useState)(false);
|
|
13373
13423
|
const [saveStatus, setSaveStatus] = (0, import_react29.useState)("idle");
|
|
13424
|
+
const [navigationStack, setNavigationStack] = (0, import_react29.useState)([]);
|
|
13374
13425
|
const canEdit = (0, import_react29.useMemo)(() => userRole !== "viewer", [userRole]);
|
|
13375
13426
|
(0, import_react29.useEffect)(() => {
|
|
13376
13427
|
if (initialGroups && !isLoaded) {
|
|
13377
13428
|
const migrate = (list) => list.map((g) => ({
|
|
13378
13429
|
id: g.id || (0, import_uuid11.v4)(),
|
|
13430
|
+
type: g.type || "group",
|
|
13431
|
+
name: g.name || "",
|
|
13379
13432
|
content: Array.isArray(g.content) ? g.content : [],
|
|
13380
|
-
// descarta dados legados
|
|
13381
13433
|
children: migrate(g.children || [])
|
|
13382
13434
|
}));
|
|
13383
13435
|
setGroups(migrate(initialGroups));
|
|
@@ -13412,6 +13464,8 @@ function AncestryBoard({
|
|
|
13412
13464
|
}, [availableAncestries, availableNodes]);
|
|
13413
13465
|
const sanitizeGroups = (list) => list.map((g) => ({
|
|
13414
13466
|
id: g.id,
|
|
13467
|
+
type: g.type || "group",
|
|
13468
|
+
name: g.name || "",
|
|
13415
13469
|
content: g.content || [],
|
|
13416
13470
|
children: sanitizeGroups(g.children || [])
|
|
13417
13471
|
}));
|
|
@@ -13442,23 +13496,72 @@ function AncestryBoard({
|
|
|
13442
13496
|
window.addEventListener("keydown", handler);
|
|
13443
13497
|
return () => window.removeEventListener("keydown", handler);
|
|
13444
13498
|
}, [isOpen, onClose]);
|
|
13445
|
-
const
|
|
13446
|
-
|
|
13499
|
+
const currentPath = (0, import_react29.useMemo)(() => {
|
|
13500
|
+
const path = [];
|
|
13501
|
+
let currentLevel = groups;
|
|
13502
|
+
for (const folderId of navigationStack) {
|
|
13503
|
+
const folder = currentLevel.find((f) => f.id === folderId);
|
|
13504
|
+
if (folder) {
|
|
13505
|
+
path.push(folder);
|
|
13506
|
+
currentLevel = folder.children;
|
|
13507
|
+
}
|
|
13508
|
+
}
|
|
13509
|
+
return path;
|
|
13510
|
+
}, [groups, navigationStack]);
|
|
13511
|
+
const currentGroups = (0, import_react29.useMemo)(() => {
|
|
13512
|
+
const lastFolder = currentPath[currentPath.length - 1];
|
|
13513
|
+
return lastFolder ? lastFolder.children : groups;
|
|
13514
|
+
}, [groups, currentPath]);
|
|
13515
|
+
const navigateUp = () => {
|
|
13516
|
+
setNavigationStack((prev) => prev.slice(0, -1));
|
|
13517
|
+
};
|
|
13518
|
+
const navigateTo = (folderId) => {
|
|
13519
|
+
setNavigationStack((prev) => [...prev, folderId]);
|
|
13520
|
+
};
|
|
13521
|
+
const navigateToBreadcrumb = (index) => {
|
|
13522
|
+
setNavigationStack((prev) => prev.slice(0, index + 1));
|
|
13447
13523
|
};
|
|
13448
|
-
const
|
|
13449
|
-
|
|
13524
|
+
const navigateHome = () => {
|
|
13525
|
+
setNavigationStack([]);
|
|
13526
|
+
};
|
|
13527
|
+
const handleAddItem = (type = "group") => {
|
|
13528
|
+
const newItem = {
|
|
13529
|
+
id: (0, import_uuid11.v4)(),
|
|
13530
|
+
type,
|
|
13531
|
+
name: type === "folder" ? "Nova Pasta" : "",
|
|
13532
|
+
content: [],
|
|
13533
|
+
children: []
|
|
13534
|
+
};
|
|
13535
|
+
if (navigationStack.length === 0) {
|
|
13536
|
+
setGroups((prev) => [newItem, ...prev]);
|
|
13537
|
+
} else {
|
|
13538
|
+
const parentId = navigationStack[navigationStack.length - 1];
|
|
13539
|
+
const add = (list) => list.map(
|
|
13540
|
+
(g) => g.id === parentId ? { ...g, children: [newItem, ...g.children] } : { ...g, children: add(g.children) }
|
|
13541
|
+
);
|
|
13542
|
+
setGroups((prev) => add(prev));
|
|
13543
|
+
}
|
|
13544
|
+
};
|
|
13545
|
+
const handleAddSubgroup = (parentId, type = "group") => {
|
|
13546
|
+
const newItem = {
|
|
13547
|
+
id: (0, import_uuid11.v4)(),
|
|
13548
|
+
type,
|
|
13549
|
+
name: type === "folder" ? "Nova Pasta" : "",
|
|
13550
|
+
content: [],
|
|
13551
|
+
children: []
|
|
13552
|
+
};
|
|
13450
13553
|
const add = (list) => list.map(
|
|
13451
|
-
(g) => g.id === parentId ? { ...g, children: [
|
|
13554
|
+
(g) => g.id === parentId ? { ...g, children: [newItem, ...g.children] } : { ...g, children: add(g.children) }
|
|
13452
13555
|
);
|
|
13453
13556
|
setGroups((prev) => add(prev));
|
|
13454
13557
|
};
|
|
13455
|
-
const
|
|
13558
|
+
const handleUpdateItem = (id, newData) => {
|
|
13456
13559
|
const update = (list) => list.map(
|
|
13457
13560
|
(g) => g.id === id ? newData : { ...g, children: update(g.children) }
|
|
13458
13561
|
);
|
|
13459
13562
|
setGroups((prev) => update(prev));
|
|
13460
13563
|
};
|
|
13461
|
-
const
|
|
13564
|
+
const handleDeleteItem = (id) => {
|
|
13462
13565
|
const del = (list) => list.filter((g) => g.id !== id).map((g) => ({ ...g, children: del(g.children) }));
|
|
13463
13566
|
setGroups((prev) => del(prev));
|
|
13464
13567
|
};
|
|
@@ -13516,15 +13619,23 @@ function AncestryBoard({
|
|
|
13516
13619
|
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
13620
|
onClick: (e) => e.stopPropagation()
|
|
13518
13621
|
},
|
|
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(
|
|
13622
|
+
/* @__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(
|
|
13623
|
+
"button",
|
|
13624
|
+
{
|
|
13625
|
+
onClick: () => handleAddItem("folder"),
|
|
13626
|
+
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"
|
|
13627
|
+
},
|
|
13628
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiPlus, { size: 14, className: "text-amber-400" }),
|
|
13629
|
+
/* @__PURE__ */ import_react29.default.createElement("span", { className: "hidden sm:inline" }, "Nova Pasta")
|
|
13630
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
13520
13631
|
"button",
|
|
13521
13632
|
{
|
|
13522
|
-
onClick:
|
|
13633
|
+
onClick: () => handleAddItem("group"),
|
|
13523
13634
|
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
13635
|
},
|
|
13525
13636
|
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiPlus, { size: 14, className: "text-indigo-400" }),
|
|
13526
13637
|
/* @__PURE__ */ import_react29.default.createElement("span", { className: "hidden sm:inline" }, "Novo Grupo")
|
|
13527
|
-
), /* @__PURE__ */ import_react29.default.createElement(
|
|
13638
|
+
)), /* @__PURE__ */ import_react29.default.createElement(
|
|
13528
13639
|
"button",
|
|
13529
13640
|
{
|
|
13530
13641
|
onClick: onClose,
|
|
@@ -13532,23 +13643,47 @@ function AncestryBoard({
|
|
|
13532
13643
|
},
|
|
13533
13644
|
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiX, { size: 16 })
|
|
13534
13645
|
))),
|
|
13535
|
-
/* @__PURE__ */ import_react29.default.createElement("div", { className: "
|
|
13536
|
-
|
|
13646
|
+
/* @__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(
|
|
13647
|
+
"button",
|
|
13648
|
+
{
|
|
13649
|
+
onClick: navigateHome,
|
|
13650
|
+
className: `hover:text-white transition-colors flex items-center gap-1 ${navigationStack.length === 0 ? "text-indigo-400" : ""}`
|
|
13651
|
+
},
|
|
13652
|
+
"Home"
|
|
13653
|
+
), 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(
|
|
13654
|
+
"button",
|
|
13655
|
+
{
|
|
13656
|
+
onClick: () => navigateToBreadcrumb(idx),
|
|
13657
|
+
className: `hover:text-white transition-colors ${idx === currentPath.length - 1 ? "text-indigo-400" : ""}`
|
|
13658
|
+
},
|
|
13659
|
+
folder.name || "Sem Nome"
|
|
13660
|
+
))), navigationStack.length > 0 && /* @__PURE__ */ import_react29.default.createElement("div", { className: "ml-auto" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
13661
|
+
"button",
|
|
13662
|
+
{
|
|
13663
|
+
onClick: navigateUp,
|
|
13664
|
+
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"
|
|
13665
|
+
},
|
|
13666
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiArrowLeft, { size: 10 }),
|
|
13667
|
+
/* @__PURE__ */ import_react29.default.createElement("span", null, "Voltar")
|
|
13668
|
+
))),
|
|
13669
|
+
/* @__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(
|
|
13670
|
+
BoardItem,
|
|
13537
13671
|
{
|
|
13538
|
-
key:
|
|
13672
|
+
key: item.id,
|
|
13539
13673
|
index,
|
|
13540
|
-
|
|
13541
|
-
onUpdate:
|
|
13542
|
-
onDelete:
|
|
13674
|
+
item,
|
|
13675
|
+
onUpdate: handleUpdateItem,
|
|
13676
|
+
onDelete: handleDeleteItem,
|
|
13543
13677
|
onAddSubgroup: handleAddSubgroup,
|
|
13544
13678
|
onIndent: handleIndent,
|
|
13545
13679
|
onOutdent: handleOutdent,
|
|
13546
13680
|
searchItems: allSearchableItems,
|
|
13547
13681
|
onMentionClick: handleMentionClick,
|
|
13682
|
+
onEnterFolder: navigateTo,
|
|
13548
13683
|
canEdit
|
|
13549
13684
|
}
|
|
13550
13685
|
))),
|
|
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,
|
|
13686
|
+
/* @__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
13687
|
)
|
|
13553
13688
|
);
|
|
13554
13689
|
}
|
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,25 @@ 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")
|
|
13407
|
+
), /* @__PURE__ */ React28.createElement(
|
|
13408
|
+
"button",
|
|
13409
|
+
{
|
|
13410
|
+
onClick: () => onAddSubgroup(item.id, "folder"),
|
|
13411
|
+
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",
|
|
13412
|
+
title: "Criar Subpasta"
|
|
13413
|
+
},
|
|
13414
|
+
/* @__PURE__ */ React28.createElement(FiFolder3, { size: 12 }),
|
|
13415
|
+
/* @__PURE__ */ React28.createElement("span", null, "Pasta")
|
|
13365
13416
|
)), /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React28.createElement(
|
|
13366
13417
|
"button",
|
|
13367
13418
|
{
|
|
13368
|
-
onClick: () => onIndent(
|
|
13419
|
+
onClick: () => onIndent(item.id),
|
|
13369
13420
|
disabled: !canIndent,
|
|
13370
13421
|
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
13422
|
title: "Aninhar no grupo acima"
|
|
@@ -13374,7 +13425,7 @@ var GroupItem = ({
|
|
|
13374
13425
|
), /* @__PURE__ */ React28.createElement(
|
|
13375
13426
|
"button",
|
|
13376
13427
|
{
|
|
13377
|
-
onClick: () => onOutdent(
|
|
13428
|
+
onClick: () => onOutdent(item.id),
|
|
13378
13429
|
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13379
13430
|
title: "Desaninhar"
|
|
13380
13431
|
},
|
|
@@ -13382,17 +13433,17 @@ var GroupItem = ({
|
|
|
13382
13433
|
), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ React28.createElement(
|
|
13383
13434
|
"button",
|
|
13384
13435
|
{
|
|
13385
|
-
onClick: () => onDelete(
|
|
13436
|
+
onClick: () => onDelete(item.id),
|
|
13386
13437
|
className: "p-1.5 text-slate-600 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
13387
13438
|
title: "Remover Grupo"
|
|
13388
13439
|
},
|
|
13389
13440
|
/* @__PURE__ */ React28.createElement(FiTrash23, { size: 14 })
|
|
13390
|
-
)))),
|
|
13391
|
-
|
|
13441
|
+
)))), item.children && item.children.length > 0 && /* @__PURE__ */ React28.createElement("div", { className: "ml-2" }, item.children.map((child, idx) => /* @__PURE__ */ React28.createElement(
|
|
13442
|
+
BoardItem,
|
|
13392
13443
|
{
|
|
13393
13444
|
key: child.id,
|
|
13394
13445
|
index: idx,
|
|
13395
|
-
|
|
13446
|
+
item: child,
|
|
13396
13447
|
onUpdate,
|
|
13397
13448
|
onDelete,
|
|
13398
13449
|
onAddSubgroup,
|
|
@@ -13400,6 +13451,7 @@ var GroupItem = ({
|
|
|
13400
13451
|
onOutdent,
|
|
13401
13452
|
searchItems,
|
|
13402
13453
|
onMentionClick,
|
|
13454
|
+
onEnterFolder,
|
|
13403
13455
|
canEdit
|
|
13404
13456
|
}
|
|
13405
13457
|
))));
|
|
@@ -13417,13 +13469,15 @@ function AncestryBoard({
|
|
|
13417
13469
|
const [groups, setGroups] = useState27([]);
|
|
13418
13470
|
const [isLoaded, setIsLoaded] = useState27(false);
|
|
13419
13471
|
const [saveStatus, setSaveStatus] = useState27("idle");
|
|
13472
|
+
const [navigationStack, setNavigationStack] = useState27([]);
|
|
13420
13473
|
const canEdit = useMemo12(() => userRole !== "viewer", [userRole]);
|
|
13421
13474
|
useEffect23(() => {
|
|
13422
13475
|
if (initialGroups && !isLoaded) {
|
|
13423
13476
|
const migrate = (list) => list.map((g) => ({
|
|
13424
13477
|
id: g.id || uuidv411(),
|
|
13478
|
+
type: g.type || "group",
|
|
13479
|
+
name: g.name || "",
|
|
13425
13480
|
content: Array.isArray(g.content) ? g.content : [],
|
|
13426
|
-
// descarta dados legados
|
|
13427
13481
|
children: migrate(g.children || [])
|
|
13428
13482
|
}));
|
|
13429
13483
|
setGroups(migrate(initialGroups));
|
|
@@ -13458,6 +13512,8 @@ function AncestryBoard({
|
|
|
13458
13512
|
}, [availableAncestries, availableNodes]);
|
|
13459
13513
|
const sanitizeGroups = (list) => list.map((g) => ({
|
|
13460
13514
|
id: g.id,
|
|
13515
|
+
type: g.type || "group",
|
|
13516
|
+
name: g.name || "",
|
|
13461
13517
|
content: g.content || [],
|
|
13462
13518
|
children: sanitizeGroups(g.children || [])
|
|
13463
13519
|
}));
|
|
@@ -13488,23 +13544,72 @@ function AncestryBoard({
|
|
|
13488
13544
|
window.addEventListener("keydown", handler);
|
|
13489
13545
|
return () => window.removeEventListener("keydown", handler);
|
|
13490
13546
|
}, [isOpen, onClose]);
|
|
13491
|
-
const
|
|
13492
|
-
|
|
13547
|
+
const currentPath = useMemo12(() => {
|
|
13548
|
+
const path = [];
|
|
13549
|
+
let currentLevel = groups;
|
|
13550
|
+
for (const folderId of navigationStack) {
|
|
13551
|
+
const folder = currentLevel.find((f) => f.id === folderId);
|
|
13552
|
+
if (folder) {
|
|
13553
|
+
path.push(folder);
|
|
13554
|
+
currentLevel = folder.children;
|
|
13555
|
+
}
|
|
13556
|
+
}
|
|
13557
|
+
return path;
|
|
13558
|
+
}, [groups, navigationStack]);
|
|
13559
|
+
const currentGroups = useMemo12(() => {
|
|
13560
|
+
const lastFolder = currentPath[currentPath.length - 1];
|
|
13561
|
+
return lastFolder ? lastFolder.children : groups;
|
|
13562
|
+
}, [groups, currentPath]);
|
|
13563
|
+
const navigateUp = () => {
|
|
13564
|
+
setNavigationStack((prev) => prev.slice(0, -1));
|
|
13565
|
+
};
|
|
13566
|
+
const navigateTo = (folderId) => {
|
|
13567
|
+
setNavigationStack((prev) => [...prev, folderId]);
|
|
13568
|
+
};
|
|
13569
|
+
const navigateToBreadcrumb = (index) => {
|
|
13570
|
+
setNavigationStack((prev) => prev.slice(0, index + 1));
|
|
13493
13571
|
};
|
|
13494
|
-
const
|
|
13495
|
-
|
|
13572
|
+
const navigateHome = () => {
|
|
13573
|
+
setNavigationStack([]);
|
|
13574
|
+
};
|
|
13575
|
+
const handleAddItem = (type = "group") => {
|
|
13576
|
+
const newItem = {
|
|
13577
|
+
id: uuidv411(),
|
|
13578
|
+
type,
|
|
13579
|
+
name: type === "folder" ? "Nova Pasta" : "",
|
|
13580
|
+
content: [],
|
|
13581
|
+
children: []
|
|
13582
|
+
};
|
|
13583
|
+
if (navigationStack.length === 0) {
|
|
13584
|
+
setGroups((prev) => [newItem, ...prev]);
|
|
13585
|
+
} else {
|
|
13586
|
+
const parentId = navigationStack[navigationStack.length - 1];
|
|
13587
|
+
const add = (list) => list.map(
|
|
13588
|
+
(g) => g.id === parentId ? { ...g, children: [newItem, ...g.children] } : { ...g, children: add(g.children) }
|
|
13589
|
+
);
|
|
13590
|
+
setGroups((prev) => add(prev));
|
|
13591
|
+
}
|
|
13592
|
+
};
|
|
13593
|
+
const handleAddSubgroup = (parentId, type = "group") => {
|
|
13594
|
+
const newItem = {
|
|
13595
|
+
id: uuidv411(),
|
|
13596
|
+
type,
|
|
13597
|
+
name: type === "folder" ? "Nova Pasta" : "",
|
|
13598
|
+
content: [],
|
|
13599
|
+
children: []
|
|
13600
|
+
};
|
|
13496
13601
|
const add = (list) => list.map(
|
|
13497
|
-
(g) => g.id === parentId ? { ...g, children: [
|
|
13602
|
+
(g) => g.id === parentId ? { ...g, children: [newItem, ...g.children] } : { ...g, children: add(g.children) }
|
|
13498
13603
|
);
|
|
13499
13604
|
setGroups((prev) => add(prev));
|
|
13500
13605
|
};
|
|
13501
|
-
const
|
|
13606
|
+
const handleUpdateItem = (id, newData) => {
|
|
13502
13607
|
const update = (list) => list.map(
|
|
13503
13608
|
(g) => g.id === id ? newData : { ...g, children: update(g.children) }
|
|
13504
13609
|
);
|
|
13505
13610
|
setGroups((prev) => update(prev));
|
|
13506
13611
|
};
|
|
13507
|
-
const
|
|
13612
|
+
const handleDeleteItem = (id) => {
|
|
13508
13613
|
const del = (list) => list.filter((g) => g.id !== id).map((g) => ({ ...g, children: del(g.children) }));
|
|
13509
13614
|
setGroups((prev) => del(prev));
|
|
13510
13615
|
};
|
|
@@ -13562,15 +13667,23 @@ function AncestryBoard({
|
|
|
13562
13667
|
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
13668
|
onClick: (e) => e.stopPropagation()
|
|
13564
13669
|
},
|
|
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(
|
|
13670
|
+
/* @__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(
|
|
13671
|
+
"button",
|
|
13672
|
+
{
|
|
13673
|
+
onClick: () => handleAddItem("folder"),
|
|
13674
|
+
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"
|
|
13675
|
+
},
|
|
13676
|
+
/* @__PURE__ */ React28.createElement(FiPlus10, { size: 14, className: "text-amber-400" }),
|
|
13677
|
+
/* @__PURE__ */ React28.createElement("span", { className: "hidden sm:inline" }, "Nova Pasta")
|
|
13678
|
+
), /* @__PURE__ */ React28.createElement(
|
|
13566
13679
|
"button",
|
|
13567
13680
|
{
|
|
13568
|
-
onClick:
|
|
13681
|
+
onClick: () => handleAddItem("group"),
|
|
13569
13682
|
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
13683
|
},
|
|
13571
13684
|
/* @__PURE__ */ React28.createElement(FiPlus10, { size: 14, className: "text-indigo-400" }),
|
|
13572
13685
|
/* @__PURE__ */ React28.createElement("span", { className: "hidden sm:inline" }, "Novo Grupo")
|
|
13573
|
-
), /* @__PURE__ */ React28.createElement(
|
|
13686
|
+
)), /* @__PURE__ */ React28.createElement(
|
|
13574
13687
|
"button",
|
|
13575
13688
|
{
|
|
13576
13689
|
onClick: onClose,
|
|
@@ -13578,23 +13691,47 @@ function AncestryBoard({
|
|
|
13578
13691
|
},
|
|
13579
13692
|
/* @__PURE__ */ React28.createElement(FiX8, { size: 16 })
|
|
13580
13693
|
))),
|
|
13581
|
-
/* @__PURE__ */ React28.createElement("div", { className: "
|
|
13582
|
-
|
|
13694
|
+
/* @__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(
|
|
13695
|
+
"button",
|
|
13696
|
+
{
|
|
13697
|
+
onClick: navigateHome,
|
|
13698
|
+
className: `hover:text-white transition-colors flex items-center gap-1 ${navigationStack.length === 0 ? "text-indigo-400" : ""}`
|
|
13699
|
+
},
|
|
13700
|
+
"Home"
|
|
13701
|
+
), currentPath.map((folder, idx) => /* @__PURE__ */ React28.createElement(React28.Fragment, { key: folder.id }, /* @__PURE__ */ React28.createElement(FiChevronRight7, { size: 10, className: "shrink-0" }), /* @__PURE__ */ React28.createElement(
|
|
13702
|
+
"button",
|
|
13703
|
+
{
|
|
13704
|
+
onClick: () => navigateToBreadcrumb(idx),
|
|
13705
|
+
className: `hover:text-white transition-colors ${idx === currentPath.length - 1 ? "text-indigo-400" : ""}`
|
|
13706
|
+
},
|
|
13707
|
+
folder.name || "Sem Nome"
|
|
13708
|
+
))), navigationStack.length > 0 && /* @__PURE__ */ React28.createElement("div", { className: "ml-auto" }, /* @__PURE__ */ React28.createElement(
|
|
13709
|
+
"button",
|
|
13710
|
+
{
|
|
13711
|
+
onClick: navigateUp,
|
|
13712
|
+
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"
|
|
13713
|
+
},
|
|
13714
|
+
/* @__PURE__ */ React28.createElement(FiArrowLeft3, { size: 10 }),
|
|
13715
|
+
/* @__PURE__ */ React28.createElement("span", null, "Voltar")
|
|
13716
|
+
))),
|
|
13717
|
+
/* @__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(
|
|
13718
|
+
BoardItem,
|
|
13583
13719
|
{
|
|
13584
|
-
key:
|
|
13720
|
+
key: item.id,
|
|
13585
13721
|
index,
|
|
13586
|
-
|
|
13587
|
-
onUpdate:
|
|
13588
|
-
onDelete:
|
|
13722
|
+
item,
|
|
13723
|
+
onUpdate: handleUpdateItem,
|
|
13724
|
+
onDelete: handleDeleteItem,
|
|
13589
13725
|
onAddSubgroup: handleAddSubgroup,
|
|
13590
13726
|
onIndent: handleIndent,
|
|
13591
13727
|
onOutdent: handleOutdent,
|
|
13592
13728
|
searchItems: allSearchableItems,
|
|
13593
13729
|
onMentionClick: handleMentionClick,
|
|
13730
|
+
onEnterFolder: navigateTo,
|
|
13594
13731
|
canEdit
|
|
13595
13732
|
}
|
|
13596
13733
|
))),
|
|
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,
|
|
13734
|
+
/* @__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
13735
|
)
|
|
13599
13736
|
);
|
|
13600
13737
|
}
|
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.14",
|
|
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",
|