mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: Custom actions and shortcuts
This commit is contained in:
parent
0f11f7da15
commit
8e5d376b49
14 changed files with 452 additions and 98 deletions
|
@ -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}`}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue