LivePanels.Canvas.Read (livepanels v0.1.0)

Copy Markdown View Source

Read-side accessors for application code that needs the current canvas projection.

Prefer the narrow query that answers the question directly. Use state/1 when passing the canonical state into lower-level helpers such as graph bounds, graph navigation, drawing queries, or custom projections.

Summary

Functions

Returns the current actor identity map.

Returns the current actor's %Clipboard{} or nil when empty.

Returns the recent browser command envelopes received by the runtime, reduced to display-oriented field deltas.

Returns the content availability status for one item, or nil when none is recorded.

Returns item content availability statuses keyed by item id.

Returns the current actor's history projection for layout mutations.

Returns one item by id, or nil if it does not exist on the canvas.

Returns all canvas items as a list.

Returns metadata for the most recent runtime command handled by this socket.

Returns the participants currently joined to the canvas.

Returns the current actor's %Selection{}.

Returns the %Selection{} for the given client_id.

Returns the canonical canvas State struct.

Returns the current actor's viewport, or nil if not yet reported.

Returns viewport anchors keyed by anchor name.

Returns the current actor's viewport profile name.

Returns the active viewport sequence as anchor names.

Returns the canvas z-order from front to back.

Types

socket()

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

Functions

actor(socket)

@spec actor(socket()) :: LivePanels.Canvas.actor()

Returns the current actor identity map.

clipboard(socket)

@spec clipboard(socket()) :: LivePanels.Canvas.Clipboard.t() | nil

Returns the current actor's %Clipboard{} or nil when empty.

command_trace(socket)

@spec command_trace(socket()) :: [map()]

Returns the recent browser command envelopes received by the runtime, reduced to display-oriented field deltas.

content_status(socket, item_id)

@spec content_status(socket(), String.t()) :: map() | nil

Returns the content availability status for one item, or nil when none is recorded.

content_statuses(socket)

@spec content_statuses(socket()) :: map()

Returns item content availability statuses keyed by item id.

history(socket)

@spec history(socket()) :: LivePanels.Canvas.History.t()

Returns the current actor's history projection for layout mutations.

item(socket, id)

@spec item(socket(), String.t()) :: LivePanels.Item.t() | nil

Returns one item by id, or nil if it does not exist on the canvas.

items(socket)

@spec items(socket()) :: [LivePanels.Item.t()]

Returns all canvas items as a list.

last_command(socket)

@spec last_command(socket()) :: map() | nil

Returns metadata for the most recent runtime command handled by this socket.

Rejected commands include :reason and :message entries even when the canvas model itself was not changed.

participants(socket)

@spec participants(socket()) :: [map()]

Returns the participants currently joined to the canvas.

selection(socket)

@spec selection(socket()) :: LivePanels.Canvas.Selection.t()

Returns the current actor's %Selection{}.

selection_for(socket, client_id)

@spec selection_for(socket(), String.t()) :: LivePanels.Canvas.Selection.t()

Returns the %Selection{} for the given client_id.

state(socket)

@spec state(socket()) :: LivePanels.Canvas.State.t()

Returns the canonical canvas State struct.

viewport(socket)

@spec viewport(socket()) :: map() | nil

Returns the current actor's viewport, or nil if not yet reported.

viewport_anchors(socket)

@spec viewport_anchors(socket()) :: map()

Returns viewport anchors keyed by anchor name.

viewport_profile(socket)

@spec viewport_profile(socket()) :: String.t()

Returns the current actor's viewport profile name.

viewport_sequence(socket)

@spec viewport_sequence(socket()) :: [String.t()]

Returns the active viewport sequence as anchor names.

z_order(socket)

@spec z_order(socket()) :: [String.t()]

Returns the canvas z-order from front to back.