@lv-x-software-house/x_view 1.2.6-dev.16 → 1.2.6-dev.18
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 +113 -3
- package/dist/index.mjs +115 -3
- 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) => {
|
|
@@ -13334,7 +13383,7 @@ var BoardItem = ({
|
|
|
13334
13383
|
title: "Remover Pasta"
|
|
13335
13384
|
},
|
|
13336
13385
|
/* @__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" }))
|
|
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),
|
|
@@ -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) => {
|
|
@@ -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
|
@@ -12960,6 +12960,8 @@ import {
|
|
|
12960
12960
|
FiTrash2 as FiTrash23,
|
|
12961
12961
|
FiArrowLeft as FiArrowLeft3,
|
|
12962
12962
|
FiArrowRight as FiArrowRight2,
|
|
12963
|
+
FiArrowUp,
|
|
12964
|
+
FiArrowDown,
|
|
12963
12965
|
FiCheckCircle,
|
|
12964
12966
|
FiLoader as FiLoader5,
|
|
12965
12967
|
FiX as FiX8,
|
|
@@ -13335,9 +13337,10 @@ var BoardItem = ({
|
|
|
13335
13337
|
index,
|
|
13336
13338
|
onUpdate,
|
|
13337
13339
|
onDelete,
|
|
13338
|
-
onAddSubgroup,
|
|
13339
13340
|
onIndent,
|
|
13340
13341
|
onOutdent,
|
|
13342
|
+
onMoveUp,
|
|
13343
|
+
onMoveDown,
|
|
13341
13344
|
searchItems,
|
|
13342
13345
|
onMentionClick,
|
|
13343
13346
|
onEnterFolder,
|
|
@@ -13346,6 +13349,8 @@ var BoardItem = ({
|
|
|
13346
13349
|
var _a;
|
|
13347
13350
|
const isFolder = item.type === "folder";
|
|
13348
13351
|
const canIndent = index > 0;
|
|
13352
|
+
const canMoveUp = index > 0;
|
|
13353
|
+
const isFirstItem = index === 0;
|
|
13349
13354
|
const handleContentChange = (content) => {
|
|
13350
13355
|
onUpdate(item.id, { ...item, content });
|
|
13351
13356
|
};
|
|
@@ -13371,7 +13376,53 @@ var BoardItem = ({
|
|
|
13371
13376
|
placeholder: "Nome da pasta..."
|
|
13372
13377
|
}
|
|
13373
13378
|
) : /* @__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-
|
|
13379
|
+
/* @__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(
|
|
13380
|
+
"button",
|
|
13381
|
+
{
|
|
13382
|
+
onClick: (e) => {
|
|
13383
|
+
e.stopPropagation();
|
|
13384
|
+
onMoveUp(item.id);
|
|
13385
|
+
},
|
|
13386
|
+
disabled: !canMoveUp,
|
|
13387
|
+
className: `p-1.5 rounded transition-colors ${!canMoveUp ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`,
|
|
13388
|
+
title: "Subir"
|
|
13389
|
+
},
|
|
13390
|
+
/* @__PURE__ */ React28.createElement(FiArrowUp, { size: 14 })
|
|
13391
|
+
), /* @__PURE__ */ React28.createElement(
|
|
13392
|
+
"button",
|
|
13393
|
+
{
|
|
13394
|
+
onClick: (e) => {
|
|
13395
|
+
e.stopPropagation();
|
|
13396
|
+
onMoveDown(item.id);
|
|
13397
|
+
},
|
|
13398
|
+
className: "p-1.5 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13399
|
+
title: "Descer"
|
|
13400
|
+
},
|
|
13401
|
+
/* @__PURE__ */ React28.createElement(FiArrowDown, { size: 14 })
|
|
13402
|
+
), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-0.5" }), /* @__PURE__ */ React28.createElement(
|
|
13403
|
+
"button",
|
|
13404
|
+
{
|
|
13405
|
+
onClick: (e) => {
|
|
13406
|
+
e.stopPropagation();
|
|
13407
|
+
onIndent(item.id);
|
|
13408
|
+
},
|
|
13409
|
+
disabled: !canIndent,
|
|
13410
|
+
className: `p-1.5 rounded transition-colors ${!canIndent ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`,
|
|
13411
|
+
title: "Aninhar"
|
|
13412
|
+
},
|
|
13413
|
+
/* @__PURE__ */ React28.createElement(FiArrowRight2, { size: 14 })
|
|
13414
|
+
), /* @__PURE__ */ React28.createElement(
|
|
13415
|
+
"button",
|
|
13416
|
+
{
|
|
13417
|
+
onClick: (e) => {
|
|
13418
|
+
e.stopPropagation();
|
|
13419
|
+
onOutdent(item.id);
|
|
13420
|
+
},
|
|
13421
|
+
className: "p-1.5 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13422
|
+
title: "Desaninhar"
|
|
13423
|
+
},
|
|
13424
|
+
/* @__PURE__ */ React28.createElement(FiArrowLeft3, { size: 14 })
|
|
13425
|
+
), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-0.5" }), /* @__PURE__ */ React28.createElement(
|
|
13375
13426
|
"button",
|
|
13376
13427
|
{
|
|
13377
13428
|
onClick: (e) => {
|
|
@@ -13382,7 +13433,7 @@ var BoardItem = ({
|
|
|
13382
13433
|
title: "Remover Pasta"
|
|
13383
13434
|
},
|
|
13384
13435
|
/* @__PURE__ */ React28.createElement(FiTrash23, { size: 14 })
|
|
13385
|
-
), /* @__PURE__ */ React28.createElement(FiChevronRight7, { className: "text-slate-500 group-hover/folder:translate-x-1 transition-transform" }))
|
|
13436
|
+
)), /* @__PURE__ */ React28.createElement(FiChevronRight7, { className: "text-slate-500 group-hover/folder:translate-x-1 transition-transform" }))
|
|
13386
13437
|
));
|
|
13387
13438
|
}
|
|
13388
13439
|
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 +13456,23 @@ var BoardItem = ({
|
|
|
13405
13456
|
/* @__PURE__ */ React28.createElement(FiPlus10, { size: 12 }),
|
|
13406
13457
|
/* @__PURE__ */ React28.createElement("span", null, "Subgrupo")
|
|
13407
13458
|
)), /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React28.createElement(
|
|
13459
|
+
"button",
|
|
13460
|
+
{
|
|
13461
|
+
onClick: () => onMoveUp(item.id),
|
|
13462
|
+
disabled: !canMoveUp,
|
|
13463
|
+
className: `p-1.5 rounded transition-colors ${!canMoveUp ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`,
|
|
13464
|
+
title: "Subir"
|
|
13465
|
+
},
|
|
13466
|
+
/* @__PURE__ */ React28.createElement(FiArrowUp, { size: 14 })
|
|
13467
|
+
), /* @__PURE__ */ React28.createElement(
|
|
13468
|
+
"button",
|
|
13469
|
+
{
|
|
13470
|
+
onClick: () => onMoveDown(item.id),
|
|
13471
|
+
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors",
|
|
13472
|
+
title: "Descer"
|
|
13473
|
+
},
|
|
13474
|
+
/* @__PURE__ */ React28.createElement(FiArrowDown, { size: 14 })
|
|
13475
|
+
), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ React28.createElement(
|
|
13408
13476
|
"button",
|
|
13409
13477
|
{
|
|
13410
13478
|
onClick: () => onIndent(item.id),
|
|
@@ -13440,6 +13508,8 @@ var BoardItem = ({
|
|
|
13440
13508
|
onAddSubgroup,
|
|
13441
13509
|
onIndent,
|
|
13442
13510
|
onOutdent,
|
|
13511
|
+
onMoveUp,
|
|
13512
|
+
onMoveDown,
|
|
13443
13513
|
searchItems,
|
|
13444
13514
|
onMentionClick,
|
|
13445
13515
|
onEnterFolder,
|
|
@@ -13523,6 +13593,18 @@ function AncestryBoard({
|
|
|
13523
13593
|
}, 3e3);
|
|
13524
13594
|
return () => clearTimeout(id);
|
|
13525
13595
|
}, [groups, isLoaded, onSave]);
|
|
13596
|
+
const triggerInstantSave = async (updatedGroups) => {
|
|
13597
|
+
if (!onSave) return;
|
|
13598
|
+
setSaveStatus("saving");
|
|
13599
|
+
try {
|
|
13600
|
+
await onSave(sanitizeGroups(updatedGroups));
|
|
13601
|
+
setSaveStatus("saved");
|
|
13602
|
+
setTimeout(() => setSaveStatus("idle"), 3e3);
|
|
13603
|
+
} catch (err) {
|
|
13604
|
+
console.error("Erro ao salvar board:", err);
|
|
13605
|
+
setSaveStatus("error");
|
|
13606
|
+
}
|
|
13607
|
+
};
|
|
13526
13608
|
useEffect23(() => {
|
|
13527
13609
|
if (!isOpen) return;
|
|
13528
13610
|
const handler = (e) => {
|
|
@@ -13631,6 +13713,7 @@ function AncestryBoard({
|
|
|
13631
13713
|
}
|
|
13632
13714
|
siblings.splice(index, 1);
|
|
13633
13715
|
targetParent.children.push(group);
|
|
13716
|
+
triggerInstantSave(next);
|
|
13634
13717
|
return next;
|
|
13635
13718
|
});
|
|
13636
13719
|
};
|
|
@@ -13647,6 +13730,33 @@ function AncestryBoard({
|
|
|
13647
13730
|
} else {
|
|
13648
13731
|
next.push(group);
|
|
13649
13732
|
}
|
|
13733
|
+
triggerInstantSave(next);
|
|
13734
|
+
return next;
|
|
13735
|
+
});
|
|
13736
|
+
};
|
|
13737
|
+
const handleMoveUp = (id) => {
|
|
13738
|
+
setGroups((prev) => {
|
|
13739
|
+
const next = JSON.parse(JSON.stringify(prev));
|
|
13740
|
+
const found = findGroupAndParent(next, id);
|
|
13741
|
+
if (!found || found.index === 0) return prev;
|
|
13742
|
+
const { siblings, index } = found;
|
|
13743
|
+
const item = siblings[index];
|
|
13744
|
+
siblings.splice(index, 1);
|
|
13745
|
+
siblings.splice(index - 1, 0, item);
|
|
13746
|
+
triggerInstantSave(next);
|
|
13747
|
+
return next;
|
|
13748
|
+
});
|
|
13749
|
+
};
|
|
13750
|
+
const handleMoveDown = (id) => {
|
|
13751
|
+
setGroups((prev) => {
|
|
13752
|
+
const next = JSON.parse(JSON.stringify(prev));
|
|
13753
|
+
const found = findGroupAndParent(next, id);
|
|
13754
|
+
if (!found || found.index === found.siblings.length - 1) return prev;
|
|
13755
|
+
const { siblings, index } = found;
|
|
13756
|
+
const item = siblings[index];
|
|
13757
|
+
siblings.splice(index, 1);
|
|
13758
|
+
siblings.splice(index + 1, 0, item);
|
|
13759
|
+
triggerInstantSave(next);
|
|
13650
13760
|
return next;
|
|
13651
13761
|
});
|
|
13652
13762
|
};
|
|
@@ -13724,6 +13834,8 @@ function AncestryBoard({
|
|
|
13724
13834
|
onAddSubgroup: handleAddSubgroup,
|
|
13725
13835
|
onIndent: handleIndent,
|
|
13726
13836
|
onOutdent: handleOutdent,
|
|
13837
|
+
onMoveUp: handleMoveUp,
|
|
13838
|
+
onMoveDown: handleMoveDown,
|
|
13727
13839
|
searchItems: allSearchableItems,
|
|
13728
13840
|
onMentionClick: handleMentionClick,
|
|
13729
13841
|
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.18",
|
|
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",
|