Internal state struct owned by Athanor.Editor.Live.
Encapsulates the assigns the library manages on behalf of the consumer:
content: the editor's node tree, persisted ateditor_content.contentin the canonical Athanor shape%{"content" => [nodes...]}metadata: flat map persisted ateditor_content.metadata(page-level fields edited via thepage_settings_component:form)selected_component_id: id of the currently-selected node (right sidebar shows that node's config when set)column_picker:nil | {parent_id, zone_name}— drives the zone-picker modal opened byAthanor.Components.Columns' per-zone "Add Component" buttonpreview_viewport::desktop | :tablet | :mobile— applied as max-width class on the canvas wrappershow_components_panel: boolean — toggles the left sidebarctx:Athanor.Ctxwith editor-mode fields populated (edit_mode?: true,add_component_callback,select_component_callback)
Summary
Types
@type t() :: %Athanor.Editor.State{ asset_request: Athanor.Editor.AssetRequest.t() | nil, column_picker: {String.t(), String.t()} | nil, content: map(), ctx: Athanor.Ctx.t() | nil, metadata: map(), preview_viewport: viewport(), selected_component_id: String.t() | nil, show_components_panel: boolean() }
@type viewport() :: :desktop | :tablet | :mobile
Functions
Build a default state. Useful for tests and as the seed value the
Editor LV macro uses before load/3 fills in real values.
Build a state with overrides. Unknown keys raise KeyError.