Expand description
Component catalogs: what a surface is allowed to contain.
A catalog names the component types and functions a surface may use, the
properties each component takes, which of those properties are structural
(they hold component ids rather than data), and any composition constraints.
Agent and renderer must agree on one, identified by an opaque catalogId.
Two ways in:
Catalog::basic— the 18-component standard catalog, built in.Catalog::from_schema— parse any A2UI catalog JSON Schema document, which is how custom design systems are described.
§Structural properties are what make validation possible
The specification is explicit that a catalog must type child references as
ComponentId or ChildList rather than as bare strings — a validator
decides which fields are structural links by looking for exactly those
references. A raw "type": "string" is treated as static text (a URL, a
label) and its target is never checked. PropKind preserves that
distinction.
§Property types are carried, not interpreted
Each property also keeps the JSON type its schema pins it to (PropType),
which is what lets crate::validate reject {"columns": "three"} where the
catalog says integer. That is one constraint out of JSON Schema, not an
engine: pattern, minimum, additionalProperties and the rest are left to
whatever validates the document itself. A property whose schema states no
type, or states several, is PropType::Unconstrained and is never rejected
— a catalog this crate reads loosely must not turn into false failures.
Structs§
- Catalog
- A set of component and function definitions, identified by
catalogId. - Component
Def - One component type in a catalog.
- Component
Ref - One component id reference found inside a component.
- Composition
Violation - A composition-constraint failure.
- Function
Def - One function in a catalog.
- PropDef
- One property of a component type.
Enums§
- Composition
Code - Error codes the specification assigns to composition failures.
- Prop
Kind - How a component property participates in the component graph.
- Prop
Type - The JSON type a property’s schema pins its value to.
Constants§
- BASIC_
COMPONENTS - Component types of the basic catalog, in specification order.
- BASIC_
FUNCTIONS - Function names of the basic catalog.
- BASIC_
ICON_ NAMES - Icon names the basic catalog’s
Iconcomponent accepts. - COMMON_
PROPS - Optional properties every component carries, whatever its type.