font/utils
Constants
-
FONT_BACKGROUND_COLOR : 'fontBackgroundColor'
module:font/utils~FONT_BACKGROUND_COLOR
The name of the font background color plugin.
-
FONT_COLOR : 'fontColor'
module:font/utils~FONT_COLOR
The name of the font color plugin.
-
FONT_FAMILY : 'fontFamily'
module:font/utils~FONT_FAMILY
The name of the font family plugin.
-
FONT_SIZE : 'fontSize'
module:font/utils~FONT_SIZE
The name of the font size plugin.
Type Definitions
-
module:font/utils~FontColorSelectorDropdownView
-
module:font/utils~FontConverterDefinition
Functions
-
addColorSelectorToDropdown( options = { options.colorPickerLabel, options.colorPickerViewConfig, options.colors, options.columns, [options.documentColorsCount], [options.documentColorsLabel], options.dropdownView, options.removeButtonLabel } ) → ColorSelectorView
internalmodule:font/utils~addColorSelectorToDropdown
A helper that adds
ColorSelectorView
to the color dropdown with proper initial values.Parameters
options : object
Configuration options
Propertiesoptions.colorPickerLabel : string
The label for the color picker button.
options.colorPickerViewConfig : false | ColorPickerViewConfig
Configuration of the color picker view.
options.colors : Array<ColorDefinition>
An array with definitions representing colors to be displayed in the color selector.
options.columns : number
The number of columns in the color grid.
[ options.documentColorsCount ] : number
The number of document colors inside the dropdown.
[ options.documentColorsLabel ] : string
The label for the section with document colors.
options.dropdownView : FontColorSelectorDropdownView
The dropdown view to which a
ColorSelectorView
will be added.options.removeButtonLabel : string
The label for the button responsible for removing the color.
Returns
ColorSelectorView
The new color selector view.
-
buildDefinition( modelAttributeKey, options ) → FontConverterDefinition
internalmodule:font/utils~buildDefinition
Builds a proper converter definition out of input data.
Parameters
modelAttributeKey : string
options : Array<FontFamilyOption> | Array<FontSizeOption>
Returns
-
renderDowncastElement( styleAttr ) → ( modelAttributeValue: string, __namedParameters: DowncastConversionApi ) => ViewAttributeElement
internalmodule:font/utils~renderDowncastElement
A font color and font background color helper responsible for downcasting a color attribute to a
<span>
element.Note: The
styleAttr
parameter should be either'color'
or'background-color'
.Parameters
styleAttr : string
Returns
( modelAttributeValue: string, __namedParameters: DowncastConversionApi ) => ViewAttributeElement
-
renderUpcastAttribute( styleAttr ) → ( viewElement: ViewElement ) => string
internalmodule:font/utils~renderUpcastAttribute
A font color and font background color helper responsible for upcasting data to the model.
Note: The
styleAttr
parameter should be either'color'
or'background-color'
.Parameters
styleAttr : string
Returns
( viewElement: ViewElement ) => string