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

@ -42,6 +42,7 @@ type MobileMenuProps = {
device: Device;
renderWelcomeScreen?: boolean;
renderMenu: () => React.ReactNode;
onContextMenu?: (event: React.MouseEvent, source: string) => void;
};
export const MobileMenu = ({
@ -60,6 +61,7 @@ export const MobileMenu = ({
device,
renderWelcomeScreen,
renderMenu,
onContextMenu,
}: MobileMenuProps) => {
const renderToolbar = () => {
return (
@ -98,6 +100,7 @@ export const MobileMenu = ({
insertOnCanvasDirectly: pointerType !== "mouse",
});
}}
onContextMenu={onContextMenu}
/>
</Stack.Row>
</Island>
@ -190,6 +193,7 @@ export const MobileMenu = ({
appState={appState}
elements={elements}
renderAction={actionManager.renderAction}
getCustomActions={actionManager.getCustomActions}
/>
</Section>
) : null}