# `StatifierBlocks.Block`
[🔗](https://github.com/riddler/statifier_blocks/blob/v0.44.1/lib/statifier_blocks/block.ex#L1)

One node of a block document (ADR-0001).

A block is `{type, id, config, slots}`, plus the `type_version` axis
decision 4 adds and an optional author-written `note` - and nothing else
(decision 2, read with ADR-0001's Amendment of 2026-09-28, `2a`). No
field is added for layout, selection, collapse state, validation results,
generated SCXML, or a provenance map: every one of those is a function of
the document plus a block-type registry, and this layer stores none of
them.

The `note` is prose for a person reading the document, never for the
chart: the compiler and the provenance map never read it, so a note
changes the document's bytes and `StatifierBlocks.Document.content_hash/1`
but not the compiled SCXML (`2f`). The empty string is the absent note:
an absent key decodes to `""`, and `""` is omitted from canonical form
(`2b`). A note is a field of the block, so it moves with the block, and
any copy of the struct keeps it (`2e`).

# `config`

```elixir
@type config() :: %{optional(String.t()) =&gt; json()}
```

Owned and interpreted by the block type; opaque to this layer.

# `id`

```elixir
@type id() :: String.t()
```

Document-unique, stable, never reused. `"blk_" <> uxid`.

# `json`

```elixir
@type json() ::
  nil
  | boolean()
  | integer()
  | String.t()
  | [json()]
  | %{optional(String.t()) =&gt; json()}
```

Any value expressible in canonical JSON. Note: no floats.

# `slot_name`

```elixir
@type slot_name() :: String.t()
```

# `t`

```elixir
@type t() :: %StatifierBlocks.Block{
  config: config(),
  id: id(),
  note: String.t(),
  slots: %{optional(slot_name()) =&gt; [t()]},
  type: type_name(),
  type_version: pos_integer()
}
```

# `type_name`

```elixir
@type type_name() :: String.t()
```

Namespaced block-type name, e.g. `"core.branch"`, `"myapp.authorize"`.

# `new`

```elixir
@spec new(
  type_name(),
  keyword()
) :: t()
```

Builds a block of the given `type`.

Options: `:id` (default a freshly minted `StatifierBlocks.Id.block/0`),
`:type_version` (default `1`), `:config` (default `%{}`), `:slots`
(default `%{}`), `:note` (default `""`, no note).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
