UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

90 lines (89 loc) 2.36 kB
/** * @license Copyright (c) 2003-2025, 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/controls/aichatcontextpanelurlinputview */ import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js'; import { ButtonView, FocusCycler, LabeledFieldView, View, type InputTextView, type ViewWithFocusCycler } from 'ckeditor5/src/ui.js'; /** * A view for URL input in the AI chat context panel. * Provides a form with input field and submit/cancel buttons with proper focus management. */ export declare class AIChatContextPanelUrlInputView extends View implements ViewWithFocusCycler { /** * Tracks information about DOM focus in the form. */ readonly focusTracker: FocusTracker; /** * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. */ readonly keystrokes: KeystrokeHandler; /** * Helps cycling over {@link #_focusables} in the form. */ readonly focusCycler: FocusCycler; /** * The URL input field. */ readonly urlInputField: LabeledFieldView<InputTextView>; /** * The back button. */ readonly backButton: ButtonView; /** * The confirm button. */ readonly confirmButton: ButtonView; constructor(locale: Locale); /** * @inheritDoc */ render(): void; /** * @inheritDoc */ destroy(): void; /** * Focuses the URL input field. */ focus(): void; /** * Gets the current URL value. */ getValue(): string; /** * Clears the URL input field. */ clear(): void; /** * Sets an error message on the URL input field. */ setError(message: string): void; /** * Clears any error on the URL input field. */ clearError(): void; } /** * Event fired when the URL form is submitted. */ export type UrlInputSubmitEvent = { name: 'submitUrl'; args: [url: string]; }; /** * Event fired when the URL form is cancelled. */ export type UrlInputCancelEvent = { name: 'cancel'; args: []; }; /** * Event fired when the balloon should be repositioned due to content size changes. */ export type RefreshBalloonEvent = { name: 'refreshBalloon'; args: []; };