MingaEditor.State.Picker.ActivationOffer (Minga v0.1.0)

Copy Markdown View Source

Owns the bounded, opaque identities offered by the current picker snapshot.

Native frontends return the generation and activation id exactly as rendered. The editor resolves that pair back to the item or source action captured here.

Summary

Functions

Returns the activation ids for source actions in their rendered order.

Returns the exact bounded action window represented by this offer.

Returns the exact bounded item window represented by this offer.

Reconciles a picker offer while preserving opaque ids for retained semantic items.

Resolves a source action only when both opaque identity components match this offer.

Resolves an item only when both opaque identity components match this offer.

Types

action_entry()

activation_id()

@type activation_id() :: pos_integer()

generation()

@type generation() :: non_neg_integer()

item_entry()

t()

@type t() :: %MingaEditor.State.Picker.ActivationOffer{
  actions: [action_entry()],
  generation: generation(),
  items: [item_entry()],
  next_activation_id: activation_id()
}

Functions

action_activation_ids(activation_offer)

@spec action_activation_ids(t()) :: [activation_id()]

Returns the activation ids for source actions in their rendered order.

offered_actions(activation_offer)

@spec offered_actions(t()) :: [action_entry()]

Returns the exact bounded action window represented by this offer.

offered_items(activation_offer)

@spec offered_items(t()) :: [item_entry()]

Returns the exact bounded item window represented by this offer.

refresh(offer, picker, action_menu, generation)

Reconciles a picker offer while preserving opaque ids for retained semantic items.

resolve_action(activation_offer, generation, activation_id)

Resolves a source action only when both opaque identity components match this offer.

resolve_item(activation_offer, generation, activation_id)

@spec resolve_item(t(), non_neg_integer(), non_neg_integer()) ::
  {:ok, non_neg_integer(), MingaEditor.UI.Picker.Item.t()} | :error

Resolves an item only when both opaque identity components match this offer.