Capability buckets and capability-owned item behavior.
LivePanels.Item is the canonical record. This module owns the optional
behavior attached to that record: content, vector state, connectors, ports,
render surface, interaction hints, layout participation, autosize, resize,
drag/drop, regions, reserved areas, and placement locks.
Summary
Functions
Returns an item's normalized autosize capability.
Returns true when an item owns its frame size from rendered content.
Returns true when an item can participate in clustering.
Returns true when this item participates in the connector/port graph.
Returns true when an item is a connector item.
Returns true when an item has a content capability.
Returns the items that carry content.
Returns the items that do not carry content.
Returns an item's normalized drag/drop capability.
Finds a declared connector port by name.
Returns application interaction hints declared by an item.
Returns true when an item id points to a contentless item.
Returns the connector port connection limit.
Returns true when an item's placement is locked.
Returns true when an item's placement is not locked.
Returns a normalized connector port direction.
Returns the connector port label.
Returns the connector port name as a string.
Returns the connector port type.
Returns the declared connector ports for an item.
Returns declared connector ports for the requested direction.
Returns true when an item may be presented by user interaction.
Returns true when focusing an item should promote it in the canvas stack.
Returns true when an item declares a region capability.
Returns the region name declared by an item.
Returns true when an item may be removed by user interaction.
Returns the render surface declared by an item.
Returns true when an item reserves layout area.
Returns the reserved-area policy declared by an item.
Returns true when this item may be interactively resized by users.
Returns true when this item participates in bulk tiling / layout operations.
Returns the axis declared by an item's tiling container capability.
Returns true when an item is a tiling container.
Returns the gap declared by an item's tiling container capability.
Returns per-child tiling ratios declared by an item.
Returns true when an item has vector state.
Types
@type autosize() :: %{ debounce_ms: non_neg_integer(), min_w: pos_integer(), min_h: pos_integer(), max_w: pos_integer(), max_h: pos_integer() }
@type port_anchor() :: map()
@type port_declaration() :: %{ :name => String.t(), :direction => :input | :output, :label => String.t(), :type => port_type(), :max_connections => pos_integer() | :unlimited, optional(:anchor) => port_anchor() }
@type viewport_dimension() :: pos_integer() | viewport_fill_dimension()
@type viewport_fill_dimension() :: %{ :mode => :fill, :inset => non_neg_integer(), optional(:min) => pos_integer(), optional(:max) => pos_integer() }
@type viewport_frame() :: %{ optional(:anchor) => LivePanels.Canvas.Placement.anchor(), optional(:x) => integer(), optional(:y) => integer(), optional(:w) => viewport_dimension(), optional(:h) => viewport_dimension() }
@type viewport_frames() :: %{optional(String.t()) => viewport_frame()}
Functions
@spec autosize(LivePanels.Item.t()) :: autosize() | nil
Returns an item's normalized autosize capability.
@spec autosize?(LivePanels.Item.t()) :: boolean()
Returns true when an item owns its frame size from rendered content.
@spec clusterable?(LivePanels.Item.t()) :: boolean()
Returns true when an item can participate in clustering.
@spec connectable?(LivePanels.Item.t()) :: boolean()
Returns true when this item participates in the connector/port graph.
An item is connectable when it declares a non-empty :ports capability.
@spec connector?(LivePanels.Item.t()) :: boolean()
Returns true when an item is a connector item.
@spec content?(LivePanels.Item.t()) :: boolean()
Returns true when an item has a content capability.
Returns the items that carry content.
Returns the items that do not carry content.
@spec drag_drop(LivePanels.Item.t()) :: LivePanels.Canvas.DragDrop.capability()
Returns an item's normalized drag/drop capability.
@spec find_port(LivePanels.Item.t(), String.t()) :: port_declaration() | nil
Finds a declared connector port by name.
@spec interaction_hints(LivePanels.Item.t()) :: map()
Returns application interaction hints declared by an item.
Returns true when an item id points to a contentless item.
@spec max_connections(port_declaration() | map()) :: pos_integer() | :unlimited
Returns the connector port connection limit.
@spec placement_locked?(LivePanels.Item.t()) :: boolean()
Returns true when an item's placement is locked.
@spec placement_unlocked?(LivePanels.Item.t()) :: boolean()
Returns true when an item's placement is not locked.
@spec port_direction(port_declaration() | map()) :: :input | :output | nil
Returns a normalized connector port direction.
@spec port_label(port_declaration() | map()) :: String.t()
Returns the connector port label.
@spec port_name(port_declaration() | map()) :: String.t()
Returns the connector port name as a string.
@spec port_type(port_declaration() | map()) :: port_type()
Returns the connector port type.
@spec ports(LivePanels.Item.t()) :: [port_declaration()]
Returns the declared connector ports for an item.
@spec ports_for_direction(LivePanels.Item.t(), :input | :output) :: [ {integer(), port_declaration()} ]
Returns declared connector ports for the requested direction.
@spec presentable?(LivePanels.Item.t()) :: boolean()
Returns true when an item may be presented by user interaction.
@spec promote_on_focus?(LivePanels.Item.t()) :: boolean()
Returns true when focusing an item should promote it in the canvas stack.
@spec region?(LivePanels.Item.t()) :: boolean()
Returns true when an item declares a region capability.
@spec region_name(LivePanels.Item.t()) :: String.t() | nil
Returns the region name declared by an item.
@spec removable?(LivePanels.Item.t()) :: boolean()
Returns true when an item may be removed by user interaction.
@spec render_surface(LivePanels.Item.t()) :: :world_html | :world_svg | :viewport_html | :none | nil
Returns the render surface declared by an item.
@spec reserved_area?(LivePanels.Item.t()) :: boolean()
Returns true when an item reserves layout area.
@spec reserved_area_policy(LivePanels.Item.t()) :: :avoid | :overlay | :collapse_shell | nil
Returns the reserved-area policy declared by an item.
@spec resizable?(LivePanels.Item.t()) :: boolean()
Returns true when this item may be interactively resized by users.
Resizability is expressed by the presence of a :resize capability.
@spec tileable?(LivePanels.Item.t()) :: boolean()
Returns true when this item participates in bulk tiling / layout operations.
An item is tileable when either it has an explicit :tile capability whose
value is non-falsy, or it has a :content capability and no explicit :tile
opt-out. Items without a :content capability and without :tile opt-in are
excluded from bulk layout placements.
@spec tiling_axis(LivePanels.Item.t()) :: :horizontal | :vertical | nil
Returns the axis declared by an item's tiling container capability.
@spec tiling_container?(LivePanels.Item.t()) :: boolean()
Returns true when an item is a tiling container.
@spec tiling_gap(LivePanels.Item.t()) :: non_neg_integer()
Returns the gap declared by an item's tiling container capability.
@spec tiling_ratios(LivePanels.Item.t()) :: map()
Returns per-child tiling ratios declared by an item.
@spec vector?(LivePanels.Item.t()) :: boolean()
Returns true when an item has vector state.