euv-ui 0.48.9

Cross-platform UI component library and 17-scheme design system for the euv framework with pixel-consistent rendering across Web, Android, iOS, iPadOS, macOS, Windows, and Linux.
Documentation
use super::*;

/// Layout flow axis for Mermaid `flowchart` / `graph` diagrams.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum MermaidFlowDirection {
    /// Top-to-bottom hierarchical layout (`TD` / `TB`).
    #[default]
    TopDown,
    /// Bottom-to-top hierarchical layout (`BT`).
    BottomTop,
    /// Left-to-right pipeline layout (`LR`).
    LeftRight,
    /// Right-to-left pipeline layout (`RL`).
    RightLeft,
}

/// Vector shape rendered for a Mermaid flowchart, state, or mindmap node.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum MermaidNodeShape {
    /// Standard rectangle box (`[Label]`).
    #[default]
    Box,
    /// Soft rounded box (`(Label)`).
    Rounded,
    /// Decision diamond (`{Label}`).
    Diamond,
    /// Pill / stadium terminal (`([Label])`).
    Stadium,
    /// Subroutine double-bordered box (`[[Label]]`).
    Subroutine,
    /// Cylindrical database node (`[(Label)]`).
    Cylinder,
    /// Circular node (`((Label))`).
    Circle,
    /// Concentric double circle (`(((Label)))`).
    DoubleCircle,
    /// Six-sided hexagon (`{{Label}}`).
    Hexagon,
    /// Right-leaning parallelogram (`[/Label/]`).
    Parallelogram,
    /// Left-leaning parallelogram (`[\Label\]`).
    ParallelogramAlt,
    /// Bottom-wide trapezoid (`[/Label\]`).
    Trapezoid,
    /// Top-wide inverted trapezoid (`[\Label/]`).
    TrapezoidAlt,
    /// Asymmetric flag / ribbon node (`>Label]`).
    Asymmetric,
    /// State diagram start filled dot (`[*]`).
    StateStart,
    /// State diagram end bullseye (`[*]`).
    StateEnd,
    /// State diagram fork or join synchronization bar (`<<fork>>` / `<<join>>`).
    ForkJoin,
    /// Attached annotation note card.
    Note,
}

/// Connector stroke and endpoint style for Mermaid edges and sequence arrows.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum MermaidEdgeStyle {
    /// Standard solid directed arrow (`-->` / `->>`).
    #[default]
    Solid,
    /// Dashed directed arrow (`-.->` / `-->>`).
    Dashed,
    /// Emphasized thick solid arrow (`==>`).
    Thick,
    /// Undirected solid line (`---`).
    Plain,
    /// Undirected dashed line (`-.-`).
    DashedPlain,
    /// Undirected thick line (`===`).
    ThickPlain,
    /// Bidirectional solid arrow (`<-->`).
    Bidir,
    /// Bidirectional dashed arrow (`<-.->`).
    DashedBidir,
    /// Bidirectional thick arrow (`<==>`).
    ThickBidir,
    /// Solid line terminating in a circle marker (`--o`).
    CircleEnd,
    /// Solid line terminating in a cross marker (`--x`).
    CrossEnd,
    /// Solid line with circle markers at both ends (`o--o`).
    CircleBoth,
    /// Solid line with cross markers at both ends (`x--x`).
    CrossBoth,
    /// Solid sequence line without filled arrowhead (`->`).
    OpenArrow,
    /// Dashed sequence line without filled arrowhead (`-->`).
    DashedOpenArrow,
    /// Solid async half-arrow (`-)`).
    AsyncArrow,
    /// Dashed async half-arrow (`--)`).
    DashedAsyncArrow,
    /// Solid sequence cross termination (`-x`).
    CrossArrow,
    /// Dashed sequence cross termination (`--x`).
    DashedCrossArrow,
}

/// Placement anchor for a `sequenceDiagram` note callout.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum MermaidSeqNotePlacement {
    /// Centered over one or more participants (`Note over A,B`).
    #[default]
    Over,
    /// Placed to the left of a participant lifeline (`Note left of A`).
    LeftOf,
    /// Placed to the right of a participant lifeline (`Note right of A`).
    RightOf,
}

/// Control-flow fragment block kind inside a Mermaid `sequenceDiagram`.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum MermaidSeqBlockKind {
    /// Repeating `loop ... end` block.
    #[default]
    Loop,
    /// Conditional `alt ... else ... end` block.
    Alt,
    /// Optional `opt ... end` block.
    Opt,
    /// Parallel `par ... and ... end` block.
    Par,
    /// Critical `critical ... option ... end` block.
    Critical,
    /// Early-exit `break ... end` block.
    Break,
    /// Highlighted `rect ... end` region.
    Rect,
}

/// UML relationship connector marker kind inside a Mermaid `classDiagram`.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum MermaidClassRelKind {
    /// Standard directed association (`-->` / `<--`).
    #[default]
    Association,
    /// Inheritance / generalization (`<|--` / `--|>`).
    Inheritance,
    /// Interface realization (`<|..` / `..|>`).
    Realization,
    /// Composition filled diamond (`*--` / `--*`).
    Composition,
    /// Aggregation hollow diamond (`o--` / `--o`).
    Aggregation,
    /// Dashed dependency (`..>` / `<..`).
    Dependency,
    /// Plain undirected link (`--` / `..`).
    Link,
}

/// Task bar visual status inside a Mermaid Gantt chart.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum MermaidGanttStatus {
    /// Default scheduled task bar.
    #[default]
    Normal,
    /// Completed task bar (`done`).
    Done,
    /// Active in-progress task bar (`active`).
    Active,
    /// Critical path task bar (`crit`).
    Critical,
    /// Diamond milestone marker (`milestone`).
    Milestone,
}

/// High-level parsed Mermaid diagram AST rendered natively onto `euv` vector `DisplayList` primitives and inline SVGs.
#[derive(Clone, Debug, PartialEq)]
pub enum MermaidDiagram {
    /// Directed flowchart (`flowchart` / `graph`).
    Flowchart(MermaidFlowchart),
    /// Interaction sequence diagram (`sequenceDiagram`).
    Sequence(MermaidSequence),
    /// Finite state machine diagram (`stateDiagram` / `stateDiagram-v2`).
    State(MermaidFlowchart),
    /// UML class diagram (`classDiagram`).
    Class(MermaidClassDiagram),
    /// Entity-relationship diagram (`erDiagram`).
    Er(MermaidErDiagram),
    /// Proportional pie chart (`pie`).
    Pie(MermaidPieChart),
    /// Timeline Gantt chart (`gantt`).
    Gantt(MermaidGanttChart),
    /// Chronological milestone timeline (`timeline`).
    Timeline(MermaidTimeline),
    /// Hierarchical radial/horizontal mindmap (`mindmap`).
    Mindmap(MermaidMindmap),
    /// Cartesian bar and line XY chart (`xychart-beta` / `xychart`).
    XyChart(MermaidXyChart),
    /// Branch and merge commit history graph (`gitGraph`).
    GitGraph(MermaidGitGraph),
}