resolveBox
import { resolveBox, type Constraints } from "@pibbl/core";resolveBox(style, constraints, context?) resolves public BoxStyle into a
ResolvedBoxStyle with border and content boxes. It applies min/max lengths,
padding, and finite constraint validation, and raises LayoutDiagnostic for
impossible or indefinite inputs.
const constraints: Constraints = { minWidth: 0, maxWidth: 320, minHeight: 0, maxHeight: 240,};const box = resolveBox({ width: "50%", padding: 12 }, constraints);It accepts Constraints and is a public layout helper, not a retained layout engine.
API details from source
Section titled “API details from source”
Resolves declared box sizing and padding into border and content boxes under parent constraints.
resolveBox: (style: Readonly<BoxStyle>, constraints: Readonly<Constraints>, context?: Readonly<LayoutDiagnosticContext>) => ResolvedBoxStyleRelated API: resolveBox, BoxStyle, Constraints, LayoutDiagnosticContext, ResolvedBoxStyle.
Parameters
Section titled “Parameters”-
style— Declared box sizing and edge properties. See BoxStyle. -
constraints— Available dimensions used to resolve percentages and constraints. See Constraints . -
context— Component and property context for diagnostic messages. See LayoutDiagnosticContext .
Returns
Section titled “Returns”Resolved box dimensions and edge values. See ResolvedBoxStyle.
See also
Section titled “See also”View source — packages/core/src/lib/layout/box.ts:25
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Authoring, signals, and lifecycle companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Box resolution: Resolve padding, percentages, and a constrained box with typed diagnostics. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.