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

Socket-first multi-item arrangement and stacking commands.

Arrangement commands operate on the current actor selection unless callers pass
an explicit scope in `opts`.

# `align_mode`

```elixir
@type align_mode() :: :left | :center | :right | :top | :middle | :bottom
```

# `command_opts`

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

# `command_result`

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

# `distribute_axis`

```elixir
@type distribute_axis() :: :horizontal | :vertical
```

# `layout_strategy`

```elixir
@type layout_strategy() :: atom() | String.t() | module()
```

# `socket`

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

# `target`

```elixir
@type target() :: LivePanels.Canvas.command_target()
```

# `z_order_mode`

```elixir
@type z_order_mode() :: :front | :back | :forward | :backward
```

# `align`

```elixir
@spec align(target(), align_mode() | String.t(), command_opts()) :: command_result()
```

Aligns items and returns the command result.

# `align!`

```elixir
@spec align!(target(), align_mode() | String.t(), command_opts()) :: target()
```

Aligns items in the requested scope.

# `demote`

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

Demotes the requested scope one z-order step and returns the command result.

# `demote!`

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

Demotes the requested scope one z-order step.

# `demote_to_back`

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

Moves the requested scope to the back and returns the command result.

# `demote_to_back!`

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

Moves the requested scope to the back.

# `distribute`

```elixir
@spec distribute(target(), distribute_axis() | String.t(), command_opts()) ::
  command_result()
```

Distributes items and returns the command result.

# `distribute!`

```elixir
@spec distribute!(target(), distribute_axis() | String.t(), command_opts()) ::
  target()
```

Distributes items in the requested scope.

# `layout`

```elixir
@spec layout(target(), layout_strategy(), command_opts()) :: command_result()
```

Lays out tileable world items and returns the command result.

# `layout!`

```elixir
@spec layout!(target(), layout_strategy(), command_opts()) :: target()
```

Lays out tileable world items using the current actor viewport.

# `promote`

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

Promotes the requested scope one z-order step and returns the command result.

# `promote!`

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

Promotes the requested scope one z-order step.

# `promote_to_front`

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

Moves the requested scope to the front and returns the command result.

# `promote_to_front!`

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

Moves the requested scope to the front.

# `reserve_area`

```elixir
@spec reserve_area(target(), LivePanels.Canvas.Item.item_ref(), command_opts()) ::
  command_result()
```

Marks a viewport item as reserved space and returns the command result.

# `reserve_area!`

```elixir
@spec reserve_area!(target(), LivePanels.Canvas.Item.item_ref(), command_opts()) ::
  target()
```

Marks a viewport item as reserved space for server-side layout planning.

---

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