# `LivePanels.Canvas.Clipboard`
[🔗](https://github.com/livepanels/livepanels/blob/v0.1.0/lib/livepanels/canvas/clipboard.ex#L1)

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.

# `command_opts`

```elixir
@type command_opts() :: keyword()
```

# `command_result`

```elixir
@type command_result() :: LivePanels.Canvas.Command.result()
```

# `offset`

```elixir
@type offset() :: %{x: integer(), y: integer()}
```

# `socket`

```elixir
@type socket() :: Phoenix.LiveView.Socket.t()
```

# `t`

```elixir
@type t() :: %LivePanels.Canvas.Clipboard{
  items: %{optional(String.t()) =&gt; LivePanels.Item.t()}
}
```

# `target`

```elixir
@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`.

# `copy`

```elixir
@spec copy(target()) :: command_result()
```

Copies the current actor selection and returns the command result.

# `copy!`

```elixir
@spec copy!(target()) :: target()
```

Copies the current actor selection into the actor clipboard.

# `count`

```elixir
@spec count(t() | term()) :: non_neg_integer()
```

Returns the number of items held by a clipboard projection.

# `cut`

```elixir
@spec cut(target()) :: command_result()
```

Copies and removes the current actor selection and returns the command result.

# `cut!`

```elixir
@spec cut!(target()) :: target()
```

Copies the current actor selection and removes it through one canvas command.

# `empty?`

```elixir
@spec empty?(t() | term()) :: boolean()
```

Returns true when a clipboard projection contains no items.

# `paste`

```elixir
@spec paste(target(), command_opts()) :: command_result()
```

Pastes the current actor clipboard and returns the command result.

# `paste!`

```elixir
@spec paste!(target(), command_opts()) :: target()
```

Pastes the current actor clipboard into the canvas.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
