[package]
name = "tui-pages"
# version.workspace = true
version = "0.8.3"
edition.workspace = true
license = "MIT"
description = "Core for TUI apps with multiple pages"
repository = "https://gitlab.com/filipriec/tui-pages"
readme = "README.md"
keywords = ["tui", "terminal", "ratatui", "keyboard", "ui"]
categories = ["command-line-interface"]
exclude = ["examples/", ".claude/", ".forge/"]

[package.metadata.docs.rs]
all-features = true

[dependencies]
ratatui = { workspace = true, optional = true }
crossterm = { workspace = true }
serde  = { workspace = true, optional = true }
toml = { workspace = true }
tracing = { workspace = true }
canvas = { path = "../tui-canvas", package = "tui-canvas", version = "0.8.3", optional = true }

[features]
default = []

# Built-in command-line 
command-line = ["dep:ratatui"]

# Full canvas integration in one switch. We do not split canvas support into
# sub-features: enabling `canvas` turns on every canvas surface — GUI renderers,
# suggestions, cursor style, validation, computed fields, textarea, textinput,
# and the canvas-owned keybindings — plus the typed-action routing, default keymaps,
# and focus handoff. Pulls in ratatui (the GUI surfaces need it). Canvas's
# default `textmode-vim` rides along, satisfying its "exactly one text mode"
# contract.
canvas = [
    "dep:canvas",
    "dep:ratatui",
    "canvas/gui",
    "canvas/suggestions",
    "canvas/cursor-style",
    "canvas/validation",
    "canvas/computed",
    "canvas/textarea",
    "canvas/textinput",
    "canvas/commandline",
    "canvas/keybindings",
]

# Derives serde on the input/mode types. KeyChord embeds crossterm's KeyCode /
# KeyModifiers, so we also turn on crossterm's own serde impls.
serde = ["dep:serde", "crossterm/serde"]
# Built-in modal dialog: content/result types plus a ratatui renderer.
# Pulls in ratatui; the rest of the crate stays rendering-agnostic.
dialog = ["dep:ratatui"]

full = ["canvas", "serde", "dialog", "command-line"]
