PhoenixDnd.Node (phoenix_dnd v0.1.0)

Copy Markdown View Source

A positioned node in a PhoenixDnd.Scene.

The data field is deliberately opaque and remains on the server. It is passed to the editor's node slot without being serialized into the DOM.

Summary

Types

position()

@type position() :: %{x: number(), y: number()}

t()

@type t() :: %PhoenixDnd.Node{
  class: term(),
  data: term(),
  id: String.t(),
  kind: String.t() | atom() | nil,
  label: String.t() | nil,
  ports: [PhoenixDnd.Port.t()],
  position: position()
}

Functions

new!(node)

@spec new!(map() | keyword() | t()) :: t()

new!(id, attrs)

@spec new!(String.t(), map() | keyword()) :: t()