/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ /** * @module ai/aichat/ui/aichatballoonview */ import { type Locale } from "@ckeditor/ckeditor5-utils"; import { type AISuggestionActionName } from "./feed/aichatfeedsuggestionitemactionsview.js"; import { type AISuggestionContentPartDefinition } from "../../aicore/utils/getsuggestionpartsfromreply.js"; import { type AIContentRenderingStrategy } from "../../aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js"; import { AIBalloonView } from "../../aiballoon/ui/aiballoonview.js"; import { ButtonView, FocusCycler, type ViewCollection } from "@ckeditor/ckeditor5-ui"; import { type AIReplyChangeGroupState, type AIReplyChangeGroupOutdatedReason } from "../../aicore/model/aireply.js"; export type AIChatBalloonViewConfig = { showApplyButton: boolean; showSuggestButton: boolean; availableActions: Array; }; /** * A view that displays the AI Chat suggestion preview in the `AIBalloon` dialog. * * It also injects previous and next suggestion buttons into the dialog header. */ export declare class AIChatBalloonView extends AIBalloonView { children: ViewCollection; /** * View that displays the next rotator button. Injected by `AIChatBalloon` into the dialog header. */ nextButtonView: ButtonView; /** * View that displays the previous rotator button. Injected by `AIChatBalloon` into the dialog header. */ previousButtonView: ButtonView; /** * Focus cycler for the balloon view that allows users to navigate through the balloon using the keyboard * as well as focus the view on demand. */ focusCycler: FocusCycler; /** * Observable property that indicates whether the suggestion display mode is "show changes". */ showDiff: boolean; /** * Observable property that indicates whether the track changes are on. */ isTrackChangesOn: boolean; /** * Whether the target editor is read-only. Forwarded to the part toolbar to disable the write actions (apply, suggest). * * @observable */ isTargetReadOnly: boolean; /** * Whether the part toolbar actions are disabled by the reply itself (for example a history reply). * * @observable */ areActionsDisabled: boolean; /** * @inheritDoc */ constructor(locale: Locale, config: AIChatBalloonViewConfig); /** * @inheritDoc */ override render(): void; /** * @inheritDoc */ override destroy(): void; /** * Focuses the first focusable child view. */ focus(): void; /** * Focuses the last focusable child view. */ focusLast(): void; /** * Updates the content of the balloon. */ updateContent(options: { part: AISuggestionContentPartDefinition; renderingStrategy: AIContentRenderingStrategy; abortSignal?: AbortSignal; keepErrors?: boolean; }): Promise; /** * Clears the content of the suggestion part displayed in the balloon. */ clearContent(): void; /** * Sets the state of the suggestion part displayed in the balloon. */ setState(state: AIReplyChangeGroupState, outdatedReason?: AIReplyChangeGroupOutdatedReason): void; /** * Shows an error message in the balloon. */ override showError(message: string): void; /** * Toggles the visibility of the rotator buttons. */ toggleRotatorButtonsVisibility(isVisible: boolean): void; }