/** * External dependencies */ import classnames from 'classnames'; import ExtendAlignmentToolbar from './aligntoolbar'; import ExtendTagToolbar from './tagtoolbar'; /** * WordPress dependencies */ const { createBlock } = wp.blocks; const { __, } = wp.i18n; const { Component, } = wp.element; const { BlockControls, } = wp.blockEditor; const { RichText } = wp.blockEditor; /** * Component */ class SectionHeadingBlockEdit extends Component { constructor() { super(...arguments); this.state = { tagName: canvasBSHLocalize.sectionHeadingTag }; } render() { const { setAttributes } = this.props; let { className, attributes, } = this.props; const { halign, tag, content, canvasClassName, } = attributes; this.state.tagName = tag ? tag : ''; // If tag default. if ( 'default' === tag || 'none' === tag || ! tag ) { this.state.tagName = canvasBSHLocalize.sectionHeadingTag; } let classAlign = halign ? `halign${halign}` : ''; // If align default. if ( 'default' === halign || 'none' === halign || ! halign ) { classAlign = canvasBSHLocalize.sectionHeadingAlign; } className = classnames( 'cnvs-block-section-heading', classAlign, canvasClassName, className ); return (