Skip to main content

clankerdiff_ratatui/
lib.rs

1//! An embeddable, repository-agnostic Ratatui diff review widget.
2//! Hosts provide [`clankerdiff_core::DiffDocument`] snapshots and route emitted
3//! [`clankerdiff_core::DiffReviewEvent`] values. This crate never executes Git.
4
5mod annotation;
6mod annotation_layout;
7mod color;
8mod commands;
9#[cfg(feature = "crossterm-backend")]
10mod crossterm_adapter;
11mod diff_commands;
12mod diff_preview;
13mod drawer;
14mod input;
15mod interaction;
16mod keybindings;
17mod markdown;
18mod markdown_layout;
19mod markdown_review;
20mod options;
21mod patch_layout;
22mod render;
23mod state;
24mod style;
25mod syntax;
26#[cfg(feature = "test-support")]
27pub mod testing;
28mod text;
29mod theme_picker;
30pub mod ui;
31mod widgets;
32
33pub use clankerdiff_core::ReviewCapabilities;
34pub use clankerdiff_markdown::{MarkdownDocument, MarkdownReviewError};
35pub use clankerdiff_theme::ReviewTheme;
36pub use color::{composite_color, layered_style, page_color};
37pub use commands::{DiffReviewCommand, MarkdownReviewCommand, ReviewCommand};
38pub use diff_preview::{
39    DiffPreviewOptions, DiffPreviewState, DiffPreviewStats, render_diff_preview,
40};
41#[cfg(feature = "crossterm-backend")]
42pub use input::handle_crossterm_event;
43pub use interaction::{
44    InputOutcome, InteractionPhase, KeyCode, KeyCode as Key, KeyEvent, KeyModifiers, MouseButton,
45    MouseEvent, MouseEventKind, ReviewInput,
46};
47pub use keybindings::{
48    BindingScope, KeyBinding, default_diff_keybindings, default_markdown_keybindings,
49};
50pub use markdown::{MarkdownRenderStats, MarkdownRenderer, StreamingMarkdownState};
51pub use markdown_layout::{
52    MarkdownLayout, MarkdownLayoutOptions, MarkdownPresentation, MarkdownRow, MarkdownRowUpdate,
53    MarkdownRows,
54};
55#[cfg(feature = "crossterm-backend")]
56pub use markdown_review::handle_crossterm_event as handle_markdown_crossterm_event;
57pub use markdown_review::{
58    MarkdownFocusPane, MarkdownReview, MarkdownReviewBuilder, MarkdownReviewEvent,
59    MarkdownReviewState, MarkdownReviewWidget,
60};
61pub use options::{NavigationPane, ReviewOptions};
62pub use render::DiffReviewWidget;
63pub use state::{DiffReviewState, DiffReviewStatus, FocusPane, RepositoryOperationStatus};
64pub use style::{RatatuiTheme, RatatuiUiTheme};
65pub use syntax::highlighted_line;
66pub use theme_picker::ThemeChoice;
67
68/// Review event emitted to the embedding host.
69pub type DiffReviewEvent = clankerdiff_core::DiffReviewEvent;