@lv-x-software-house/x_view 1.2.2-dev.11 → 1.2.2-dev.13
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 +101 -29
- package/dist/index.mjs +101 -29
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3486,6 +3486,8 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3486
3486
|
const [selectedItem, setSelectedItem] = (0, import_react4.useState)(null);
|
|
3487
3487
|
const [searchHistory, setSearchHistory] = (0, import_react4.useState)([]);
|
|
3488
3488
|
const [activeIndex, setActiveIndex] = (0, import_react4.useState)(0);
|
|
3489
|
+
const [selectedIndices, setSelectedIndices] = (0, import_react4.useState)(/* @__PURE__ */ new Set([0]));
|
|
3490
|
+
const [lastSelectedIndex, setLastSelectedIndex] = (0, import_react4.useState)(0);
|
|
3489
3491
|
const sectionRefs = (0, import_react4.useRef)([]);
|
|
3490
3492
|
const [isDropdownOpen, setIsDropdownOpen] = (0, import_react4.useState)(false);
|
|
3491
3493
|
const inputRef = (0, import_react4.useRef)(null);
|
|
@@ -3534,6 +3536,8 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3534
3536
|
}, [selectedItem]);
|
|
3535
3537
|
(0, import_react4.useEffect)(() => {
|
|
3536
3538
|
setActiveIndex(0);
|
|
3539
|
+
setSelectedIndices(/* @__PURE__ */ new Set([0]));
|
|
3540
|
+
setLastSelectedIndex(0);
|
|
3537
3541
|
}, [selectedItem]);
|
|
3538
3542
|
(0, import_react4.useEffect)(() => {
|
|
3539
3543
|
if (selectedItem && sectionRefs.current[activeIndex]) {
|
|
@@ -3550,22 +3554,64 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3550
3554
|
if (document.activeElement === inputRef.current) return;
|
|
3551
3555
|
if (e.key === "ArrowDown" || e.key === "ArrowRight") {
|
|
3552
3556
|
e.preventDefault();
|
|
3553
|
-
setActiveIndex((prev) =>
|
|
3557
|
+
setActiveIndex((prev) => {
|
|
3558
|
+
const next = Math.min(prev + 1, itemSections.length - 1);
|
|
3559
|
+
if (e.shiftKey) {
|
|
3560
|
+
setSelectedIndices((old) => /* @__PURE__ */ new Set([...old, next]));
|
|
3561
|
+
} else if (!e.ctrlKey && !e.metaKey) {
|
|
3562
|
+
setSelectedIndices(/* @__PURE__ */ new Set([next]));
|
|
3563
|
+
setLastSelectedIndex(next);
|
|
3564
|
+
}
|
|
3565
|
+
return next;
|
|
3566
|
+
});
|
|
3554
3567
|
}
|
|
3555
3568
|
if (e.key === "ArrowUp" || e.key === "ArrowLeft") {
|
|
3556
3569
|
e.preventDefault();
|
|
3557
|
-
setActiveIndex((prev) =>
|
|
3570
|
+
setActiveIndex((prev) => {
|
|
3571
|
+
const next = Math.max(prev - 1, 0);
|
|
3572
|
+
if (e.shiftKey) {
|
|
3573
|
+
setSelectedIndices((old) => /* @__PURE__ */ new Set([...old, next]));
|
|
3574
|
+
} else if (!e.ctrlKey && !e.metaKey) {
|
|
3575
|
+
setSelectedIndices(/* @__PURE__ */ new Set([next]));
|
|
3576
|
+
setLastSelectedIndex(next);
|
|
3577
|
+
}
|
|
3578
|
+
return next;
|
|
3579
|
+
});
|
|
3558
3580
|
}
|
|
3559
3581
|
if (e.key === "Enter") {
|
|
3560
3582
|
e.preventDefault();
|
|
3561
|
-
|
|
3562
|
-
handleConfirmImport(itemSections[activeIndex]);
|
|
3563
|
-
}
|
|
3583
|
+
handleConfirmImport();
|
|
3564
3584
|
}
|
|
3565
3585
|
};
|
|
3566
3586
|
window.addEventListener("keydown", handleKeyDown);
|
|
3567
3587
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
3568
|
-
}, [itemSections,
|
|
3588
|
+
}, [itemSections, selectedItem]);
|
|
3589
|
+
const handleSectionClick = (index, e) => {
|
|
3590
|
+
e.stopPropagation();
|
|
3591
|
+
if (e.shiftKey && lastSelectedIndex !== null) {
|
|
3592
|
+
const start = Math.min(lastSelectedIndex, index);
|
|
3593
|
+
const end = Math.max(lastSelectedIndex, index);
|
|
3594
|
+
const newSelection = new Set(selectedIndices);
|
|
3595
|
+
for (let i = start; i <= end; i++) {
|
|
3596
|
+
newSelection.add(i);
|
|
3597
|
+
}
|
|
3598
|
+
setSelectedIndices(newSelection);
|
|
3599
|
+
} else if (e.ctrlKey || e.metaKey) {
|
|
3600
|
+
const newSelection = new Set(selectedIndices);
|
|
3601
|
+
if (newSelection.has(index)) {
|
|
3602
|
+
newSelection.delete(index);
|
|
3603
|
+
if (newSelection.size === 0) newSelection.add(index);
|
|
3604
|
+
} else {
|
|
3605
|
+
newSelection.add(index);
|
|
3606
|
+
}
|
|
3607
|
+
setSelectedIndices(newSelection);
|
|
3608
|
+
setLastSelectedIndex(index);
|
|
3609
|
+
} else {
|
|
3610
|
+
setSelectedIndices(/* @__PURE__ */ new Set([index]));
|
|
3611
|
+
setLastSelectedIndex(index);
|
|
3612
|
+
}
|
|
3613
|
+
setActiveIndex(index);
|
|
3614
|
+
};
|
|
3569
3615
|
const handleSelectItem = (item) => {
|
|
3570
3616
|
setSelectedItem(item);
|
|
3571
3617
|
setSearchHistory((prev) => {
|
|
@@ -3579,16 +3625,22 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3579
3625
|
setSearchTerm("");
|
|
3580
3626
|
setIsDropdownOpen(false);
|
|
3581
3627
|
};
|
|
3582
|
-
const handleConfirmImport = (
|
|
3583
|
-
|
|
3584
|
-
if (!section) return;
|
|
3628
|
+
const handleConfirmImport = () => {
|
|
3629
|
+
if (selectedIndices.size === 0) return;
|
|
3585
3630
|
const type = selectedItem._type;
|
|
3586
3631
|
const itemId = selectedItem.id || selectedItem.ancestry_id;
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3632
|
+
const indicesToImport = Array.from(selectedIndices).sort((a, b) => a - b);
|
|
3633
|
+
const tagsToImport = [];
|
|
3634
|
+
indicesToImport.forEach((idx) => {
|
|
3635
|
+
const section = itemSections[idx];
|
|
3636
|
+
if (section && section.id) {
|
|
3637
|
+
tagsToImport.push(`[[REF:${type}:${itemId}:${section.id}]]`);
|
|
3638
|
+
}
|
|
3639
|
+
});
|
|
3640
|
+
if (tagsToImport.length > 0) {
|
|
3641
|
+
onSelect(tagsToImport);
|
|
3590
3642
|
} else {
|
|
3591
|
-
alert("
|
|
3643
|
+
alert("Nenhuma se\xE7\xE3o v\xE1lida selecionada.");
|
|
3592
3644
|
}
|
|
3593
3645
|
};
|
|
3594
3646
|
const renderSectionContent = (content) => {
|
|
@@ -3659,7 +3711,8 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3659
3711
|
/* @__PURE__ */ import_react4.default.createElement("div", { className: "truncate" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "text-sm font-medium text-slate-200 truncate" }, item.name), /* @__PURE__ */ import_react4.default.createElement("div", { className: "text-[10px] text-slate-500 uppercase tracking-wider" }, isNode ? ((_a = item.version_node) == null ? void 0 : _a.is_version) ? "Vers\xE3o" : "Node" : "Ancestralidade"))
|
|
3660
3712
|
);
|
|
3661
3713
|
}))), /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex-1 flex flex-col bg-black/20 relative z-10" }, selectedItem ? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-6 pr-8" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "w-full text-sm leading-relaxed text-slate-300 break-words whitespace-pre-wrap" }, itemSections.map((section, index) => {
|
|
3662
|
-
const
|
|
3714
|
+
const isSelected = selectedIndices.has(index);
|
|
3715
|
+
const isFocused = index === activeIndex;
|
|
3663
3716
|
const match = section.content.match(/^(\s*)([\s\S]*?)(\s*)$/);
|
|
3664
3717
|
let leadingSpace = match ? match[1] : "";
|
|
3665
3718
|
const bodyText = match ? match[2] : section.content;
|
|
@@ -3677,10 +3730,11 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3677
3730
|
refAssigned = true;
|
|
3678
3731
|
}
|
|
3679
3732
|
},
|
|
3680
|
-
onClick: () =>
|
|
3733
|
+
onClick: (e) => handleSectionClick(index, e),
|
|
3681
3734
|
className: `
|
|
3682
3735
|
transition-colors duration-200 cursor-pointer rounded-md px-1 py-0.5 -mx-1 box-decoration-clone
|
|
3683
|
-
${
|
|
3736
|
+
${isSelected ? "bg-indigo-500/30 ring-1 ring-indigo-500/50" : "hover:bg-white/5"}
|
|
3737
|
+
${isFocused && !isSelected ? "ring-1 ring-white/20" : ""}
|
|
3684
3738
|
`
|
|
3685
3739
|
},
|
|
3686
3740
|
renderSectionContent(bodyText)
|
|
@@ -3701,8 +3755,8 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3701
3755
|
CodeBlock,
|
|
3702
3756
|
{
|
|
3703
3757
|
content: part,
|
|
3704
|
-
isActive,
|
|
3705
|
-
onClick: () =>
|
|
3758
|
+
isActive: isSelected,
|
|
3759
|
+
onClick: (e) => handleSectionClick(index, e)
|
|
3706
3760
|
}
|
|
3707
3761
|
)
|
|
3708
3762
|
);
|
|
@@ -3712,7 +3766,7 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3712
3766
|
const isLastLine = lineIndex === lines.length - 1;
|
|
3713
3767
|
const isEmptyLine = line.trim() === "";
|
|
3714
3768
|
if (isEmptyLine) {
|
|
3715
|
-
return /* @__PURE__ */ import_react4.default.createElement(
|
|
3769
|
+
return /* @__PURE__ */ import_react4.default.createElement("br", { key: `${index}-${partIndex}-${lineIndex}` });
|
|
3716
3770
|
}
|
|
3717
3771
|
return /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, { key: `${index}-${partIndex}-${lineIndex}` }, /* @__PURE__ */ import_react4.default.createElement(
|
|
3718
3772
|
"span",
|
|
@@ -3723,10 +3777,11 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3723
3777
|
refAssigned = true;
|
|
3724
3778
|
}
|
|
3725
3779
|
},
|
|
3726
|
-
onClick: () =>
|
|
3780
|
+
onClick: (e) => handleSectionClick(index, e),
|
|
3727
3781
|
className: `
|
|
3728
|
-
transition-colors duration-200 cursor-pointer rounded-md px-1 py-0.5 -mx-1 box-decoration-clone
|
|
3729
|
-
${
|
|
3782
|
+
transition-colors duration-200 cursor-pointer rounded-md px-1 py-0.5 -mx-1 box-decoration-clone select-none
|
|
3783
|
+
${isSelected ? "bg-indigo-500/30 text-white ring-1 ring-indigo-500/50 shadow-sm" : "hover:bg-white/5 hover:text-slate-200"}
|
|
3784
|
+
${isFocused && !isSelected ? "ring-1 ring-white/20" : ""}
|
|
3730
3785
|
`
|
|
3731
3786
|
},
|
|
3732
3787
|
formatLineContent(line)
|
|
@@ -3740,7 +3795,8 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3740
3795
|
className: "flex items-center gap-2 px-6 py-2.5 bg-indigo-600 hover:bg-indigo-500 text-white text-sm font-semibold rounded-lg shadow-lg shadow-indigo-500/20 transition-all transform active:scale-95"
|
|
3741
3796
|
},
|
|
3742
3797
|
/* @__PURE__ */ import_react4.default.createElement(import_fi3.FiDownload, { className: "text-indigo-200" }),
|
|
3743
|
-
"Importar
|
|
3798
|
+
"Importar ",
|
|
3799
|
+
selectedIndices.size > 1 ? `${selectedIndices.size} Se\xE7\xF5es` : "Se\xE7\xE3o"
|
|
3744
3800
|
))) : /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex-1 flex flex-col items-center justify-center text-slate-500" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "w-16 h-16 rounded-full bg-white/5 flex items-center justify-center mb-4" }, /* @__PURE__ */ import_react4.default.createElement(import_fi3.FiSearch, { size: 24, className: "opacity-50" })), /* @__PURE__ */ import_react4.default.createElement("p", null, "Selecione um item \xE0 esquerda para visualizar suas se\xE7\xF5es."))))
|
|
3745
3801
|
));
|
|
3746
3802
|
}
|
|
@@ -3874,12 +3930,28 @@ function DescriptionEditModal({
|
|
|
3874
3930
|
const uniqueSuffix = v4_default().slice(0, 4);
|
|
3875
3931
|
insertAtCursor(`*/${nextNum}:${uniqueSuffix}/ `);
|
|
3876
3932
|
};
|
|
3877
|
-
const handleImportSelect = (
|
|
3878
|
-
const
|
|
3879
|
-
const
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3933
|
+
const handleImportSelect = (tags) => {
|
|
3934
|
+
const tagsArray = Array.isArray(tags) ? tags : [tags];
|
|
3935
|
+
const el = textareaRef.current;
|
|
3936
|
+
if (!el) return;
|
|
3937
|
+
let currentText = text;
|
|
3938
|
+
let currentNum = getNextSectionNumber(currentText);
|
|
3939
|
+
let blockToInsert = "";
|
|
3940
|
+
tagsArray.forEach((tag) => {
|
|
3941
|
+
const uniqueSuffix = v4_default().slice(0, 4);
|
|
3942
|
+
blockToInsert += `
|
|
3943
|
+
*/${currentNum}:${uniqueSuffix}/ ${tag}
|
|
3944
|
+
`;
|
|
3945
|
+
currentNum++;
|
|
3946
|
+
});
|
|
3947
|
+
const start = el.selectionStart;
|
|
3948
|
+
const end = el.selectionEnd;
|
|
3949
|
+
const newText = currentText.substring(0, start) + blockToInsert + currentText.substring(end);
|
|
3950
|
+
el.value = newText;
|
|
3951
|
+
el.setSelectionRange(start + blockToInsert.length, start + blockToInsert.length);
|
|
3952
|
+
el.dispatchEvent(new Event("input", { bubbles: true }));
|
|
3953
|
+
el.focus();
|
|
3954
|
+
setText(newText);
|
|
3883
3955
|
setIsImportModalOpen(false);
|
|
3884
3956
|
};
|
|
3885
3957
|
const handleMentionSelect = (node) => {
|
package/dist/index.mjs
CHANGED
|
@@ -3442,6 +3442,8 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3442
3442
|
const [selectedItem, setSelectedItem] = useState4(null);
|
|
3443
3443
|
const [searchHistory, setSearchHistory] = useState4([]);
|
|
3444
3444
|
const [activeIndex, setActiveIndex] = useState4(0);
|
|
3445
|
+
const [selectedIndices, setSelectedIndices] = useState4(/* @__PURE__ */ new Set([0]));
|
|
3446
|
+
const [lastSelectedIndex, setLastSelectedIndex] = useState4(0);
|
|
3445
3447
|
const sectionRefs = useRef4([]);
|
|
3446
3448
|
const [isDropdownOpen, setIsDropdownOpen] = useState4(false);
|
|
3447
3449
|
const inputRef = useRef4(null);
|
|
@@ -3490,6 +3492,8 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3490
3492
|
}, [selectedItem]);
|
|
3491
3493
|
useEffect4(() => {
|
|
3492
3494
|
setActiveIndex(0);
|
|
3495
|
+
setSelectedIndices(/* @__PURE__ */ new Set([0]));
|
|
3496
|
+
setLastSelectedIndex(0);
|
|
3493
3497
|
}, [selectedItem]);
|
|
3494
3498
|
useEffect4(() => {
|
|
3495
3499
|
if (selectedItem && sectionRefs.current[activeIndex]) {
|
|
@@ -3506,22 +3510,64 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3506
3510
|
if (document.activeElement === inputRef.current) return;
|
|
3507
3511
|
if (e.key === "ArrowDown" || e.key === "ArrowRight") {
|
|
3508
3512
|
e.preventDefault();
|
|
3509
|
-
setActiveIndex((prev) =>
|
|
3513
|
+
setActiveIndex((prev) => {
|
|
3514
|
+
const next = Math.min(prev + 1, itemSections.length - 1);
|
|
3515
|
+
if (e.shiftKey) {
|
|
3516
|
+
setSelectedIndices((old) => /* @__PURE__ */ new Set([...old, next]));
|
|
3517
|
+
} else if (!e.ctrlKey && !e.metaKey) {
|
|
3518
|
+
setSelectedIndices(/* @__PURE__ */ new Set([next]));
|
|
3519
|
+
setLastSelectedIndex(next);
|
|
3520
|
+
}
|
|
3521
|
+
return next;
|
|
3522
|
+
});
|
|
3510
3523
|
}
|
|
3511
3524
|
if (e.key === "ArrowUp" || e.key === "ArrowLeft") {
|
|
3512
3525
|
e.preventDefault();
|
|
3513
|
-
setActiveIndex((prev) =>
|
|
3526
|
+
setActiveIndex((prev) => {
|
|
3527
|
+
const next = Math.max(prev - 1, 0);
|
|
3528
|
+
if (e.shiftKey) {
|
|
3529
|
+
setSelectedIndices((old) => /* @__PURE__ */ new Set([...old, next]));
|
|
3530
|
+
} else if (!e.ctrlKey && !e.metaKey) {
|
|
3531
|
+
setSelectedIndices(/* @__PURE__ */ new Set([next]));
|
|
3532
|
+
setLastSelectedIndex(next);
|
|
3533
|
+
}
|
|
3534
|
+
return next;
|
|
3535
|
+
});
|
|
3514
3536
|
}
|
|
3515
3537
|
if (e.key === "Enter") {
|
|
3516
3538
|
e.preventDefault();
|
|
3517
|
-
|
|
3518
|
-
handleConfirmImport(itemSections[activeIndex]);
|
|
3519
|
-
}
|
|
3539
|
+
handleConfirmImport();
|
|
3520
3540
|
}
|
|
3521
3541
|
};
|
|
3522
3542
|
window.addEventListener("keydown", handleKeyDown);
|
|
3523
3543
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
3524
|
-
}, [itemSections,
|
|
3544
|
+
}, [itemSections, selectedItem]);
|
|
3545
|
+
const handleSectionClick = (index, e) => {
|
|
3546
|
+
e.stopPropagation();
|
|
3547
|
+
if (e.shiftKey && lastSelectedIndex !== null) {
|
|
3548
|
+
const start = Math.min(lastSelectedIndex, index);
|
|
3549
|
+
const end = Math.max(lastSelectedIndex, index);
|
|
3550
|
+
const newSelection = new Set(selectedIndices);
|
|
3551
|
+
for (let i = start; i <= end; i++) {
|
|
3552
|
+
newSelection.add(i);
|
|
3553
|
+
}
|
|
3554
|
+
setSelectedIndices(newSelection);
|
|
3555
|
+
} else if (e.ctrlKey || e.metaKey) {
|
|
3556
|
+
const newSelection = new Set(selectedIndices);
|
|
3557
|
+
if (newSelection.has(index)) {
|
|
3558
|
+
newSelection.delete(index);
|
|
3559
|
+
if (newSelection.size === 0) newSelection.add(index);
|
|
3560
|
+
} else {
|
|
3561
|
+
newSelection.add(index);
|
|
3562
|
+
}
|
|
3563
|
+
setSelectedIndices(newSelection);
|
|
3564
|
+
setLastSelectedIndex(index);
|
|
3565
|
+
} else {
|
|
3566
|
+
setSelectedIndices(/* @__PURE__ */ new Set([index]));
|
|
3567
|
+
setLastSelectedIndex(index);
|
|
3568
|
+
}
|
|
3569
|
+
setActiveIndex(index);
|
|
3570
|
+
};
|
|
3525
3571
|
const handleSelectItem = (item) => {
|
|
3526
3572
|
setSelectedItem(item);
|
|
3527
3573
|
setSearchHistory((prev) => {
|
|
@@ -3535,16 +3581,22 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3535
3581
|
setSearchTerm("");
|
|
3536
3582
|
setIsDropdownOpen(false);
|
|
3537
3583
|
};
|
|
3538
|
-
const handleConfirmImport = (
|
|
3539
|
-
|
|
3540
|
-
if (!section) return;
|
|
3584
|
+
const handleConfirmImport = () => {
|
|
3585
|
+
if (selectedIndices.size === 0) return;
|
|
3541
3586
|
const type = selectedItem._type;
|
|
3542
3587
|
const itemId = selectedItem.id || selectedItem.ancestry_id;
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3588
|
+
const indicesToImport = Array.from(selectedIndices).sort((a, b) => a - b);
|
|
3589
|
+
const tagsToImport = [];
|
|
3590
|
+
indicesToImport.forEach((idx) => {
|
|
3591
|
+
const section = itemSections[idx];
|
|
3592
|
+
if (section && section.id) {
|
|
3593
|
+
tagsToImport.push(`[[REF:${type}:${itemId}:${section.id}]]`);
|
|
3594
|
+
}
|
|
3595
|
+
});
|
|
3596
|
+
if (tagsToImport.length > 0) {
|
|
3597
|
+
onSelect(tagsToImport);
|
|
3546
3598
|
} else {
|
|
3547
|
-
alert("
|
|
3599
|
+
alert("Nenhuma se\xE7\xE3o v\xE1lida selecionada.");
|
|
3548
3600
|
}
|
|
3549
3601
|
};
|
|
3550
3602
|
const renderSectionContent = (content) => {
|
|
@@ -3615,7 +3667,8 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3615
3667
|
/* @__PURE__ */ React4.createElement("div", { className: "truncate" }, /* @__PURE__ */ React4.createElement("div", { className: "text-sm font-medium text-slate-200 truncate" }, item.name), /* @__PURE__ */ React4.createElement("div", { className: "text-[10px] text-slate-500 uppercase tracking-wider" }, isNode ? ((_a = item.version_node) == null ? void 0 : _a.is_version) ? "Vers\xE3o" : "Node" : "Ancestralidade"))
|
|
3616
3668
|
);
|
|
3617
3669
|
}))), /* @__PURE__ */ React4.createElement("div", { className: "flex-1 flex flex-col bg-black/20 relative z-10" }, selectedItem ? /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-6 pr-8" }, /* @__PURE__ */ React4.createElement("div", { className: "w-full text-sm leading-relaxed text-slate-300 break-words whitespace-pre-wrap" }, itemSections.map((section, index) => {
|
|
3618
|
-
const
|
|
3670
|
+
const isSelected = selectedIndices.has(index);
|
|
3671
|
+
const isFocused = index === activeIndex;
|
|
3619
3672
|
const match = section.content.match(/^(\s*)([\s\S]*?)(\s*)$/);
|
|
3620
3673
|
let leadingSpace = match ? match[1] : "";
|
|
3621
3674
|
const bodyText = match ? match[2] : section.content;
|
|
@@ -3633,10 +3686,11 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3633
3686
|
refAssigned = true;
|
|
3634
3687
|
}
|
|
3635
3688
|
},
|
|
3636
|
-
onClick: () =>
|
|
3689
|
+
onClick: (e) => handleSectionClick(index, e),
|
|
3637
3690
|
className: `
|
|
3638
3691
|
transition-colors duration-200 cursor-pointer rounded-md px-1 py-0.5 -mx-1 box-decoration-clone
|
|
3639
|
-
${
|
|
3692
|
+
${isSelected ? "bg-indigo-500/30 ring-1 ring-indigo-500/50" : "hover:bg-white/5"}
|
|
3693
|
+
${isFocused && !isSelected ? "ring-1 ring-white/20" : ""}
|
|
3640
3694
|
`
|
|
3641
3695
|
},
|
|
3642
3696
|
renderSectionContent(bodyText)
|
|
@@ -3657,8 +3711,8 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3657
3711
|
CodeBlock,
|
|
3658
3712
|
{
|
|
3659
3713
|
content: part,
|
|
3660
|
-
isActive,
|
|
3661
|
-
onClick: () =>
|
|
3714
|
+
isActive: isSelected,
|
|
3715
|
+
onClick: (e) => handleSectionClick(index, e)
|
|
3662
3716
|
}
|
|
3663
3717
|
)
|
|
3664
3718
|
);
|
|
@@ -3668,7 +3722,7 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3668
3722
|
const isLastLine = lineIndex === lines.length - 1;
|
|
3669
3723
|
const isEmptyLine = line.trim() === "";
|
|
3670
3724
|
if (isEmptyLine) {
|
|
3671
|
-
return /* @__PURE__ */ React4.createElement(
|
|
3725
|
+
return /* @__PURE__ */ React4.createElement("br", { key: `${index}-${partIndex}-${lineIndex}` });
|
|
3672
3726
|
}
|
|
3673
3727
|
return /* @__PURE__ */ React4.createElement(React4.Fragment, { key: `${index}-${partIndex}-${lineIndex}` }, /* @__PURE__ */ React4.createElement(
|
|
3674
3728
|
"span",
|
|
@@ -3679,10 +3733,11 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3679
3733
|
refAssigned = true;
|
|
3680
3734
|
}
|
|
3681
3735
|
},
|
|
3682
|
-
onClick: () =>
|
|
3736
|
+
onClick: (e) => handleSectionClick(index, e),
|
|
3683
3737
|
className: `
|
|
3684
|
-
transition-colors duration-200 cursor-pointer rounded-md px-1 py-0.5 -mx-1 box-decoration-clone
|
|
3685
|
-
${
|
|
3738
|
+
transition-colors duration-200 cursor-pointer rounded-md px-1 py-0.5 -mx-1 box-decoration-clone select-none
|
|
3739
|
+
${isSelected ? "bg-indigo-500/30 text-white ring-1 ring-indigo-500/50 shadow-sm" : "hover:bg-white/5 hover:text-slate-200"}
|
|
3740
|
+
${isFocused && !isSelected ? "ring-1 ring-white/20" : ""}
|
|
3686
3741
|
`
|
|
3687
3742
|
},
|
|
3688
3743
|
formatLineContent(line)
|
|
@@ -3696,7 +3751,8 @@ function SectionImportModal({ isOpen, onClose, onSelect, availableNodes = [], av
|
|
|
3696
3751
|
className: "flex items-center gap-2 px-6 py-2.5 bg-indigo-600 hover:bg-indigo-500 text-white text-sm font-semibold rounded-lg shadow-lg shadow-indigo-500/20 transition-all transform active:scale-95"
|
|
3697
3752
|
},
|
|
3698
3753
|
/* @__PURE__ */ React4.createElement(FiDownload, { className: "text-indigo-200" }),
|
|
3699
|
-
"Importar
|
|
3754
|
+
"Importar ",
|
|
3755
|
+
selectedIndices.size > 1 ? `${selectedIndices.size} Se\xE7\xF5es` : "Se\xE7\xE3o"
|
|
3700
3756
|
))) : /* @__PURE__ */ React4.createElement("div", { className: "flex-1 flex flex-col items-center justify-center text-slate-500" }, /* @__PURE__ */ React4.createElement("div", { className: "w-16 h-16 rounded-full bg-white/5 flex items-center justify-center mb-4" }, /* @__PURE__ */ React4.createElement(FiSearch, { size: 24, className: "opacity-50" })), /* @__PURE__ */ React4.createElement("p", null, "Selecione um item \xE0 esquerda para visualizar suas se\xE7\xF5es."))))
|
|
3701
3757
|
));
|
|
3702
3758
|
}
|
|
@@ -3830,12 +3886,28 @@ function DescriptionEditModal({
|
|
|
3830
3886
|
const uniqueSuffix = v4_default().slice(0, 4);
|
|
3831
3887
|
insertAtCursor(`*/${nextNum}:${uniqueSuffix}/ `);
|
|
3832
3888
|
};
|
|
3833
|
-
const handleImportSelect = (
|
|
3834
|
-
const
|
|
3835
|
-
const
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3889
|
+
const handleImportSelect = (tags) => {
|
|
3890
|
+
const tagsArray = Array.isArray(tags) ? tags : [tags];
|
|
3891
|
+
const el = textareaRef.current;
|
|
3892
|
+
if (!el) return;
|
|
3893
|
+
let currentText = text;
|
|
3894
|
+
let currentNum = getNextSectionNumber(currentText);
|
|
3895
|
+
let blockToInsert = "";
|
|
3896
|
+
tagsArray.forEach((tag) => {
|
|
3897
|
+
const uniqueSuffix = v4_default().slice(0, 4);
|
|
3898
|
+
blockToInsert += `
|
|
3899
|
+
*/${currentNum}:${uniqueSuffix}/ ${tag}
|
|
3900
|
+
`;
|
|
3901
|
+
currentNum++;
|
|
3902
|
+
});
|
|
3903
|
+
const start = el.selectionStart;
|
|
3904
|
+
const end = el.selectionEnd;
|
|
3905
|
+
const newText = currentText.substring(0, start) + blockToInsert + currentText.substring(end);
|
|
3906
|
+
el.value = newText;
|
|
3907
|
+
el.setSelectionRange(start + blockToInsert.length, start + blockToInsert.length);
|
|
3908
|
+
el.dispatchEvent(new Event("input", { bubbles: true }));
|
|
3909
|
+
el.focus();
|
|
3910
|
+
setText(newText);
|
|
3839
3911
|
setIsImportModalOpen(false);
|
|
3840
3912
|
};
|
|
3841
3913
|
const handleMentionSelect = (node) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lv-x-software-house/x_view",
|
|
3
|
-
"version": "1.2.2-dev.
|
|
3
|
+
"version": "1.2.2-dev.13",
|
|
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",
|