import { FC } from 'react'; /** * One live caption — either what the user is saying or what the assistant is. * * Replaces the message-bubble list the voice overlay used to render. That list * was the chat transcript squeezed into a modal: bubbles, the whole scrollback, * and raw `##`/`**` because it printed the model's markdown as plain text. * * Three things here are deliberate and were all wrong before: * * ★ **Left-aligned, not centred.** Centring is fine for one short line and * unreadable for four — every line starts in a different place, so the eye has * to hunt for each beginning. Tamil/English mixed text makes it worse, because * the line lengths vary wildly. The BLOCK is centred on the stage; the text * inside it is not. * * ★ **Responsive type, not one fixed size.** `clamp()` so the same component is * legible in a 380px docked panel and from arm's length on a maximised desktop * window, without a second component or a transform. * * ★ **Bounded width.** A caption spanning a 1440px window is one long line the * eye cannot track back from, so the measure is capped — 45rem / 720px on the * full-screen stage, the middle of the 680-760px the design calls for. * * ★ That measure is deliberately NOT the 60-75 characters typography usually * aims at: at 36px type 720px carries roughly 40. A voice caption is glanced at * from arm's length while someone is talking, not read as prose, and the size * is what makes it glanceable — so the two constraints are set independently * and the width follows the spec rather than the usual reading rule. */ interface Props { text: string; /** Who is speaking. The assistant's caption is the loud one. */ role: "user" | "assistant"; /** Full-screen rather than docked in the panel. */ expanded: boolean; /** * The reply broken into the chunks being SPOKEN, plus the one sounding now. * * ★ When present the caption reveals only chunks 0..index, so the text tracks * the voice instead of arriving whole the instant playback starts. That is * what "captions appear multiple sentences ahead of the audio" describes: the * user reads the whole answer, then sits through it being read to them. * * ★ The chunks are the SPOKEN strings, not a parallel rendering of the same * markdown. A live caption whose words differ from the audio is not a caption. * * Absent — no engine support, or nothing playing — falls back to `text` whole, * which is exactly today's behaviour. */ spokenChunks?: { chunks: string[]; index: number; } | null; testId?: string; } /** * Marks the scroll box the caption lives in, so the sounding chunk can be kept * in view WITHOUT `scrollIntoView`, which also scrolls every ancestor scroller * — here that would drag the page behind a docked session. */ export declare const CAPTION_SCROLL_ATTR = "data-caption-scroll"; export declare const VoiceCaption: FC; export {}; //# sourceMappingURL=VoiceCaption.d.ts.map