Minga.RenderModel.UI.Action (Minga v0.1.0)

Copy Markdown View Source

Semantic UI action metadata shared by render-model surfaces.

Actions are declarative. They may name an editor action to execute when explicit input dispatches the action, but they never carry extension callbacks or arbitrary render-time code.

Summary

Types

Editor action dispatched through MingaEditor.Commands.execute/2.

Semantic action style hint for frontends.

t()

Functions

Returns true when the action can be dispatched.

Builds an action from a struct, map, or keyword list.

Types

editor_action()

@type editor_action() :: atom() | tuple() | nil

Editor action dispatched through MingaEditor.Commands.execute/2.

kind()

@type kind() :: :primary | :secondary | :destructive | :link | :toggle

Semantic action style hint for frontends.

t()

@type t() :: %Minga.RenderModel.UI.Action{
  confirm: String.t() | nil,
  editor_action: editor_action(),
  enabled?: boolean(),
  icon: String.t() | nil,
  id: String.t(),
  kind: kind(),
  label: String.t(),
  payload: map()
}

Functions

enabled?(action)

@spec enabled?(t()) :: boolean()

Returns true when the action can be dispatched.

new(action)

@spec new(t() | map() | keyword()) :: {:ok, t()} | {:error, term()}

Builds an action from a struct, map, or keyword list.