image/imagestyle/utils
@ckeditor/ckeditor5-image/src/imagestyle/utils
Filtering
Constants
-
DEFAULT_DROPDOWN_DEFINITIONS : Array.<ImageStyleDropdownDefinition>
module:image/imagestyle/utils~DEFAULT_DROPDOWN_DEFINITIONS
readonly
Default drop-downs provided by the plugin that can be referred in the
toolbar
configuration. The drop-downs are containers for the image style options.If both of the
ImageEditing
plugins are loaded, there are 2 predefined drop-downs available:'imageStyle:wrapText'
, which contains thealignLeft
andalignRight
options, that is, those that wraps the text around the image,'imageStyle:breakText'
, which contains thealignBlockLeft
,alignCenter
andalignBlockRight
options, that is, those that breaks the text around the image.
-
DEFAULT_ICONS : Object.<String, String>
module:image/imagestyle/utils~DEFAULT_ICONS
readonly
-
DEFAULT_OPTIONS : Object.<String, ImageStyleOptionDefinition>
module:image/imagestyle/utils~DEFAULT_OPTIONS
readonly
Default image style options provided by the plugin that can be referred in the
styles
configuration.There are available 5 styles focused on formatting:
'alignLeft'
aligns the inline or block image to the left and wraps it with the text using theimage-style-align-left
class,'alignRight'
aligns the inline or block image to the right and wraps it with the text using theimage-style-align-right
class,'alignCenter'
centers the block image using theimage-style-align-center
class,'alignBlockLeft'
aligns the block image to the left using theimage-style-block-align-left
class,'alignBlockRight'
aligns the block image to the right using theimage-style-block-align-right
class,
and 3 semantic styles:
'inline'
is an inline image without any CSS class,'block'
is a block image without any CSS class,'side'
is a block image styled with theimage-style-side
CSS class.
Functions
-
getDefaultDropdownDefinitions( pluginCollection ) → Array.<ImageStyleDropdownDefinition>
module:image/imagestyle/utils~getDefaultDropdownDefinitions
protected
Returns a list of the available predefined drop-downs' definitions depending on the loaded image editing plugins.
-
getDefaultStylesConfiguration( isInlinePluginLoaded, isBlockPluginLoaded ) → Object.<String, Array>
module:image/imagestyle/utils~getDefaultStylesConfiguration
protected
Returns the default image styles configuration depending on the loaded image editing plugins.
Parameters
isInlinePluginLoaded : Boolean
Determines whether the
ImageBlockEditing
plugin has been loaded.isBlockPluginLoaded : Boolean
Determines whether the
ImageInlineEditing
plugin has been loaded.
Returns
Object.<String, Array>
It returns an object with the lists of the image style options and groups defined as strings related to the default options
-
normalizeStyles( config = { config.isInlinePluginLoaded, config.isBlockPluginLoaded, config.configuredStyles } ) → ImageStyleConfig
module:image/imagestyle/utils~normalizeStyles
protected
Returns a list of the normalized and validated image style options.
Parameters
config : Object
-
Properties
config.isInlinePluginLoaded : Boolean
Determines whether the
ImageBlockEditing
plugin has been loaded.config.isBlockPluginLoaded : Boolean
Determines whether the
ImageInlineEditing
plugin has been loaded.config.configuredStyles : ImageStyleConfig
The image styles configuration provided in the image styles configuration as a default or custom value.
Returns
ImageStyleConfig
- Each of options contains a complete icon markup.
- The image style options not supported by any of the loaded plugins are filtered out.
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.