lumen_ir/lib.rs
1//! `lumen-ir` - the runtime-shared intermediate representation for Lumen.
2//!
3//! This crate owns the data model that both the compiler (`lumenc`) and the
4//! parser-free runtime consume:
5//!
6//! - [`layout_ir`] - [`LayoutIR`](layout_ir::LayoutIR), the tree of styled
7//! elements decoupled from ECS spawning, plus the `From` impls that convert
8//! each IR spec into its `lumen_core` / `lumen_primitives` runtime type.
9//! - [`css`] - the CSS AST ([`Stylesheet`](css::Stylesheet)) and the
10//! Cascade-5 application / re-application logic. The hand-rolled front-end
11//! that *parses* CSS text into a [`Stylesheet`](css::Stylesheet) still lives
12//! in `lumenc::parse::css`; this crate owns the data + the cascade.
13//! - [`interpolate`] - the `{...}` placeholder resolver a `<for>` row and a
14//! fragment instance are built with, shared by the runtime and the web
15//! emitter so both write the same text.
16//! - [`fragment`] - [`Fragment`](fragment::Fragment), the named reusable
17//! markup subtree, and the [`FragmentTable`](fragment::FragmentTable) an
18//! app declares.
19//! - [`translate`] - the `translatable="key"` resolver, shared by the spawner
20//! and the web emitter so an app run in a locale and a page built for it
21//! show the same strings.
22//! - [`values`] - shared attribute/property value parsers.
23//! - [`css_vars`] - the `var(--name [, fallback])` resolver.
24//! - [`artifact`] - the AOT compiled-app container (`lumenc build` output).
25//!
26//! `lumenc` re-exports every module here so existing `lumenc::...` paths stay
27//! valid.
28
29#![forbid(unsafe_code)]
30#![warn(missing_docs)]
31
32pub mod addon;
33pub mod artifact;
34pub mod css;
35pub mod css_vars;
36pub mod fragment;
37pub mod interpolate;
38pub mod layout_ir;
39pub mod source_map;
40pub mod translate;
41pub mod values;
42
43/// IR -> runtime-component `From` conversions (orphan-rule home for the
44/// `Attributes`/value-spec -> `lumen_core`/`lumen_primitives` impls).
45mod convert;
46pub use convert::typography_role_to_px;