All checks were successful
deploy / deploy (push) Successful in 1m23s
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>
17 lines
529 B
Elixir
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
|