diff --git a/packages/block-editor/src/components/block-edit/edit.js b/packages/block-editor/src/components/block-edit/edit.js index 84044be7cc60db..ccfeba3496a068 100644 --- a/packages/block-editor/src/components/block-edit/edit.js +++ b/packages/block-editor/src/components/block-edit/edit.js @@ -50,13 +50,8 @@ export const Edit = ( props ) => { // with which a block is displayed. If `blockType` is valid, assign // them preferentially as the render value for the block. const Component = blockType.edit || blockType.save; - const lightBlockWrapper = hasBlockSupport( - blockType, - 'lightBlockWrapper', - false - ); - if ( lightBlockWrapper ) { + if ( blockType.apiVersion >= 1 ) { return ; } diff --git a/packages/block-editor/src/components/block-edit/test/edit.js b/packages/block-editor/src/components/block-edit/test/edit.js index 3e89608bb096e5..f43a17523ba5a7 100644 --- a/packages/block-editor/src/components/block-edit/test/edit.js +++ b/packages/block-editor/src/components/block-edit/test/edit.js @@ -104,12 +104,10 @@ describe( 'Edit', () => { it( 'should assign context', () => { const edit = ( { context } ) => context.value; registerBlockType( 'core/test-block', { + apiVersion: 1, category: 'text', title: 'block title', usesContext: [ 'value' ], - supports: { - lightBlockWrapper: true, - }, edit, save: noop, } ); diff --git a/packages/block-editor/src/components/block-list/block.js b/packages/block-editor/src/components/block-list/block.js index bf915525f872f6..13cab7f95054b1 100644 --- a/packages/block-editor/src/components/block-list/block.js +++ b/packages/block-editor/src/components/block-list/block.js @@ -126,11 +126,7 @@ function BlockListBlock( { const onBlockError = () => setErrorState( true ); const blockType = getBlockType( name ); - const lightBlockWrapper = hasBlockSupport( - blockType, - 'lightBlockWrapper', - false - ); + const lightBlockWrapper = blockType.apiVersion >= 1; const isUnregisteredBlock = name === getUnregisteredTypeHandlerName(); // Determine whether the block has props to apply to the wrapper. diff --git a/packages/block-library/src/audio/block.json b/packages/block-library/src/audio/block.json index 30b165e51cfa0c..b031e3f9ba2d8c 100644 --- a/packages/block-library/src/audio/block.json +++ b/packages/block-library/src/audio/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/audio", "category": "media", "attributes": { @@ -37,7 +38,6 @@ }, "supports": { "anchor": true, - "align": true, - "lightBlockWrapper": true + "align": true } } diff --git a/packages/block-library/src/button/block.json b/packages/block-library/src/button/block.json index 4e44f9d8769eea..e3a2df055aed00 100644 --- a/packages/block-library/src/button/block.json +++ b/packages/block-library/src/button/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/button", "category": "design", "parent": [ @@ -57,7 +58,6 @@ "anchor": true, "align": true, "alignWide": false, - "reusable": false, - "lightBlockWrapper": true + "reusable": false } } diff --git a/packages/block-library/src/buttons/block.json b/packages/block-library/src/buttons/block.json index ce5c22427a8bfc..573edbd8dac7e3 100644 --- a/packages/block-library/src/buttons/block.json +++ b/packages/block-library/src/buttons/block.json @@ -1,10 +1,10 @@ { + "apiVersion": 1, "name": "core/buttons", "category": "design", "supports": { "anchor": true, "align": true, - "alignWide": false, - "lightBlockWrapper": true + "alignWide": false } } diff --git a/packages/block-library/src/code/block.json b/packages/block-library/src/code/block.json index 9b3916f1460f0f..0a28bdc62eed46 100644 --- a/packages/block-library/src/code/block.json +++ b/packages/block-library/src/code/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/code", "category": "text", "attributes": { @@ -9,7 +10,6 @@ } }, "supports": { - "anchor": true, - "lightBlockWrapper": true + "anchor": true } } diff --git a/packages/block-library/src/column/block.json b/packages/block-library/src/column/block.json index bc8d16aa9601c2..3773866ff58b69 100644 --- a/packages/block-library/src/column/block.json +++ b/packages/block-library/src/column/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/column", "category": "text", "parent": [ @@ -17,7 +18,6 @@ "supports": { "anchor": true, "reusable": false, - "html": false, - "lightBlockWrapper": true + "html": false } } diff --git a/packages/block-library/src/columns/block.json b/packages/block-library/src/columns/block.json index 0a84a4a35d7812..0015cfe6229212 100644 --- a/packages/block-library/src/columns/block.json +++ b/packages/block-library/src/columns/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/columns", "category": "design", "attributes": { @@ -13,7 +14,6 @@ "full" ], "html": false, - "lightBlockWrapper": true, "__experimentalColor": { "gradients": true, "linkColor": true diff --git a/packages/block-library/src/cover/block.json b/packages/block-library/src/cover/block.json index 922e7cff034c6c..036218ed009416 100644 --- a/packages/block-library/src/cover/block.json +++ b/packages/block-library/src/cover/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/cover", "category": "media", "attributes": { @@ -49,7 +50,6 @@ "anchor": true, "align": true, "html": false, - "lightBlockWrapper": true, "__experimentalPadding": true } } diff --git a/packages/block-library/src/group/block.json b/packages/block-library/src/group/block.json index a2d0cc083a9f6d..73141fe2781057 100644 --- a/packages/block-library/src/group/block.json +++ b/packages/block-library/src/group/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/group", "category": "design", "attributes": { @@ -14,7 +15,6 @@ ], "anchor": true, "html": false, - "lightBlockWrapper": true, "__experimentalColor": { "gradients": true, "linkColor": true diff --git a/packages/block-library/src/heading/block.json b/packages/block-library/src/heading/block.json index fd03a4487ee5aa..ccfca157bb39a5 100644 --- a/packages/block-library/src/heading/block.json +++ b/packages/block-library/src/heading/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/heading", "category": "text", "attributes": { @@ -22,7 +23,6 @@ "supports": { "anchor": true, "className": false, - "lightBlockWrapper": true, "__experimentalColor": { "linkColor": true }, diff --git a/packages/block-library/src/image/block.json b/packages/block-library/src/image/block.json index 798210cbd5c2f8..3cd9a4f61a42ab 100644 --- a/packages/block-library/src/image/block.json +++ b/packages/block-library/src/image/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/image", "category": "media", "attributes": { @@ -70,7 +71,6 @@ } }, "supports": { - "anchor": true, - "lightBlockWrapper": true + "anchor": true } } diff --git a/packages/block-library/src/list/block.json b/packages/block-library/src/list/block.json index 3fa10c51a1f859..ee29f6f636a1b6 100644 --- a/packages/block-library/src/list/block.json +++ b/packages/block-library/src/list/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/list", "category": "text", "attributes": { @@ -30,7 +31,6 @@ "__experimentalColor": { "gradients": true }, - "__unstablePasteTextInline": true, - "lightBlockWrapper": true + "__unstablePasteTextInline": true } } diff --git a/packages/block-library/src/media-text/block.json b/packages/block-library/src/media-text/block.json index 9911c4d35edc1b..3de52e6861e3d5 100644 --- a/packages/block-library/src/media-text/block.json +++ b/packages/block-library/src/media-text/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/media-text", "category": "media", "attributes": { @@ -84,7 +85,6 @@ "anchor": true, "align": [ "wide", "full" ], "html": false, - "lightBlockWrapper": true, "__experimentalColor": { "gradients": true, "linkColor": true diff --git a/packages/block-library/src/navigation-link/block.json b/packages/block-library/src/navigation-link/block.json index edad7abb6cda7f..4d12106a91bb50 100644 --- a/packages/block-library/src/navigation-link/block.json +++ b/packages/block-library/src/navigation-link/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/navigation-link", "category": "design", "parent": [ "core/navigation" ], @@ -40,7 +41,6 @@ ], "supports": { "reusable": false, - "html": false, - "lightBlockWrapper": true + "html": false } } diff --git a/packages/block-library/src/navigation/block.json b/packages/block-library/src/navigation/block.json index d12d267cf26a1b..ee788fe806c6e1 100644 --- a/packages/block-library/src/navigation/block.json +++ b/packages/block-library/src/navigation/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/navigation", "category": "design", "attributes": { @@ -48,7 +49,6 @@ "anchor": true, "html": false, "inserter": true, - "lightBlockWrapper": true, "__experimentalFontSize": true, "__experimentalColor": { "textColor": true, diff --git a/packages/block-library/src/paragraph/block.json b/packages/block-library/src/paragraph/block.json index 91d8ad357f7ebf..977502cd6f42f1 100644 --- a/packages/block-library/src/paragraph/block.json +++ b/packages/block-library/src/paragraph/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/paragraph", "category": "text", "attributes": { @@ -29,7 +30,6 @@ "supports": { "anchor": true, "className": false, - "lightBlockWrapper": true, "__experimentalColor": { "linkColor": true }, diff --git a/packages/block-library/src/post-author/block.json b/packages/block-library/src/post-author/block.json index 3e788777dec81d..5448cd0c7ddbd3 100644 --- a/packages/block-library/src/post-author/block.json +++ b/packages/block-library/src/post-author/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/post-author", "category": "design", "attributes": { @@ -26,7 +27,6 @@ ], "supports": { "html": false, - "lightBlockWrapper": true, "__experimentalFontSize": true, "__experimentalColor": { "gradients": true, diff --git a/packages/block-library/src/post-comments-count/block.json b/packages/block-library/src/post-comments-count/block.json index 5908f13b721c76..d9bec3cb0964b8 100644 --- a/packages/block-library/src/post-comments-count/block.json +++ b/packages/block-library/src/post-comments-count/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/post-comments-count", "category": "design", "attributes": { @@ -11,7 +12,6 @@ ], "supports": { "html": false, - "lightBlockWrapper": true, "__experimentalColor": { "gradients": true }, diff --git a/packages/block-library/src/post-comments-form/block.json b/packages/block-library/src/post-comments-form/block.json index c0e131b83b231b..27d931feb31e2d 100644 --- a/packages/block-library/src/post-comments-form/block.json +++ b/packages/block-library/src/post-comments-form/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/post-comments-form", "category": "design", "attributes": { @@ -12,7 +13,6 @@ ], "supports": { "html": false, - "lightBlockWrapper": true, "__experimentalColor": { "gradients": true, "linkColor": true diff --git a/packages/block-library/src/post-comments/block.json b/packages/block-library/src/post-comments/block.json index 51dbb5c22dcbcc..489c67c12330a6 100644 --- a/packages/block-library/src/post-comments/block.json +++ b/packages/block-library/src/post-comments/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/post-comments", "category": "design", "attributes": { @@ -12,7 +13,6 @@ ], "supports": { "html": false, - "lightBlockWrapper": true, "align": [ "wide", "full" diff --git a/packages/block-library/src/post-date/block.json b/packages/block-library/src/post-date/block.json index 872bf705c01162..679fbbec936dd1 100644 --- a/packages/block-library/src/post-date/block.json +++ b/packages/block-library/src/post-date/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/post-date", "category": "design", "attributes": { @@ -15,7 +16,6 @@ ], "supports": { "html": false, - "lightBlockWrapper": true, "__experimentalColor": { "gradients": true }, diff --git a/packages/block-library/src/post-excerpt/block.json b/packages/block-library/src/post-excerpt/block.json index 28952d268ff922..7f10168d57d98b 100644 --- a/packages/block-library/src/post-excerpt/block.json +++ b/packages/block-library/src/post-excerpt/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/post-excerpt", "category": "design", "attributes": { @@ -23,7 +24,6 @@ ], "supports": { "html": false, - "lightBlockWrapper": true, "__experimentalFontSize": true, "__experimentalColor": { "gradients": true, diff --git a/packages/block-library/src/post-hierarchical-terms/block.json b/packages/block-library/src/post-hierarchical-terms/block.json index 0afec0b02857af..4a8712297c4e2e 100644 --- a/packages/block-library/src/post-hierarchical-terms/block.json +++ b/packages/block-library/src/post-hierarchical-terms/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/post-hierarchical-terms", "category": "design", "attributes": { @@ -15,7 +16,6 @@ ], "supports": { "html": false, - "lightBlockWrapper": true, "__experimentalFontSize": true, "__experimentalColor": { "gradients": true, diff --git a/packages/block-library/src/post-tags/block.json b/packages/block-library/src/post-tags/block.json index 4b4c95c0b351dc..fca8d0b5e4c842 100644 --- a/packages/block-library/src/post-tags/block.json +++ b/packages/block-library/src/post-tags/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/post-tags", "category": "design", "attributes": { @@ -9,7 +10,6 @@ "usesContext": [ "postId", "postType" ], "supports": { "html": false, - "lightBlockWrapper": true, "__experimentalFontSize": true, "__experimentalColor": { "gradients": true, diff --git a/packages/block-library/src/post-title/block.json b/packages/block-library/src/post-title/block.json index 70cfbdec753be3..1360fa87127d1e 100644 --- a/packages/block-library/src/post-title/block.json +++ b/packages/block-library/src/post-title/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/post-title", "category": "design", "usesContext": [ @@ -29,7 +30,6 @@ }, "supports": { "html": false, - "lightBlockWrapper": true, "__experimentalColor": { "gradients": true }, diff --git a/packages/block-library/src/preformatted/block.json b/packages/block-library/src/preformatted/block.json index 4eb99004f7a0ee..e9d0e9f8265038 100644 --- a/packages/block-library/src/preformatted/block.json +++ b/packages/block-library/src/preformatted/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/preformatted", "category": "text", "attributes": { @@ -11,7 +12,6 @@ } }, "supports": { - "anchor": true, - "lightBlockWrapper": true + "anchor": true } } diff --git a/packages/block-library/src/query-loop/block.json b/packages/block-library/src/query-loop/block.json index abd48e3e8de025..2f9b1f3716f8d1 100644 --- a/packages/block-library/src/query-loop/block.json +++ b/packages/block-library/src/query-loop/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/query-loop", "category": "design", "usesContext": [ @@ -8,7 +9,6 @@ ], "supports": { "reusable": false, - "lightBlockWrapper": true, "html": false } } diff --git a/packages/block-library/src/query/block.json b/packages/block-library/src/query/block.json index 63d489ad0d5525..6bd602b0c11c85 100644 --- a/packages/block-library/src/query/block.json +++ b/packages/block-library/src/query/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/query", "category": "design", "attributes": { @@ -25,7 +26,6 @@ "query": "query" }, "supports": { - "html": false, - "lightBlockWrapper": true + "html": false } } diff --git a/packages/block-library/src/quote/block.json b/packages/block-library/src/quote/block.json index a03b93b0dbf47e..92af6919fa7e4b 100644 --- a/packages/block-library/src/quote/block.json +++ b/packages/block-library/src/quote/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/quote", "category": "text", "attributes": { @@ -20,7 +21,6 @@ } }, "supports": { - "anchor": true, - "lightBlockWrapper": true + "anchor": true } } diff --git a/packages/block-library/src/search/block.json b/packages/block-library/src/search/block.json index 92de1d6f028b34..8c9c732e1c7f8c 100644 --- a/packages/block-library/src/search/block.json +++ b/packages/block-library/src/search/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/search", "category": "widgets", "attributes": { @@ -33,7 +34,6 @@ }, "supports": { "align": [ "left", "center", "right" ], - "html": false, - "lightBlockWrapper": true + "html": false } } diff --git a/packages/block-library/src/site-logo/block.json b/packages/block-library/src/site-logo/block.json index f86b4a22ef363c..425b174b37eab6 100644 --- a/packages/block-library/src/site-logo/block.json +++ b/packages/block-library/src/site-logo/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/site-logo", "category": "layout", "attributes": { @@ -10,7 +11,6 @@ } }, "supports": { - "html": false, - "lightBlockWrapper": true + "html": false } } diff --git a/packages/block-library/src/site-tagline/block.json b/packages/block-library/src/site-tagline/block.json index b0b4d5ab95b0b0..b5b0995d33ac38 100644 --- a/packages/block-library/src/site-tagline/block.json +++ b/packages/block-library/src/site-tagline/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/site-tagline", "category": "design", "attributes": { @@ -8,7 +9,6 @@ }, "supports": { "html": false, - "lightBlockWrapper": true, "__experimentalColor": { "gradients": true }, diff --git a/packages/block-library/src/site-title/block.json b/packages/block-library/src/site-title/block.json index 4817093296629a..cc5befb1928685 100644 --- a/packages/block-library/src/site-title/block.json +++ b/packages/block-library/src/site-title/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/site-title", "category": "design", "attributes": { @@ -12,7 +13,6 @@ }, "supports": { "html": false, - "lightBlockWrapper": true, "__experimentalColor": { "gradients": true }, diff --git a/packages/block-library/src/social-link/block.json b/packages/block-library/src/social-link/block.json index 5539298ec3bede..f708d73bdd0a5b 100644 --- a/packages/block-library/src/social-link/block.json +++ b/packages/block-library/src/social-link/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/social-link", "category": "widgets", "parent": [ @@ -20,7 +21,6 @@ ], "supports": { "reusable": false, - "html": false, - "lightBlockWrapper": true + "html": false } } diff --git a/packages/block-library/src/social-links/block.json b/packages/block-library/src/social-links/block.json index 46a31ce06590c1..74bdb9883951c7 100644 --- a/packages/block-library/src/social-links/block.json +++ b/packages/block-library/src/social-links/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/social-links", "category": "widgets", "attributes": { @@ -16,7 +17,6 @@ "center", "right" ], - "lightBlockWrapper": true, "anchor": true } } diff --git a/packages/block-library/src/template-part/block.json b/packages/block-library/src/template-part/block.json index 839fe03f0759c7..11decf2b39299f 100644 --- a/packages/block-library/src/template-part/block.json +++ b/packages/block-library/src/template-part/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/template-part", "category": "design", "attributes": { @@ -19,7 +20,6 @@ "supports": { "align": true, "html": false, - "lightBlockWrapper": true, "__experimentalColor": { "gradients": true, "linkColor": true diff --git a/packages/block-library/src/verse/block.json b/packages/block-library/src/verse/block.json index 57084b270b0a89..c6f30e44524f56 100644 --- a/packages/block-library/src/verse/block.json +++ b/packages/block-library/src/verse/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/verse", "category": "text", "attributes": { @@ -14,7 +15,6 @@ } }, "supports": { - "anchor": true, - "lightBlockWrapper": true + "anchor": true } } diff --git a/packages/block-library/src/video/block.json b/packages/block-library/src/video/block.json index f35e400362c84a..6d17214e6f9733 100644 --- a/packages/block-library/src/video/block.json +++ b/packages/block-library/src/video/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "core/video", "category": "media", "attributes": { @@ -63,7 +64,6 @@ }, "supports": { "anchor": true, - "align": true, - "lightBlockWrapper": true + "align": true } } diff --git a/phpunit/class-register-block-type-from-metadata-test.php b/phpunit/class-register-block-type-from-metadata-test.php index 63eb031f8ba012..6b4a6d8f063c27 100644 --- a/phpunit/class-register-block-type-from-metadata-test.php +++ b/phpunit/class-register-block-type-from-metadata-test.php @@ -182,8 +182,7 @@ function test_block_registers_with_metadata_fixture() { $this->assertEqualSets( array( 'groupId' ), $result->uses_context ); $this->assertEquals( array( - 'align' => true, - 'lightBlockWrapper' => true, + 'align' => true, ), $result->supports ); diff --git a/phpunit/fixtures/block.json b/phpunit/fixtures/block.json index be4205ce767af2..2e14b1e6ad38ec 100644 --- a/phpunit/fixtures/block.json +++ b/phpunit/fixtures/block.json @@ -1,4 +1,5 @@ { + "apiVersion": 1, "name": "my-plugin/notice", "title": "Notice", "category": "common", @@ -26,8 +27,7 @@ } }, "supports": { - "align": true, - "lightBlockWrapper": true + "align": true }, "styles": [ {