@mosaicjs/ansi
v0.8.0
Published
The text/degraded renderer for Mosaic (the decompose floor). No React; walks the IR and prints.
Readme
@mosaicjs/ansi
The text/degraded renderer for Mosaic - the
decomposeTofloor. No React; renders the IR as plain text or ANSI.
Status: implemented. The full example gallery renders under test.
For scripts, CI logs, pipes, and any non-web host that wants a baseline.
Rich blocks decompose to primitives (a Diagram becomes grouped node lines and from -> to edges, a DataTable becomes an aligned text table, Progress becomes [█████░░░] 50%), controls print their state, and derived expr values still evaluate - they are content, not interaction.
import { renderAnsi } from "@mosaicjs/ansi";
console.log(renderAnsi(source)); // plain text, safe to pipe
console.log(renderAnsi(source, { color: true })); // ANSI tonesIt exists to prove the floor: every artifact renders readably everywhere (invariant 8). Full reference: docs/rendering.md.
