Crate weavetui_core

Crate weavetui_core 

Source
Expand description

Core library for the weavetui TUI framework.

This crate defines the fundamental traits and types for building interactive Text User Interface (TUI) components, including Component for rendering and event handling, and ComponentAccessor for managing component properties and children.

It provides the building blocks for the weavetui ecosystem, designed to be used in conjunction with the weavetui_derive crate for declarative component creation.

Re-exports§

pub use internal::ComponentContext;

Modules§

app
Application module for weavetui.
component_manager
This module provides utility functions for managing Component instances, including drawing, updating, event handling, and theme propagation across the component tree.
event
This module defines the Event and Action enums, which are central to the application’s event-driven architecture. Event represents raw input from the terminal or internal application occurrences, while Action represents a processed command that can be dispatched and handled by components.
internal
This module contains internal structures and types used within the weavetui_core crate, primarily for managing component state and context. These types are generally not intended for direct public consumption but are essential for the framework’s internal workings.
keyboard
This module provides utilities for handling keyboard input, including parsing key event strings into KeyEvent sequences and managing keybindings for the application. It allows for flexible definition and lookup of actions based on user input.
macros
This module contains convenience macros for the weavetui framework, simplifying the creation of keybindings and component collections. These macros reduce boilerplate and improve readability when setting up application components and their interactions.
theme
This module defines structures and utilities for managing themes within the weavetui framework. It provides Theme to encapsulate styles and colors, and ThemeManager to handle multiple themes and their application to UI components.
tui
This module provides the Tui struct, which is responsible for managing the terminal user interface. It handles initialization, event polling, rendering, and cleanup of the terminal, acting as the bridge between the application logic and the crossterm/ratatui backend.

Macros§

components
Creates a vector of components from a list of component instances.
kb
Creates an array of keybindings.

Structs§

ComponentHandler
A handler for managing the lifecycle of a component.

Traits§

Component
The main trait for all UI components in the weavetui framework.
ComponentAccessor
A trait that provides access to the basic properties of a component.

Type Aliases§

Children
A type alias for a BTreeMap that stores child components.