berrypod/lib/berrypod/pages/settings_field.ex
jamey 6fbd654d57
All checks were successful
deploy / deploy (push) Successful in 1m23s
add SettingsField struct and repeater field type for block settings
Introduces typed settings schema with SettingsField struct, replaces
the read-only JSON textarea with a full repeater UI for info_card items.
Supports add, remove, reorder and inline editing of repeater items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 00:54:13 +00:00

17 lines
529 B
Elixir

defmodule Berrypod.Pages.SettingsField do
@moduledoc "Defines a single field in a block's settings schema."
@type field_type :: :text | :textarea | :number | :select | :repeater
@type t :: %__MODULE__{
key: String.t(),
label: String.t(),
type: field_type(),
default: term(),
options: [String.t()] | nil,
item_schema: [t()] | nil
}
@enforce_keys [:key, :label, :type]
defstruct [:key, :label, :type, default: nil, options: nil, item_schema: nil]
end