pub mod engine;
pub mod git;
mod render;
mod source;
pub mod transform;
mod view;
#[cfg(feature = "testing")]
pub mod assert;
#[cfg(feature = "test-report")]
pub mod test_report;
pub use engine::{
diff_chars, diff_lines, diff_slices, diff_words, group_hunks, hunk_header, tokenize, Hunk, Op,
TextDiff,
};
pub use source::SourceDiff;
pub use view::{DiffView, Side};
use rich::{Console, Style};
pub const STYLES: &[(&str, &str)] = &[
("diff.added", "green"),
("diff.removed", "red"),
("diff.added.emphasis", "bold underline green"),
("diff.removed.emphasis", "bold underline red"),
("diff.hunk", "cyan"),
("diff.header", "bold"),
("diff.line_number", "dim"),
("diff.context", "none"),
("test.passed", "green"),
("test.failed", "bold red"),
("test.errored", "bold magenta"),
("test.skipped", "yellow"),
];
pub(crate) fn style(console: &Console, key: &str) -> Style {
let fallback = STYLES
.iter()
.find(|(name, _)| *name == key)
.map_or("none", |(_, spec)| spec);
crate::event::theme_style(console, key, fallback)
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum Layout {
#[default]
Unified,
SideBySide,
}