Rich text / foldkit-mixins-richtext

commandPalette

function · packages/mixins-richtext/src/palette.ts:47

function commandPalette<Message>(): SlotView.SlotView<
  typeof CommandPaletteSlots,
  CommandPaletteInput<Message>,
  Message
>

The palette as a slot view: a combobox field over a listbox of the matches. ArrowUp and ArrowDown move the highlight, wrapping; Home and End stay the field's. Enter sends the highlighted entry, and does nothing when no entry matches. A stale index — one the matches do not hold — highlights the first match, as the slash menu does, so a query that narrows never leaves Enter choosing nothing.