realtime-nav.ts44 lines · main
| 1 | // @ts-nocheck |
| 2 | import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups' |
| 3 | import { RegistryDefinations } from '../types' |
| 4 | |
| 5 | /** |
| 6 | * Contextual chords for jumping between Realtime sub-pages — `R + <letter>`. |
| 7 | * |
| 8 | * Active only while RealtimeLayout is mounted (i.e. the user is somewhere |
| 9 | * under `/project/<ref>/realtime/*`). Mirrors the database-nav / auth-nav / |
| 10 | * functions-nav pattern: the leading `R` is layout-scoped so it doesn't burn a |
| 11 | * global key. |
| 12 | */ |
| 13 | export const REALTIME_NAV_SHORTCUT_IDS = { |
| 14 | NAV_REALTIME_INSPECTOR: 'nav.realtime-inspector', |
| 15 | NAV_REALTIME_POLICIES: 'nav.realtime-policies', |
| 16 | NAV_REALTIME_SETTINGS: 'nav.realtime-settings', |
| 17 | } |
| 18 | |
| 19 | export type RealtimeNavShortcutId = |
| 20 | (typeof REALTIME_NAV_SHORTCUT_IDS)[keyof typeof REALTIME_NAV_SHORTCUT_IDS] |
| 21 | |
| 22 | export const realtimeNavRegistry: RegistryDefinations<RealtimeNavShortcutId> = { |
| 23 | [REALTIME_NAV_SHORTCUT_IDS.NAV_REALTIME_INSPECTOR]: { |
| 24 | id: REALTIME_NAV_SHORTCUT_IDS.NAV_REALTIME_INSPECTOR, |
| 25 | label: 'Go to Inspector', |
| 26 | sequence: ['R', 'I'], |
| 27 | showInSettings: false, |
| 28 | referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_REALTIME, |
| 29 | }, |
| 30 | [REALTIME_NAV_SHORTCUT_IDS.NAV_REALTIME_POLICIES]: { |
| 31 | id: REALTIME_NAV_SHORTCUT_IDS.NAV_REALTIME_POLICIES, |
| 32 | label: 'Go to Policies', |
| 33 | sequence: ['R', 'P'], |
| 34 | showInSettings: false, |
| 35 | referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_REALTIME, |
| 36 | }, |
| 37 | [REALTIME_NAV_SHORTCUT_IDS.NAV_REALTIME_SETTINGS]: { |
| 38 | id: REALTIME_NAV_SHORTCUT_IDS.NAV_REALTIME_SETTINGS, |
| 39 | label: 'Go to Settings', |
| 40 | sequence: ['R', 'S'], |
| 41 | showInSettings: false, |
| 42 | referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_REALTIME, |
| 43 | }, |
| 44 | } |