layoutmodel
v0.0.1
Published
Serializable layout trees and immutable tree operations.
Maintainers
Readme
Layout Model
Serializable layout trees and immutable tree operations.
layoutmodel is a serializable, framework-neutral tree of typed nodes. It keeps ordered children and plain JSON properties, with immutable helpers for traversal and editing.
import { appendLayoutChild, createLayoutNode, findLayoutNode } from "layoutmodel";
const root = createLayoutNode({ id: "root", type: "stack" });
const card = createLayoutNode("card", "card-1", { title: "Hello" });
const next = appendLayoutChild(root, "root", card);
findLayoutNode(next, "card-1");No layout engine or rendering assumption is included; adapters decide how node types and properties are interpreted.
MIT
