Modal-overlay payload for the prompt variant.
Wraps the existing MingaEditor.State.Prompt struct with the metadata the
ModalOverlay sum type carries for every variant: opened_at (monotonic
millisecond timestamp) and owner. Prompts are global UX, so owner
defaults to :global.
Summary
Functions
Builds a prompt payload wrapping the given prompt_ui state.
Replaces the inner prompt_ui state on the payload, preserving owner
and opened_at. The only sanctioned way to update the inner state from
outside this module (Rule 2: state ownership).
Types
@type owner() :: term()
@type t() :: %MingaEditor.State.ModalOverlay.Prompt{ opened_at: integer(), owner: owner(), prompt_ui: MingaEditor.State.Prompt.t() }
Functions
@spec new( MingaEditor.State.Prompt.t(), keyword() ) :: t()
Builds a prompt payload wrapping the given prompt_ui state.
@spec put_prompt_ui(t(), MingaEditor.State.Prompt.t()) :: t()
Replaces the inner prompt_ui state on the payload, preserving owner
and opened_at. The only sanctioned way to update the inner state from
outside this module (Rule 2: state ownership).