Skip to main content

euv_docs/viewer/
struct.rs

1use super::*;
2
3/// Shared reactive state driving the showcase-parity `euv-docs` viewer across native desktop, headless, and WebAssembly targets.
4#[derive(Clone, Data)]
5pub struct DocsViewerState {
6    /// Immutable documentation site data shared across routes.
7    pub(crate) site: Rc<DocSite>,
8    /// Reactive theme controller supporting all 17 `euv-ui` schemes and Light/Dark switching.
9    pub(crate) theme: UiThemeState,
10    /// Persistent `PageRetention::Freeze` router preserving scroll state per documentation page.
11    pub(crate) router: EuvRouter,
12    /// Active canonical route path signal.
13    #[get(type(copy))]
14    pub(crate) active_route: Signal<String>,
15    /// Live sidebar search query signal.
16    #[get(type(copy))]
17    pub(crate) search_query: Signal<String>,
18    /// Active table-of-contents heading anchor slug signal.
19    #[get(type(copy))]
20    pub(crate) active_toc_slug: Signal<String>,
21    /// Quick-search command palette modal visibility signal.
22    #[get(type(copy))]
23    pub(crate) cmd_open: Signal<bool>,
24    /// Quick-search command palette query signal.
25    #[get(type(copy))]
26    pub(crate) cmd_query: Signal<String>,
27    /// Loaded `/api/page-artifacts` catalog records rendered on `home: true` pages.
28    #[get(type(copy))]
29    pub(crate) catalog_items: Signal<Vec<DocsCatalogArtifact>>,
30    /// Whether the `/api/page-artifacts` catalog request is currently loading.
31    #[get(type(copy))]
32    pub(crate) catalog_loading: Signal<bool>,
33    /// Whether the latest `/api/page-artifacts` catalog request failed (enabling localized Retry).
34    #[get(type(copy))]
35    pub(crate) catalog_error: Signal<bool>,
36    /// Guard preventing duplicate route registration on `router`.
37    pub(crate) router_ready: Rc<Cell<bool>>,
38}