# `ElementorexCms.Registry`
[🔗](https://github.com/rocket4ce/elementorex_cms/blob/v0.1.0/lib/elementorex_cms/registry.ex#L1)

The set of blocks a document can use.

`default/0` is the built-in blocks plus the ones configured by your app:

    config :elementorex_cms,
      # your blocks, added to the built-in ones (same type = replaces it)
      blocks: [MyAppWeb.Blocks.Pricing, MyAppWeb.Blocks.Whatsapp],
      # built-in types to leave out
      exclude_blocks: ["video", "mockup"]

A registry can also be built for one editor or page with `new/2`, e.g. to offer
fewer blocks in a modal than in a landing page:

    registry = ElementorexCms.Registry.new(only: ~w(heading text button image alert))

# `t`

```elixir
@type t() :: %ElementorexCms.Registry{
  blocks: %{required(String.t()) =&gt; module()},
  order: [String.t()]
}
```

# `accepts?`

```elixir
@spec accepts?(t(), String.t(), String.t()) :: boolean()
```

Whether a node of `child_type` may go inside a node of `parent_type`, per the
`:children` option of the parent and the `:parents` option of the child.

# `builtin`

```elixir
@spec builtin() :: [module()]
```

Built-in block modules.

# `categories`

```elixir
@spec categories() :: [atom()]
```

Palette categories of the built-in blocks, in display order.

# `container?`

```elixir
@spec container?(t(), String.t()) :: boolean()
```

Whether the type is a container block.

# `default`

```elixir
@spec default() :: t()
```

The built-in blocks plus the configured ones (see the module docs).

# `fetch`

```elixir
@spec fetch(t() | nil, String.t() | nil) :: module() | nil
```

The module of a block type, or `nil`.

# `list`

```elixir
@spec list(t()) :: [module()]
```

Block modules in registration order.

# `new`

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

Builds a registry.

  * `:blocks` - block modules (default: the built-in ones plus the configured)
  * `:only` - keep only these types (the root is always kept)
  * `:exclude` - leave out these types

# `palette`

```elixir
@spec palette(t()) :: [{atom(), [module()]}]
```

Blocks shown in the palette grouped by category: `[{category, [module]}]`,
built-in categories first, then the custom ones in order of appearance.

---

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