Trevixal API
    Preparing search index...

    Function paletteCommandsFromMenus

    • Turn wired menus into palette commands. Every entry the menus offer, with the icon and shortcut it already prints. Pass the shortcut manager's labels() when the menus have them, so both print what actually fires.

      Hand-listing the palette's contents means it drifts: the menus grow and the palette quietly keeps offering the dozen commands somebody typed out once. Deriving it instead means an entry reachable from a menu is reachable from the palette by construction. Separators and entries the host never wired are skipped, since withActions has already dropped the latter.

      A submenu contributes its children, not itself: Download as is not a command, Word document (.docx) is. The parent's label is folded into the child's keywords so typing download docx still finds it.

      Parameters

      • menus: readonly Menu[]
      • OptionalshortcutLabels: Readonly<Record<string, string | null>>

      Returns PaletteCommand[]