mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-22 04:33:13 +00:00
a41c97b413
These are less stable than the non-ref traits as we have not yet committed to the exact API. This change moves them to ratatui from ratatui-core. To facilitate this: - implementations of WidgetRef for all internal widgets are removed and replaced with implementations of Widget for references to those widgets. - Widget is now implemented for Option<W> where W: Widget, allowing for rendering of optional widgets. - The blanket implementation of Widget for WidgetRef is reversed, to be a blanket implementation of WidgetRef for all &W where W: Widget. BREAKING CHANGE: implementations of WidgetRef no longer have a blanket implementation of Widget, so Widgets should generally implement the Widget trait on a reference to the widget rather than implementing WidgetRef directly. This has the advantage of not requiring unstable features to be enabled. Part of: https://github.com/ratatui/ratatui/issues/1388 Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
60 lines
1.8 KiB
TOML
60 lines
1.8 KiB
TOML
[package]
|
|
name = "ratatui-core"
|
|
description = """
|
|
Core types and traits for the Ratatui Terminal UI library.
|
|
Widget libraries should use this crate. Applications should use the main Ratatui crate.
|
|
"""
|
|
version = "0.3.0"
|
|
readme = "README.md"
|
|
authors.workspace = true
|
|
documentation.workspace = true
|
|
repository.workspace = true
|
|
homepage.workspace = true
|
|
keywords.workspace = true
|
|
categories.workspace = true
|
|
license.workspace = true
|
|
exclude.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
|
|
[features]
|
|
## enables conversions from colors in the [`palette`] crate to [`Color`](crate::style::Color).
|
|
palette = ["dep:palette"]
|
|
|
|
## enables the backend code that sets the underline color. Underline color is only supported by
|
|
## the Crossterm backend, and is not supported on Windows 7.
|
|
underline-color = []
|
|
|
|
## 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.
|
|
serde = ["dep:serde", "bitflags/serde", "compact_str/serde"]
|
|
|
|
[package.metadata.docs.rs]
|
|
all-features = true
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
[dependencies]
|
|
bitflags = "2.3"
|
|
cassowary = "0.3"
|
|
compact_str = "0.8.0"
|
|
document-features = { workspace = true, optional = true }
|
|
indoc.workspace = true
|
|
itertools.workspace = true
|
|
lru = "0.12.0"
|
|
palette = { version = "0.7.6", optional = true }
|
|
paste = "1.0.2"
|
|
serde = { workspace = true, optional = true }
|
|
strum.workspace = true
|
|
unicode-segmentation.workspace = true
|
|
unicode-truncate = "2"
|
|
unicode-width.workspace = true
|
|
|
|
[dev-dependencies]
|
|
rstest.workspace = true
|
|
pretty_assertions.workspace = true
|
|
serde_json = "1.0.132"
|
|
|
|
[lints.clippy]
|
|
# we often split up a module into multiple files with the main type in a file named after the
|
|
# module, so we want to allow this pattern
|
|
module_inception = "allow"
|