Corex.Content.Item (Corex v0.1.0-beta.1)

View Source

Content item structure. Use it to create content items for components with trigger/content patterns:

Examples

Corex.Content.Item.new(%{trigger: "Lorem", content: "Consectetur adipiscing elit."})

Summary

Functions

Creates a single Content.Item from a map, auto-generating an ID if not provided.

Types

t()

@type t() :: %Corex.Content.Item{
  content: String.t(),
  disabled: boolean(),
  meta: map(),
  trigger: String.t(),
  value: String.t()
}

Functions

new(attrs)

@spec new(map()) :: t()

Creates a single Content.Item from a map, auto-generating an ID if not provided.

Raises ArgumentError if attrs is not a map or is missing required fields.