Data-first graph patch operations.
Resolver stages emit patches instead of mutating node fields directly. Keeping patches as ordinary structs makes graph changes easy to test, diff, and record in provenance before any Figma-specific rule language exists.
Summary
Functions
Applies one or more patches to a graph.
Creates a field assignment patch.
Creates a component swap intent patch.
Types
@type t() :: %Figler.Scene.Graph.Patch{ field: atom() | nil, meta: map(), op: :set | :swap, source: atom(), target: Figler.Scene.Graph.GUID.graph_guid(), value: term() }
Functions
@spec apply_all(Figler.Scene.Graph.t(), t() | [t()]) :: Figler.Scene.Graph.t()
Applies one or more patches to a graph.
@spec set(Figler.Scene.Graph.GUID.graph_guid(), atom(), term(), keyword()) :: t()
Creates a field assignment patch.
@spec swap( Figler.Scene.Graph.GUID.graph_guid(), Figler.Scene.Graph.GUID.figma_guid(), keyword() ) :: t()
Creates a component swap intent patch.