UNPKG

@steroidsjs/ckeditor5

Version:

The development environment of CKEditor 5 – the best browser-based rich text editor.

82 lines (72 loc) 2.19 kB
/** * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ /** * @module image/image */ import { Plugin } from 'ckeditor5/src/core'; import { Widget } from 'ckeditor5/src/widget'; import ImageEditing from './image/imageediting'; import ImageTextAlternative from './imagetextalternative'; import { isImageWidget } from './image/utils'; import '../theme/image.css'; /** * The image plugin. * * For a detailed overview, check the {@glink features/image image feature} documentation. * * This is a "glue" plugin which loads the following plugins: * * * {@link module:image/image/imageediting~ImageEditing}, * * {@link module:image/imagetextalternative~ImageTextAlternative}. * * Usually, it is used in conjuction with other plugins from this package. See the {@glink api/image package page} * for more information. * * @extends module:core/plugin~Plugin */ export default class Image extends Plugin { /** * @inheritDoc */ static get requires() { return [ ImageEditing, Widget, ImageTextAlternative ]; } /** * @inheritDoc */ static get pluginName() { return 'Image'; } /** * Checks if a given view element is an image widget. * * @param {module:engine/view/element~Element} viewElement * @returns {Boolean} */ isImageWidget( viewElement ) { return isImageWidget( viewElement ); } } /** * The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package. * * Read more in {@link module:image/image~ImageConfig}. * * @member {module:image/image~ImageConfig} module:core/editor/editorconfig~EditorConfig#image */ /** * The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package. * * ClassicEditor * .create( editorElement, { * image: ... // Image feature options. * } ) * .then( ... ) * .catch( ... ); * * See {@link module:core/editor/editorconfig~EditorConfig all editor options}. * * @interface ImageConfig */