functions-nav.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // @ts-nocheck
  2. import { SHORTCUT_REFERENCE_GROUPS } from '../referenceGroups'
  3. import { RegistryDefinations } from '../types'
  4. /**
  5. * Contextual chords for jumping between Edge Functions sub-pages — `F + <letter>`.
  6. *
  7. * Active only while EdgeFunctionsLayout is mounted (i.e. the user is somewhere
  8. * under `/project/<ref>/functions/*`). Mirrors the database-nav / auth-nav /
  9. * storage-nav pattern: the leading `F` is layout-scoped so it doesn't burn a
  10. * global key.
  11. */
  12. export const FUNCTIONS_NAV_SHORTCUT_IDS = {
  13. NAV_FUNCTIONS_OVERVIEW: 'nav.functions-overview',
  14. NAV_FUNCTIONS_SECRETS: 'nav.functions-secrets',
  15. }
  16. export type FunctionsNavShortcutId =
  17. (typeof FUNCTIONS_NAV_SHORTCUT_IDS)[keyof typeof FUNCTIONS_NAV_SHORTCUT_IDS]
  18. export const functionsNavRegistry: RegistryDefinations<FunctionsNavShortcutId> = {
  19. [FUNCTIONS_NAV_SHORTCUT_IDS.NAV_FUNCTIONS_OVERVIEW]: {
  20. id: FUNCTIONS_NAV_SHORTCUT_IDS.NAV_FUNCTIONS_OVERVIEW,
  21. label: 'Go to Functions',
  22. sequence: ['F', 'O'],
  23. showInSettings: false,
  24. referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_FUNCTIONS,
  25. },
  26. [FUNCTIONS_NAV_SHORTCUT_IDS.NAV_FUNCTIONS_SECRETS]: {
  27. id: FUNCTIONS_NAV_SHORTCUT_IDS.NAV_FUNCTIONS_SECRETS,
  28. label: 'Go to Secrets',
  29. sequence: ['F', 'K'],
  30. showInSettings: false,
  31. referenceGroup: SHORTCUT_REFERENCE_GROUPS.NAVIGATION_FUNCTIONS,
  32. },
  33. }