@lv-x-software-house/x_view 1.2.6-dev.15 → 1.2.6-dev.17
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 +118 -8
- package/dist/index.mjs +124 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13287,9 +13287,10 @@ var BoardItem = ({
|
|
|
13287
13287
|
index,
|
|
13288
13288
|
onUpdate,
|
|
13289
13289
|
onDelete,
|
|
13290
|
-
onAddSubgroup,
|
|
13291
13290
|
onIndent,
|
|
13292
13291
|
onOutdent,
|
|
13292
|
+
onMoveUp,
|
|
13293
|
+
onMoveDown,
|
|
13293
13294
|
searchItems,
|
|
13294
13295
|
onMentionClick,
|
|
13295
13296
|
onEnterFolder,
|
|
@@ -13298,6 +13299,8 @@ var BoardItem = ({
|
|
|
13298
13299
|
var _a;
|
|
13299
13300
|
const isFolder = item.type === "folder";
|
|
13300
13301
|
const canIndent = index > 0;
|
|
13302
|
+
const canMoveUp = index > 0;
|
|
13303
|
+
const isFirstItem = index === 0;
|
|
13301
13304
|
const handleContentChange = (content) => {
|
|
13302
13305
|
onUpdate(item.id, { ...item, content });
|
|
13303
13306
|
};
|
|
@@ -13323,7 +13326,53 @@ var BoardItem = ({
|
|
|
13323
13326
|
placeholder: "Nome da pasta..."
|
|
13324
13327
|
}
|
|
13325
13328
|
) : /* @__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-
|
|
13329
|
+
/* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-1.5 opacity-0 group-item/item:opacity-100 group-hover/folder:opacity-100 transition-opacity" }, canEdit && /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-0.5 bg-slate-900/80 backdrop-blur-sm p-1 rounded-lg border border-white/5 shadow-xl" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
13330
|
+
"button",
|
|
13331
|
+
{
|
|
13332
|
+
onClick: (e) => {
|
|
13333
|
+
e.stopPropagation();
|
|
13334
|
+
onMoveUp(item.id);
|
|
13335
|
+
},
|
|
13336
|
+
disabled: !canMoveUp,
|
|
13337
|
+
className: `p-1.5 rounded transition-colors ${!canMoveUp ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`,
|
|
13338
|
+
title: "Subir"
|
|
13339
|
+
},
|
|
13340
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiArrowUp, { size: 14 })
|
|
13341
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
13342
|
+
"button",
|
|
13343
|
+
{
|
|
13344
|
+
onClick: (e) => {
|
|
13345
|
+
e.stopPropagation();
|
|
13346
|
+
onMoveDown(item.id);
|
|
13347
|
+
},
|
|
13348
|
+
className: "p-1.5 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13349
|
+
title: "Descer"
|
|
13350
|
+
},
|
|
13351
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiArrowDown, { size: 14 })
|
|
13352
|
+
), /* @__PURE__ */ import_react29.default.createElement("div", { className: "w-px h-3 bg-white/10 mx-0.5" }), /* @__PURE__ */ import_react29.default.createElement(
|
|
13353
|
+
"button",
|
|
13354
|
+
{
|
|
13355
|
+
onClick: (e) => {
|
|
13356
|
+
e.stopPropagation();
|
|
13357
|
+
onIndent(item.id);
|
|
13358
|
+
},
|
|
13359
|
+
disabled: !canIndent,
|
|
13360
|
+
className: `p-1.5 rounded transition-colors ${!canIndent ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`,
|
|
13361
|
+
title: "Aninhar"
|
|
13362
|
+
},
|
|
13363
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiArrowRight, { size: 14 })
|
|
13364
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
13365
|
+
"button",
|
|
13366
|
+
{
|
|
13367
|
+
onClick: (e) => {
|
|
13368
|
+
e.stopPropagation();
|
|
13369
|
+
onOutdent(item.id);
|
|
13370
|
+
},
|
|
13371
|
+
className: "p-1.5 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13372
|
+
title: "Desaninhar"
|
|
13373
|
+
},
|
|
13374
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiArrowLeft, { size: 14 })
|
|
13375
|
+
), /* @__PURE__ */ import_react29.default.createElement("div", { className: "w-px h-3 bg-white/10 mx-0.5" }), /* @__PURE__ */ import_react29.default.createElement(
|
|
13327
13376
|
"button",
|
|
13328
13377
|
{
|
|
13329
13378
|
onClick: (e) => {
|
|
@@ -13333,8 +13382,8 @@ var BoardItem = ({
|
|
|
13333
13382
|
className: "p-1.5 text-slate-500 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
13334
13383
|
title: "Remover Pasta"
|
|
13335
13384
|
},
|
|
13336
|
-
/* @__PURE__ */ import_react29.default.createElement(
|
|
13337
|
-
), /* @__PURE__ */ import_react29.default.createElement(import_fi23.FiChevronRight, { className: "text-slate-500 group-hover/folder:translate-x-1 transition-transform" }))
|
|
13385
|
+
/* @__PURE__ */ import_react29.default.createElement(FiTrash2, { size: 14 })
|
|
13386
|
+
)), /* @__PURE__ */ import_react29.default.createElement(import_fi23.FiChevronRight, { className: "text-slate-500 group-hover/folder:translate-x-1 transition-transform" }))
|
|
13338
13387
|
));
|
|
13339
13388
|
}
|
|
13340
13389
|
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(
|
|
@@ -13357,6 +13406,23 @@ var BoardItem = ({
|
|
|
13357
13406
|
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiPlus, { size: 12 }),
|
|
13358
13407
|
/* @__PURE__ */ import_react29.default.createElement("span", null, "Subgrupo")
|
|
13359
13408
|
)), /* @__PURE__ */ import_react29.default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ import_react29.default.createElement(
|
|
13409
|
+
"button",
|
|
13410
|
+
{
|
|
13411
|
+
onClick: () => onMoveUp(item.id),
|
|
13412
|
+
disabled: !canMoveUp,
|
|
13413
|
+
className: `p-1.5 rounded transition-colors ${!canMoveUp ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`,
|
|
13414
|
+
title: "Subir"
|
|
13415
|
+
},
|
|
13416
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiArrowUp, { size: 14 })
|
|
13417
|
+
), /* @__PURE__ */ import_react29.default.createElement(
|
|
13418
|
+
"button",
|
|
13419
|
+
{
|
|
13420
|
+
onClick: () => onMoveDown(item.id),
|
|
13421
|
+
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13422
|
+
title: "Descer"
|
|
13423
|
+
},
|
|
13424
|
+
/* @__PURE__ */ import_react29.default.createElement(import_fi23.FiArrowDown, { size: 14 })
|
|
13425
|
+
), /* @__PURE__ */ import_react29.default.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ import_react29.default.createElement(
|
|
13360
13426
|
"button",
|
|
13361
13427
|
{
|
|
13362
13428
|
onClick: () => onIndent(item.id),
|
|
@@ -13380,7 +13446,7 @@ var BoardItem = ({
|
|
|
13380
13446
|
className: "p-1.5 text-slate-600 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
13381
13447
|
title: "Remover Grupo"
|
|
13382
13448
|
},
|
|
13383
|
-
/* @__PURE__ */ import_react29.default.createElement(
|
|
13449
|
+
/* @__PURE__ */ import_react29.default.createElement(FiTrash2, { size: 14 })
|
|
13384
13450
|
)))), 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
13451
|
BoardItem,
|
|
13386
13452
|
{
|
|
@@ -13392,6 +13458,8 @@ var BoardItem = ({
|
|
|
13392
13458
|
onAddSubgroup,
|
|
13393
13459
|
onIndent,
|
|
13394
13460
|
onOutdent,
|
|
13461
|
+
onMoveUp,
|
|
13462
|
+
onMoveDown,
|
|
13395
13463
|
searchItems,
|
|
13396
13464
|
onMentionClick,
|
|
13397
13465
|
onEnterFolder,
|
|
@@ -13475,6 +13543,18 @@ function AncestryBoard({
|
|
|
13475
13543
|
}, 3e3);
|
|
13476
13544
|
return () => clearTimeout(id);
|
|
13477
13545
|
}, [groups, isLoaded, onSave]);
|
|
13546
|
+
const triggerInstantSave = async (updatedGroups) => {
|
|
13547
|
+
if (!onSave) return;
|
|
13548
|
+
setSaveStatus("saving");
|
|
13549
|
+
try {
|
|
13550
|
+
await onSave(sanitizeGroups(updatedGroups));
|
|
13551
|
+
setSaveStatus("saved");
|
|
13552
|
+
setTimeout(() => setSaveStatus("idle"), 3e3);
|
|
13553
|
+
} catch (err) {
|
|
13554
|
+
console.error("Erro ao salvar board:", err);
|
|
13555
|
+
setSaveStatus("error");
|
|
13556
|
+
}
|
|
13557
|
+
};
|
|
13478
13558
|
(0, import_react29.useEffect)(() => {
|
|
13479
13559
|
if (!isOpen) return;
|
|
13480
13560
|
const handler = (e) => {
|
|
@@ -13524,11 +13604,11 @@ function AncestryBoard({
|
|
|
13524
13604
|
children: []
|
|
13525
13605
|
};
|
|
13526
13606
|
if (navigationStack.length === 0) {
|
|
13527
|
-
setGroups((prev) => [
|
|
13607
|
+
setGroups((prev) => [...prev, newItem]);
|
|
13528
13608
|
} else {
|
|
13529
13609
|
const parentId = navigationStack[navigationStack.length - 1];
|
|
13530
13610
|
const add = (list) => list.map(
|
|
13531
|
-
(g) => g.id === parentId ? { ...g, children: [
|
|
13611
|
+
(g) => g.id === parentId ? { ...g, children: [...g.children, newItem] } : { ...g, children: add(g.children) }
|
|
13532
13612
|
);
|
|
13533
13613
|
setGroups((prev) => add(prev));
|
|
13534
13614
|
}
|
|
@@ -13544,7 +13624,7 @@ function AncestryBoard({
|
|
|
13544
13624
|
content: [],
|
|
13545
13625
|
children: []
|
|
13546
13626
|
};
|
|
13547
|
-
return { ...g, children: [
|
|
13627
|
+
return { ...g, children: [...g.children, newItem] };
|
|
13548
13628
|
}
|
|
13549
13629
|
return { ...g, children: add(g.children) };
|
|
13550
13630
|
});
|
|
@@ -13583,6 +13663,7 @@ function AncestryBoard({
|
|
|
13583
13663
|
}
|
|
13584
13664
|
siblings.splice(index, 1);
|
|
13585
13665
|
targetParent.children.push(group);
|
|
13666
|
+
triggerInstantSave(next);
|
|
13586
13667
|
return next;
|
|
13587
13668
|
});
|
|
13588
13669
|
};
|
|
@@ -13599,6 +13680,33 @@ function AncestryBoard({
|
|
|
13599
13680
|
} else {
|
|
13600
13681
|
next.push(group);
|
|
13601
13682
|
}
|
|
13683
|
+
triggerInstantSave(next);
|
|
13684
|
+
return next;
|
|
13685
|
+
});
|
|
13686
|
+
};
|
|
13687
|
+
const handleMoveUp = (id) => {
|
|
13688
|
+
setGroups((prev) => {
|
|
13689
|
+
const next = JSON.parse(JSON.stringify(prev));
|
|
13690
|
+
const found = findGroupAndParent(next, id);
|
|
13691
|
+
if (!found || found.index === 0) return prev;
|
|
13692
|
+
const { siblings, index } = found;
|
|
13693
|
+
const item = siblings[index];
|
|
13694
|
+
siblings.splice(index, 1);
|
|
13695
|
+
siblings.splice(index - 1, 0, item);
|
|
13696
|
+
triggerInstantSave(next);
|
|
13697
|
+
return next;
|
|
13698
|
+
});
|
|
13699
|
+
};
|
|
13700
|
+
const handleMoveDown = (id) => {
|
|
13701
|
+
setGroups((prev) => {
|
|
13702
|
+
const next = JSON.parse(JSON.stringify(prev));
|
|
13703
|
+
const found = findGroupAndParent(next, id);
|
|
13704
|
+
if (!found || found.index === found.siblings.length - 1) return prev;
|
|
13705
|
+
const { siblings, index } = found;
|
|
13706
|
+
const item = siblings[index];
|
|
13707
|
+
siblings.splice(index, 1);
|
|
13708
|
+
siblings.splice(index + 1, 0, item);
|
|
13709
|
+
triggerInstantSave(next);
|
|
13602
13710
|
return next;
|
|
13603
13711
|
});
|
|
13604
13712
|
};
|
|
@@ -13676,6 +13784,8 @@ function AncestryBoard({
|
|
|
13676
13784
|
onAddSubgroup: handleAddSubgroup,
|
|
13677
13785
|
onIndent: handleIndent,
|
|
13678
13786
|
onOutdent: handleOutdent,
|
|
13787
|
+
onMoveUp: handleMoveUp,
|
|
13788
|
+
onMoveDown: handleMoveDown,
|
|
13679
13789
|
searchItems: allSearchableItems,
|
|
13680
13790
|
onMentionClick: handleMentionClick,
|
|
13681
13791
|
onEnterFolder: navigateTo,
|
package/dist/index.mjs
CHANGED
|
@@ -4387,7 +4387,7 @@ import { v4 as uuidv43 } from "uuid";
|
|
|
4387
4387
|
|
|
4388
4388
|
// src/components/CustomPropertyDisplay.jsx
|
|
4389
4389
|
import React3, { useState as useState4, useRef as useRef3, useEffect as useEffect3 } from "react";
|
|
4390
|
-
import { FiCheck, FiX, FiEdit3, FiTrash2, FiExternalLink, FiFileText, FiChevronDown, FiUpload, FiLoader } from "react-icons/fi";
|
|
4390
|
+
import { FiCheck, FiX, FiEdit3, FiTrash2 as FiTrash22, FiExternalLink, FiFileText, FiChevronDown, FiUpload, FiLoader } from "react-icons/fi";
|
|
4391
4391
|
function CustomPropertyDisplay({
|
|
4392
4392
|
prop,
|
|
4393
4393
|
onUpdate,
|
|
@@ -4744,7 +4744,7 @@ function CustomPropertyDisplay({
|
|
|
4744
4744
|
onMouseLeave: () => setIsHovered(false)
|
|
4745
4745
|
},
|
|
4746
4746
|
isEditing ? renderEditView() : renderDisplayView(),
|
|
4747
|
-
!isEditing && !readOnly && /* @__PURE__ */ React3.createElement("div", { className: `absolute top-2 right-2 flex items-center gap-1 transition-opacity ${isHovered ? "opacity-100" : "opacity-0"}` }, /* @__PURE__ */ React3.createElement("button", { onClick: () => setIsEditing(true), className: "w-7 h-7 grid place-items-center rounded-lg bg-slate-700/80 hover:bg-slate-600/80 text-slate-200 transition-colors", title: "Editar" }, /* @__PURE__ */ React3.createElement(FiEdit3, { size: 14 })), /* @__PURE__ */ React3.createElement("button", { onClick: onRemove, className: "w-7 h-7 grid place-items-center rounded-lg bg-red-700/80 hover:bg-red-600/80 text-slate-200 transition-colors", title: "Remover" }, /* @__PURE__ */ React3.createElement(
|
|
4747
|
+
!isEditing && !readOnly && /* @__PURE__ */ React3.createElement("div", { className: `absolute top-2 right-2 flex items-center gap-1 transition-opacity ${isHovered ? "opacity-100" : "opacity-0"}` }, /* @__PURE__ */ React3.createElement("button", { onClick: () => setIsEditing(true), className: "w-7 h-7 grid place-items-center rounded-lg bg-slate-700/80 hover:bg-slate-600/80 text-slate-200 transition-colors", title: "Editar" }, /* @__PURE__ */ React3.createElement(FiEdit3, { size: 14 })), /* @__PURE__ */ React3.createElement("button", { onClick: onRemove, className: "w-7 h-7 grid place-items-center rounded-lg bg-red-700/80 hover:bg-red-600/80 text-slate-200 transition-colors", title: "Remover" }, /* @__PURE__ */ React3.createElement(FiTrash22, { size: 14 })))
|
|
4748
4748
|
);
|
|
4749
4749
|
}
|
|
4750
4750
|
|
|
@@ -6644,7 +6644,7 @@ import {
|
|
|
6644
6644
|
FiPlus as FiPlus2,
|
|
6645
6645
|
FiLock as FiLock2,
|
|
6646
6646
|
FiLink as FiLink4,
|
|
6647
|
-
FiTrash2 as
|
|
6647
|
+
FiTrash2 as FiTrash23
|
|
6648
6648
|
} from "react-icons/fi";
|
|
6649
6649
|
import { v4 as uuidv44 } from "uuid";
|
|
6650
6650
|
|
|
@@ -8083,7 +8083,7 @@ function CreateAncestryPanel({
|
|
|
8083
8083
|
className: "flex items-center gap-1.5 text-xs text-rose-400/80 hover:text-white hover:bg-rose-500/20 px-2 py-1 rounded transition-colors",
|
|
8084
8084
|
title: "Excluir permanentemente esta ramifica\xE7\xE3o e seu conte\xFAdo"
|
|
8085
8085
|
},
|
|
8086
|
-
/* @__PURE__ */ React10.createElement(
|
|
8086
|
+
/* @__PURE__ */ React10.createElement(FiTrash23, null),
|
|
8087
8087
|
" Excluir Ramifica\xE7\xE3o"
|
|
8088
8088
|
))), /* @__PURE__ */ React10.createElement("div", { className: "px-6 pb-4 pt-2 overflow-y-auto flex-grow custom-scrollbar" }, branchStack.length > 0 && /* @__PURE__ */ React10.createElement("div", { className: "mb-4" }, isContextLinked ? /* @__PURE__ */ React10.createElement("div", { className: "p-3 rounded-lg bg-indigo-500/10 border border-indigo-500/30 flex items-center justify-between" }, /* @__PURE__ */ React10.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React10.createElement("div", { className: "w-8 h-8 rounded bg-indigo-500/20 text-indigo-300 grid place-content-center" }, /* @__PURE__ */ React10.createElement(FiLayers5, null)), /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement("div", { className: "text-xs text-indigo-200 font-semibold uppercase tracking-wider" }, "Ancestralidade Vinculada"), /* @__PURE__ */ React10.createElement("div", { className: "text-sm text-white font-medium truncate max-w-[200px]" }, currentContext.name.replace("[REF] ", "")))), /* @__PURE__ */ React10.createElement(
|
|
8089
8089
|
"button",
|
|
@@ -12957,9 +12957,10 @@ import {
|
|
|
12957
12957
|
FiCornerUpRight as FiCornerUpRight4,
|
|
12958
12958
|
FiPlay,
|
|
12959
12959
|
FiPlus as FiPlus10,
|
|
12960
|
-
FiTrash2 as FiTrash23,
|
|
12961
12960
|
FiArrowLeft as FiArrowLeft3,
|
|
12962
12961
|
FiArrowRight as FiArrowRight2,
|
|
12962
|
+
FiArrowUp,
|
|
12963
|
+
FiArrowDown,
|
|
12963
12964
|
FiCheckCircle,
|
|
12964
12965
|
FiLoader as FiLoader5,
|
|
12965
12966
|
FiX as FiX8,
|
|
@@ -13335,9 +13336,10 @@ var BoardItem = ({
|
|
|
13335
13336
|
index,
|
|
13336
13337
|
onUpdate,
|
|
13337
13338
|
onDelete,
|
|
13338
|
-
onAddSubgroup,
|
|
13339
13339
|
onIndent,
|
|
13340
13340
|
onOutdent,
|
|
13341
|
+
onMoveUp,
|
|
13342
|
+
onMoveDown,
|
|
13341
13343
|
searchItems,
|
|
13342
13344
|
onMentionClick,
|
|
13343
13345
|
onEnterFolder,
|
|
@@ -13346,6 +13348,8 @@ var BoardItem = ({
|
|
|
13346
13348
|
var _a;
|
|
13347
13349
|
const isFolder = item.type === "folder";
|
|
13348
13350
|
const canIndent = index > 0;
|
|
13351
|
+
const canMoveUp = index > 0;
|
|
13352
|
+
const isFirstItem = index === 0;
|
|
13349
13353
|
const handleContentChange = (content) => {
|
|
13350
13354
|
onUpdate(item.id, { ...item, content });
|
|
13351
13355
|
};
|
|
@@ -13371,7 +13375,53 @@ var BoardItem = ({
|
|
|
13371
13375
|
placeholder: "Nome da pasta..."
|
|
13372
13376
|
}
|
|
13373
13377
|
) : /* @__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-
|
|
13378
|
+
/* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-1.5 opacity-0 group-item/item:opacity-100 group-hover/folder:opacity-100 transition-opacity" }, canEdit && /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-0.5 bg-slate-900/80 backdrop-blur-sm p-1 rounded-lg border border-white/5 shadow-xl" }, /* @__PURE__ */ React28.createElement(
|
|
13379
|
+
"button",
|
|
13380
|
+
{
|
|
13381
|
+
onClick: (e) => {
|
|
13382
|
+
e.stopPropagation();
|
|
13383
|
+
onMoveUp(item.id);
|
|
13384
|
+
},
|
|
13385
|
+
disabled: !canMoveUp,
|
|
13386
|
+
className: `p-1.5 rounded transition-colors ${!canMoveUp ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`,
|
|
13387
|
+
title: "Subir"
|
|
13388
|
+
},
|
|
13389
|
+
/* @__PURE__ */ React28.createElement(FiArrowUp, { size: 14 })
|
|
13390
|
+
), /* @__PURE__ */ React28.createElement(
|
|
13391
|
+
"button",
|
|
13392
|
+
{
|
|
13393
|
+
onClick: (e) => {
|
|
13394
|
+
e.stopPropagation();
|
|
13395
|
+
onMoveDown(item.id);
|
|
13396
|
+
},
|
|
13397
|
+
className: "p-1.5 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13398
|
+
title: "Descer"
|
|
13399
|
+
},
|
|
13400
|
+
/* @__PURE__ */ React28.createElement(FiArrowDown, { size: 14 })
|
|
13401
|
+
), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-0.5" }), /* @__PURE__ */ React28.createElement(
|
|
13402
|
+
"button",
|
|
13403
|
+
{
|
|
13404
|
+
onClick: (e) => {
|
|
13405
|
+
e.stopPropagation();
|
|
13406
|
+
onIndent(item.id);
|
|
13407
|
+
},
|
|
13408
|
+
disabled: !canIndent,
|
|
13409
|
+
className: `p-1.5 rounded transition-colors ${!canIndent ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`,
|
|
13410
|
+
title: "Aninhar"
|
|
13411
|
+
},
|
|
13412
|
+
/* @__PURE__ */ React28.createElement(FiArrowRight2, { size: 14 })
|
|
13413
|
+
), /* @__PURE__ */ React28.createElement(
|
|
13414
|
+
"button",
|
|
13415
|
+
{
|
|
13416
|
+
onClick: (e) => {
|
|
13417
|
+
e.stopPropagation();
|
|
13418
|
+
onOutdent(item.id);
|
|
13419
|
+
},
|
|
13420
|
+
className: "p-1.5 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13421
|
+
title: "Desaninhar"
|
|
13422
|
+
},
|
|
13423
|
+
/* @__PURE__ */ React28.createElement(FiArrowLeft3, { size: 14 })
|
|
13424
|
+
), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-0.5" }), /* @__PURE__ */ React28.createElement(
|
|
13375
13425
|
"button",
|
|
13376
13426
|
{
|
|
13377
13427
|
onClick: (e) => {
|
|
@@ -13381,8 +13431,8 @@ var BoardItem = ({
|
|
|
13381
13431
|
className: "p-1.5 text-slate-500 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
13382
13432
|
title: "Remover Pasta"
|
|
13383
13433
|
},
|
|
13384
|
-
/* @__PURE__ */ React28.createElement(
|
|
13385
|
-
), /* @__PURE__ */ React28.createElement(FiChevronRight7, { className: "text-slate-500 group-hover/folder:translate-x-1 transition-transform" }))
|
|
13434
|
+
/* @__PURE__ */ React28.createElement(FiTrash2, { size: 14 })
|
|
13435
|
+
)), /* @__PURE__ */ React28.createElement(FiChevronRight7, { className: "text-slate-500 group-hover/folder:translate-x-1 transition-transform" }))
|
|
13386
13436
|
));
|
|
13387
13437
|
}
|
|
13388
13438
|
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(
|
|
@@ -13405,6 +13455,23 @@ var BoardItem = ({
|
|
|
13405
13455
|
/* @__PURE__ */ React28.createElement(FiPlus10, { size: 12 }),
|
|
13406
13456
|
/* @__PURE__ */ React28.createElement("span", null, "Subgrupo")
|
|
13407
13457
|
)), /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React28.createElement(
|
|
13458
|
+
"button",
|
|
13459
|
+
{
|
|
13460
|
+
onClick: () => onMoveUp(item.id),
|
|
13461
|
+
disabled: !canMoveUp,
|
|
13462
|
+
className: `p-1.5 rounded transition-colors ${!canMoveUp ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`,
|
|
13463
|
+
title: "Subir"
|
|
13464
|
+
},
|
|
13465
|
+
/* @__PURE__ */ React28.createElement(FiArrowUp, { size: 14 })
|
|
13466
|
+
), /* @__PURE__ */ React28.createElement(
|
|
13467
|
+
"button",
|
|
13468
|
+
{
|
|
13469
|
+
onClick: () => onMoveDown(item.id),
|
|
13470
|
+
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13471
|
+
title: "Descer"
|
|
13472
|
+
},
|
|
13473
|
+
/* @__PURE__ */ React28.createElement(FiArrowDown, { size: 14 })
|
|
13474
|
+
), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ React28.createElement(
|
|
13408
13475
|
"button",
|
|
13409
13476
|
{
|
|
13410
13477
|
onClick: () => onIndent(item.id),
|
|
@@ -13428,7 +13495,7 @@ var BoardItem = ({
|
|
|
13428
13495
|
className: "p-1.5 text-slate-600 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors",
|
|
13429
13496
|
title: "Remover Grupo"
|
|
13430
13497
|
},
|
|
13431
|
-
/* @__PURE__ */ React28.createElement(
|
|
13498
|
+
/* @__PURE__ */ React28.createElement(FiTrash2, { size: 14 })
|
|
13432
13499
|
)))), item.children && item.children.length > 0 && /* @__PURE__ */ React28.createElement("div", { className: "ml-2" }, item.children.map((child, idx) => /* @__PURE__ */ React28.createElement(
|
|
13433
13500
|
BoardItem,
|
|
13434
13501
|
{
|
|
@@ -13440,6 +13507,8 @@ var BoardItem = ({
|
|
|
13440
13507
|
onAddSubgroup,
|
|
13441
13508
|
onIndent,
|
|
13442
13509
|
onOutdent,
|
|
13510
|
+
onMoveUp,
|
|
13511
|
+
onMoveDown,
|
|
13443
13512
|
searchItems,
|
|
13444
13513
|
onMentionClick,
|
|
13445
13514
|
onEnterFolder,
|
|
@@ -13523,6 +13592,18 @@ function AncestryBoard({
|
|
|
13523
13592
|
}, 3e3);
|
|
13524
13593
|
return () => clearTimeout(id);
|
|
13525
13594
|
}, [groups, isLoaded, onSave]);
|
|
13595
|
+
const triggerInstantSave = async (updatedGroups) => {
|
|
13596
|
+
if (!onSave) return;
|
|
13597
|
+
setSaveStatus("saving");
|
|
13598
|
+
try {
|
|
13599
|
+
await onSave(sanitizeGroups(updatedGroups));
|
|
13600
|
+
setSaveStatus("saved");
|
|
13601
|
+
setTimeout(() => setSaveStatus("idle"), 3e3);
|
|
13602
|
+
} catch (err) {
|
|
13603
|
+
console.error("Erro ao salvar board:", err);
|
|
13604
|
+
setSaveStatus("error");
|
|
13605
|
+
}
|
|
13606
|
+
};
|
|
13526
13607
|
useEffect23(() => {
|
|
13527
13608
|
if (!isOpen) return;
|
|
13528
13609
|
const handler = (e) => {
|
|
@@ -13572,11 +13653,11 @@ function AncestryBoard({
|
|
|
13572
13653
|
children: []
|
|
13573
13654
|
};
|
|
13574
13655
|
if (navigationStack.length === 0) {
|
|
13575
|
-
setGroups((prev) => [
|
|
13656
|
+
setGroups((prev) => [...prev, newItem]);
|
|
13576
13657
|
} else {
|
|
13577
13658
|
const parentId = navigationStack[navigationStack.length - 1];
|
|
13578
13659
|
const add = (list) => list.map(
|
|
13579
|
-
(g) => g.id === parentId ? { ...g, children: [
|
|
13660
|
+
(g) => g.id === parentId ? { ...g, children: [...g.children, newItem] } : { ...g, children: add(g.children) }
|
|
13580
13661
|
);
|
|
13581
13662
|
setGroups((prev) => add(prev));
|
|
13582
13663
|
}
|
|
@@ -13592,7 +13673,7 @@ function AncestryBoard({
|
|
|
13592
13673
|
content: [],
|
|
13593
13674
|
children: []
|
|
13594
13675
|
};
|
|
13595
|
-
return { ...g, children: [
|
|
13676
|
+
return { ...g, children: [...g.children, newItem] };
|
|
13596
13677
|
}
|
|
13597
13678
|
return { ...g, children: add(g.children) };
|
|
13598
13679
|
});
|
|
@@ -13631,6 +13712,7 @@ function AncestryBoard({
|
|
|
13631
13712
|
}
|
|
13632
13713
|
siblings.splice(index, 1);
|
|
13633
13714
|
targetParent.children.push(group);
|
|
13715
|
+
triggerInstantSave(next);
|
|
13634
13716
|
return next;
|
|
13635
13717
|
});
|
|
13636
13718
|
};
|
|
@@ -13647,6 +13729,33 @@ function AncestryBoard({
|
|
|
13647
13729
|
} else {
|
|
13648
13730
|
next.push(group);
|
|
13649
13731
|
}
|
|
13732
|
+
triggerInstantSave(next);
|
|
13733
|
+
return next;
|
|
13734
|
+
});
|
|
13735
|
+
};
|
|
13736
|
+
const handleMoveUp = (id) => {
|
|
13737
|
+
setGroups((prev) => {
|
|
13738
|
+
const next = JSON.parse(JSON.stringify(prev));
|
|
13739
|
+
const found = findGroupAndParent(next, id);
|
|
13740
|
+
if (!found || found.index === 0) return prev;
|
|
13741
|
+
const { siblings, index } = found;
|
|
13742
|
+
const item = siblings[index];
|
|
13743
|
+
siblings.splice(index, 1);
|
|
13744
|
+
siblings.splice(index - 1, 0, item);
|
|
13745
|
+
triggerInstantSave(next);
|
|
13746
|
+
return next;
|
|
13747
|
+
});
|
|
13748
|
+
};
|
|
13749
|
+
const handleMoveDown = (id) => {
|
|
13750
|
+
setGroups((prev) => {
|
|
13751
|
+
const next = JSON.parse(JSON.stringify(prev));
|
|
13752
|
+
const found = findGroupAndParent(next, id);
|
|
13753
|
+
if (!found || found.index === found.siblings.length - 1) return prev;
|
|
13754
|
+
const { siblings, index } = found;
|
|
13755
|
+
const item = siblings[index];
|
|
13756
|
+
siblings.splice(index, 1);
|
|
13757
|
+
siblings.splice(index + 1, 0, item);
|
|
13758
|
+
triggerInstantSave(next);
|
|
13650
13759
|
return next;
|
|
13651
13760
|
});
|
|
13652
13761
|
};
|
|
@@ -13724,6 +13833,8 @@ function AncestryBoard({
|
|
|
13724
13833
|
onAddSubgroup: handleAddSubgroup,
|
|
13725
13834
|
onIndent: handleIndent,
|
|
13726
13835
|
onOutdent: handleOutdent,
|
|
13836
|
+
onMoveUp: handleMoveUp,
|
|
13837
|
+
onMoveDown: handleMoveDown,
|
|
13727
13838
|
searchItems: allSearchableItems,
|
|
13728
13839
|
onMentionClick: handleMentionClick,
|
|
13729
13840
|
onEnterFolder: navigateTo,
|
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.17",
|
|
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",
|