UNPKG

1.89 kBTypeScriptView Raw
1/**
2 * @license Copyright (c) 2003-2023, 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/imagestyle/imagestyleui
7 */
8import { Plugin } from 'ckeditor5/src/core';
9import ImageStyleEditing from './imagestyleediting';
10import '../../theme/imagestyle.css';
11/**
12 * The image style UI plugin.
13 *
14 * It registers buttons corresponding to the {@link module:image/imageconfig~ImageConfig#styles} configuration.
15 * It also registers the {@link module:image/imagestyle/utils#DEFAULT_DROPDOWN_DEFINITIONS default drop-downs} and the
16 * custom drop-downs defined by the developer in the {@link module:image/imageconfig~ImageConfig#toolbar} configuration.
17 */
18export default class ImageStyleUI extends Plugin {
19 /**
20 * @inheritDoc
21 */
22 static get requires(): readonly [typeof ImageStyleEditing];
23 /**
24 * @inheritDoc
25 */
26 static get pluginName(): "ImageStyleUI";
27 /**
28 * Returns the default localized style titles provided by the plugin.
29 *
30 * The following localized titles corresponding with
31 * {@link module:image/imagestyle/utils#DEFAULT_OPTIONS} are available:
32 *
33 * * `'Wrap text'`,
34 * * `'Break text'`,
35 * * `'In line'`,
36 * * `'Full size image'`,
37 * * `'Side image'`,
38 * * `'Left aligned image'`,
39 * * `'Centered image'`,
40 * * `'Right aligned image'`
41 */
42 get localizedDefaultStylesTitles(): Record<string, string>;
43 /**
44 * @inheritDoc
45 */
46 init(): void;
47 /**
48 * Creates a dropdown and stores it in the editor {@link module:ui/componentfactory~ComponentFactory}.
49 */
50 private _createDropdown;
51 /**
52 * Creates a button and stores it in the editor {@link module:ui/componentfactory~ComponentFactory}.
53 */
54 private _createButton;
55 private _executeCommand;
56}