diff --git a/packages/block-library/CHANGELOG.md b/packages/block-library/CHANGELOG.md index 3a0624b02baa1f..29cb6c7cfd2517 100644 --- a/packages/block-library/CHANGELOG.md +++ b/packages/block-library/CHANGELOG.md @@ -6,6 +6,10 @@ - Allow setting the `crossOrigin` attribute so the `useTransformImage` hook can use cross-origin sources ([#28255](https://github.com/WordPress/gutenberg/pull/28255/)). +### Bug Fixes + +- Fix a regression where the Cover block migration would not work with custom units for `minHeight` ([#28627](https://github.com/WordPress/gutenberg/pull/28627)) + ## 2.27.0 (2020-12-17) ### Enhancement diff --git a/packages/block-library/src/cover/deprecated.js b/packages/block-library/src/cover/deprecated.js index b214f3e0ce3ae0..a3bab8926aba56 100644 --- a/packages/block-library/src/cover/deprecated.js +++ b/packages/block-library/src/cover/deprecated.js @@ -79,6 +79,9 @@ const deprecated = [ minHeight: { type: 'number', }, + minHeightUnit: { + type: 'string', + }, gradient: { type: 'string', }, diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html index 00094d59af0fa8..79f8a553b77af0 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.html @@ -12,3 +12,15 @@ + +
+
+ +

+ +
+
+ diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json index 4709d0adb36708..5a2d306553d614 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json @@ -29,5 +29,41 @@ } ], "originalContent": "\n\t
\n\t\t\n\t
\n" + }, + { + "clientId": "_clientId_1", + "name": "core/cover", + "isValid": true, + "attributes": { + "url": "https://example.com/some-background-image.png", + "id": 1933, + "hasParallax": false, + "dimRatio": 0, + "backgroundType": "image", + "focalPoint": { + "x": "0.50", + "y": "0.40" + }, + "title": "", + "contentAlign": "center", + "isRepeated": false, + "minHeight": 48, + "minHeightUnit": "vw", + "className": "alignfull" + }, + "innerBlocks": [ + { + "clientId": "_clientId_0", + "name": "core/paragraph", + "isValid": true, + "attributes": { + "content": "", + "dropCap": false + }, + "innerBlocks": [], + "originalContent": "

" + } + ], + "originalContent": "\n\t
\n\t\t\n\t
\n" } ] diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json index c38b616c41d0d7..cb1f14786bf34e 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.parsed.json @@ -27,6 +27,47 @@ "\n\t\n\n" ] }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + }, + { + "blockName": "core/cover", + "attrs": { + "url": "https://example.com/some-background-image.png", + "id": 1933, + "dimRatio": 0, + "focalPoint": { + "x": "0.50", + "y": "0.40" + }, + "minHeight": 48, + "minHeightUnit": "vw", + "align": "full" + }, + "innerBlocks": [ + { + "blockName": "core/paragraph", + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n\t\t

\n\t\t", + "innerContent": [ + "\n\t\t

\n\t\t" + ] + } + ], + "innerHTML": "\n\n\t
\n\t\t\n\t
\n\n", + "innerContent": [ + "\n\n\t
\n\t\t", + null, + "\n\t
\n\n" + ] + }, { "blockName": null, "attrs": {}, diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html index b9dfae00e3e660..f079f578eca39d 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.serialized.html @@ -5,3 +5,9 @@

+ + +
+

+
+