Skip to content

Commit

Permalink
Allow the specification of blocks allowed within columns (#35342)
Browse files Browse the repository at this point in the history
* allowedChildBlocks within columns implementation

* Revert "Move to single line"

This reverts commit cf358e6.

* Revert "Remove allowedBlocks prop for column"

This reverts commit 7f9d656.

* Revert "Remove unnessecary line"

This reverts commit c205d34.

* Remove columns allowedChlidBlocks

* Fix columns edit cs

* Update edit.js

* Fix cs

* indentation fix

* fix rebase issues

Co-authored-by: Jesser Hulshof <jesserh16@gmail.com>
  • Loading branch information
aristath and JesserH committed Oct 7, 2021
1 parent fe4c0df commit 03f771b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/block-library/src/column/block.json
Expand Up @@ -13,6 +13,9 @@
"width": {
"type": "string"
},
"allowedBlocks": {
"type": "array"
},
"templateLock": {
"enum": [ "all", "insert", false ]
}
Expand Down
8 changes: 7 additions & 1 deletion packages/block-library/src/column/edit.js
Expand Up @@ -25,7 +25,12 @@ import { useSelect, useDispatch } from '@wordpress/data';
import { sprintf, __ } from '@wordpress/i18n';

function ColumnEdit( {
attributes: { verticalAlignment, width, templateLock = false },
attributes: {
verticalAlignment,
width,
templateLock = false,
allowedBlocks,
},
setAttributes,
clientId,
} ) {
Expand Down Expand Up @@ -92,6 +97,7 @@ function ColumnEdit( {
{ ...blockProps, 'aria-label': label },
{
templateLock,
allowedBlocks,
renderAppender: hasChildBlocks
? undefined
: InnerBlocks.ButtonBlockAppender,
Expand Down

0 comments on commit 03f771b

Please sign in to comment.