Expand description
LayoutIR - Lumen markup as a tree of styled elements, decoupled from
ECS spawning so multiple backends can consume it (runtime spawn, AOT
codegen, typed Rust struct emission, FFI bytecode).
Modules§
- layout_
direction_ serde - serde adapter for
Attributes::dir.lumen-corecarries no serde dependency, soLayoutDirectioncannot deriveSerialize/Deserializeitself; this module mapsOption<LayoutDirection>to a stable, compactOption<u8>(0 = Auto,1 = Ltr,2 = Rtl) for the AOT artifact. Keeping the mapping here (rather than adding serde to lumen-core) keeps the parser-independent runtime free of an extra core dependency.
Structs§
- Attributes
- Resolved attribute bag; one struct so the parser fills it in a single pass and the spawner / codegen don’t have to re-parse strings.
- Bind
Spec - Parsed
bind="<kind>:<name>". - Border
Paint Spec - Resolved border paint for a state override (
:hover { border: ... },hover-border:/focus-border:). Unlike the base border - which accumulates from theborder-width/border-color/border-stylelonghands - a state border is authored via the shorthand only, so it resolves to concrete widths + color at parse time. - Deferred
Attr - One attribute of a fragment body element, kept as authored.
- Dropdown
Button Spec - Synthesised
<dropdown>header payload: the open signal plus the full option list mirrored from the<option>children (markup order), so the runtime header component can run keyboard interaction while the popup body is unmounted. - Edges
- Four edge values (in CSS order: left, right, top, bottom).
- Element
- One node in the IR tree.
- Fragment
Use - A fragment instantiation, recorded on the element that stands in for the fragment’s body until the tree is expanded.
- Grid
Template Spec - Parsed
grid-template-rows+grid-template-columnslists (W5.9). - LayoutIR
- Top of the IR. Single root element; multi-rooted markup is illegal.
- Lint
Finding - One parse-time finding. Carries a 1-based (line, col) anchor in the source so downstream tools can surface a diagnostic at the exact byte where the legacy shape lives.
- Menu
BarSpec - Parsed
<menubar>content. Top-level submenus + their items. - Menu
Spec - One
<menu label="File">...</menu>submenu. - Outline
Spec - Parsed
focus-outline="<width> <#color>"(plus the CSSoutline-offsetfolded in at spawn). - Rgba
- RGBA color in
[0,1]^4. - Script
Refs - The
<script>elements one markup source carries, read without building its tree. - Shadow
Spec - Parsed
shadow=/box-shadow=value. Authors may stack multiple shadows via comma separation in CSS; markup accepts a single entry.innerflips drop -> inset. - Tooltip
Spec - Parsed
<tooltip text="..." delay="...">payload, propagated from the wrapper to its single child asAttributes::tooltip. - Transition
Ir - IR-side parsed
transitionshorthand entry.From<&TransitionIr> for lumen_primitives::TransitionSpecconverts to the runtime form at spawn time.
Enums§
- Align
Content Spec - CSS
align-contentvalues (IR-side mirror oflumen_core::components::AlignContent). - BgSpec
- Parsed
bg=value. Solid colors, gradients, and images share one attribute surface so authors don’t pick betweenbg=andbg-gradient=. - Bind
Kind - What
bind=targets. - Border
Style Spec - CSS
border-stylesubset. v1 recognisesnoneandsolid; other keywords are rejected at parse time with a per-declaration warning. - BoxSizing
Spec - CSS
box-sizingvalues (IR-side mirror oflumen_core::components::BoxSizing). - Display
Spec - CSS
displayvalue (W5.9). Mirrors lumen-core’sDisplay. - Easing
Ir - IR-side mirror of
lumen_primitives::Easing. Cubic-bezier carries its four control points; named curves are zero-sized. - Flex
Align - Cross-axis alignment (CSS
align-items). - Flex
Axis - Flex direction.
- Flex
Justify - Main-axis distribution (CSS
justify-content). - Flex
Wrap Spec - CSS
flex-wrapvalues (IR-side mirror oflumen_core::components::FlexWrap). - IfMode
Spec <if mode="render|hide">policy.- Image
FitSpec - CSS
object-fitanalogue. - Interpolation
Slot - Round-8 wave-C: classification of a
{...}placeholder inside markup. Carries the resolution scope the spawner consults when materializing the slot into a concrete string. - Length
Spec - Length specifier as it appears in markup.
- Line
Height Spec - CSS
line-heightvalue. UnlikeLengthSpec, the two forms carry different meanings rather than different units of the same quantity: a bare number (line-height: 1.2) scales with the element’s own font size, while apxvalue (line-height: 19px) is a fixed line box height that does not track font-size changes. Kept as two variants instead of collapsing to a single px number so a consumer can tell which behavior the author asked for. - Lint
Kind - Category bucket for a parse-time
LintFinding. New variants land here as the parser learns more rules. - Lint
Severity - Severity tier for a parse-time
LintFinding. - Menu
Entry Spec - One entry inside a submenu - either a clickable item or a separator line.
- Overflow
Spec - CSS-style overflow control.
- Parse
Error - Markup parse errors.
- Position
Spec - CSS-style position mode.
- Scroll
Axis Spec - Scroll axis declared in markup.
- Scrollbar
Width Spec - CSS
scrollbar-widthkeyword (Scrollbars Styling Level 1). - Text
Align Spec - Horizontal text alignment.
- Text
Overflow Spec - CSS
text-overflow- what to do with text that overflows its box. - Text
Wrap Spec - Text wrap policy attribute.
- Track
Size Spec - One CSS Grid track-size term (W5.9). IR-side mirror of
lumen_core::components::TrackSize. - Transition
Property Ir - IR-side mirror of
lumen_primitives::TransitionProperty. Kept local to layout_ir so the parser doesn’t need to depend on primitives. - Widget
Part - Synthetic widget-part roles attached by the parser desugars - see
Attributes::part. - Widget
Role - A widget tag that the parser replaces with plain boxes - see
Attributes::widget.
Functions§
- relativize_
asset_ paths - Rewrite every
<image src>underelthat points insiderootto a path relative to it, recording inoutsidethe ones that point elsewhere.