-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Buttons block: remove block alignment options.
- Loading branch information
1 parent
60ef323
commit 5174a52
Showing
14 changed files
with
145 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { omit } from 'lodash'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { InnerBlocks } from '@wordpress/block-editor'; | ||
|
||
const deprecated = [ | ||
{ | ||
supports: { | ||
align: true, | ||
alignWide: false, | ||
}, | ||
save() { | ||
return ( | ||
<div> | ||
<InnerBlocks.Content /> | ||
</div> | ||
); | ||
}, | ||
migrate( attributes ) { | ||
return omit( attributes, [ 'align' ] ); | ||
}, | ||
}, | ||
]; | ||
|
||
export default deprecated; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<!-- wp:buttons --> | ||
<div class="wp-block-buttons"> | ||
<!-- wp:button --> | ||
<div class="wp-block-button"><a class="wp-block-button__link">My button 1</a></div> | ||
<div class="wp-block-button"><a class="wp-block-button__link">first</a></div> | ||
<!-- /wp:button --> | ||
|
||
<!-- wp:button --> | ||
<div class="wp-block-button"><a class="wp-block-button__link">My button 2</a></div> | ||
<div class="wp-block-button"><a class="wp-block-button__link">second</a></div> | ||
<!-- /wp:button --> | ||
</div> | ||
<!-- /wp:buttons --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/e2e-tests/fixtures/blocks/core__buttons.serialized.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<!-- wp:buttons --> | ||
<div class="wp-block-buttons"><!-- wp:button --> | ||
<div class="wp-block-button"><a class="wp-block-button__link">My button 1</a></div> | ||
<div class="wp-block-button"><a class="wp-block-button__link">first</a></div> | ||
<!-- /wp:button --> | ||
|
||
<!-- wp:button --> | ||
<div class="wp-block-button"><a class="wp-block-button__link">My button 2</a></div> | ||
<div class="wp-block-button"><a class="wp-block-button__link">second</a></div> | ||
<!-- /wp:button --></div> | ||
<!-- /wp:buttons --> |
11 changes: 11 additions & 0 deletions
11
packages/e2e-tests/fixtures/blocks/core__buttons__deprecated.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- wp:buttons {"align":"center"} --> | ||
<div class="wp-block-buttons aligncenter"> | ||
<!-- wp:button --> | ||
<div class="wp-block-button"><a class="wp-block-button__link">first</a></div> | ||
<!-- /wp:button --> | ||
|
||
<!-- wp:button --> | ||
<div class="wp-block-button"><a class="wp-block-button__link">second</a></div> | ||
<!-- /wp:button --> | ||
</div> | ||
<!-- /wp:buttons --> |
33 changes: 33 additions & 0 deletions
33
packages/e2e-tests/fixtures/blocks/core__buttons__deprecated.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[ | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "core/buttons", | ||
"isValid": true, | ||
"attributes": { | ||
"className": "aligncenter" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "core/button", | ||
"isValid": true, | ||
"attributes": { | ||
"text": "first" | ||
}, | ||
"innerBlocks": [], | ||
"originalContent": "<div class=\"wp-block-button\"><a class=\"wp-block-button__link\">first</a></div>" | ||
}, | ||
{ | ||
"clientId": "_clientId_1", | ||
"name": "core/button", | ||
"isValid": true, | ||
"attributes": { | ||
"text": "second" | ||
}, | ||
"innerBlocks": [], | ||
"originalContent": "<div class=\"wp-block-button\"><a class=\"wp-block-button__link\">second</a></div>" | ||
} | ||
], | ||
"originalContent": "<div class=\"wp-block-buttons aligncenter\">\n\t\n\n\t\n</div>" | ||
} | ||
] |
45 changes: 45 additions & 0 deletions
45
packages/e2e-tests/fixtures/blocks/core__buttons__deprecated.parsed.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
[ | ||
{ | ||
"blockName": "core/buttons", | ||
"attrs": { | ||
"align": "center" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"blockName": "core/button", | ||
"attrs": {}, | ||
"innerBlocks": [], | ||
"innerHTML": "\n\t<div class=\"wp-block-button\"><a class=\"wp-block-button__link\">first</a></div>\n\t", | ||
"innerContent": [ | ||
"\n\t<div class=\"wp-block-button\"><a class=\"wp-block-button__link\">first</a></div>\n\t" | ||
] | ||
}, | ||
{ | ||
"blockName": "core/button", | ||
"attrs": {}, | ||
"innerBlocks": [], | ||
"innerHTML": "\n\t<div class=\"wp-block-button\"><a class=\"wp-block-button__link\">second</a></div>\n\t", | ||
"innerContent": [ | ||
"\n\t<div class=\"wp-block-button\"><a class=\"wp-block-button__link\">second</a></div>\n\t" | ||
] | ||
} | ||
], | ||
"innerHTML": "\n<div class=\"wp-block-buttons aligncenter\">\n\t\n\n\t\n</div>\n", | ||
"innerContent": [ | ||
"\n<div class=\"wp-block-buttons aligncenter\">\n\t", | ||
null, | ||
"\n\n\t", | ||
null, | ||
"\n</div>\n" | ||
] | ||
}, | ||
{ | ||
"blockName": null, | ||
"attrs": {}, | ||
"innerBlocks": [], | ||
"innerHTML": "\n", | ||
"innerContent": [ | ||
"\n" | ||
] | ||
} | ||
] |
9 changes: 9 additions & 0 deletions
9
packages/e2e-tests/fixtures/blocks/core__buttons__deprecated.serialized.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!-- wp:buttons {"className":"aligncenter"} --> | ||
<div class="wp-block-buttons aligncenter"><!-- wp:button --> | ||
<div class="wp-block-button"><a class="wp-block-button__link">first</a></div> | ||
<!-- /wp:button --> | ||
|
||
<!-- wp:button --> | ||
<div class="wp-block-button"><a class="wp-block-button__link">second</a></div> | ||
<!-- /wp:button --></div> | ||
<!-- /wp:buttons --> |
4 changes: 2 additions & 2 deletions
4
packages/e2e-tests/specs/editor/various/__snapshots__/adding-patterns.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters