Skip to content

Commit

Permalink
Update deprecation to match last update from trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
renatho committed Oct 22, 2024
1 parent 0ae6273 commit 4b67126
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/block-library/src/cover/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const v8ToV11BlockAttributes = {
},
};

const v12BlockAttributes = {
const v12toV13BlockAttributes = {
...v8ToV11BlockAttributes,
useFeaturedImage: {
type: 'boolean',
Expand All @@ -176,6 +176,13 @@ const v12BlockAttributes = {
},
};

const v14BlockAttributes = {
...v12toV13BlockAttributes,
sizeSlug: {
type: 'string',
},
};

const v7toV11BlockSupports = {
anchor: true,
align: true,
Expand Down Expand Up @@ -246,7 +253,7 @@ const v12BlockSupports = {

// Deprecation for blocks that have z-index.
const v14 = {
attributes: v12BlockAttributes,
attributes: v14BlockAttributes,
supports: v12BlockSupports,
save( { attributes } ) {
const {
Expand All @@ -268,6 +275,7 @@ const v14 = {
minHeight: minHeightProp,
minHeightUnit,
tagName: Tag,
sizeSlug,
} = attributes;
const overlayColorClass = getColorClassName(
'background-color',
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit 4b67126

Please sign in to comment.