Skip to content

Commit

Permalink
Allow more layouts, only align where applicable
Browse files Browse the repository at this point in the history
- Added block layout controls to the Co-Authors block.
- Updated Co-Authors block CSS so the default / flow layout displays co-authors in an inline style suitable for bylines.
- Added context that is passed from Co-Authors block to its descendants so controls only relevant to the inline style can be hidden when using other layouts.
- Removed support for align from the block.json file of the image and avatar blocks, instead adding it manually in the block’s edit.js so it can be omitted when using the defaut layout. When using other layouts the align controls will be removed where not applicable by `useAvailableAlignments`.
  • Loading branch information
douglas-johnson committed Jan 10, 2024
1 parent bf8b4a9 commit bfd1244
Show file tree
Hide file tree
Showing 26 changed files with 301 additions and 214 deletions.
11 changes: 5 additions & 6 deletions build/blocks/block-coauthor-avatar/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
"coauthors"
],
"supports": {
"align": [
"left",
"right",
"center"
],
"html": false,
"__experimentalBorder": {
"color": true,
Expand All @@ -38,7 +33,8 @@
}
},
"usesContext": [
"co-authors-plus/author"
"co-authors-plus/author",
"co-authors-plus/layout"
],
"attributes": {
"size": {
Expand All @@ -54,6 +50,9 @@
},
"verticalAlign": {
"type": "string"
},
"align": {
"type": "string"
}
},
"textdomain": "co-authors-plus",
Expand Down
2 changes: 1 addition & 1 deletion build/blocks/block-coauthor-avatar/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '5778275863c0d5c029a7');
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'b6b841ac8f86f7358245');
2 changes: 1 addition & 1 deletion build/blocks/block-coauthor-avatar/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/blocks/block-coauthor-avatar/style-index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions build/blocks/block-coauthor-image/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
"coauthors"
],
"supports": {
"align": [
"left",
"right",
"center",
"wide",
"full"
],
"__experimentalBorder": {
"color": true,
"radius": true,
Expand All @@ -39,7 +32,8 @@
}
},
"usesContext": [
"co-authors-plus/author"
"co-authors-plus/author",
"co-authors-plus/layout"
],
"attributes": {
"isLink": {
Expand Down Expand Up @@ -67,6 +61,9 @@
},
"verticalAlign": {
"type": "string"
},
"align": {
"type": "string"
}
},
"textdomain": "co-authors-plus",
Expand Down
2 changes: 1 addition & 1 deletion build/blocks/block-coauthor-image/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '2f63fdbfb2b1caab2a26');
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '2c80e74d7ff9efae21e8');
Loading

0 comments on commit bfd1244

Please sign in to comment.