Skip to content

Vizel API / core/src / VizelCommandSpec

Interface: VizelCommandSpec

Defined in: packages/core/src/builders/types.ts:198

Actionable item shared across command surfaces.

The same logical command appears in multiple surfaces (slash menu, toolbar, bubble menu, block menu, keyboard shortcut). The spec carries the view-only fields a renderer needs: identity, localized label, optional description / icon / shortcut, classification group, fuzzy-match keywords, and the runtime-evaluated enable / active flags.

VizelCommand carries the runtime-bearing form (canRun, isActive, run); builders derive a VizelCommandSpec from a VizelCommand for a specific editor instance, stripping the runtime fields so renderers receive view-only data.

Properties

description?

ts
readonly optional description?: string;

Defined in: packages/core/src/builders/types.ts:204

Optional secondary line (slash menu description, tooltip hint).


group?

ts
readonly optional group?: string;

Defined in: packages/core/src/builders/types.ts:210

Group key for slash menu sections, toolbar grouping, etc.


icon?

ts
readonly optional icon?: string;

Defined in: packages/core/src/builders/types.ts:206

Optional icon identifier resolved by the icon catalog.


id

ts
readonly id: string;

Defined in: packages/core/src/builders/types.ts:200

Stable identifier shared across surfaces (e.g. "format/bold").


isActive

ts
readonly isActive: boolean;

Defined in: packages/core/src/builders/types.ts:216

Whether the command's mark / node is currently active at the selection.


isEnabled

ts
readonly isEnabled: boolean;

Defined in: packages/core/src/builders/types.ts:214

Whether the command can currently run against the editor.


keywords?

ts
readonly optional keywords?: readonly string[];

Defined in: packages/core/src/builders/types.ts:212

Fuzzy-match keywords used by slash menu filtering.


label

ts
readonly label: string;

Defined in: packages/core/src/builders/types.ts:202

Localized display label.


shortcut?

ts
readonly optional shortcut?: VizelShortcutSpec;

Defined in: packages/core/src/builders/types.ts:208

Optional keyboard shortcut hint.

Released under the MIT License.