feat: Custom actions and shortcuts

This commit is contained in:
Daniel J. Geiger 2023-01-06 13:34:39 -06:00
parent 0f11f7da15
commit 8e5d376b49
14 changed files with 452 additions and 98 deletions

View file

@ -26,6 +26,7 @@ type ToolButtonBaseProps = {
selected?: boolean;
className?: string;
isLoading?: boolean;
onContextMenu?(event: React.MouseEvent, source: string): void;
};
type ToolButtonProps =
@ -157,6 +158,11 @@ export const ToolButton = React.forwardRef((props: ToolButtonProps, ref) => {
lastPointerTypeRef.current = null;
});
}}
onContextMenu={(event) => {
if (props.onContextMenu !== undefined) {
props.onContextMenu(event, props.name ?? "");
}
}}
>
<input
className={`ToolIcon_type_radio ${sizeCn}`}