rae 0.1.7

Renderer-neutral widget, layout, sanitization, and GLSL shader primitives for Rust desktop tools.
Documentation
use rae::{
    compute_shell_layout, PaneChrome, PaneId, PromptModel, Rgba, StatusChip, TranscriptItem,
    WidgetFrame, WidgetSection,
};

fn main() {
    let layout = compute_shell_layout(rae::Rect::new(0.0, 0.0, 1440.0, 900.0));
    let frame = WidgetFrame {
        panes: vec![
            PaneChrome {
                id: PaneId::Main,
                title: "Transcript".into(),
                subtitle: "safe output stream".into(),
                rect: layout.main,
                focused: true,
            },
            PaneChrome {
                id: PaneId::Sidebar,
                title: "Inspector".into(),
                subtitle: "surface metadata".into(),
                rect: layout.sidebar,
                focused: false,
            },
            PaneChrome {
                id: PaneId::Prompt,
                title: "Prompt".into(),
                subtitle: "build mode".into(),
                rect: layout.prompt,
                focused: false,
            },
        ],
        prompt: PromptModel {
            label: "prompt".into(),
            input: "Show sanitized shader widget output".into(),
            cursor: 27,
            placeholder: "Type a command or renderer note".into(),
        },
        transcript: vec![
            TranscriptItem::system("workspace loaded: KnottRustDesign"),
            TranscriptItem::user("Make examples evolve with rae"),
            TranscriptItem::assistant(
                "This frame contains panes, prompt text, status chips, sections, and sanitized transcript rows.",
                "renderer neutral",
            ),
        ],
        chips: vec![
            StatusChip {
                label: "surface".into(),
                value: "glass".into(),
                color: Rgba::rgb8(122, 185, 255),
            },
            StatusChip {
                label: "output".into(),
                value: "sanitized".into(),
                color: Rgba::rgb8(83, 225, 147),
            },
        ],
        sections: vec![
            WidgetSection {
                title: "shader".into(),
                lines: vec!["bind u_time/u_resolution/u_intensity".into()],
                accent: Rgba::rgb8(122, 185, 255),
            },
            WidgetSection {
                title: "output".into(),
                lines: vec!["strip ANSI before rendering".into(), "preserve copy-safe text".into()],
                accent: Rgba::rgb8(83, 225, 147),
            },
        ],
    };

    println!("widget frame snapshot");
    println!("prompt: {} > {}", frame.prompt.label(), frame.prompt.input);
    for pane in &frame.panes {
        println!(
            "pane {:?}: {:<12} focused:{} rect=({:.0},{:.0},{:.0},{:.0})",
            pane.id,
            pane.title,
            pane.focused,
            pane.rect.x,
            pane.rect.y,
            pane.rect.width,
            pane.rect.height
        );
    }
    for chip in &frame.chips {
        println!("chip: {}={}", chip.label, chip.value);
    }
    for section in &frame.sections {
        println!("section: {} ({} lines)", section.title, section.lines.len());
    }
}