mirror of https://github.com/langgenius/dify.git
add "add block" shortcut ui
This commit is contained in:
parent
fef4e09dfc
commit
3bd5f9542e
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue