euv-example 0.48.1

Cross-platform native showcase application demonstrating euv fine-grained reactivity, multi-mode rendering, window controls, and euv-ui components.
Documentation
use super::*;

/// Cross-component custom event emitted via `#[event]` / `emit!` and received via `on!` across showcase pages.
#[event]
#[derive(Data, Debug)]
pub struct ShowcasePulseEvent {
    /// Source page or control emitting the pulse.
    pub(crate) source: String,
    /// Monotonic pulse sequence counter.
    #[get(type(copy))]
    pub(crate) seq: u32,
}

/// App-wide reactive global state store registered via `#[store]` and observed with `watch!(global ...)`.
#[store]
#[derive(Data, Debug, Default, PartialEq)]
pub struct ShowcaseGlobalBanner {
    /// Total cross-component pulses received globally.
    #[get(type(copy))]
    pub(crate) pulses: u32,
    /// Latest event source label broadcast globally.
    pub(crate) last_source: String,
}

/// Typed `Component` + `Lifecycle` page wrapper enforcing `PageRetention::Freeze` for every showcase route.
#[derive(Clone, Getter)]
pub struct ShowcasePage {
    /// Static normalized route path owned by this page component.
    #[get(type(copy))]
    pub(crate) route: &'static str,
    /// Shared reactive showcase state.
    pub(crate) state: ShowcaseState,
    /// Active theme tokens snapshot for this render pass.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Single source of truth describing one showcase route: path, navigation copy, sidebar section, quick-launch badge, and page builder.
#[derive(Clone, Copy, Getter)]
pub struct ShowcaseRouteSpec {
    /// Normalized route path.
    #[get(type(copy))]
    pub(crate) path: &'static str,
    /// Sidebar, command palette, and quick-launch label.
    #[get(type(copy))]
    pub(crate) label: &'static str,
    /// Compact breadcrumb title.
    #[get(type(copy))]
    pub(crate) title: &'static str,
    /// Sidebar drawer section heading.
    #[get(type(copy))]
    pub(crate) section: &'static str,
    /// Two-letter quick-launch badge.
    #[get(type(copy))]
    pub(crate) tag: &'static str,
    /// One-line responsibility summary.
    #[get(type(copy))]
    pub(crate) summary: &'static str,
    /// Page builder mounting this route.
    #[get(type(copy))]
    pub(crate) mount: fn(&ShowcaseState, ThemeTokens) -> NodeId,
}