indicatrix_web/lib.rs
1//! Browser build of `indicatrix`: open a faceting design (a self-contained
2//! `.isdd` file (or a legacy `.indicatrix`), `.asc`, `.gem`,
3//! `.gcs`), keep it in the shared `indicatrix_editor::EditorSession`, and save it
4//! back as a browser download. See `README.md` for what works today and what the
5//! later phases add.
6//!
7//! # Modules
8//!
9//! - `app`: the one `app::state::WebApp` (in an `Rc<RefCell<..>>`), the entry
10//! point, callback wiring, the `push_*` UI refresh, persistence to
11//! `sessionStorage`, the solve (tiny designs on the page, the rest in the solve
12//! Worker), diagnostics.
13//! - `io`: file input (picker + drag-and-drop), per-kind loaders, the HDR cap, and
14//! file output (`Blob` downloads).
15//! - `render`: the CPU-worker live render loop, its settings panel, the PNG export
16//! and the viewport-size tracking.
17//! - `workers`: the one lazily created Worker pool (render Workers + solve Worker, and
18//! the analysis Worker on first use).
19//! - `metrics`: the Render tab's gemological-metrics HUD and the Tilt Performance dialog,
20//! both computed in the analysis Worker.
21//!
22//! - `views`: the Solid and Diagram tabs.
23//! - `editor`: the CAD panels of the Design dock -- the tier table, its command bar and
24//! editing actions, and the unsaved-changes dialog.
25//!
26//! # Why everything is `#[cfg(target_arch = "wasm32")]`
27//!
28//! This crate exists for one target: it drives a Slint UI through `wasm-bindgen`
29//! and reads files through the DOM. A native build compiles to nothing, so
30//! `cargo check --workspace` on a native host costs the desktop apps nothing.
31//! Pure logic that deserves native tests lives in the shared crates instead
32//! (`indicatrix-editor`'s `files` module, for one).
33
34#[cfg(target_arch = "wasm32")]
35mod app;
36#[cfg(target_arch = "wasm32")]
37mod editor;
38#[cfg(target_arch = "wasm32")]
39mod io;
40#[cfg(target_arch = "wasm32")]
41mod metrics;
42#[cfg(target_arch = "wasm32")]
43mod render;
44#[cfg(target_arch = "wasm32")]
45mod storage;
46#[cfg(target_arch = "wasm32")]
47mod views;
48#[cfg(target_arch = "wasm32")]
49mod workers;
50
51// Must run in the crate root: it `include!`s build.rs's generated module.
52#[cfg(target_arch = "wasm32")]
53slint::include_modules!();