Feat: Add Shortcut to open docs (ctrl shift D)
This commit is contained in:
parent
a3e7c6f8f6
commit
5facaac995
2 changed files with 23 additions and 3 deletions
|
|
@ -236,6 +236,15 @@ export default function NodeToolbarComponent({
|
||||||
saveComponent(cloneDeep(data), false);
|
saveComponent(cloneDeep(data), false);
|
||||||
unselectAll()
|
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);
|
document.addEventListener("keydown", onKeyDown);
|
||||||
|
|
@ -468,10 +477,19 @@ export default function NodeToolbarComponent({
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<IconComponent
|
<IconComponent
|
||||||
name="FileText"
|
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
|
<span className="">Docs</span>{" "}
|
||||||
</div>{" "}
|
<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>
|
</SelectItem>
|
||||||
{isMinimal && (
|
{isMinimal && (
|
||||||
<SelectItem value={"show"}>
|
<SelectItem value={"show"}>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import {
|
import {
|
||||||
AlertCircle,
|
AlertCircle,
|
||||||
|
ArrowBigUp,
|
||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
ArrowUpToLine,
|
ArrowUpToLine,
|
||||||
Bell,
|
Bell,
|
||||||
|
|
@ -455,4 +456,5 @@ export const nodeIconsLucide: iconsType = {
|
||||||
Bot,
|
Bot,
|
||||||
Delete,
|
Delete,
|
||||||
Command,
|
Command,
|
||||||
|
ArrowBigUp,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue