Rich Text
Edit
Namespace: core/rich-text
.
Selectors
getFormatType
Returns a format type by name.
Parameters
- state
Object
: Data state. - name
string
: Format type name.
Returns
Object?
: Format type.
getFormatTypeForBareElement
Gets the format type, if any, that can handle a bare element (without a
data-format-type attribute), given the tag name of this element.
Parameters
- state
Object
: Data state. - bareElementTagName
string
: The tag name of the element to find a format type for.
Returns
?Object
: Format type.
getFormatTypeForClassName
Gets the format type, if any, that can handle an element, given its classes.
Parameters
- state
Object
: Data state. - elementClassName
string
: The classes of the element to find a format type for.
Returns
?Object
: Format type.
getFormatTypes
Returns all the available format types.
Parameters
- state
Object
: Data state.
Returns
Array
: Format types.
Actions
addFormatTypes
Returns an action object used in signalling that format types have been
added.
Parameters
- formatTypes
Array|Object
: Format types received.
Returns
Object
: Action object.
removeFormatTypes
Returns an action object used to remove a registered format type.
Parameters
- names
string|Array
: Format name.
Returns
Object
: Action object.