Skip to content

Vizel API / core/src / buildVizelBlockMenuSpec

Function: buildVizelBlockMenuSpec()

ts
function buildVizelBlockMenuSpec(
   actions, 
   turnIntoOptions, 
   showTurnInto, 
   locale): VizelBlockMenuSpec;

Defined in: packages/core/src/builders/block-menu.ts:86

Build a VizelBlockMenuSpec for the block context menu.

The skeleton owns: container ARIA, grouping of actions into sections, is-destructive flag derivation, submenu trigger ARIA wiring (aria-haspopup + aria-expanded), and submenu list shape.

The framework component owns: positioning, focus management, event binding, and computing per-action disabled state (which requires the runtime editor + node, not available here).

Parameters

ParameterTypeDescription
actionsreadonly VizelBlockMenuAction[]Resolved block-menu actions (already locale-applied).
turnIntoOptionsreadonly VizelNodeTypeOption[]Filtered list of available "Turn into" targets.
showTurnIntobooleanWhether the submenu is currently open.
localeVizelLocale | undefinedOptional locale for translated labels.

Returns

VizelBlockMenuSpec

Released under the MIT License.