@lv-x-software-house/x_view 1.2.6-dev.38 → 1.2.6-dev.40
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 +451 -330
- package/dist/index.mjs +458 -331
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8485,7 +8485,7 @@ var PRESET_COLORS = [
|
|
|
8485
8485
|
"#ffffff",
|
|
8486
8486
|
"#000000"
|
|
8487
8487
|
];
|
|
8488
|
-
function ColorPicker({ color, onChange, disabled }) {
|
|
8488
|
+
function ColorPicker({ color, onChange, disabled, isCompact = false }) {
|
|
8489
8489
|
const [isOpen, setIsOpen] = useState13(false);
|
|
8490
8490
|
const popoverRef = useRef9(null);
|
|
8491
8491
|
useEffect12(() => {
|
|
@@ -8503,27 +8503,87 @@ function ColorPicker({ color, onChange, disabled }) {
|
|
|
8503
8503
|
onChange(val.startsWith("#") ? val : "#" + val);
|
|
8504
8504
|
}
|
|
8505
8505
|
};
|
|
8506
|
-
|
|
8507
|
-
"
|
|
8506
|
+
if (isCompact) {
|
|
8507
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "relative", ref: popoverRef }, /* @__PURE__ */ React12.createElement(
|
|
8508
|
+
"button",
|
|
8509
|
+
{
|
|
8510
|
+
type: "button",
|
|
8511
|
+
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
8512
|
+
className: `h-4 w-4 rounded-[4px] border border-white/20 shadow-sm transition-all hover:scale-110 active:scale-95 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 relative overflow-hidden ${disabled ? "opacity-40 grayscale pointer-events-none" : ""}`,
|
|
8513
|
+
style: { backgroundColor: color },
|
|
8514
|
+
title: "Alterar Cor"
|
|
8515
|
+
},
|
|
8516
|
+
/* @__PURE__ */ React12.createElement("div", { className: "absolute inset-0 shadow-[inset_0_0_2px_rgba(255,255,255,0.2)]" })
|
|
8517
|
+
), isOpen && !disabled && /* @__PURE__ */ React12.createElement("div", { className: "absolute top-full right-0 mt-2 z-[9999] p-3 bg-slate-950 rounded-xl border border-white/10 shadow-[0_10px_40px_rgba(0,0,0,0.7)] w-[200px] animate-in fade-in zoom-in-95 duration-100" }, /* @__PURE__ */ React12.createElement("div", { className: "mb-3 custom-react-colorful" }, /* @__PURE__ */ React12.createElement(HexColorPicker, { color, onChange })), /* @__PURE__ */ React12.createElement("div", { className: "h-px bg-white/10 my-3" }), /* @__PURE__ */ React12.createElement("div", { className: "grid grid-cols-5 gap-2" }, PRESET_COLORS.map((preset) => /* @__PURE__ */ React12.createElement(
|
|
8518
|
+
"button",
|
|
8519
|
+
{
|
|
8520
|
+
key: preset,
|
|
8521
|
+
type: "button",
|
|
8522
|
+
onClick: () => {
|
|
8523
|
+
onChange(preset);
|
|
8524
|
+
setIsOpen(false);
|
|
8525
|
+
},
|
|
8526
|
+
className: "w-full aspect-square rounded border border-white/5 hover:border-white/30 hover:scale-110 transition-all shadow-sm flex items-center justify-center",
|
|
8527
|
+
style: { backgroundColor: preset },
|
|
8528
|
+
title: preset
|
|
8529
|
+
},
|
|
8530
|
+
(color || "").toLowerCase() === (preset || "").toLowerCase() && /* @__PURE__ */ React12.createElement(
|
|
8531
|
+
FiCheck6,
|
|
8532
|
+
{
|
|
8533
|
+
className: `drop-shadow-md ${["#ffffff", "#4df5cb", "#84cc16", "#f59e0b"].includes(preset) ? "text-black" : "text-white"}`,
|
|
8534
|
+
size: 12
|
|
8535
|
+
}
|
|
8536
|
+
)
|
|
8537
|
+
)))), /* @__PURE__ */ React12.createElement("style", null, `
|
|
8538
|
+
.custom-react-colorful .react-colorful {
|
|
8539
|
+
width: 100%;
|
|
8540
|
+
height: 150px;
|
|
8541
|
+
}
|
|
8542
|
+
.custom-react-colorful .react-colorful__saturation {
|
|
8543
|
+
border-radius: 8px 8px 0 0;
|
|
8544
|
+
border-bottom: 1px solid rgba(255,255,255,0.1);
|
|
8545
|
+
}
|
|
8546
|
+
.custom-react-colorful .react-colorful__hue {
|
|
8547
|
+
height: 16px;
|
|
8548
|
+
border-radius: 0 0 8px 8px;
|
|
8549
|
+
margin-top: 2px;
|
|
8550
|
+
}
|
|
8551
|
+
.custom-react-colorful .react-colorful__pointer {
|
|
8552
|
+
width: 16px;
|
|
8553
|
+
height: 16px;
|
|
8554
|
+
border: 2px solid #fff;
|
|
8555
|
+
box-shadow: 0 1px 4px rgba(0,0,0,0.5);
|
|
8556
|
+
}
|
|
8557
|
+
`));
|
|
8558
|
+
}
|
|
8559
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "relative w-full", ref: popoverRef }, /* @__PURE__ */ React12.createElement(
|
|
8560
|
+
"div",
|
|
8508
8561
|
{
|
|
8509
|
-
|
|
8510
|
-
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
8511
|
-
className: "h-8 w-12 rounded-md border border-white/10 shadow-sm transition-transform hover:scale-105 active:scale-95 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 relative overflow-hidden",
|
|
8512
|
-
style: { backgroundColor: color },
|
|
8513
|
-
title: "Abrir seletor de cor"
|
|
8562
|
+
className: `flex items-center gap-3 bg-slate-900/60 p-2.5 rounded-lg border border-white/10 transition-opacity duration-200 ${disabled ? "opacity-40 pointer-events-none grayscale" : "opacity-100"}`
|
|
8514
8563
|
},
|
|
8515
|
-
/* @__PURE__ */ React12.createElement(
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8564
|
+
/* @__PURE__ */ React12.createElement(
|
|
8565
|
+
"button",
|
|
8566
|
+
{
|
|
8567
|
+
type: "button",
|
|
8568
|
+
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
8569
|
+
className: "h-8 w-12 rounded-md border border-white/10 shadow-sm transition-transform hover:scale-105 active:scale-95 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 relative overflow-hidden",
|
|
8570
|
+
style: { backgroundColor: color },
|
|
8571
|
+
title: "Abrir seletor de cor"
|
|
8572
|
+
},
|
|
8573
|
+
/* @__PURE__ */ React12.createElement("div", { className: "absolute inset-0 shadow-[inset_0_0_2px_rgba(255,255,255,0.2)]" })
|
|
8574
|
+
),
|
|
8575
|
+
/* @__PURE__ */ React12.createElement("div", { className: "flex-1 flex items-center gap-2 bg-slate-800/50 rounded-md px-2 py-1.5 border border-white/5 focus-within:border-indigo-500/50 focus-within:ring-1 focus-within:ring-indigo-500/50 transition-all" }, /* @__PURE__ */ React12.createElement(FiHash, { className: "text-slate-500", size: 14 }), /* @__PURE__ */ React12.createElement(
|
|
8576
|
+
"input",
|
|
8577
|
+
{
|
|
8578
|
+
type: "text",
|
|
8579
|
+
value: color.replace("#", ""),
|
|
8580
|
+
onChange: handleInputChange,
|
|
8581
|
+
disabled,
|
|
8582
|
+
className: "w-full bg-transparent border-none focus:ring-0 text-sm text-slate-200 uppercase font-mono placeholder-slate-600 p-0",
|
|
8583
|
+
maxLength: 6
|
|
8584
|
+
}
|
|
8585
|
+
))
|
|
8586
|
+
), isOpen && !disabled && /* @__PURE__ */ React12.createElement("div", { className: "absolute top-full left-0 mt-2 z-[9999] p-3 bg-slate-950 rounded-xl border border-white/10 shadow-2xl w-[200px] animate-in fade-in zoom-in-95 duration-100" }, /* @__PURE__ */ React12.createElement("div", { className: "mb-3 custom-react-colorful" }, /* @__PURE__ */ React12.createElement(HexColorPicker, { color, onChange })), /* @__PURE__ */ React12.createElement("div", { className: "h-px bg-white/10 my-3" }), /* @__PURE__ */ React12.createElement("div", { className: "grid grid-cols-5 gap-2" }, PRESET_COLORS.map((preset) => /* @__PURE__ */ React12.createElement(
|
|
8527
8587
|
"button",
|
|
8528
8588
|
{
|
|
8529
8589
|
key: preset,
|
|
@@ -12950,7 +13010,13 @@ function AncestryLinkDetailsPanel({ data, onClose, onOpenImageViewer, onOpenRefe
|
|
|
12950
13010
|
}
|
|
12951
13011
|
|
|
12952
13012
|
// src/components/Boards.jsx
|
|
12953
|
-
import React28, {
|
|
13013
|
+
import React28, {
|
|
13014
|
+
useState as useState27,
|
|
13015
|
+
useMemo as useMemo12,
|
|
13016
|
+
useEffect as useEffect23,
|
|
13017
|
+
useRef as useRef20,
|
|
13018
|
+
useCallback as useCallback5
|
|
13019
|
+
} from "react";
|
|
12954
13020
|
import {
|
|
12955
13021
|
FiSearch as FiSearch8,
|
|
12956
13022
|
FiLayers as FiLayers7,
|
|
@@ -13339,220 +13405,250 @@ var Tooltip = ({ text, children }) => {
|
|
|
13339
13405
|
if (!text) return children;
|
|
13340
13406
|
return /* @__PURE__ */ React28.createElement("div", { className: "relative group/tooltip" }, children, /* @__PURE__ */ React28.createElement("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-slate-900 border border-white/10 text-white text-[10px] rounded opacity-0 group-hover/tooltip:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-[3000] shadow-2xl" }, text));
|
|
13341
13407
|
};
|
|
13342
|
-
var BoardItem = React28.memo(
|
|
13343
|
-
|
|
13344
|
-
|
|
13345
|
-
|
|
13346
|
-
|
|
13347
|
-
|
|
13348
|
-
|
|
13349
|
-
|
|
13350
|
-
|
|
13351
|
-
|
|
13352
|
-
|
|
13353
|
-
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
13384
|
-
|
|
13385
|
-
|
|
13386
|
-
|
|
13387
|
-
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
/* @__PURE__ */ React28.createElement("div", { className: "absolute inset-y-0 left-0 w-1 bg-gradient-to-r from-indigo-500/20 to-transparent opacity-0 group-hover/folder:opacity-100 transition-opacity rounded-l-xl" }),
|
|
13391
|
-
/* @__PURE__ */ React28.createElement("div", { className: "w-9 h-9 rounded-lg bg-indigo-500/10 flex items-center justify-center text-indigo-400 group-hover/folder:scale-105 group-hover/folder:bg-indigo-500/20 transition-all duration-300 shadow-inner shrink-0" }, /* @__PURE__ */ React28.createElement(FiFolder3, { size: 18 })),
|
|
13392
|
-
/* @__PURE__ */ React28.createElement("div", { className: "flex-1 min-w-0 flex flex-col justify-center" }, canEdit ? /* @__PURE__ */ React28.createElement(
|
|
13393
|
-
"input",
|
|
13394
|
-
{
|
|
13395
|
-
type: "text",
|
|
13396
|
-
value: item.name,
|
|
13397
|
-
onChange: handleNameChange,
|
|
13398
|
-
onClick: (e) => e.stopPropagation(),
|
|
13399
|
-
className: "bg-transparent border-none outline-none text-xs font-semibold text-slate-200 w-full focus:text-white placeholder:text-slate-600 truncate",
|
|
13400
|
-
placeholder: "Nome..."
|
|
13401
|
-
}
|
|
13402
|
-
) : /* @__PURE__ */ React28.createElement("span", { className: "text-xs font-semibold text-slate-200 block truncate" }, item.name), /* @__PURE__ */ React28.createElement("span", { className: "text-[9px] text-slate-500 uppercase tracking-widest font-bold" }, ((_a = item.children) == null ? void 0 : _a.length) || 0, " itens")),
|
|
13403
|
-
canEdit && /* @__PURE__ */ React28.createElement("div", { className: "absolute inset-y-0 right-1.5 opacity-0 group-hover/folder:opacity-100 transition-all duration-300 z-10 flex items-center" }, /* @__PURE__ */ React28.createElement("div", { className: "flex bg-slate-950/90 backdrop-blur-md p-1 rounded-lg border border-white/10 shadow-2xl items-center" }, /* @__PURE__ */ React28.createElement(Tooltip, { text: "Subir" }, /* @__PURE__ */ React28.createElement(
|
|
13404
|
-
"button",
|
|
13408
|
+
var BoardItem = React28.memo(
|
|
13409
|
+
({
|
|
13410
|
+
item,
|
|
13411
|
+
index,
|
|
13412
|
+
prevItem,
|
|
13413
|
+
nextItem,
|
|
13414
|
+
onUpdate,
|
|
13415
|
+
onDelete,
|
|
13416
|
+
onAddSubgroup,
|
|
13417
|
+
onIndent,
|
|
13418
|
+
onIndentDown,
|
|
13419
|
+
onOutdent,
|
|
13420
|
+
onMoveUp,
|
|
13421
|
+
onMoveDown,
|
|
13422
|
+
searchItems,
|
|
13423
|
+
onMentionClick,
|
|
13424
|
+
onEnterFolder,
|
|
13425
|
+
canEdit,
|
|
13426
|
+
isAtRoot = false
|
|
13427
|
+
}) => {
|
|
13428
|
+
var _a;
|
|
13429
|
+
const isFolder = item.type === "folder";
|
|
13430
|
+
const canMoveUp = index > 0;
|
|
13431
|
+
const canMoveDown = nextItem !== void 0;
|
|
13432
|
+
const getIndentUpTooltip = () => {
|
|
13433
|
+
if (!prevItem) return null;
|
|
13434
|
+
const typeLabel = prevItem.type === "folder" ? "pasta" : "grupo de texto";
|
|
13435
|
+
return isFolder ? prevItem.type === "folder" ? "Aninhar na pasta ao lado" : null : `Mover para dentro do ${typeLabel} acima`;
|
|
13436
|
+
};
|
|
13437
|
+
const getIndentDownTooltip = () => {
|
|
13438
|
+
if (!nextItem) return null;
|
|
13439
|
+
const typeLabel = nextItem.type === "folder" ? "pasta" : "grupo de texto";
|
|
13440
|
+
return isFolder ? nextItem.type === "folder" ? "Aninhar na pasta lado" : null : `Mover para dentro do ${typeLabel} abaixo`;
|
|
13441
|
+
};
|
|
13442
|
+
const showIndentUp = !!getIndentUpTooltip();
|
|
13443
|
+
const showIndentDown = !!getIndentDownTooltip();
|
|
13444
|
+
const handleContentChange = (content) => {
|
|
13445
|
+
onUpdate(item.id, { ...item, content });
|
|
13446
|
+
};
|
|
13447
|
+
const handleNameChange = (e) => {
|
|
13448
|
+
onUpdate(item.id, { ...item, name: e.target.value });
|
|
13449
|
+
};
|
|
13450
|
+
const handleColorChange = (newColor) => {
|
|
13451
|
+
onUpdate(item.id, { ...item, color: newColor });
|
|
13452
|
+
};
|
|
13453
|
+
if (isFolder) {
|
|
13454
|
+
return /* @__PURE__ */ React28.createElement("div", { className: "relative group/item animate-in fade-in zoom-in duration-300 w-[calc(16.66%-14px)] min-w-[160px] h-14 flex-shrink-0" }, /* @__PURE__ */ React28.createElement(
|
|
13455
|
+
"div",
|
|
13405
13456
|
{
|
|
13406
|
-
onClick: (
|
|
13407
|
-
|
|
13408
|
-
onMoveUp(item.id);
|
|
13409
|
-
},
|
|
13410
|
-
disabled: !canMoveUp,
|
|
13411
|
-
className: `p-1 rounded transition-colors ${!canMoveUp ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`
|
|
13457
|
+
onClick: () => onEnterFolder(item.id),
|
|
13458
|
+
className: "h-full flex items-center gap-3 px-3 py-2 bg-white/5 hover:bg-white/10 border border-white/10 hover:border-white/20 rounded-xl cursor-pointer transition-all duration-300 group/folder relative"
|
|
13412
13459
|
},
|
|
13413
|
-
/* @__PURE__ */ React28.createElement(
|
|
13414
|
-
|
|
13415
|
-
|
|
13416
|
-
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
|
|
13460
|
+
/* @__PURE__ */ React28.createElement(
|
|
13461
|
+
"div",
|
|
13462
|
+
{
|
|
13463
|
+
className: "absolute inset-y-0 left-0 w-1 opacity-0 group-hover/folder:opacity-100 transition-opacity rounded-l-xl",
|
|
13464
|
+
style: { background: `linear-gradient(to right, ${item.color || "#6366f1"}33, transparent)` }
|
|
13465
|
+
}
|
|
13466
|
+
),
|
|
13467
|
+
/* @__PURE__ */ React28.createElement(
|
|
13468
|
+
"div",
|
|
13469
|
+
{
|
|
13470
|
+
className: "w-9 h-9 rounded-lg flex items-center justify-center group-hover/folder:scale-105 transition-all duration-300 shadow-inner shrink-0",
|
|
13471
|
+
style: {
|
|
13472
|
+
backgroundColor: `${item.color || "#6366f1"}1a`,
|
|
13473
|
+
// 10% opacity
|
|
13474
|
+
color: item.color || "#6366f1"
|
|
13475
|
+
}
|
|
13420
13476
|
},
|
|
13421
|
-
|
|
13422
|
-
|
|
13423
|
-
},
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
|
|
13429
|
-
e.stopPropagation()
|
|
13430
|
-
|
|
13477
|
+
/* @__PURE__ */ React28.createElement(FiFolder3, { size: 18 })
|
|
13478
|
+
),
|
|
13479
|
+
/* @__PURE__ */ React28.createElement("div", { className: "flex-1 min-w-0 flex flex-col justify-center" }, canEdit ? /* @__PURE__ */ React28.createElement(
|
|
13480
|
+
"input",
|
|
13481
|
+
{
|
|
13482
|
+
type: "text",
|
|
13483
|
+
value: item.name,
|
|
13484
|
+
onChange: handleNameChange,
|
|
13485
|
+
onClick: (e) => e.stopPropagation(),
|
|
13486
|
+
className: "bg-transparent border-none outline-none text-xs font-semibold text-slate-200 w-full focus:text-white placeholder:text-slate-600 truncate",
|
|
13487
|
+
placeholder: "Nome..."
|
|
13488
|
+
}
|
|
13489
|
+
) : /* @__PURE__ */ React28.createElement("span", { className: "text-xs font-semibold text-slate-200 block truncate" }, item.name), /* @__PURE__ */ React28.createElement("span", { className: "text-[9px] text-slate-500 uppercase tracking-widest font-bold" }, ((_a = item.children) == null ? void 0 : _a.length) || 0, " itens")),
|
|
13490
|
+
canEdit && /* @__PURE__ */ React28.createElement("div", { className: "absolute inset-y-0 right-1.5 opacity-0 group-hover/folder:opacity-100 transition-all duration-300 z-10 flex items-center" }, /* @__PURE__ */ React28.createElement("div", { className: "flex bg-slate-950/90 backdrop-blur-md p-1 rounded-lg border border-white/10 shadow-2xl items-center" }, /* @__PURE__ */ React28.createElement("div", { className: "px-1", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React28.createElement(
|
|
13491
|
+
ColorPicker,
|
|
13492
|
+
{
|
|
13493
|
+
isCompact: true,
|
|
13494
|
+
color: item.color || "#6366f1",
|
|
13495
|
+
onChange: handleColorChange,
|
|
13496
|
+
disabled: !canEdit
|
|
13497
|
+
}
|
|
13498
|
+
)), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-4 bg-white/5 mx-0.5 self-center" }), /* @__PURE__ */ React28.createElement(Tooltip, { text: "Subir" }, /* @__PURE__ */ React28.createElement(
|
|
13499
|
+
"button",
|
|
13500
|
+
{
|
|
13501
|
+
onClick: (e) => {
|
|
13502
|
+
e.stopPropagation();
|
|
13503
|
+
onMoveUp(item.id);
|
|
13504
|
+
},
|
|
13505
|
+
disabled: !canMoveUp,
|
|
13506
|
+
className: `p-1 rounded transition-colors ${!canMoveUp ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`
|
|
13431
13507
|
},
|
|
13432
|
-
|
|
13433
|
-
},
|
|
13434
|
-
|
|
13435
|
-
|
|
13436
|
-
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13508
|
+
/* @__PURE__ */ React28.createElement(FiArrowUp, { size: 14 })
|
|
13509
|
+
)), /* @__PURE__ */ React28.createElement(Tooltip, { text: "Descer" }, /* @__PURE__ */ React28.createElement(
|
|
13510
|
+
"button",
|
|
13511
|
+
{
|
|
13512
|
+
onClick: (e) => {
|
|
13513
|
+
e.stopPropagation();
|
|
13514
|
+
onMoveDown(item.id);
|
|
13515
|
+
},
|
|
13516
|
+
disabled: !canMoveDown,
|
|
13517
|
+
className: `p-1 rounded transition-colors ${!canMoveDown ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`
|
|
13441
13518
|
},
|
|
13442
|
-
|
|
13443
|
-
},
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
|
|
13447
|
-
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
|
|
13519
|
+
/* @__PURE__ */ React28.createElement(FiArrowDown, { size: 14 })
|
|
13520
|
+
)), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-4 bg-white/5 mx-0.5 self-center" }), showIndentUp && /* @__PURE__ */ React28.createElement(Tooltip, { text: getIndentUpTooltip() }, /* @__PURE__ */ React28.createElement(
|
|
13521
|
+
"button",
|
|
13522
|
+
{
|
|
13523
|
+
onClick: (e) => {
|
|
13524
|
+
e.stopPropagation();
|
|
13525
|
+
onIndent(item.id);
|
|
13526
|
+
},
|
|
13527
|
+
className: "p-1 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors"
|
|
13451
13528
|
},
|
|
13452
|
-
|
|
13453
|
-
},
|
|
13454
|
-
|
|
13455
|
-
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
|
|
13459
|
-
|
|
13460
|
-
|
|
13529
|
+
/* @__PURE__ */ React28.createElement(FiArrowLeft3, { size: 14 })
|
|
13530
|
+
)), showIndentDown && /* @__PURE__ */ React28.createElement(Tooltip, { text: getIndentDownTooltip() }, /* @__PURE__ */ React28.createElement(
|
|
13531
|
+
"button",
|
|
13532
|
+
{
|
|
13533
|
+
onClick: (e) => {
|
|
13534
|
+
e.stopPropagation();
|
|
13535
|
+
onIndentDown(item.id);
|
|
13536
|
+
},
|
|
13537
|
+
className: "p-1 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors"
|
|
13461
13538
|
},
|
|
13462
|
-
|
|
13463
|
-
},
|
|
13464
|
-
|
|
13465
|
-
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13472
|
-
|
|
13473
|
-
|
|
13474
|
-
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13478
|
-
|
|
13479
|
-
|
|
13480
|
-
|
|
13481
|
-
|
|
13482
|
-
|
|
13483
|
-
|
|
13484
|
-
|
|
13485
|
-
/* @__PURE__ */ React28.createElement(FiPlus10, { size: 12 }),
|
|
13486
|
-
/* @__PURE__ */ React28.createElement("span", null, "Subgrupo")
|
|
13487
|
-
)), /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React28.createElement(Tooltip, { text: "Subir" }, /* @__PURE__ */ React28.createElement(
|
|
13488
|
-
"button",
|
|
13489
|
-
{
|
|
13490
|
-
onClick: () => onMoveUp(item.id),
|
|
13491
|
-
disabled: !canMoveUp,
|
|
13492
|
-
className: `p-1.5 rounded transition-colors ${!canMoveUp ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`
|
|
13493
|
-
},
|
|
13494
|
-
/* @__PURE__ */ React28.createElement(FiArrowUp, { size: 14 })
|
|
13495
|
-
)), /* @__PURE__ */ React28.createElement(Tooltip, { text: "Descer" }, /* @__PURE__ */ React28.createElement(
|
|
13496
|
-
"button",
|
|
13497
|
-
{
|
|
13498
|
-
onClick: () => onMoveDown(item.id),
|
|
13499
|
-
disabled: !canMoveDown,
|
|
13500
|
-
className: `p-1.5 rounded transition-colors ${!canMoveDown ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`
|
|
13501
|
-
},
|
|
13502
|
-
/* @__PURE__ */ React28.createElement(FiArrowDown, { size: 14 })
|
|
13503
|
-
)), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), showIndentUp && /* @__PURE__ */ React28.createElement(Tooltip, { text: getIndentUpTooltip() }, /* @__PURE__ */ React28.createElement(
|
|
13504
|
-
"button",
|
|
13505
|
-
{
|
|
13506
|
-
onClick: () => onIndent(item.id),
|
|
13507
|
-
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors"
|
|
13508
|
-
},
|
|
13509
|
-
/* @__PURE__ */ React28.createElement(FiArrowLeft3, { size: 14 })
|
|
13510
|
-
)), showIndentDown && /* @__PURE__ */ React28.createElement(Tooltip, { text: getIndentDownTooltip() }, /* @__PURE__ */ React28.createElement(
|
|
13511
|
-
"button",
|
|
13512
|
-
{
|
|
13513
|
-
onClick: () => onIndentDown(item.id),
|
|
13514
|
-
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors"
|
|
13515
|
-
},
|
|
13516
|
-
/* @__PURE__ */ React28.createElement(FiArrowRight2, { size: 14 })
|
|
13517
|
-
)), !isAtRoot && /* @__PURE__ */ React28.createElement(Tooltip, { text: "Desaninhar / Recuar n\xEDvel" }, /* @__PURE__ */ React28.createElement(
|
|
13518
|
-
"button",
|
|
13519
|
-
{
|
|
13520
|
-
onClick: () => onOutdent(item.id),
|
|
13521
|
-
disabled: !onOutdent,
|
|
13522
|
-
className: `p-1.5 rounded transition-colors ${!onOutdent ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`
|
|
13523
|
-
},
|
|
13524
|
-
/* @__PURE__ */ React28.createElement(FiCornerUpLeft3, { size: 14 })
|
|
13525
|
-
)), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ React28.createElement(Tooltip, { text: "Remover Grupo de Texto" }, /* @__PURE__ */ React28.createElement(
|
|
13526
|
-
"button",
|
|
13527
|
-
{
|
|
13528
|
-
onClick: () => onDelete(item.id),
|
|
13529
|
-
className: "p-1.5 text-slate-600 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors"
|
|
13530
|
-
},
|
|
13531
|
-
/* @__PURE__ */ React28.createElement(FiTrash23, { size: 14 })
|
|
13532
|
-
))))), item.children && item.children.length > 0 && /* @__PURE__ */ React28.createElement("div", { className: "ml-2" }, item.children.map((child, idx) => /* @__PURE__ */ React28.createElement(
|
|
13533
|
-
BoardItem,
|
|
13534
|
-
{
|
|
13535
|
-
key: child.id,
|
|
13536
|
-
index: idx,
|
|
13537
|
-
prevItem: item.children[idx - 1],
|
|
13538
|
-
nextItem: item.children[idx + 1],
|
|
13539
|
-
item: child,
|
|
13540
|
-
onUpdate,
|
|
13541
|
-
onDelete,
|
|
13542
|
-
onAddSubgroup,
|
|
13543
|
-
onIndent,
|
|
13544
|
-
onIndentDown,
|
|
13545
|
-
onOutdent,
|
|
13546
|
-
onMoveUp,
|
|
13547
|
-
onMoveDown,
|
|
13548
|
-
searchItems,
|
|
13549
|
-
onMentionClick,
|
|
13550
|
-
onEnterFolder,
|
|
13551
|
-
canEdit,
|
|
13552
|
-
isAtRoot: false
|
|
13539
|
+
/* @__PURE__ */ React28.createElement(FiArrowRight2, { size: 14 })
|
|
13540
|
+
)), !isAtRoot && /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement("div", { className: "w-px h-4 bg-white/5 mx-0.5 self-center" }), /* @__PURE__ */ React28.createElement(Tooltip, { text: "Desaninhar / Recuar n\xEDvel" }, /* @__PURE__ */ React28.createElement(
|
|
13541
|
+
"button",
|
|
13542
|
+
{
|
|
13543
|
+
onClick: (e) => {
|
|
13544
|
+
e.stopPropagation();
|
|
13545
|
+
onOutdent(item.id);
|
|
13546
|
+
},
|
|
13547
|
+
className: `p-1 rounded text-slate-400 hover:text-white hover:bg-white/10 transition-colors`
|
|
13548
|
+
},
|
|
13549
|
+
/* @__PURE__ */ React28.createElement(FiCornerUpLeft3, { size: 14 })
|
|
13550
|
+
))), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-4 bg-white/5 mx-0.5 self-center" }), /* @__PURE__ */ React28.createElement(Tooltip, { text: "Remover Pasta" }, /* @__PURE__ */ React28.createElement(
|
|
13551
|
+
"button",
|
|
13552
|
+
{
|
|
13553
|
+
onClick: (e) => {
|
|
13554
|
+
e.stopPropagation();
|
|
13555
|
+
onDelete(item.id);
|
|
13556
|
+
},
|
|
13557
|
+
className: "p-1 text-slate-500 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors"
|
|
13558
|
+
},
|
|
13559
|
+
/* @__PURE__ */ React28.createElement(FiTrash23, { size: 14 })
|
|
13560
|
+
))))
|
|
13561
|
+
));
|
|
13553
13562
|
}
|
|
13554
|
-
|
|
13555
|
-
|
|
13563
|
+
return /* @__PURE__ */ React28.createElement("div", { className: "w-full flex flex-col gap-2 mb-3 pl-4 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(
|
|
13564
|
+
RichGroupEditor_default,
|
|
13565
|
+
{
|
|
13566
|
+
content: item.content,
|
|
13567
|
+
onChange: handleContentChange,
|
|
13568
|
+
onMentionClick,
|
|
13569
|
+
searchItems,
|
|
13570
|
+
readOnly: !canEdit,
|
|
13571
|
+
placeholder: "Escreva sobre este grupo de texto\u2026 ou @ para mencionar"
|
|
13572
|
+
}
|
|
13573
|
+
), 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(
|
|
13574
|
+
"button",
|
|
13575
|
+
{
|
|
13576
|
+
onClick: () => onAddSubgroup(item.id, "text_group"),
|
|
13577
|
+
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",
|
|
13578
|
+
title: "Criar Subgrupo de Texto"
|
|
13579
|
+
},
|
|
13580
|
+
/* @__PURE__ */ React28.createElement(FiPlus10, { size: 12 }),
|
|
13581
|
+
/* @__PURE__ */ React28.createElement("span", null, "Subgrupo")
|
|
13582
|
+
)), /* @__PURE__ */ React28.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React28.createElement(Tooltip, { text: "Subir" }, /* @__PURE__ */ React28.createElement(
|
|
13583
|
+
"button",
|
|
13584
|
+
{
|
|
13585
|
+
onClick: () => onMoveUp(item.id),
|
|
13586
|
+
disabled: !canMoveUp,
|
|
13587
|
+
className: `p-1.5 rounded transition-colors ${!canMoveUp ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`
|
|
13588
|
+
},
|
|
13589
|
+
/* @__PURE__ */ React28.createElement(FiArrowUp, { size: 14 })
|
|
13590
|
+
)), /* @__PURE__ */ React28.createElement(Tooltip, { text: "Descer" }, /* @__PURE__ */ React28.createElement(
|
|
13591
|
+
"button",
|
|
13592
|
+
{
|
|
13593
|
+
onClick: () => onMoveDown(item.id),
|
|
13594
|
+
disabled: !canMoveDown,
|
|
13595
|
+
className: `p-1.5 rounded transition-colors ${!canMoveDown ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`
|
|
13596
|
+
},
|
|
13597
|
+
/* @__PURE__ */ React28.createElement(FiArrowDown, { size: 14 })
|
|
13598
|
+
)), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), showIndentUp && /* @__PURE__ */ React28.createElement(Tooltip, { text: getIndentUpTooltip() }, /* @__PURE__ */ React28.createElement(
|
|
13599
|
+
"button",
|
|
13600
|
+
{
|
|
13601
|
+
onClick: () => onIndent(item.id),
|
|
13602
|
+
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors"
|
|
13603
|
+
},
|
|
13604
|
+
/* @__PURE__ */ React28.createElement(FiArrowLeft3, { size: 14 })
|
|
13605
|
+
)), showIndentDown && /* @__PURE__ */ React28.createElement(Tooltip, { text: getIndentDownTooltip() }, /* @__PURE__ */ React28.createElement(
|
|
13606
|
+
"button",
|
|
13607
|
+
{
|
|
13608
|
+
onClick: () => onIndentDown(item.id),
|
|
13609
|
+
className: "p-1.5 text-slate-500 hover:text-white hover:bg-white/10 rounded transition-colors"
|
|
13610
|
+
},
|
|
13611
|
+
/* @__PURE__ */ React28.createElement(FiArrowRight2, { size: 14 })
|
|
13612
|
+
)), !isAtRoot && /* @__PURE__ */ React28.createElement(Tooltip, { text: "Desaninhar / Recuar n\xEDvel" }, /* @__PURE__ */ React28.createElement(
|
|
13613
|
+
"button",
|
|
13614
|
+
{
|
|
13615
|
+
onClick: () => onOutdent(item.id),
|
|
13616
|
+
disabled: !onOutdent,
|
|
13617
|
+
className: `p-1.5 rounded transition-colors ${!onOutdent ? "text-slate-800 cursor-not-allowed" : "text-slate-500 hover:text-white hover:bg-white/10"}`
|
|
13618
|
+
},
|
|
13619
|
+
/* @__PURE__ */ React28.createElement(FiCornerUpLeft3, { size: 14 })
|
|
13620
|
+
)), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-3 bg-white/10 mx-1" }), /* @__PURE__ */ React28.createElement(Tooltip, { text: "Remover Grupo de Texto" }, /* @__PURE__ */ React28.createElement(
|
|
13621
|
+
"button",
|
|
13622
|
+
{
|
|
13623
|
+
onClick: () => onDelete(item.id),
|
|
13624
|
+
className: "p-1.5 text-slate-600 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors"
|
|
13625
|
+
},
|
|
13626
|
+
/* @__PURE__ */ React28.createElement(FiTrash23, { size: 14 })
|
|
13627
|
+
))))), item.children && item.children.length > 0 && /* @__PURE__ */ React28.createElement("div", { className: "ml-2" }, item.children.map((child, idx) => /* @__PURE__ */ React28.createElement(
|
|
13628
|
+
BoardItem,
|
|
13629
|
+
{
|
|
13630
|
+
key: child.id,
|
|
13631
|
+
index: idx,
|
|
13632
|
+
prevItem: item.children[idx - 1],
|
|
13633
|
+
nextItem: item.children[idx + 1],
|
|
13634
|
+
item: child,
|
|
13635
|
+
onUpdate,
|
|
13636
|
+
onDelete,
|
|
13637
|
+
onAddSubgroup,
|
|
13638
|
+
onIndent,
|
|
13639
|
+
onIndentDown,
|
|
13640
|
+
onOutdent,
|
|
13641
|
+
onMoveUp,
|
|
13642
|
+
onMoveDown,
|
|
13643
|
+
searchItems,
|
|
13644
|
+
onMentionClick,
|
|
13645
|
+
onEnterFolder,
|
|
13646
|
+
canEdit,
|
|
13647
|
+
isAtRoot: false
|
|
13648
|
+
}
|
|
13649
|
+
))));
|
|
13650
|
+
}
|
|
13651
|
+
);
|
|
13556
13652
|
function Boards({
|
|
13557
13653
|
isOpen,
|
|
13558
13654
|
onClose,
|
|
@@ -13580,13 +13676,17 @@ function Boards({
|
|
|
13580
13676
|
}
|
|
13581
13677
|
return null;
|
|
13582
13678
|
};
|
|
13583
|
-
const sanitizeBoardItems = useCallback5(
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13588
|
-
|
|
13589
|
-
|
|
13679
|
+
const sanitizeBoardItems = useCallback5(
|
|
13680
|
+
(list) => list.map((g) => ({
|
|
13681
|
+
id: g.id,
|
|
13682
|
+
type: g.type || "text_group",
|
|
13683
|
+
name: g.name || "",
|
|
13684
|
+
color: g.color || void 0,
|
|
13685
|
+
content: g.content || [],
|
|
13686
|
+
children: sanitizeBoardItems(g.children || [])
|
|
13687
|
+
})),
|
|
13688
|
+
[]
|
|
13689
|
+
);
|
|
13590
13690
|
useEffect23(() => {
|
|
13591
13691
|
if (initialBoardItems && !isLoaded) {
|
|
13592
13692
|
const hasLegacyTypes = (list) => list.some(
|
|
@@ -13601,6 +13701,7 @@ function Boards({
|
|
|
13601
13701
|
id: g.id || uuidv411(),
|
|
13602
13702
|
type: g.type || "text_group",
|
|
13603
13703
|
name: g.name || "",
|
|
13704
|
+
color: g.color || void 0,
|
|
13604
13705
|
content: Array.isArray(g.content) ? g.content : [],
|
|
13605
13706
|
children: prepare(g.children || [])
|
|
13606
13707
|
}));
|
|
@@ -13658,21 +13759,24 @@ function Boards({
|
|
|
13658
13759
|
}, 3e3);
|
|
13659
13760
|
return () => clearTimeout(id);
|
|
13660
13761
|
}, [boardItems, isLoaded, onSave, sanitizeBoardItems]);
|
|
13661
|
-
const triggerInstantSave = useCallback5(
|
|
13662
|
-
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
|
|
13666
|
-
|
|
13667
|
-
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13762
|
+
const triggerInstantSave = useCallback5(
|
|
13763
|
+
async (updatedBoardItems) => {
|
|
13764
|
+
if (!onSave) return;
|
|
13765
|
+
const sanitized = sanitizeBoardItems(updatedBoardItems);
|
|
13766
|
+
const sanitizedJson = JSON.stringify(sanitized);
|
|
13767
|
+
lastSavedBoardItemsRef.current = sanitizedJson;
|
|
13768
|
+
setSaveStatus("saving");
|
|
13769
|
+
try {
|
|
13770
|
+
await onSave(sanitized);
|
|
13771
|
+
setSaveStatus("saved");
|
|
13772
|
+
setTimeout(() => setSaveStatus("idle"), 3e3);
|
|
13773
|
+
} catch (err) {
|
|
13774
|
+
console.error("Erro ao salvar board:", err);
|
|
13775
|
+
setSaveStatus("error");
|
|
13776
|
+
}
|
|
13777
|
+
},
|
|
13778
|
+
[onSave, sanitizeBoardItems]
|
|
13779
|
+
);
|
|
13676
13780
|
useEffect23(() => {
|
|
13677
13781
|
if (!isOpen) return;
|
|
13678
13782
|
const handler = (e) => {
|
|
@@ -13701,24 +13805,28 @@ function Boards({
|
|
|
13701
13805
|
const lastFolder = currentPath[currentPath.length - 1];
|
|
13702
13806
|
return lastFolder ? lastFolder.children : boardItems;
|
|
13703
13807
|
}, [boardItems, currentPath]);
|
|
13704
|
-
const handleAddItem = useCallback5(
|
|
13705
|
-
|
|
13706
|
-
|
|
13707
|
-
|
|
13708
|
-
|
|
13709
|
-
|
|
13710
|
-
|
|
13711
|
-
|
|
13712
|
-
|
|
13713
|
-
|
|
13714
|
-
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
|
|
13718
|
-
|
|
13719
|
-
|
|
13720
|
-
|
|
13721
|
-
|
|
13808
|
+
const handleAddItem = useCallback5(
|
|
13809
|
+
(type = "text_group") => {
|
|
13810
|
+
const newItem = {
|
|
13811
|
+
id: uuidv411(),
|
|
13812
|
+
type,
|
|
13813
|
+
name: type === "folder" ? "Nova Pasta" : "",
|
|
13814
|
+
color: type === "folder" ? "#6366f1" : void 0,
|
|
13815
|
+
content: [],
|
|
13816
|
+
children: []
|
|
13817
|
+
};
|
|
13818
|
+
if (navigationStack.length === 0) {
|
|
13819
|
+
setBoardItems((prev) => [...prev, newItem]);
|
|
13820
|
+
} else {
|
|
13821
|
+
const parentId = navigationStack[navigationStack.length - 1];
|
|
13822
|
+
const add = (list) => list.map(
|
|
13823
|
+
(g) => g.id === parentId ? { ...g, children: [...g.children, newItem] } : { ...g, children: add(g.children) }
|
|
13824
|
+
);
|
|
13825
|
+
setBoardItems((prev) => add(prev));
|
|
13826
|
+
}
|
|
13827
|
+
},
|
|
13828
|
+
[navigationStack]
|
|
13829
|
+
);
|
|
13722
13830
|
const handleAddSubgroup = useCallback5((parentId, type = "text_group") => {
|
|
13723
13831
|
const add = (list) => list.map((g) => {
|
|
13724
13832
|
if (g.id === parentId) {
|
|
@@ -13727,6 +13835,7 @@ function Boards({
|
|
|
13727
13835
|
id: uuidv411(),
|
|
13728
13836
|
type,
|
|
13729
13837
|
name: type === "folder" ? "Nova Pasta" : "",
|
|
13838
|
+
color: type === "folder" ? "#6366f1" : void 0,
|
|
13730
13839
|
content: [],
|
|
13731
13840
|
children: []
|
|
13732
13841
|
};
|
|
@@ -13746,70 +13855,88 @@ function Boards({
|
|
|
13746
13855
|
const del = (list) => list.filter((g) => g.id !== id).map((g) => ({ ...g, children: del(g.children) }));
|
|
13747
13856
|
setBoardItems((prev) => del(prev));
|
|
13748
13857
|
}, []);
|
|
13749
|
-
const handleIndent = useCallback5(
|
|
13750
|
-
|
|
13751
|
-
|
|
13752
|
-
|
|
13753
|
-
|
|
13754
|
-
|
|
13755
|
-
|
|
13756
|
-
|
|
13757
|
-
|
|
13758
|
-
|
|
13759
|
-
|
|
13760
|
-
|
|
13761
|
-
|
|
13762
|
-
|
|
13763
|
-
|
|
13764
|
-
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
13768
|
-
|
|
13769
|
-
|
|
13770
|
-
|
|
13771
|
-
|
|
13772
|
-
|
|
13773
|
-
|
|
13774
|
-
|
|
13775
|
-
|
|
13776
|
-
|
|
13777
|
-
|
|
13778
|
-
|
|
13779
|
-
|
|
13780
|
-
|
|
13781
|
-
|
|
13782
|
-
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
13788
|
-
|
|
13789
|
-
|
|
13790
|
-
|
|
13791
|
-
|
|
13792
|
-
|
|
13793
|
-
|
|
13794
|
-
|
|
13795
|
-
|
|
13796
|
-
|
|
13797
|
-
|
|
13798
|
-
|
|
13799
|
-
|
|
13800
|
-
|
|
13801
|
-
|
|
13802
|
-
|
|
13803
|
-
|
|
13804
|
-
|
|
13805
|
-
|
|
13806
|
-
|
|
13807
|
-
|
|
13808
|
-
|
|
13809
|
-
|
|
13810
|
-
|
|
13811
|
-
|
|
13812
|
-
|
|
13858
|
+
const handleIndent = useCallback5(
|
|
13859
|
+
(id) => {
|
|
13860
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13861
|
+
const found = findGroupAndParent(next, id);
|
|
13862
|
+
if (!found || found.index === 0) return;
|
|
13863
|
+
const { group, siblings, index } = found;
|
|
13864
|
+
const targetParent = siblings[index - 1];
|
|
13865
|
+
if (group.type === "folder" && targetParent.type === "text_group") return;
|
|
13866
|
+
siblings.splice(index, 1);
|
|
13867
|
+
targetParent.children.push(group);
|
|
13868
|
+
setBoardItems(next);
|
|
13869
|
+
triggerInstantSave(next);
|
|
13870
|
+
},
|
|
13871
|
+
[boardItems, triggerInstantSave]
|
|
13872
|
+
);
|
|
13873
|
+
const handleIndentDown = useCallback5(
|
|
13874
|
+
(id) => {
|
|
13875
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13876
|
+
const found = findGroupAndParent(next, id);
|
|
13877
|
+
if (!found || found.index === found.siblings.length - 1) return;
|
|
13878
|
+
const { group, siblings, index } = found;
|
|
13879
|
+
const targetParent = siblings[index + 1];
|
|
13880
|
+
if (group.type === "folder" && targetParent.type === "text_group") return;
|
|
13881
|
+
siblings.splice(index, 1);
|
|
13882
|
+
targetParent.children.push(group);
|
|
13883
|
+
setBoardItems(next);
|
|
13884
|
+
triggerInstantSave(next);
|
|
13885
|
+
},
|
|
13886
|
+
[boardItems, triggerInstantSave]
|
|
13887
|
+
);
|
|
13888
|
+
const handleOutdent = useCallback5(
|
|
13889
|
+
(id) => {
|
|
13890
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13891
|
+
const found = findGroupAndParent(next, id);
|
|
13892
|
+
if (!found || !found.parent) return;
|
|
13893
|
+
const { group, siblings, index, parent } = found;
|
|
13894
|
+
siblings.splice(index, 1);
|
|
13895
|
+
const parentFound = findGroupAndParent(next, parent.id);
|
|
13896
|
+
if (parentFound) {
|
|
13897
|
+
parentFound.siblings.splice(parentFound.index + 1, 0, group);
|
|
13898
|
+
} else {
|
|
13899
|
+
next.push(group);
|
|
13900
|
+
}
|
|
13901
|
+
setBoardItems(next);
|
|
13902
|
+
triggerInstantSave(next);
|
|
13903
|
+
},
|
|
13904
|
+
[boardItems, triggerInstantSave]
|
|
13905
|
+
);
|
|
13906
|
+
const handleMoveUp = useCallback5(
|
|
13907
|
+
(id) => {
|
|
13908
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13909
|
+
const found = findGroupAndParent(next, id);
|
|
13910
|
+
if (!found || found.index === 0) return;
|
|
13911
|
+
const { siblings, index } = found;
|
|
13912
|
+
const item = siblings[index];
|
|
13913
|
+
siblings.splice(index, 1);
|
|
13914
|
+
siblings.splice(index - 1, 0, item);
|
|
13915
|
+
setBoardItems(next);
|
|
13916
|
+
triggerInstantSave(next);
|
|
13917
|
+
},
|
|
13918
|
+
[boardItems, triggerInstantSave]
|
|
13919
|
+
);
|
|
13920
|
+
const handleMoveDown = useCallback5(
|
|
13921
|
+
(id) => {
|
|
13922
|
+
const next = JSON.parse(JSON.stringify(boardItems));
|
|
13923
|
+
const found = findGroupAndParent(next, id);
|
|
13924
|
+
if (!found || found.index === found.siblings.length - 1) return;
|
|
13925
|
+
const { siblings, index } = found;
|
|
13926
|
+
const item = siblings[index];
|
|
13927
|
+
siblings.splice(index, 1);
|
|
13928
|
+
siblings.splice(index + 1, 0, item);
|
|
13929
|
+
setBoardItems(next);
|
|
13930
|
+
triggerInstantSave(next);
|
|
13931
|
+
},
|
|
13932
|
+
[boardItems, triggerInstantSave]
|
|
13933
|
+
);
|
|
13934
|
+
const handleMentionClick = useCallback5(
|
|
13935
|
+
(item) => {
|
|
13936
|
+
if (onSelect) onSelect(item);
|
|
13937
|
+
},
|
|
13938
|
+
[onSelect]
|
|
13939
|
+
);
|
|
13813
13940
|
const navigateUp = useCallback5(() => {
|
|
13814
13941
|
setNavigationStack((prev) => prev.slice(0, -1));
|
|
13815
13942
|
}, []);
|