2016-10-09 17:46:53 +00:00
|
|
|
[package]
|
2023-03-17 16:03:49 +00:00
|
|
|
name = "ratatui"
|
2024-02-12 11:35:48 +00:00
|
|
|
version = "0.26.1" # crate version
|
2023-07-17 10:41:45 +00:00
|
|
|
authors = ["Florian Dehau <work@fdehau.com>", "The Ratatui Developers"]
|
2023-08-27 20:58:54 +00:00
|
|
|
description = "A library that's all about cooking up terminal user interfaces"
|
2023-03-17 16:03:49 +00:00
|
|
|
documentation = "https://docs.rs/ratatui/latest/ratatui/"
|
2016-11-28 08:52:51 +00:00
|
|
|
keywords = ["tui", "terminal", "dashboard"]
|
2023-07-22 10:34:11 +00:00
|
|
|
repository = "https://github.com/ratatui-org/ratatui"
|
2021-01-01 13:35:07 +00:00
|
|
|
readme = "README.md"
|
2016-11-08 09:29:42 +00:00
|
|
|
license = "MIT"
|
2023-06-11 20:27:35 +00:00
|
|
|
exclude = [
|
|
|
|
"assets/*",
|
|
|
|
".github",
|
|
|
|
"Makefile.toml",
|
|
|
|
"CONTRIBUTING.md",
|
|
|
|
"*.log",
|
|
|
|
"tags",
|
|
|
|
]
|
2018-09-01 12:05:33 +00:00
|
|
|
autoexamples = true
|
2022-01-22 12:07:35 +00:00
|
|
|
edition = "2021"
|
2024-03-02 12:13:17 +00:00
|
|
|
rust-version = "1.74.0"
|
2016-10-09 17:46:53 +00:00
|
|
|
|
2017-05-21 12:07:44 +00:00
|
|
|
[badges]
|
|
|
|
|
2016-10-09 17:46:53 +00:00
|
|
|
[dependencies]
|
2023-08-27 09:00:35 +00:00
|
|
|
crossterm = { version = "0.27", optional = true }
|
2024-01-08 10:38:41 +00:00
|
|
|
termion = { version = "3.0", optional = true }
|
2024-01-30 04:02:44 +00:00
|
|
|
termwiz = { version = "0.22.0", optional = true }
|
2023-08-27 09:00:35 +00:00
|
|
|
|
|
|
|
serde = { version = "1", optional = true, features = ["derive"] }
|
2023-06-01 13:37:59 +00:00
|
|
|
bitflags = "2.3"
|
2018-09-04 20:00:45 +00:00
|
|
|
cassowary = "0.3"
|
2023-06-02 14:03:34 +00:00
|
|
|
indoc = "2.0"
|
2023-11-20 22:47:59 +00:00
|
|
|
itertools = "0.12"
|
2023-07-26 07:05:12 +00:00
|
|
|
paste = "1.0.2"
|
2024-01-29 15:59:42 +00:00
|
|
|
strum = { version = "0.26", features = ["derive"] }
|
2023-06-11 20:27:35 +00:00
|
|
|
time = { version = "0.3.11", optional = true, features = ["local-offset"] }
|
2023-06-02 14:03:34 +00:00
|
|
|
unicode-segmentation = "1.10"
|
|
|
|
unicode-width = "0.1"
|
2023-08-27 09:00:35 +00:00
|
|
|
document-features = { version = "0.2.7", optional = true }
|
2023-10-21 13:25:05 +00:00
|
|
|
lru = "0.12.0"
|
2023-12-02 20:21:13 +00:00
|
|
|
stability = "0.1.1"
|
2024-01-19 12:50:42 +00:00
|
|
|
compact_str = "0.7.1"
|
2019-05-15 17:33:11 +00:00
|
|
|
|
2016-10-12 17:43:39 +00:00
|
|
|
[dev-dependencies]
|
2023-06-01 13:22:18 +00:00
|
|
|
anyhow = "1.0.71"
|
2023-09-21 08:47:23 +00:00
|
|
|
argh = "0.1.12"
|
2023-09-10 00:30:41 +00:00
|
|
|
better-panic = "0.3.0"
|
2023-08-11 01:36:12 +00:00
|
|
|
cargo-husky = { version = "1.5.0", default-features = false, features = [
|
|
|
|
"user-hooks",
|
|
|
|
] }
|
2023-12-17 09:34:59 +00:00
|
|
|
color-eyre = "0.6.2"
|
2023-09-21 08:47:23 +00:00
|
|
|
criterion = { version = "0.5.1", features = ["html_reports"] }
|
2024-02-26 09:23:20 +00:00
|
|
|
derive_builder = "0.20.0"
|
2023-06-16 13:09:41 +00:00
|
|
|
fakeit = "1.1"
|
2024-01-13 23:13:50 +00:00
|
|
|
font8x8 = "0.3.1"
|
2023-09-21 08:47:23 +00:00
|
|
|
palette = "0.7.3"
|
2023-08-17 07:44:33 +00:00
|
|
|
pretty_assertions = "1.4.0"
|
2023-12-17 09:34:59 +00:00
|
|
|
rand = "0.8.5"
|
2024-01-13 23:13:50 +00:00
|
|
|
rand_chacha = "0.3.1"
|
2024-01-05 19:38:30 +00:00
|
|
|
rstest = "0.18.2"
|
feat(serde): support TableState, ListState, and ScrollbarState (#723)
TableState, ListState, and ScrollbarState can now be serialized and deserialized
using serde.
```rust
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
struct AppState {
list_state: ListState,
table_state: TableState,
scrollbar_state: ScrollbarState,
}
let app_state = AppState::default();
let serialized = serde_json::to_string(app_state);
let app_state = serde_json::from_str(serialized);
```
2024-01-13 00:13:35 +00:00
|
|
|
serde_json = "1.0.109"
|
2023-06-16 13:09:41 +00:00
|
|
|
|
2024-02-27 11:12:33 +00:00
|
|
|
[lints.rust]
|
|
|
|
unsafe_code = "forbid"
|
|
|
|
[lints.clippy]
|
2024-03-02 12:24:35 +00:00
|
|
|
pedantic = { level = "warn", priority = -1 }
|
|
|
|
cast_possible_truncation = "allow"
|
|
|
|
cast_possible_wrap = "allow"
|
|
|
|
cast_precision_loss = "allow"
|
|
|
|
cast_sign_loss = "allow"
|
|
|
|
missing_errors_doc = "allow"
|
|
|
|
missing_panics_doc = "allow"
|
|
|
|
module_name_repetitions = "allow"
|
|
|
|
must_use_candidate = "allow"
|
|
|
|
wildcard_imports = "allow"
|
|
|
|
|
|
|
|
# nursery or restricted
|
2024-02-27 13:08:06 +00:00
|
|
|
deref_by_slicing = "warn"
|
2024-02-28 14:51:53 +00:00
|
|
|
empty_line_after_doc_comments = "warn"
|
2024-02-27 12:41:34 +00:00
|
|
|
equatable_if_let = "warn"
|
2024-02-27 11:32:07 +00:00
|
|
|
missing_const_for_fn = "warn"
|
2024-02-27 11:54:00 +00:00
|
|
|
use_self = "warn"
|
2024-02-27 11:12:33 +00:00
|
|
|
|
2023-08-27 09:00:35 +00:00
|
|
|
[features]
|
2023-10-18 20:52:43 +00:00
|
|
|
#! The crate provides a set of optional features that can be enabled in your `cargo.toml` file.
|
|
|
|
#!
|
|
|
|
## By default, we enable the crossterm backend as this is a reasonable choice for most applications
|
|
|
|
## as it is supported on Linux/Mac/Windows systems. We also enable the `underline-color` feature
|
|
|
|
## which allows you to set the underline color of text.
|
|
|
|
default = ["crossterm", "underline-color"]
|
|
|
|
#! Generally an application will only use one backend, so you should only enable one of the following features:
|
|
|
|
## enables the [`CrosstermBackend`] backend and adds a dependency on the [Crossterm crate].
|
|
|
|
crossterm = ["dep:crossterm"]
|
|
|
|
## enables the [`TermionBackend`] backend and adds a dependency on the [Termion crate].
|
|
|
|
termion = ["dep:termion"]
|
|
|
|
## enables the [`TermwizBackend`] backend and adds a dependency on the [Termwiz crate].
|
|
|
|
termwiz = ["dep:termwiz"]
|
|
|
|
|
2023-08-27 09:00:35 +00:00
|
|
|
#! The following optional features are available for all backends:
|
|
|
|
## enables serialization and deserialization of style and color types using the [Serde crate].
|
|
|
|
## This is useful if you want to save themes to a file.
|
2024-01-19 12:50:42 +00:00
|
|
|
serde = ["dep:serde", "bitflags/serde", "compact_str/serde"]
|
2023-08-27 09:00:35 +00:00
|
|
|
|
|
|
|
## enables the [`border!`] macro.
|
|
|
|
macros = []
|
|
|
|
|
|
|
|
## enables all widgets.
|
|
|
|
all-widgets = ["widget-calendar"]
|
|
|
|
|
|
|
|
#! Widgets that add dependencies are gated behind feature flags to prevent unused transitive
|
|
|
|
#! dependencies. The available features are:
|
|
|
|
## enables the [`calendar`] widget module and adds a dependency on the [Time crate].
|
|
|
|
widget-calendar = ["dep:time"]
|
|
|
|
|
2023-10-18 20:52:43 +00:00
|
|
|
#! Underline color is only supported by the [`CrosstermBackend`] backend, and is not supported
|
|
|
|
#! on Windows 7.
|
|
|
|
## enables the backend code that sets the underline color.
|
|
|
|
underline-color = ["dep:crossterm"]
|
|
|
|
|
2023-12-02 20:21:13 +00:00
|
|
|
#! The following features are unstable and may change in the future:
|
|
|
|
|
|
|
|
## Enable all unstable features.
|
2024-02-02 08:02:16 +00:00
|
|
|
unstable = ["unstable-rendered-line-info", "unstable-widget-ref"]
|
2023-12-02 20:21:13 +00:00
|
|
|
|
2023-12-07 17:14:56 +00:00
|
|
|
## Enables the [`Paragraph::line_count`](crate::widgets::Paragraph::line_count)
|
|
|
|
## [`Paragraph::line_width`](crate::widgets::Paragraph::line_width) methods
|
|
|
|
## which are experimental and may change in the future.
|
|
|
|
## See [Issue 293](https://github.com/ratatui-org/ratatui/issues/293) for more details.
|
|
|
|
unstable-rendered-line-info = []
|
|
|
|
|
2024-02-02 08:02:16 +00:00
|
|
|
## Enables the `WidgetRef` and `StatefulWidgetRef` traits which are experimental and may change in
|
|
|
|
## the future.
|
|
|
|
unstable-widget-ref = []
|
|
|
|
|
2023-08-27 09:00:35 +00:00
|
|
|
[package.metadata.docs.rs]
|
|
|
|
all-features = true
|
|
|
|
# see https://doc.rust-lang.org/nightly/rustdoc/scraped-examples.html
|
|
|
|
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
|
|
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
|
2023-09-02 02:57:48 +00:00
|
|
|
[[bench]]
|
|
|
|
name = "barchart"
|
|
|
|
harness = false
|
|
|
|
|
2023-08-11 02:17:32 +00:00
|
|
|
[[bench]]
|
|
|
|
name = "block"
|
|
|
|
harness = false
|
|
|
|
|
2023-06-16 13:09:41 +00:00
|
|
|
[[bench]]
|
2023-09-02 02:57:48 +00:00
|
|
|
name = "list"
|
2023-06-16 13:09:41 +00:00
|
|
|
harness = false
|
2017-05-25 13:17:08 +00:00
|
|
|
|
2023-11-21 22:23:21 +00:00
|
|
|
[lib]
|
|
|
|
bench = false
|
|
|
|
|
2023-08-05 14:47:06 +00:00
|
|
|
[[bench]]
|
2023-09-02 02:57:48 +00:00
|
|
|
name = "paragraph"
|
2023-08-05 14:47:06 +00:00
|
|
|
harness = false
|
|
|
|
|
2023-08-11 02:11:41 +00:00
|
|
|
[[bench]]
|
2023-09-02 02:57:48 +00:00
|
|
|
name = "sparkline"
|
2023-08-11 02:11:41 +00:00
|
|
|
harness = false
|
|
|
|
|
2023-08-05 14:47:06 +00:00
|
|
|
|
2017-05-25 13:17:08 +00:00
|
|
|
[[example]]
|
2021-11-11 14:56:37 +00:00
|
|
|
name = "barchart"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "block"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "canvas"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
2023-04-26 21:02:35 +00:00
|
|
|
[[example]]
|
|
|
|
name = "calendar"
|
|
|
|
required-features = ["crossterm", "widget-calendar"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2023-04-26 21:02:35 +00:00
|
|
|
|
2021-11-11 14:56:37 +00:00
|
|
|
[[example]]
|
|
|
|
name = "chart"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
2023-08-11 01:36:12 +00:00
|
|
|
[[example]]
|
|
|
|
name = "colors"
|
|
|
|
required-features = ["crossterm"]
|
|
|
|
# this example is a bit verbose, so we don't want to include it in the docs
|
|
|
|
doc-scrape-examples = false
|
|
|
|
|
2023-09-10 00:30:41 +00:00
|
|
|
[[example]]
|
|
|
|
name = "colors_rgb"
|
|
|
|
required-features = ["crossterm"]
|
|
|
|
doc-scrape-examples = true
|
|
|
|
|
2021-11-11 14:56:37 +00:00
|
|
|
[[example]]
|
|
|
|
name = "custom_widget"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "demo"
|
|
|
|
# this runs for all of the terminal backends, so it can't be built using --all-features or scraped
|
|
|
|
doc-scrape-examples = false
|
2021-11-11 14:56:37 +00:00
|
|
|
|
2023-09-21 08:47:23 +00:00
|
|
|
[[example]]
|
|
|
|
name = "demo2"
|
|
|
|
required-features = ["crossterm", "widget-calendar"]
|
|
|
|
doc-scrape-examples = true
|
|
|
|
|
2023-09-28 02:57:04 +00:00
|
|
|
[[example]]
|
|
|
|
name = "docsrs"
|
|
|
|
required-features = ["crossterm"]
|
|
|
|
doc-scrape-examples = false
|
|
|
|
|
2021-11-11 14:56:37 +00:00
|
|
|
[[example]]
|
|
|
|
name = "gauge"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
2023-06-01 13:22:18 +00:00
|
|
|
[[example]]
|
|
|
|
name = "hello_world"
|
|
|
|
required-features = ["crossterm"]
|
|
|
|
doc-scrape-examples = true
|
|
|
|
|
2021-11-11 14:56:37 +00:00
|
|
|
[[example]]
|
|
|
|
name = "layout"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
2024-01-13 02:11:15 +00:00
|
|
|
[[example]]
|
|
|
|
name = "constraints"
|
|
|
|
required-features = ["crossterm"]
|
|
|
|
doc-scrape-examples = false
|
|
|
|
|
2024-01-13 09:51:41 +00:00
|
|
|
[[example]]
|
|
|
|
name = "flex"
|
|
|
|
required-features = ["crossterm"]
|
2024-01-14 15:49:45 +00:00
|
|
|
doc-scrape-examples = true
|
2024-01-13 09:51:41 +00:00
|
|
|
|
2024-01-31 05:12:29 +00:00
|
|
|
[[example]]
|
|
|
|
name = "constraint-explorer"
|
|
|
|
required-features = ["crossterm"]
|
|
|
|
doc-scrape-examples = true
|
|
|
|
|
2021-11-11 14:56:37 +00:00
|
|
|
[[example]]
|
|
|
|
name = "list"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
2023-08-11 01:36:12 +00:00
|
|
|
[[example]]
|
|
|
|
name = "modifiers"
|
|
|
|
required-features = ["crossterm"]
|
|
|
|
# this example is a bit verbose, so we don't want to include it in the docs
|
|
|
|
doc-scrape-examples = false
|
|
|
|
|
2022-04-24 14:49:57 +00:00
|
|
|
[[example]]
|
|
|
|
name = "panic"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2022-04-24 14:49:57 +00:00
|
|
|
|
2021-11-11 14:56:37 +00:00
|
|
|
[[example]]
|
|
|
|
name = "paragraph"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "popup"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
2023-12-14 02:25:21 +00:00
|
|
|
[[example]]
|
|
|
|
name = "ratatui-logo"
|
|
|
|
required-features = ["crossterm"]
|
|
|
|
doc-scrape-examples = true
|
|
|
|
|
2023-06-17 19:25:43 +00:00
|
|
|
[[example]]
|
|
|
|
name = "scrollbar"
|
|
|
|
required-features = ["crossterm"]
|
|
|
|
doc-scrape-examples = true
|
|
|
|
|
2021-11-11 14:56:37 +00:00
|
|
|
[[example]]
|
|
|
|
name = "sparkline"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "table"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "tabs"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2021-11-11 14:56:37 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "user_input"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
2023-04-17 12:23:50 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "inline"
|
|
|
|
required-features = ["crossterm"]
|
2023-05-24 19:58:04 +00:00
|
|
|
doc-scrape-examples = true
|
feat(serde): support TableState, ListState, and ScrollbarState (#723)
TableState, ListState, and ScrollbarState can now be serialized and deserialized
using serde.
```rust
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
struct AppState {
list_state: ListState,
table_state: TableState,
scrollbar_state: ScrollbarState,
}
let app_state = AppState::default();
let serialized = serde_json::to_string(app_state);
let app_state = serde_json::from_str(serialized);
```
2024-01-13 00:13:35 +00:00
|
|
|
|
|
|
|
[[test]]
|
|
|
|
name = "state_serde"
|
|
|
|
required-features = ["serde"]
|