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

@ -78,6 +78,7 @@ interface LayerUIProps {
onImageAction: (data: { insertOnCanvasDirectly: boolean }) => void;
renderWelcomeScreen: boolean;
children?: React.ReactNode;
onContextMenu?: (event: React.MouseEvent, source: string) => void;
}
const LayerUI = ({
@ -104,6 +105,7 @@ const LayerUI = ({
onImageAction,
renderWelcomeScreen,
children,
onContextMenu,
}: LayerUIProps) => {
const device = useDevice();
@ -240,6 +242,7 @@ const LayerUI = ({
appState={appState}
elements={elements}
renderAction={actionManager.renderAction}
getCustomActions={actionManager.getCustomActions}
/>
</Island>
</Section>
@ -327,6 +330,7 @@ const LayerUI = ({
insertOnCanvasDirectly: pointerType !== "mouse",
});
}}
onContextMenu={onContextMenu}
/>
{/* {actionManager.renderAction("eraser", {
// size: "small",
@ -433,6 +437,7 @@ const LayerUI = ({
renderSidebars={renderSidebars}
device={device}
renderMenu={renderMenu}
onContextMenu={onContextMenu}
/>
)}