mirror of
https://github.com/langgenius/dify.git
synced 2026-04-25 17:47:30 +08:00
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 })
|
}, { exactMatch: true, useCapture: true })
|
||||||
|
|
||||||
|
useKeyPress(`${getKeyboardKeyCodeBySystem('shift')}.a`, (e) => {
|
||||||
|
if (shouldHandleShortcut(e))
|
||||||
|
e.preventDefault()
|
||||||
|
}, { exactMatch: true, useCapture: true })
|
||||||
|
|
||||||
useKeyPress(`${getKeyboardKeyCodeBySystem('alt')}.r`, (e) => {
|
useKeyPress(`${getKeyboardKeyCodeBySystem('alt')}.r`, (e) => {
|
||||||
if (shouldHandleShortcut(e)) {
|
if (shouldHandleShortcut(e)) {
|
||||||
e.preventDefault()
|
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'
|
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')}
|
{t('workflow.common.addBlock')}
|
||||||
|
<ShortcutsName keys={['shift', 'a']} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -427,6 +427,7 @@ export const isMac = () => {
|
|||||||
const specialKeysNameMap: Record<string, string | undefined> = {
|
const specialKeysNameMap: Record<string, string | undefined> = {
|
||||||
ctrl: '⌘',
|
ctrl: '⌘',
|
||||||
alt: '⌥',
|
alt: '⌥',
|
||||||
|
shift: '⇧',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getKeyboardKeyNameBySystem = (key: string) => {
|
export const getKeyboardKeyNameBySystem = (key: string) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user