Skip to content

Centralize Layout Mapping Logic #840

@jacobsimionato

Description

@jacobsimionato

Proposal: Centralize Layout Mapping Logic

Reason

Mapping A2UI layout enums (like spaceBetween) to framework-specific values (like space-between in CSS or MainAxisAlignment.spaceBetween in Flutter) is currently handled inconsistently inside each renderer.

Design

  1. Shared Constants: Create renderers/web_core/src/v0_9/common/layout.ts to host standard mapping functions for Web/CSS-based renderers.
  2. Normalization: Provide mapJustify(val) and mapAlign(val) functions that return standard CSS values.
  3. Refactor: Remove the redundant mapping logic from react_prototype and any future Angular/Lit renderers, importing from the centralized web_core location instead.

Key Files

  • renderers/web_core/src/v0_9/common/layout.ts (New)
  • renderers/react_prototype/src/basic_catalog/utils.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions