/
githubmirror
/
ydb-embedded-ui
Обзор
Документация
Войти
/
githubmirror
/
ydb-embedded-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/containers/Tenant/Query/QueryEditor/constants.ts
25 строк
823 B
Hellen
fix: tune editor shortcuts (#3939)
25 май 2026, 14:38
Не верифицирован
25 май 2026, 14:38
17e5ad3
Код
Авторство
О чём код?
import {isMacOS} from '../../../../utils/platform'; /** * Hotkey labels for display in Gravity UI Hotkey component. * Uses `mod` prefix which maps to Cmd on Mac / Ctrl on other platforms. */ export const HOTKEY_LABELS = { newTab: 'mod+alt+t', renameTab: 'mod+alt+r', closeTab: 'mod+alt+c', closeOtherTabs: 'mod+alt+backspace', closeAllTabs: 'mod+shift+backspace', saveQueryAs: 'mod+shift+s', nextTab: 'mod+alt+right', previousTab: 'mod+alt+left', } as const; /** * Converts a Gravity UI hotkey label (e.g. `mod+alt+t`) to * a `hotkeys-js` compatible string (e.g. `command+alt+t` on Mac, `ctrl+alt+t` on others). */ export function toHotkeysJsFormat(label: string): string { const platformMod = isMacOS() ? 'command' : 'ctrl'; return label.replace(/\bmod\b/g, platformMod); }