UNPKG

1.9 kBTypeScriptView Raw
1/**
2 * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4 */
5/**
6 * @module image/imageinsert/ui/imageinsertformview
7 */
8import { View, ViewCollection, FocusCycler, type FocusableView } from 'ckeditor5/src/ui.js';
9import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
10import '../../../theme/imageinsert.css';
11/**
12 * The view displayed in the insert image dropdown.
13 *
14 * See {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.
15 */
16export default class ImageInsertFormView extends View {
17 /**
18 * Tracks information about DOM focus in the form.
19 */
20 readonly focusTracker: FocusTracker;
21 /**
22 * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
23 */
24 readonly keystrokes: KeystrokeHandler;
25 /**
26 * A collection of views that can be focused in the form.
27 */
28 protected readonly _focusables: ViewCollection<FocusableView>;
29 /**
30 * Helps cycling over {@link #_focusables} in the form.
31 */
32 protected readonly _focusCycler: FocusCycler;
33 /**
34 * A collection of the defined integrations for inserting the images.
35 */
36 private readonly children;
37 /**
38 * Creates a view for the dropdown panel of {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.
39 *
40 * @param locale The localization services instance.
41 * @param integrations An integrations object that contains components (or tokens for components) to be shown in the panel view.
42 */
43 constructor(locale: Locale, integrations?: Array<FocusableView>);
44 /**
45 * @inheritDoc
46 */
47 render(): void;
48 /**
49 * @inheritDoc
50 */
51 destroy(): void;
52 /**
53 * Focuses the first {@link #_focusables focusable} in the form.
54 */
55 focus(): void;
56}