# `LivePanels.Context`
[🔗](https://github.com/livepanels/livepanels/blob/v0.1.0/lib/livepanels/context.ex#L1)

Runtime identity contract shared by canvas LiveViews and item content LiveViews.

This module is documented as a runtime concept, not as a command surface.
LivePanels builds and assigns `%LivePanels.Context{}` values while mounting
canvas and item content LiveViews. The public entry point is `assign_key/0`;
the remaining helpers are runtime-owned.

LivePanels assigns runtime state under `:livepanels` when a canvas or item
content LiveView mounts. The context lives at `socket.assigns.livepanels.context`. Public
helpers should read runtime identity through this struct instead of reaching
for individual socket assigns. Canvas projections such as items, selection,
history, clipboard, connectors, viewport, canvas state, and cursor mode also live
under `socket.assigns.livepanels`; matching root assign names remain
app-owned.

# `mode`

```elixir
@type mode() :: :local | :shared
```

# `t`

```elixir
@type t() :: %LivePanels.Context{
  canvas_id: String.t(),
  canvas_mode: mode(),
  client_id: String.t(),
  item_id: String.t() | nil,
  pubsub: module(),
  viewer_id: String.t()
}
```

# `assign_key`

```elixir
@spec assign_key() :: :livepanels
```

Returns the socket assign key that stores the LivePanels runtime projection.

---

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