add all function shortcuts to contextmenu

This commit is contained in:
Jeff Emmett 2024-11-27 13:24:11 +07:00
parent 7a73870bf5
commit aa1b40dd21
1 changed files with 73 additions and 41 deletions

View File

@ -365,7 +365,8 @@ export const components: TLComponents = {
return (
<DefaultContextMenu {...rest}>
<DefaultContextMenuContent />
<TldrawUiMenuGroup id="custom-actions">
{/* Camera Controls */}
<TldrawUiMenuItem
id="zoom-to-selection"
label="Zoom to Selection"
@ -389,6 +390,37 @@ export const components: TLComponents = {
disabled={!hasCameraHistory}
onSelect={() => revertCamera(editor)}
/>
{/* Shape Creation Tools */}
<TldrawUiMenuItem
id="video-chat"
label="Create Video Chat"
icon="video"
kbd="v"
onSelect={() => {
editor.setCurrentTool('VideoChat');
}}
/>
<TldrawUiMenuItem
id="chat-box"
label="Create Chat Box"
icon="chat"
kbd="c"
onSelect={() => {
editor.setCurrentTool('ChatBox');
}}
/>
<TldrawUiMenuItem
id="embed"
label="Create Embed"
icon="embed"
kbd="e"
onSelect={() => {
editor.setCurrentTool('Embed');
}}
/>
Frame-specific actions
{isFrame && (
<>
<TldrawUiMenuItem
@ -405,7 +437,7 @@ export const components: TLComponents = {
/>
</>
)}
</TldrawUiMenuGroup>
</DefaultContextMenu>
)
},