Command palette overlay.
Access:
app.commandPalette
app.getModule('commandPalette')
app.invoke('commandPalette.method', …)
bindSession#
Stores trigger character, filter text, and session config for replaceTrigger.
Parameters:
- char (
string) — trigger character - filter (
any) — filter - config (
object) — configuration object
app.commandPalette.bindSession({ char: '/', filter: 'h' });
showLoaderItems#
Wraps external loader items and opens the palette panel, or hides it when empty.
Parameters:
- items (
Array) — list of items to process - panel (
any) — panel
app.commandPalette.showLoaderItems(items, { panel: 'mention' });
pick#
Placeholder handler; replacement is performed in dropdown:item:before:command.
app.commandPalette.pick();
buildItems#
Builds filtered Add and Turn into sections from addbar and format items.
Parameters:
- filter (
any) — filter
Returns: { items: object[], size: number }
app.commandPalette.buildItems({ filter: 'head' });
showPanel#
Opens a palette dropdown at the current selection caret position.
Parameters:
- items (
Array) — list of items to process - name (
string) — identifier name
app.commandPalette.showPanel(items);
hidePanel#
Closes the open palette dropdown and resets open state flags.
Parameters:
- opts (
object) — options
app.commandPalette.hidePanel();
hidePanelForce#
Hides the palette and clears handleStr and session state.
Parameters:
- opts (
object) — options
app.commandPalette.hidePanelForce();
replaceTrigger#
Removes the trigger text at the caret marker and inserts replacement content, block, or nodes.
Parameters:
- replacement (
string) — trigger replacement text - html (
string) — HTML string - block (
Block | HTMLElement) — block instance - nodes (
Node | string | Array) — nodes
app.commandPalette.replaceTrigger('Hello');