@lv-x-software-house/x_view 1.2.6-dev.37 → 1.2.6-dev.39

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.
Files changed (3) hide show
  1. package/dist/index.js +451 -330
  2. package/dist/index.mjs +458 -331
  3. 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
- return /* @__PURE__ */ React12.createElement("div", { className: "relative w-full", ref: popoverRef }, /* @__PURE__ */ React12.createElement("div", { 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"}` }, /* @__PURE__ */ React12.createElement(
8507
- "button",
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-5 w-5 rounded 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 bottom-full right-0 mb-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(
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
- type: "button",
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("div", { className: "absolute inset-0 shadow-[inset_0_0_2px_rgba(255,255,255,0.2)]" })
8516
- ), /* @__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(
8517
- "input",
8518
- {
8519
- type: "text",
8520
- value: color.replace("#", ""),
8521
- onChange: handleInputChange,
8522
- disabled,
8523
- className: "w-full bg-transparent border-none focus:ring-0 text-sm text-slate-200 uppercase font-mono placeholder-slate-600 p-0",
8524
- maxLength: 6
8525
- }
8526
- ))), 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(
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, { useState as useState27, useMemo as useMemo12, useEffect as useEffect23, useRef as useRef20, useCallback as useCallback5 } from "react";
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
- item,
13344
- index,
13345
- prevItem,
13346
- nextItem,
13347
- onUpdate,
13348
- onDelete,
13349
- onAddSubgroup,
13350
- onIndent,
13351
- onIndentDown,
13352
- onOutdent,
13353
- onMoveUp,
13354
- onMoveDown,
13355
- searchItems,
13356
- onMentionClick,
13357
- onEnterFolder,
13358
- canEdit,
13359
- isAtRoot = false
13360
- }) => {
13361
- var _a;
13362
- const isFolder = item.type === "folder";
13363
- const canMoveUp = index > 0;
13364
- const canMoveDown = nextItem !== void 0;
13365
- const getIndentUpTooltip = () => {
13366
- if (!prevItem) return null;
13367
- const typeLabel = prevItem.type === "folder" ? "pasta" : "grupo de texto";
13368
- return isFolder ? prevItem.type === "folder" ? "Aninhar na pasta acima" : null : `Mover para dentro do ${typeLabel} acima`;
13369
- };
13370
- const getIndentDownTooltip = () => {
13371
- if (!nextItem) return null;
13372
- const typeLabel = nextItem.type === "folder" ? "pasta" : "grupo de texto";
13373
- return isFolder ? nextItem.type === "folder" ? "Aninhar na pasta abaixo" : null : `Mover para dentro do ${typeLabel} abaixo`;
13374
- };
13375
- const showIndentUp = !!getIndentUpTooltip();
13376
- const showIndentDown = !!getIndentDownTooltip();
13377
- const handleContentChange = (content) => {
13378
- onUpdate(item.id, { ...item, content });
13379
- };
13380
- const handleNameChange = (e) => {
13381
- onUpdate(item.id, { ...item, name: e.target.value });
13382
- };
13383
- if (isFolder) {
13384
- 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(
13385
- "div",
13386
- {
13387
- onClick: () => onEnterFolder(item.id),
13388
- 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 overflow-hidden"
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" }),
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: "Mover" }, /* @__PURE__ */ React28.createElement("div", { className: "flex items-center" }, /* @__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: (e) => {
13407
- e.stopPropagation();
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(FiArrowUp, { size: 14 })
13414
- ), /* @__PURE__ */ React28.createElement(
13415
- "button",
13416
- {
13417
- onClick: (e) => {
13418
- e.stopPropagation();
13419
- onMoveDown(item.id);
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
- disabled: !canMoveDown,
13422
- className: `p-1 rounded transition-colors ${!canMoveDown ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`
13423
- },
13424
- /* @__PURE__ */ React28.createElement(FiArrowDown, { size: 14 })
13425
- ))), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-4 bg-white/5 mx-0.5 self-center" }), /* @__PURE__ */ React28.createElement(Tooltip, { text: "Aninhar" }, /* @__PURE__ */ React28.createElement("div", { className: "flex items-center" }, showIndentUp && /* @__PURE__ */ React28.createElement(
13426
- "button",
13427
- {
13428
- onClick: (e) => {
13429
- e.stopPropagation();
13430
- onIndent(item.id);
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(Tooltip, { text: "Subir" }, /* @__PURE__ */ React28.createElement(
13491
+ "button",
13492
+ {
13493
+ onClick: (e) => {
13494
+ e.stopPropagation();
13495
+ onMoveUp(item.id);
13496
+ },
13497
+ disabled: !canMoveUp,
13498
+ className: `p-1 rounded transition-colors ${!canMoveUp ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`
13431
13499
  },
13432
- className: "p-1 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors"
13433
- },
13434
- /* @__PURE__ */ React28.createElement(FiArrowLeft3, { size: 14 })
13435
- ), showIndentDown && /* @__PURE__ */ React28.createElement(
13436
- "button",
13437
- {
13438
- onClick: (e) => {
13439
- e.stopPropagation();
13440
- onIndentDown(item.id);
13500
+ /* @__PURE__ */ React28.createElement(FiArrowUp, { size: 14 })
13501
+ )), /* @__PURE__ */ React28.createElement(Tooltip, { text: "Descer" }, /* @__PURE__ */ React28.createElement(
13502
+ "button",
13503
+ {
13504
+ onClick: (e) => {
13505
+ e.stopPropagation();
13506
+ onMoveDown(item.id);
13507
+ },
13508
+ disabled: !canMoveDown,
13509
+ className: `p-1 rounded transition-colors ${!canMoveDown ? "text-slate-800 cursor-not-allowed" : "text-slate-400 hover:text-white hover:bg-white/10"}`
13441
13510
  },
13442
- className: "p-1 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors"
13443
- },
13444
- /* @__PURE__ */ React28.createElement(FiArrowRight2, { size: 14 })
13445
- ))), !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(
13446
- "button",
13447
- {
13448
- onClick: (e) => {
13449
- e.stopPropagation();
13450
- onOutdent(item.id);
13511
+ /* @__PURE__ */ React28.createElement(FiArrowDown, { size: 14 })
13512
+ )), /* @__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(
13513
+ "button",
13514
+ {
13515
+ onClick: (e) => {
13516
+ e.stopPropagation();
13517
+ onIndent(item.id);
13518
+ },
13519
+ className: "p-1 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors"
13451
13520
  },
13452
- className: `p-1 rounded text-slate-400 hover:text-white hover:bg-white/10 transition-colors`
13453
- },
13454
- /* @__PURE__ */ React28.createElement(FiCornerUpLeft3, { size: 14 })
13455
- )), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-4 bg-white/5 mx-0.5 self-center" }), /* @__PURE__ */ React28.createElement(
13456
- "button",
13457
- {
13458
- onClick: (e) => {
13459
- e.stopPropagation();
13460
- onDelete(item.id);
13521
+ /* @__PURE__ */ React28.createElement(FiArrowLeft3, { size: 14 })
13522
+ )), showIndentDown && /* @__PURE__ */ React28.createElement(Tooltip, { text: getIndentDownTooltip() }, /* @__PURE__ */ React28.createElement(
13523
+ "button",
13524
+ {
13525
+ onClick: (e) => {
13526
+ e.stopPropagation();
13527
+ onIndentDown(item.id);
13528
+ },
13529
+ className: "p-1 text-slate-400 hover:text-white hover:bg-white/10 rounded transition-colors"
13461
13530
  },
13462
- className: "p-1 text-slate-500 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors"
13463
- },
13464
- /* @__PURE__ */ React28.createElement(FiTrash23, { size: 14 })
13465
- )))
13466
- ));
13467
- }
13468
- 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(
13469
- RichGroupEditor_default,
13470
- {
13471
- content: item.content,
13472
- onChange: handleContentChange,
13473
- onMentionClick,
13474
- searchItems,
13475
- readOnly: !canEdit,
13476
- placeholder: "Escreva sobre este grupo de texto\u2026 ou @ para mencionar"
13477
- }
13478
- ), 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(
13479
- "button",
13480
- {
13481
- onClick: () => onAddSubgroup(item.id, "text_group"),
13482
- 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",
13483
- title: "Criar Subgrupo de Texto"
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
13531
+ /* @__PURE__ */ React28.createElement(FiArrowRight2, { size: 14 })
13532
+ )), !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(
13533
+ "button",
13534
+ {
13535
+ onClick: (e) => {
13536
+ e.stopPropagation();
13537
+ onOutdent(item.id);
13538
+ },
13539
+ className: `p-1 rounded text-slate-400 hover:text-white hover:bg-white/10 transition-colors`
13540
+ },
13541
+ /* @__PURE__ */ React28.createElement(FiCornerUpLeft3, { size: 14 })
13542
+ ))), /* @__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(
13543
+ "button",
13544
+ {
13545
+ onClick: (e) => {
13546
+ e.stopPropagation();
13547
+ onDelete(item.id);
13548
+ },
13549
+ className: "p-1 text-slate-500 hover:text-red-400 hover:bg-red-500/10 rounded transition-colors"
13550
+ },
13551
+ /* @__PURE__ */ React28.createElement(FiTrash23, { size: 14 })
13552
+ )), /* @__PURE__ */ React28.createElement("div", { className: "w-px h-4 bg-white/5 mx-0.5 self-center" }), /* @__PURE__ */ React28.createElement("div", { className: "px-1", onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ React28.createElement(
13553
+ ColorPicker,
13554
+ {
13555
+ isCompact: true,
13556
+ color: item.color || "#6366f1",
13557
+ onChange: handleColorChange,
13558
+ disabled: !canEdit
13559
+ }
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((list) => list.map((g) => ({
13584
- id: g.id,
13585
- type: g.type || "text_group",
13586
- name: g.name || "",
13587
- content: g.content || [],
13588
- children: sanitizeBoardItems(g.children || [])
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(async (updatedBoardItems) => {
13662
- if (!onSave) return;
13663
- const sanitized = sanitizeBoardItems(updatedBoardItems);
13664
- const sanitizedJson = JSON.stringify(sanitized);
13665
- lastSavedBoardItemsRef.current = sanitizedJson;
13666
- setSaveStatus("saving");
13667
- try {
13668
- await onSave(sanitized);
13669
- setSaveStatus("saved");
13670
- setTimeout(() => setSaveStatus("idle"), 3e3);
13671
- } catch (err) {
13672
- console.error("Erro ao salvar board:", err);
13673
- setSaveStatus("error");
13674
- }
13675
- }, [onSave, sanitizeBoardItems]);
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((type = "text_group") => {
13705
- const newItem = {
13706
- id: uuidv411(),
13707
- type,
13708
- name: type === "folder" ? "Nova Pasta" : "",
13709
- content: [],
13710
- children: []
13711
- };
13712
- if (navigationStack.length === 0) {
13713
- setBoardItems((prev) => [...prev, newItem]);
13714
- } else {
13715
- const parentId = navigationStack[navigationStack.length - 1];
13716
- const add = (list) => list.map(
13717
- (g) => g.id === parentId ? { ...g, children: [...g.children, newItem] } : { ...g, children: add(g.children) }
13718
- );
13719
- setBoardItems((prev) => add(prev));
13720
- }
13721
- }, [navigationStack]);
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((id) => {
13750
- const next = JSON.parse(JSON.stringify(boardItems));
13751
- const found = findGroupAndParent(next, id);
13752
- if (!found || found.index === 0) return;
13753
- const { group, siblings, index } = found;
13754
- const targetParent = siblings[index - 1];
13755
- if (group.type === "folder" && targetParent.type === "text_group") return;
13756
- siblings.splice(index, 1);
13757
- targetParent.children.push(group);
13758
- setBoardItems(next);
13759
- triggerInstantSave(next);
13760
- }, [boardItems, triggerInstantSave]);
13761
- const handleIndentDown = useCallback5((id) => {
13762
- const next = JSON.parse(JSON.stringify(boardItems));
13763
- const found = findGroupAndParent(next, id);
13764
- if (!found || found.index === found.siblings.length - 1) return;
13765
- const { group, siblings, index } = found;
13766
- const targetParent = siblings[index + 1];
13767
- if (group.type === "folder" && targetParent.type === "text_group") return;
13768
- siblings.splice(index, 1);
13769
- targetParent.children.push(group);
13770
- setBoardItems(next);
13771
- triggerInstantSave(next);
13772
- }, [boardItems, triggerInstantSave]);
13773
- const handleOutdent = useCallback5((id) => {
13774
- const next = JSON.parse(JSON.stringify(boardItems));
13775
- const found = findGroupAndParent(next, id);
13776
- if (!found || !found.parent) return;
13777
- const { group, siblings, index, parent } = found;
13778
- siblings.splice(index, 1);
13779
- const parentFound = findGroupAndParent(next, parent.id);
13780
- if (parentFound) {
13781
- parentFound.siblings.splice(parentFound.index + 1, 0, group);
13782
- } else {
13783
- next.push(group);
13784
- }
13785
- setBoardItems(next);
13786
- triggerInstantSave(next);
13787
- }, [boardItems, triggerInstantSave]);
13788
- const handleMoveUp = useCallback5((id) => {
13789
- const next = JSON.parse(JSON.stringify(boardItems));
13790
- const found = findGroupAndParent(next, id);
13791
- if (!found || found.index === 0) return;
13792
- const { siblings, index } = found;
13793
- const item = siblings[index];
13794
- siblings.splice(index, 1);
13795
- siblings.splice(index - 1, 0, item);
13796
- setBoardItems(next);
13797
- triggerInstantSave(next);
13798
- }, [boardItems, triggerInstantSave]);
13799
- const handleMoveDown = useCallback5((id) => {
13800
- const next = JSON.parse(JSON.stringify(boardItems));
13801
- const found = findGroupAndParent(next, id);
13802
- if (!found || found.index === found.siblings.length - 1) return;
13803
- const { siblings, index } = found;
13804
- const item = siblings[index];
13805
- siblings.splice(index, 1);
13806
- siblings.splice(index + 1, 0, item);
13807
- setBoardItems(next);
13808
- triggerInstantSave(next);
13809
- }, [boardItems, triggerInstantSave]);
13810
- const handleMentionClick = useCallback5((item) => {
13811
- if (onSelect) onSelect(item);
13812
- }, [onSelect]);
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
  }, []);