Feat: Add Shortcut to open docs (ctrl shift D)

This commit is contained in:
igorrCarvalho 2024-03-01 00:47:42 -03:00
commit 5facaac995
2 changed files with 23 additions and 3 deletions

View file

@ -236,6 +236,15 @@ export default function NodeToolbarComponent({
saveComponent(cloneDeep(data), false);
unselectAll()
}
if (
(selected && data.node?.documentation) &&
(event.ctrlKey || event.metaKey) &&
event.shiftKey &&
event.key === "D"
) {
event.preventDefault();
openInNewTab(data.node?.documentation);
}
}
document.addEventListener("keydown", onKeyDown);
@ -468,10 +477,19 @@ export default function NodeToolbarComponent({
<div className="flex">
<IconComponent
name="FileText"
className="relative top-0.5 mr-2 h-4 w-4"
className="relative top-0.5 mr-2 h-4 w-4 "
/>{" "}
Docs
</div>{" "}
<span className="">Docs</span>{" "}
<IconComponent
name="Command"
className="absolute right-[2rem] top-[0.65em] h-3.5 w-3.5 stroke-2"
></IconComponent>
<IconComponent
name="ArrowBigUp"
className="absolute right-[1.15rem] top-[0.65em] h-3.5 w-3.5 stroke-2"
></IconComponent>
<span className="absolute right-2 top-[0.419em]">D</span>
</div>
</SelectItem>
{isMinimal && (
<SelectItem value={"show"}>

View file

@ -1,5 +1,6 @@
import {
AlertCircle,
ArrowBigUp,
ArrowLeft,
ArrowUpToLine,
Bell,
@ -455,4 +456,5 @@ export const nodeIconsLucide: iconsType = {
Bot,
Delete,
Command,
ArrowBigUp,
};