mirror of
https://github.com/langgenius/dify.git
synced 2026-03-07 08:35:58 +08:00
add "add block" shortcut ui
This commit is contained in:
@ -77,6 +77,11 @@ export const useShortcuts = (): void => {
|
||||
}
|
||||
}, { exactMatch: true, useCapture: true })
|
||||
|
||||
useKeyPress(`${getKeyboardKeyCodeBySystem('shift')}.a`, (e) => {
|
||||
if (shouldHandleShortcut(e))
|
||||
e.preventDefault()
|
||||
}, { exactMatch: true, useCapture: true })
|
||||
|
||||
useKeyPress(`${getKeyboardKeyCodeBySystem('alt')}.r`, (e) => {
|
||||
if (shouldHandleShortcut(e)) {
|
||||
e.preventDefault()
|
||||
|
||||
@ -38,6 +38,7 @@ const PanelContextmenu = () => {
|
||||
className='flex items-center justify-between px-3 h-8 text-sm text-gray-700 rounded-lg cursor-pointer hover:bg-gray-50'
|
||||
>
|
||||
{t('workflow.common.addBlock')}
|
||||
<ShortcutsName keys={['shift', 'a']} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -427,6 +427,7 @@ export const isMac = () => {
|
||||
const specialKeysNameMap: Record<string, string | undefined> = {
|
||||
ctrl: '⌘',
|
||||
alt: '⌥',
|
||||
shift: '⇧',
|
||||
}
|
||||
|
||||
export const getKeyboardKeyNameBySystem = (key: string) => {
|
||||
|
||||
Reference in New Issue
Block a user