diff --git a/packages/js/email-editor/src/components/block-editor/index.scss b/packages/js/email-editor/src/components/block-editor/index.scss index d6e3b53233..fe60a3efa5 100644 --- a/packages/js/email-editor/src/components/block-editor/index.scss +++ b/packages/js/email-editor/src/components/block-editor/index.scss @@ -66,6 +66,16 @@ } .mailpoet-email-editor__settings-panel { + .mailpoet-settings-panel__richtext { + border: 1px solid var(--wp-components-color-gray-600, #949494); + border-radius: 2px; + box-shadow: transparent 0 0 0; + display: block; + min-height: 80px; + padding: 9px 11px; + width: 100%; + } + .mailpoet-settings-panel__subject .components-base-control__label { width: 100%; diff --git a/packages/js/email-editor/src/components/sidebar/details-panel.tsx b/packages/js/email-editor/src/components/sidebar/details-panel.tsx index d693647387..41f51a4bbd 100644 --- a/packages/js/email-editor/src/components/sidebar/details-panel.tsx +++ b/packages/js/email-editor/src/components/sidebar/details-panel.tsx @@ -1,15 +1,11 @@ -import { - __experimentalText as Text, // eslint-disable-line - ExternalLink, - PanelBody, - TextareaControl, -} from '@wordpress/components'; +import { BaseControl, ExternalLink, PanelBody } from '@wordpress/components'; import { useDispatch } from '@wordpress/data'; import { useEntityProp } from '@wordpress/core-data'; import { __ } from '@wordpress/i18n'; import { createInterpolateElement } from '@wordpress/element'; import classnames from 'classnames'; import { storeName } from '../../store'; +import { RichText } from '@wordpress/block-editor'; const previewTextMaxLength = 150; const previewTextRecommendedLength = 80; @@ -58,6 +54,26 @@ export function DetailsPanel() { const previewTextLength = mailpoetEmailData?.preheader?.length ?? 0; + const preheaderHelp = createInterpolateElement( + __( + 'This text will appear in the inbox, underneath the subject line.', + 'mailpoet' + ), + { + link: ( + // eslint-disable-next-line jsx-a11y/anchor-has-content, jsx-a11y/control-has-associated-label + + ), + } + ); const preheaderLabel = ( <> { __( 'Preview text', 'mailpoet' ) } @@ -82,57 +98,45 @@ export function DetailsPanel() { title={ __( 'Details', 'mailpoet' ) } className="mailpoet-email-editor__settings-panel" > - - updateEmailMailPoetProperty( 'subject', value ) - } - data-automation-id="email_subject" - /> -
- { subjectHelp } -
- - - updateEmailMailPoetProperty( 'preheader', value ) - } - data-automation-id="email_preview_text" - /> -
- - { createInterpolateElement( - __( - 'This text will appear in the inbox, underneath the subject line.', - 'mailpoet' - ), - { - link: ( - // eslint-disable-next-line jsx-a11y/anchor-has-content, jsx-a11y/control-has-associated-label - - ), - } + className="mailpoet-settings-panel__subject" + help={ subjectHelp } + > + -
+ onChange={ ( value ) => + updateEmailMailPoetProperty( 'subject', value ) + } + value={ mailpoetEmailData?.subject ?? '' } + data-automation-id="email_subject" + /> + + + + + updateEmailMailPoetProperty( 'preheader', value ) + } + value={ mailpoetEmailData?.preheader ?? '' } + data-automation-id="email_preview_text" + /> + ); }