Save and load design scenes to/from .phia.json files.
Scenes are serialized as JSON containing a flat list of nodes with their parent-child relationships. On load, the nodes are inserted back into a fresh ETS scene table.
File format
{
"version": 1,
"name": "My Dashboard",
"theme": "zinc",
"nodes": [
{
"id": "abc123",
"type": "phia_component",
"component": "button",
"attrs": {"variant": ":default"},
"slots": {"inner_block": "Click me"},
"parent_id": null,
"children": ["def456"],
"name": "My Button"
}
],
"root_children": ["abc123"]
}
Summary
Functions
List all .phia.json files in a directory.
Load a scene from a .phia.json file.
Save a scene to a .phia.json file.
Functions
List all .phia.json files in a directory.
Load a scene from a .phia.json file.
Returns {:ok, scene, metadata} where metadata includes :theme and :name.
Save a scene to a .phia.json file.
Options:
:theme— current theme atom (default::zinc)