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 /// Mobile catalog drawer visibility signal toggled by the bottom navigation `Catalog` (`目录`) tab.
28 #[get(type(copy))]
29 pub(crate) catalog_drawer_open: Signal<bool>,
30 /// Loaded `/api/page-artifacts` catalog records rendered on `home: true` pages.
31 #[get(type(copy))]
32 pub(crate) catalog_items: Signal<Vec<DocsCatalogArtifact>>,
33 /// Whether the `/api/page-artifacts` catalog request is currently loading.
34 #[get(type(copy))]
35 pub(crate) catalog_loading: Signal<bool>,
36 /// Whether the latest `/api/page-artifacts` catalog request failed (enabling localized Retry).
37 #[get(type(copy))]
38 pub(crate) catalog_error: Signal<bool>,
39 /// Guard preventing duplicate route registration on `router`.
40 pub(crate) router_ready: Rc<Cell<bool>>,
41}