LivePanels.Canvas.Arrange (livepanels v0.1.0)

Copy Markdown View Source

Socket-first multi-item arrangement and stacking commands.

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

Summary

Functions

Aligns items and returns the command result.

Aligns items in the requested scope.

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

Demotes the requested scope one z-order step.

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

Moves the requested scope to the back.

Distributes items and returns the command result.

Distributes items in the requested scope.

Lays out tileable world items and returns the command result.

Lays out tileable world items using the current actor viewport.

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

Promotes the requested scope one z-order step.

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

Moves the requested scope to the front.

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

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

Types

align_mode()

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

command_opts()

@type command_opts() :: keyword()

command_result()

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

distribute_axis()

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

layout_strategy()

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

socket()

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

target()

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

z_order_mode()

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

Functions

align(target, mode, opts \\ [])

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

Aligns items and returns the command result.

align!(target, mode, opts \\ [])

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

Aligns items in the requested scope.

demote(target, opts \\ [])

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

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

demote!(target, opts \\ [])

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

Demotes the requested scope one z-order step.

demote_to_back(target, opts \\ [])

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

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

demote_to_back!(target, opts \\ [])

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

Moves the requested scope to the back.

distribute(target, axis, opts \\ [])

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

Distributes items and returns the command result.

distribute!(target, axis, opts \\ [])

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

Distributes items in the requested scope.

layout(target, strategy, opts \\ [])

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

Lays out tileable world items and returns the command result.

layout!(target, strategy, opts \\ [])

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

Lays out tileable world items using the current actor viewport.

promote(target, opts \\ [])

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

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

promote!(target, opts \\ [])

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

Promotes the requested scope one z-order step.

promote_to_front(target, opts \\ [])

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

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

promote_to_front!(target, opts \\ [])

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

Moves the requested scope to the front.

reserve_area(target, item, opts \\ [])

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

reserve_area!(target, item, opts \\ [])

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

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