Actor-scoped clipboard projection returned by LivePanels.Canvas.Read.clipboard/1.
Applications may inspect this struct for read-only UI state. This module also owns socket-first and transaction-first clipboard command helpers.
Summary
Types
First argument accepted by clipboard command helpers.
Functions
Copies the current actor selection and returns the command result.
Copies the current actor selection into the actor clipboard.
Returns the number of items held by a clipboard projection.
Copies and removes the current actor selection and returns the command result.
Copies the current actor selection and removes it through one canvas command.
Returns true when a clipboard projection contains no items.
Pastes the current actor clipboard and returns the command result.
Pastes the current actor clipboard into the canvas.
Types
@type command_opts() :: keyword()
@type command_result() :: LivePanels.Canvas.Command.result()
@type socket() :: Phoenix.LiveView.Socket.t()
@type t() :: %LivePanels.Canvas.Clipboard{ items: %{optional(String.t()) => LivePanels.Item.t()} }
@type target() :: LivePanels.Canvas.command_target()
First argument accepted by clipboard command helpers.
Pass a LiveView socket for a standalone command, or a
LivePanels.Canvas.Transaction context inside LivePanels.Canvas.transaction/2.
Functions
@spec copy(target()) :: command_result()
Copies the current actor selection and returns the command result.
Copies the current actor selection into the actor clipboard.
@spec count(t() | term()) :: non_neg_integer()
Returns the number of items held by a clipboard projection.
@spec cut(target()) :: command_result()
Copies and removes the current actor selection and returns the command result.
Copies the current actor selection and removes it through one canvas command.
Returns true when a clipboard projection contains no items.
@spec paste(target(), command_opts()) :: command_result()
Pastes the current actor clipboard and returns the command result.
@spec paste!(target(), command_opts()) :: target()
Pastes the current actor clipboard into the canvas.