Actor-scoped canvas item selection.
Selection is runtime state, not layout. It lets applications build item, graph, and drawing editors with shared target state without turning product chrome into core.
Summary
Types
First argument accepted by selection command helpers.
Functions
Clears the current actor selection and returns the command result.
Clears the current actor selection.
Returns the number of selected items.
Returns true when the selection contains no items.
Includes one or more items and returns the command result.
Includes one or more items in the current actor selection.
Returns the number of selected items.
Replaces the current actor selection and returns the command result.
Replaces the current actor selection.
Selects every item and connector item and returns the command result.
Selects every item and connector item the current actor can select.
Returns true when the selection contains the given canvas item.
Returns selected canvas item ids.
Toggles one or more items and returns the command result.
Toggles one or more items in the current actor selection.
Types
@type command_result() :: LivePanels.Canvas.Command.result()
@type item_ref() :: LivePanels.Item.ref()
@type socket() :: Phoenix.LiveView.Socket.t()
@type target() :: LivePanels.Canvas.command_target()
First argument accepted by selection command helpers.
Pass a LiveView socket for a standalone command, or a
LivePanels.Canvas.Transaction context inside LivePanels.Canvas.transaction/2.
Functions
@spec clear(target()) :: command_result()
Clears the current actor selection and returns the command result.
Clears the current actor selection.
@spec count(t() | term()) :: non_neg_integer()
Returns the number of selected items.
Returns true when the selection contains no items.
@spec include(target(), selection_ref()) :: command_result()
Includes one or more items and returns the command result.
@spec include!(target(), selection_ref()) :: target()
Includes one or more items in the current actor selection.
@spec item_count(t() | term()) :: non_neg_integer()
Returns the number of selected items.
@spec select(target(), selection_ref()) :: command_result()
Replaces the current actor selection and returns the command result.
@spec select!(target(), selection_ref()) :: target()
Replaces the current actor selection.
@spec select_all(target()) :: command_result()
Selects every item and connector item and returns the command result.
Selects every item and connector item the current actor can select.
Returns true when the selection contains the given canvas item.
Returns selected canvas item ids.
@spec toggle(target(), selection_ref()) :: command_result()
Toggles one or more items and returns the command result.
@spec toggle!(target(), selection_ref()) :: target()
Toggles one or more items in the current actor selection.