diff --git a/component/template/Cargo.toml b/component/template/Cargo.toml index 6f06ce5..4d9efb9 100644 --- a/component/template/Cargo.toml +++ b/component/template/Cargo.toml @@ -24,7 +24,7 @@ lazy_static = "1.4.0" libc = "0.2.148" log = "0.4.20" pretty_assertions = "1.4.0" -ratatui = { version = "0.26.0", features = ["serde", "macros"] } +ratatui = { version = "0.27.0", features = ["serde", "macros"] } serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.107" signal-hook = "0.3.17" diff --git a/simple-async/Cargo.toml b/simple-async/Cargo.toml index 796570c..9319eeb 100644 --- a/simple-async/Cargo.toml +++ b/simple-async/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" [dependencies] crossterm = { version = "0.27.0", features = ["event-stream"] } futures = "0.3.30" -ratatui = "0.26.0" +ratatui = "0.27.0" tokio = { version = "1.35.1", features = ["full"] } diff --git a/simple/Cargo.toml b/simple/Cargo.toml index b678010..32b7320 100644 --- a/simple/Cargo.toml +++ b/simple/Cargo.toml @@ -6,5 +6,4 @@ license = "MIT" edition = "2021" [dependencies] -crossterm = "0.27.0" -ratatui = "0.26.0" +ratatui = "0.27.0" diff --git a/simple/src/event.rs b/simple/src/event.rs index b6f7cce..5bf9d35 100644 --- a/simple/src/event.rs +++ b/simple/src/event.rs @@ -1,5 +1,7 @@ use crate::app::AppResult; -use crossterm::event::{self, Event as CrosstermEvent, KeyEvent, KeyEventKind, MouseEvent}; +use ratatui::crossterm::event::{ + self, Event as CrosstermEvent, KeyEvent, KeyEventKind, MouseEvent, +}; use std::sync::mpsc; use std::thread; use std::time::{Duration, Instant}; diff --git a/simple/src/handler.rs b/simple/src/handler.rs index 3cea937..6b66656 100644 --- a/simple/src/handler.rs +++ b/simple/src/handler.rs @@ -1,5 +1,5 @@ use crate::app::{App, AppResult}; -use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; +use ratatui::crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; /// Handles the key events and updates the state of [`App`]. pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult<()> { diff --git a/simple/src/tui.rs b/simple/src/tui.rs index d90bbe3..5039de5 100644 --- a/simple/src/tui.rs +++ b/simple/src/tui.rs @@ -1,9 +1,9 @@ use crate::app::{App, AppResult}; use crate::event::EventHandler; use crate::ui; -use crossterm::event::{DisableMouseCapture, EnableMouseCapture}; -use crossterm::terminal::{self, EnterAlternateScreen, LeaveAlternateScreen}; use ratatui::backend::Backend; +use ratatui::crossterm::event::{DisableMouseCapture, EnableMouseCapture}; +use ratatui::crossterm::terminal::{self, EnterAlternateScreen, LeaveAlternateScreen}; use ratatui::Terminal; use std::io; use std::panic; @@ -31,7 +31,7 @@ impl Tui { /// It enables the raw mode and sets terminal properties. pub fn init(&mut self) -> AppResult<()> { terminal::enable_raw_mode()?; - crossterm::execute!(io::stderr(), EnterAlternateScreen, EnableMouseCapture)?; + ratatui::crossterm::execute!(io::stderr(), EnterAlternateScreen, EnableMouseCapture)?; // Define a custom panic hook to reset the terminal properties. // This way, you won't have your terminal messed up if an unexpected error happens. @@ -61,7 +61,7 @@ impl Tui { /// the terminal properties if unexpected errors occur. fn reset() -> AppResult<()> { terminal::disable_raw_mode()?; - crossterm::execute!(io::stderr(), LeaveAlternateScreen, DisableMouseCapture)?; + ratatui::crossterm::execute!(io::stderr(), LeaveAlternateScreen, DisableMouseCapture)?; Ok(()) }