UNPKG

1.92 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/imagestyle/imagestyleediting
7 */
8import { Plugin } from 'ckeditor5/src/core.js';
9import ImageUtils from '../imageutils.js';
10import type { ImageStyleOptionDefinition } from '../imageconfig.js';
11/**
12 * The image style engine plugin. It sets the default configuration, creates converters and registers
13 * {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand ImageStyleCommand}.
14 */
15export default class ImageStyleEditing extends Plugin {
16 /**
17 * @inheritDoc
18 */
19 static get pluginName(): "ImageStyleEditing";
20 /**
21 * @inheritDoc
22 */
23 static get requires(): readonly [typeof ImageUtils];
24 /**
25 * It contains a list of the normalized and validated style options.
26 *
27 * * Each option contains a complete icon markup.
28 * * The style options not supported by any of the loaded image editing plugins (
29 * {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} or
30 * {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`}) are filtered out.
31 *
32 * @internal
33 * @readonly
34 */
35 normalizedStyles?: Array<ImageStyleOptionDefinition>;
36 /**
37 * @inheritDoc
38 */
39 init(): void;
40 /**
41 * Sets the editor conversion taking the presence of
42 * {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`}
43 * and {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugins into consideration.
44 */
45 private _setupConversion;
46 /**
47 * Registers a post-fixer that will make sure that the style attribute value is correct for a specific image type (block vs inline).
48 */
49 private _setupPostFixer;
50}