import type{PropertyValues}from'lit';import{type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type LyraClipboardWriteFailure,type LyraClipboardWriteSuccess}from'../../../internal/clipboard.js';export interface ArtifactVersion{id:string;label?:string;} /** Which slot is currently visible in ``. */ export type ArtifactPanelView='preview'|'code';export interface LyraArtifactPanelEventMap{'lr-view-change':CustomEvent<{view:ArtifactPanelView;}>;'lr-version-change':CustomEvent<{versionId:string;}>;'lr-restore':CustomEvent<{versionId:string;}>;'lr-copy':CustomEvent;'lr-error':CustomEvent;'lr-copy-error':CustomEvent;'lr-download':CustomEvent<{filename:string;src:string;}>;} /** * `` — shell around one agent-generated artifact: a * title/kind header, a preview<->code toggle, version navigation with * restore, a streaming indicator, and built-in copy/download actions. * Renders none of the artifact itself — content is slotted. Version ids are stable identities; * empty/blank ids are omitted and duplicates normalize before navigation, labels, restore actions, * and counts, first-wins. * * Public collection properties take bounded, clone-owned readonly snapshots. Create a new * collection and reassign it after changes; mutating the assigned array does not update the view. * * @customElement lr-artifact-panel * @event lr-view-change - `detail: { view }`. Fired when the preview/code toggle changes. * @event lr-version-change - `detail: { versionId }`. Fired when the previous/next * navigation moves to a different version. * @event lr-restore - `detail: { versionId }`. Fired by the restore-this-version button; * mutates nothing itself — `versions` and the resulting content stay host-owned state. * @event lr-copy - `detail: { ok: true, text }`. Fired after the clipboard write fulfills. * @event lr-error - The clipboard write failed; generic no-detail notification. * @event lr-copy-error - `detail: { ok: false, text, reason, error }` — typed clipboard failure. * @event lr-download - `detail: { filename, src }`. Fired with the sanitized download URL. * @slot - Preview-view content. * @slot code - Code-view content (typically a ``). The preview/code toggle * only renders once this slot has assigned content. * @slot actions - Extra header controls, rendered between the version navigation and the * built-in copy/download buttons. * @csspart base - The root wrapper. * @csspart header - The header row. * @csspart label - The artifact title. * @csspart kind - The kind badge. * @csspart view-toggle - The preview/code toggle group (rendered only once the `code` slot * has content). * @csspart view-button - One toggle button; carries `data-view="preview"` or `data-view="code"`. * @csspart version-nav - The version navigation group (rendered only once `versions` is non-empty). * @csspart version-previous - The previous-version button. * @csspart version-previous-glyph - The chevron glyph inside `version-previous`, mirrored under RTL. * @csspart version-next - The next-version button. * @csspart version-next-glyph - The chevron glyph inside `version-next`, mirrored under RTL. * @csspart version-position - The "Version N of M" text. * @csspart version-label - The active `ArtifactVersion.label`, when supplied. * @csspart restore-button - The restore-this-version button, rendered only while the active * version isn't the latest one. * @csspart actions - The `actions` slot wrapper. * @csspart copy-button - The copy button, rendered only while `copyText` is non-empty. * @csspart download-button - The download button, rendered only while `downloadSrc` is non-empty. * @csspart body - The content body wrapper. * @csspart streaming-indicator - The streaming state indicator, rendered only while `streaming`. * @cssprop [--lr-artifact-panel-view-active-bg=var(--lr-color-brand-quiet)] - Background of the * pressed (active) preview/code toggle button. * @cssprop [--lr-artifact-panel-view-active-color=var(--lr-color-brand)] - Text color of the pressed * (active) preview/code toggle button. Restyling the pressed state otherwise requires overriding * the library-wide brand tokens, since `::part(view-button)[aria-pressed]` is invalid CSS. * @status stable * @since 4.0.0 */ export declare class LyraArtifactPanel extends LyraElement{protected static readonly ownedCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[]; /** The artifact's title, shown in the header. Optional. Omitting it localizes the default * `artifactPanelLabel` message for the view-toggle group's accessible name (and shows no * visible title); an explicit empty string also renders no visible/accessible label. */ label?:string; /** A short kind label (e.g. `document`, `code`), shown as a badge next to `label`. */ kind:string; /** Which slot is currently visible. */ view:ArtifactPanelView; /** The artifact's version history, oldest first. The last entry is the latest version. Empty/blank * ids are omitted and duplicates normalize first-wins before navigation, counts, and events. */ versions:readonly ArtifactVersion[]; /** The currently viewed version's id, or `null` to mean "the latest version". */ activeVersionId:string|null; /** Whether the artifact is still being generated. Sets `aria-busy` on the body and shows a * text indicator instead of an animated one, so it stays legible under reduced motion. */ streaming:boolean; /** The text copied to the clipboard by the copy button. Empty hides the button. */ copyText:string; /** The download URL, sanitized through `safeDownloadHref()` before use. Empty hides the button. */ downloadSrc:string; /** The suggested filename reported in the `lr-download` event detail. */ downloadName:string;private hasCodeSlot;private copyGeneration;private get normalizedVersions();disconnectedCallback():void;protected willUpdate(changed:PropertyValues):void;private onCodeSlotChange;private get accessibleLabel();private setView;private get currentIndex();private goToVersion;private onCopy;private onDownload;render():TemplateResult; /** `localize()` interpolates with a bare `String(value)`, so a number handed to it renders in * ASCII digits no matter the locale -- mixing two numbering systems inside one translated * sentence. Route every user-facing number through the effective locale instead. */ private formatCount;}declare global{interface HTMLElementTagNameMap{'lr-artifact-panel':LyraArtifactPanel;}}