StatifierBlocks.ViewModel.Node (StatifierBlocks v0.3.0)

Copy Markdown View Source

One block, rendered: its resolved status, its presentation metadata, its slots (recursive), its form, and its own findings.

outcome is the outcome this block produces for the slot it sits in, when the parent's type declared a slot_outcome_key for that slot and this block's config holds a well-formed outcome name there; nil otherwise, which is every block whose parent declared nothing. It is resolved here rather than by a consumer so that the picture-drawing side reads one field instead of a metadata key plus a config lookup, and so it never learns that core.on_event is the type with an outcome.

Summary

Types

status()

@type status() :: :ok | {:unresolvable, term()}

t()

@type t() :: %StatifierBlocks.ViewModel.Node{
  block_id: StatifierBlocks.Block.id(),
  entry: StatifierBlocks.BlockType.palette_entry(),
  findings: [StatifierBlocks.Finding.t()],
  findings_count: non_neg_integer(),
  form: StatifierBlocks.ViewModel.Form.t() | nil,
  outcome: String.t() | nil,
  raw_config_json: String.t() | nil,
  slots: [StatifierBlocks.ViewModel.Slot.t()],
  status: status(),
  type: StatifierBlocks.Block.type_name(),
  type_version: pos_integer()
}