Skip to content

Vizel API / core/src / buildVizelBlockMenuSpecFromCommands

Function: buildVizelBlockMenuSpecFromCommands()

ts
function buildVizelBlockMenuSpecFromCommands(commands, options): readonly VizelCommandSpec[];

Defined in: packages/core/src/builders/block-menu-from-commands.ts:29

Build the block-menu action list from a VizelCommand array.

Filters by surfaces.blockMenu, sorts by priority ascending, and projects each command into a VizelCommandSpec.

The framework VizelBlockMenu component composes the resulting action list with the popover spec built by buildVizelBlockMenuSpec (which carries the existing block-level metadata like "Turn into" submenus). This helper only handles the action portion that flows from the unified command registry.

Parameters

ParameterType
commandsreadonly VizelCommand[]
optionsVizelBlockMenuFromCommandsOptions

Returns

readonly VizelCommandSpec[]

Released under the MIT License.