euv_example/pages/struct.rs
1use super::*;
2
3/// Cross-component custom event emitted via `#[event]` / `emit!` and received via `on_event!` across showcase pages.
4#[event]
5#[derive(Data, Debug)]
6pub struct ShowcasePulseEvent {
7 /// Source page or control emitting the pulse.
8 pub(crate) source: String,
9 /// Monotonic pulse sequence counter.
10 #[get(type(copy))]
11 pub(crate) seq: u32,
12}
13
14/// App-wide reactive global state store registered via `#[global_state_store]` and observed with `watch!(global ...)`.
15#[global_state_store]
16#[derive(Data, Debug, Default, PartialEq)]
17pub struct ShowcaseGlobalBanner {
18 /// Total cross-component pulses received globally.
19 #[get(type(copy))]
20 pub(crate) pulses: u32,
21 /// Latest event source label broadcast globally.
22 pub(crate) last_source: String,
23}
24
25/// Typed `Component` + `Lifecycle` page wrapper enforcing `PageRetention::Freeze` for every showcase route.
26#[derive(Clone, Getter)]
27pub struct ShowcasePage {
28 /// Static normalized route path owned by this page component.
29 #[get(type(copy))]
30 pub(crate) route: &'static str,
31 /// Shared reactive showcase state.
32 pub(crate) state: ShowcaseState,
33 /// Active theme tokens snapshot for this render pass.
34 #[get(type(copy))]
35 pub(crate) tokens: ThemeTokens,
36}