compiled autocomplete

This commit is contained in:
Priec
2025-07-29 21:46:55 +02:00
parent 1a451a576f
commit b8e1b77222
6 changed files with 479 additions and 112 deletions

View File

@@ -1,47 +1,25 @@
// canvas/src/lib.rs
//! Canvas - A reusable text editing and form canvas system
//!
//! This crate provides a generic canvas abstraction for building text-based interfaces
//! with multiple input fields, cursor management, and mode-based editing.
pub mod state;
pub mod actions;
pub mod modes;
pub mod config;
pub mod suggestions;
pub mod dispatcher;
pub mod state;
pub mod suggestions; // Keep for backwards compatibility
pub mod autocomplete; // NEW: Core autocomplete functionality
pub mod modes;
// GUI module (optional, enabled with "gui" feature)
#[cfg(feature = "gui")]
pub mod gui;
// Re-export the main types for easy use
pub use state::{CanvasState, ActionContext};
pub use actions::{CanvasAction, ActionResult, execute_edit_action, execute_canvas_action};
pub use modes::{AppMode, ModeManager, HighlightState};
pub use suggestions::SuggestionState;
// Re-export commonly used types
pub use actions::{CanvasAction, ActionResult};
pub use dispatcher::ActionDispatcher;
pub use state::{CanvasState, ActionContext};
pub use autocomplete::{SuggestionItem, AutocompleteState}; // NEW
pub use modes::{AppMode, ModeManager, HighlightState};
// Re-export GUI types when available
#[cfg(feature = "gui")]
pub use gui::{CanvasTheme, render_canvas};
pub use gui::{render_canvas, CanvasTheme};
// High-level convenience API
pub mod prelude {
pub use crate::{
CanvasState,
ActionContext,
CanvasAction,
ActionResult,
execute_edit_action,
execute_canvas_action,
ActionDispatcher,
AppMode,
ModeManager,
HighlightState,
SuggestionState,
};
#[cfg(feature = "gui")]
pub use crate::{CanvasTheme, render_canvas};
}
// Keep backwards compatibility exports
pub use suggestions::SuggestionState;