diff --git a/packages/block-library/src/cover/index.js b/packages/block-library/src/cover/index.js index 09df032d9418d..b1ceb293c336f 100644 --- a/packages/block-library/src/cover/index.js +++ b/packages/block-library/src/cover/index.js @@ -23,7 +23,6 @@ import { compose } from '@wordpress/compose'; import { BlockControls, InspectorControls, - BlockAlignmentToolbar, MediaPlaceholder, MediaUpload, MediaUploadCheck, @@ -34,8 +33,6 @@ import { getColorClassName, } from '@wordpress/editor'; -const validAlignments = [ 'left', 'center', 'right', 'wide', 'full' ]; - const blockAttributes = { title: { type: 'string', @@ -45,9 +42,6 @@ const blockAttributes = { url: { type: 'string', }, - align: { - type: 'string', - }, contentAlign: { type: 'string', default: 'center', @@ -92,6 +86,10 @@ export const settings = { attributes: blockAttributes, + supports: { + align: true, + }, + transforms: { from: [ { @@ -168,20 +166,12 @@ export const settings = { ], }, - getEditWrapperProps( attributes ) { - const { align } = attributes; - if ( -1 !== validAlignments.indexOf( align ) ) { - return { 'data-align': align }; - } - }, - edit: compose( [ withColors( { overlayColor: 'background-color' } ), withNotices, ] )( ( { attributes, setAttributes, isSelected, className, noticeOperations, noticeUI, overlayColor, setOverlayColor } ) => { const { - align, backgroundType, contentAlign, dimRatio, @@ -190,7 +180,6 @@ export const settings = { title, url, } = attributes; - const updateAlignment = ( nextAlign ) => setAttributes( { align: nextAlign } ); const onSelectMedia = ( media ) => { if ( ! media || ! media.url ) { setAttributes( { url: undefined, id: undefined } ); @@ -238,10 +227,6 @@ export const settings = { const controls = ( - { !! url && (