From 4b671267d230fce41a7443e1ecc33ed2dc054009 Mon Sep 17 00:00:00 2001 From: Renatho De Carli Rosa Date: Tue, 22 Oct 2024 18:20:35 -0300 Subject: [PATCH] Update deprecation to match last update from trunk --- packages/block-library/src/cover/deprecated.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/cover/deprecated.js b/packages/block-library/src/cover/deprecated.js index 28e67a53caf34e..677ad098fd01e4 100644 --- a/packages/block-library/src/cover/deprecated.js +++ b/packages/block-library/src/cover/deprecated.js @@ -164,7 +164,7 @@ const v8ToV11BlockAttributes = { }, }; -const v12BlockAttributes = { +const v12toV13BlockAttributes = { ...v8ToV11BlockAttributes, useFeaturedImage: { type: 'boolean', @@ -176,6 +176,13 @@ const v12BlockAttributes = { }, }; +const v14BlockAttributes = { + ...v12toV13BlockAttributes, + sizeSlug: { + type: 'string', + }, +}; + const v7toV11BlockSupports = { anchor: true, align: true, @@ -246,7 +253,7 @@ const v12BlockSupports = { // Deprecation for blocks that have z-index. const v14 = { - attributes: v12BlockAttributes, + attributes: v14BlockAttributes, supports: v12BlockSupports, save( { attributes } ) { const { @@ -268,6 +275,7 @@ const v14 = { minHeight: minHeightProp, minHeightUnit, tagName: Tag, + sizeSlug, } = attributes; const overlayColorClass = getColorClassName( 'background-color', @@ -320,6 +328,7 @@ const v14 = { 'wp-block-cover__image-background', id ? `wp-image-${ id }` : null, { + [ `size-${ sizeSlug }` ]: sizeSlug, 'has-parallax': hasParallax, 'is-repeated': isRepeated, } @@ -397,7 +406,7 @@ const v14 = { // Deprecation for blocks that does not have the aria-label when the image background is fixed or repeated. const v13 = { - attributes: v12BlockAttributes, + attributes: v12toV13BlockAttributes, supports: v12BlockSupports, save( { attributes } ) { const { @@ -547,7 +556,7 @@ const v13 = { // Deprecation for blocks to prevent auto overlay color from overriding previously set values. const v12 = { - attributes: v12BlockAttributes, + attributes: v12toV13BlockAttributes, supports: v12BlockSupports, isEligible( attributes ) { return (