alma 0.1.0

A Bevy-native modal text editor with Vim-style navigation.
Documentation
//! Bevy-facing ECS contracts and system pipeline definitions.
#![allow(dead_code)]

pub mod buffer;
pub mod components;
pub mod events;
pub mod focus;
pub mod layout;
pub mod schedules;

use bevy::prelude::{App, Plugin};
use events::{
    command::CommandRequested,
    cursor::{CursorMoveRequested, CursorMoved},
    edit::{BufferEditRequested, BufferEdited},
    focus::FocusRequested,
    input::EditorInputEvent,
    intent::ViewportIntent,
    lifecycle::LifecycleRequested,
    status::StatusMessageRequested,
};
use schedules::configure_editor_sets;

pub use buffer::{BufferPlugin, InitialEditorBuffer};
pub use focus::FocusPlugin;
pub use layout::{LayoutPlugin, TextShapePlugin};

/// Core editor ECS plugin that owns shared contracts and schedule wiring.
#[derive(Clone, Copy, Debug, Default)]
pub struct EditorCorePlugin;

impl Plugin for EditorCorePlugin {
    fn build(&self, app: &mut App) {
        configure_editor_sets(app);
        let _app = app
            .add_message::<EditorInputEvent>()
            .add_message::<ViewportIntent>()
            .add_message::<CommandRequested>()
            .add_message::<BufferEditRequested>()
            .add_message::<BufferEdited>()
            .add_message::<CursorMoveRequested>()
            .add_message::<CursorMoved>()
            .add_message::<FocusRequested>()
            .add_message::<StatusMessageRequested>()
            .add_message::<LifecycleRequested>();
    }
}