Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

4.3 KB
Raw Blame
/**
 * The help center's content model.
 *
 * Every screen ("mask") in TREK registers a help context; a context owns a set
 * of guides. The words live in the i18n catalogue under `help.ctx.<id>.*` and
 * `help.guide.<id>.*`, the pictures and walkthroughs under
 * `public/help-media/`, generated by the Playwright run in `e2e/help/` from
 * the same guide definitions. Nothing here is prose: this file only says what
 * exists, so a guide that is registered but has no text or no picture fails a
 * test instead of rendering a raw key.
 */

/** How much of a task a guide covers; drives the chip and the media it carries. */
export type HelpGuideSize = 'quick' | 'guide' | 'tour'

export interface HelpDocLink {
  /** Wiki slug, e.g. `Creating-a-Trip`. */
  slug: string
  /** GitHub-style heading anchor inside that page, without the `#`. */
  anchor?: string
}

export interface HelpGuideMedia {
  /** One focus shot per step, `step-<n>.webp`. */
  steps: boolean
  /** The state after the last step, `result.webp`. */
  result: boolean
  /**
   * Steps whose still also comes as a short silent loop, `step-<n>.loop.webp`,
   * for the few gestures a still cannot show (a drag, a route being drawn, a
   * flyover). The still stays the poster and what reduced motion shows.
   */
  clips?: number[]
}

/** Icon names the help components know how to draw (see components/Help/helpIcons.ts). */
export type HelpIcon =
  | 'plus'
  | 'sticker'
  | 'type'
  | 'paintBucket'
  | 'pencil'
  | 'image'
  | 'copy'
  | 'archive'
  | 'trash'
  | 'filter'
  | 'calendar'
  | 'layout'
  | 'coins'
  | 'clock'
  | 'compass'
  | 'calendarCheck'
  | 'halfDay'
  | 'hourglass'
  | 'calculator'
  | 'calendarRange'
  | 'building'
  | 'flag'
  | 'graduationCap'
  | 'calendarOff'
  | 'calendarDays'
  | 'repeat'
  | 'userPlus'
  | 'share'
  | 'globe'
  | 'mapPin'
  | 'search'
  | 'star'
  | 'eye'
  | 'regions'
  | 'chart'
  | 'minusCircle'
  | 'landmark'
  | 'download'
  | 'checkCircle'
  | 'panelRight'
  | 'tags'
  | 'upload'
  | 'fileInput'
  | 'library'
  | 'bookmark'
  | 'bookOpen'
  | 'sparkles'
  | 'thumbsUp'
  | 'gallery'
  | 'link'
  | 'book'
  | 'sliders'
  | 'palette'
  | 'map'
  | 'bell'
  | 'plug'
  | 'cloudOff'
  | 'user'
  | 'lock'
  | 'shield'
  | 'fingerprint'
  | 'key'
  | 'route'
  | 'users'
  | 'userRound'
  | 'crown'
  | 'panelLeft'
  | 'undo'
  | 'ticket'
  | 'train'
  | 'plane'
  | 'listChecks'
  | 'wallet'
  | 'folder'
  | 'messages'
  | 'mountain'
  | 'footprints'
  | 'bike'
  | 'layers'
  | 'rotate3d'
  | 'mountainSnow'
  | 'waves'
  | 'wind'
  | 'history'
  | 'fileDown'
  | 'backpack'
  | 'bellRing'
  | 'blocks'
  | 'info'
  | 'receipt'
  | 'pin'
  | 'arrowUpDown'
  | 'packagePlus'
  | 'routeOff'
  | 'car'
  | 'fileSpreadsheet'
  | 'bed'
  | 'batteryCharging'
  | 'alert'
  | 'filePen'
  | 'cloudDownload'
  | 'mapPinned'
  | 'shuffle'
  | 'moon'
  | 'spline'
  | 'cableCar'
  | 'copyPlus'
  | 'folderInput'
  | 'mailCheck'
  | 'notebookPen'
  | 'moveRight'

export interface HelpGuide {
  id: string
  /** The context the guide belongs to; a guide may be reached from others via `related`. */
  context: string
  icon: HelpIcon
  size: HelpGuideSize
  /** Number of steps; the texts are `help.guide.<id>.step.1` … `.step.<steps>`. */
  steps: number
  /** Number of "good to know" notes; `help.guide.<id>.tip.1` … */
  tips: number
  media: HelpGuideMedia
  /** Where the reference documentation continues. */
  docs?: HelpDocLink
  /** An in-app route the guide can take the reader to; label is `help.guide.<id>.link`. */
  link?: string
  /** Where "go there" opens when the guide's part of its screen sits elsewhere, under another tab. */
  route?: string
  related?: string[]
}

export interface HelpContext {
  id: string
  icon: HelpIcon
  /**
   * The screen this one lives under, for the screen switcher: a journal is
   * reached from the Journey list, a settings tab from Settings. Top-level
   * screens have none.
   */
  parent?: string
  /**
   * Where the screen is in the app, for the "go there" button. Screens that
   * need an id in the address (a journal, the studio) have none.
   */
  route?: string
  /** Number of "on this screen" bullets; `help.ctx.<id>.bullet.1` … */
  bullets: number
  /** Guide ids in display order. */
  guides: string[]
  /** Reference pages for the "in the docs" list. */
  docs: HelpDocLink[]
  /** Whether `help-media/ctx/<id>.webp` exists. */
  hero: boolean
}