alma 0.1.1

A Bevy-native modal text editor with Vim-style navigation.
Documentation
//! Bevy UI chrome, status, and styling.

mod chrome;
mod status;
pub mod style;

use crate::ecs::schedules::{EditorSet, EditorStartupSet};
use bevy::prelude::{App, IntoScheduleConfigs, Plugin, Startup, Update};

pub use chrome::{
    ChromeProposalLane, ChromeStatusLine, spawn_chrome, sync_chrome_proposal_lane,
    sync_chrome_status_line,
};

/// Height of the bottom Vim status line.
pub const STATUS_BAR_HEIGHT: f32 = 28.0;

/// Bevy plugin for editor UI chrome.
#[derive(Clone, Copy, Debug, Default)]
pub struct BevyUiPlugin;

impl Plugin for BevyUiPlugin {
    fn build(&self, app: &mut App) {
        let _app = app
            .init_resource::<ChromeProposalLane>()
            .add_systems(Startup, spawn_chrome.in_set(EditorStartupSet::Chrome))
            .add_systems(
                Update,
                (sync_chrome_status_line, sync_chrome_proposal_lane).in_set(EditorSet::Render),
            );
    }
}