/** * Semantic layer over the syntactic scanner: validates attributes against * the sdoc language rules and produces typed entities ready for the Vite * plugin, the CLI app-gen, and the editor tooling. */ import { type ScanError, type Span, type TagBlock } from './scanner.js'; import type { ComponentStatus, DocNote, GlossaryBlock, TodoItem } from '../types.js'; export type { TodoItem }; export type ArgValue = string | number | boolean | null; /** Explicit presentation overrides from stage attributes */ export interface Sizing { maxWidth: string | null; padding: string | null; /** flex-direction of preview/example stages */ direction: string | null; /** gap of preview/example stages */ gap: string | null; /** horizontal alignment of preview/example stage contents */ contentX: string | null; /** vertical alignment of preview/example stage contents */ contentY: string | null; /** background of preview/example stages — a CSS color or var() */ background: string | null; /** minimum height of preview/example stages — a CSS length; reserves room * for content that overflows the stage, like an open dropdown */ minHeight: string | null; /** table-of-contents visibility (DOC) */ toc: boolean | null; } export interface PreviewBlock { /** The identifier from component={X}; null when invalid/missing (already reported) */ componentName: string | null; /** Parsed args literal; null when absent or invalid */ args: Record | null; /** Exact source of the args expression (inner object), for code display */ argsRaw: string | null; /** Explicit title="…" override, when present */ title: string | null; /** Short text rendered with the preview, when present */ description: string | null; /** Other names this component answers to, from synonyms="…". Shown with * the preview and searched by the MCP server; empty when absent. */ synonyms: string[]; /** Where this component sits in its life, from status="…"; null when the * author did not say. */ status: ComponentStatus | null; /** Tab label: the title override or the component name */ label: string; sizing: Sizing; /** Normalized full body — block script/style included (display/formatting form) */ body: string; bodySpan: Span; /** Block-level