Control

Per-block control handle UI.

addDropdown#

Registers a dynamic control-dropdown button config by name.

Parameters:

  • name (string) — identifier name
  • config (object) — configuration object
app.control.addDropdown('duplicate', { title: 'Duplicate', command: 'block.duplicate' });

removeDropdown#

Marks control-dropdown button names as removed.

Parameters:

  • ...names (Array) — list of names to process
app.control.removeDropdown('duplicate');

getDropdownItems#

Builds the control dropdown item list including parent navigation entries.

Parameters:

  • block (Block | HTMLElement) — block instance

Returns: object[]

app.control.getDropdownItems(block);

hide#

Destroys the visible control bar and clears its wrapper.

app.control.hide();

add#

Registers a dynamic control button config by name.

Parameters:

  • name (string) — identifier name
  • config (object) — configuration object
app.control.add('custom', { icon: '…', command: 'custom.run' });

remove#

Marks control button names as removed.

Parameters:

  • ...names (Array) — list of names to process
app.control.remove('toggle');

addDynamic#

Queues a dynamic button for insertion when the control toolbar DOM exists.

Parameters:

  • name (string) — identifier name
  • config (object) — configuration object
app.control.addDynamic('extra', { command: 'extra.run' });

removeDynamic#

Removes a dynamically inserted button from the control toolbar DOM.

Parameters:

  • name (string) — identifier name
app.control.removeDynamic('extra');

setActive#

Adds button name(s) to the API active overlay set.

Parameters:

  • names (Array) — list of names to process
app.control.setActive('toggle');

clearActive#

Removes button name(s) from the API active overlay set.

Parameters:

  • names (Array) — list of names to process
app.control.clearActive('toggle');

clearAllActive#

Clears all API-driven active button states.

app.control.clearAllActive();

setDisabled#

Disables control buttons via the uiButtonsState service.

Parameters:

  • names (Array) — list of names to process
app.control.setDisabled('toggle');

clearDisabled#

Re-enables named control buttons.

Parameters:

  • names (Array) — list of names to process
app.control.clearDisabled('toggle');

setDisabledAll#

Disables all control buttons except those listed in except.

Parameters:

  • except (Array) — names or types to exclude from the rule
app.control.setDisabledAll();

clearDisabledAll#

Clears disabled state on all control buttons except those listed in except.

Parameters:

  • except (Array) — names or types to exclude from the rule
app.control.clearDisabledAll();

updateButton#

Patches dynamic config and live button state by name.

Parameters:

  • name (string) — identifier name
  • patch (object) — patch
app.control.updateButton('toggle', { pressed: true });

getButton#

Returns the Button instance for a control button name.

Parameters:

  • name (string) — identifier name

Returns: Button|null

app.control.getButton('toggle');

getButtonEl#

Returns the DOM element for a control button name.

Parameters:

  • name (string) — identifier name

Returns: HTMLElement|null

app.control.getButtonEl('toggle');