diff --git a/bin/api-docs/gen-block-lib-list.js b/bin/api-docs/gen-block-lib-list.js index 5595265e686b3f..0c79def1989992 100644 --- a/bin/api-docs/gen-block-lib-list.js +++ b/bin/api-docs/gen-block-lib-list.js @@ -156,6 +156,7 @@ function readBlockJSON( filename ) { parent, ancestor, __experimental, + allowedBlocks, } = blockjson; const sourcefile = getSourceFromFile( filename ); const blockInfoList = [ `- **Name:** ${ name }` ]; @@ -172,6 +173,11 @@ function readBlockJSON( filename ) { if ( ancestor?.length > 0 ) { blockInfoList.push( `- **Ancestor:** ${ ancestor.join( ', ' ) }` ); } + if ( allowedBlocks?.length > 0 ) { + blockInfoList.push( + `- **Allowed Blocks:** ${ allowedBlocks.join( ', ' ) }` + ); + } if ( supports ) { blockInfoList.push( `- **Supports:** ${ processObjWithInnerKeys( diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 9376badd212514..ca6b5529f81423 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -60,6 +60,7 @@ Prompt visitors to take action with a group of button-style links. ([Source](htt - **Name:** core/buttons - **Category:** design +- **Allowed Blocks:** core/button - **Supports:** align (full, wide), anchor, interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), spacing (blockGap, margin), typography (fontSize, lineHeight), ~~html~~ ## Calendar @@ -105,6 +106,7 @@ Display content in multiple columns, with blocks added to each column. ([Source] - **Name:** core/columns - **Category:** design +- **Allowed Blocks:** core/column - **Supports:** align (full, wide), anchor, color (background, button, gradients, heading, link, text), interactivity (clientNavigation), layout (default, ~~allowEditing~~, ~~allowInheriting~~, ~~allowSwitching~~), shadow, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isStackedOnMobile, templateLock, verticalAlignment @@ -194,6 +196,7 @@ Displays a paginated navigation to next/previous set of comments, when applicabl - **Name:** core/comments-pagination - **Category:** theme - **Parent:** core/comments +- **Allowed Blocks:** core/comments-pagination-previous, core/comments-pagination-numbers, core/comments-pagination-next - **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** paginationArrow @@ -287,6 +290,7 @@ A form. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/blo - **Name:** core/form - **Experimental:** true - **Category:** common +- **Allowed Blocks:** core/paragraph, core/heading, core/form-input, core/form-submit-button, core/form-submission-notification, core/group, core/columns - **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ - **Attributes:** action, email, method, submissionMethod @@ -319,6 +323,7 @@ A submission button for forms. ([Source](https://github.com/WordPress/gutenberg/ - **Experimental:** true - **Category:** common - **Ancestor:** core/form +- **Allowed Blocks:** core/buttons, core/button ## Classic @@ -335,6 +340,7 @@ Display multiple images in a rich gallery. ([Source](https://github.com/WordPres - **Name:** core/gallery - **Category:** media +- **Allowed Blocks:** core/image - **Supports:** align, anchor, color (background, gradients, ~~text~~), interactivity (clientNavigation), layout (default, ~~allowEditing~~, ~~allowInheriting~~, ~~allowSwitching~~), spacing (blockGap, margin, padding), units (em, px, rem, vh, vw), ~~html~~ - **Attributes:** allowResize, caption, columns, fixedHeight, ids, imageCrop, images, linkTarget, linkTo, randomOrder, shortCodeTransforms, sizeSlug @@ -408,6 +414,7 @@ Create a bulleted or numbered list. ([Source](https://github.com/WordPress/guten - **Name:** core/list - **Category:** text +- **Allowed Blocks:** core/list-item - **Supports:** __unstablePasteTextInline, anchor, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ - **Attributes:** ordered, placeholder, reversed, start, type, values @@ -418,6 +425,7 @@ Create a list item. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/ - **Name:** core/list-item - **Category:** text - **Parent:** core/list +- **Allowed Blocks:** core/list - **Supports:** interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ - **Attributes:** content, placeholder @@ -463,6 +471,7 @@ A collection of blocks that allow visitors to get around your site. ([Source](ht - **Name:** core/navigation - **Category:** theme +- **Allowed Blocks:** core/navigation-link, core/search, core/social-links, core/page-list, core/spacer, core/home-link, core/site-title, core/site-logo, core/navigation-submenu, core/loginout, core/buttons - **Supports:** align (full, wide), ariaLabel, inserter, interactivity, layout (allowSizingOnChildren, default, ~~allowInheriting~~, ~~allowSwitching~~, ~~allowVerticalAlignment~~), spacing (blockGap, units), typography (fontSize, lineHeight), ~~html~~, ~~renaming~~ - **Attributes:** __unstableLocation, backgroundColor, customBackgroundColor, customOverlayBackgroundColor, customOverlayTextColor, customTextColor, hasIcon, icon, maxNestingLevel, openSubmenusOnClick, overlayBackgroundColor, overlayMenu, overlayTextColor, ref, rgbBackgroundColor, rgbTextColor, showSubmenuIcon, templateLock, textColor @@ -473,6 +482,7 @@ Add a page, link, or another item to your navigation. ([Source](https://github.c - **Name:** core/navigation-link - **Category:** design - **Parent:** core/navigation +- **Allowed Blocks:** core/navigation-link, core/navigation-submenu, core/page-list - **Supports:** interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~renaming~~, ~~reusable~~ - **Attributes:** description, id, isTopLevelLink, kind, label, opensInNewTab, rel, title, type, url @@ -501,6 +511,7 @@ Display a list of all pages. ([Source](https://github.com/WordPress/gutenberg/tr - **Name:** core/page-list - **Category:** widgets +- **Allowed Blocks:** core/page-list-item - **Supports:** interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** isNested, parentPageID @@ -566,6 +577,7 @@ This block is deprecated. Please use the Comments block instead. ([Source](https - **Name:** core/post-comment - **Experimental:** fse - **Category:** theme +- **Allowed Blocks:** core/avatar, core/comment-author-name, core/comment-content, core/comment-date, core/comment-edit-link, core/comment-reply-link - **Supports:** interactivity (clientNavigation), ~~html~~, ~~inserter~~ - **Attributes:** commentId @@ -722,6 +734,7 @@ Displays a paginated navigation to next/previous set of posts, when applicable. - **Name:** core/query-pagination - **Category:** theme - **Ancestor:** core/query +- **Allowed Blocks:** core/query-pagination-previous, core/query-pagination-numbers, core/query-pagination-next - **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** paginationArrow, showLabel @@ -861,6 +874,7 @@ Display icons linking to your social media profiles or sites. ([Source](https:// - **Name:** core/social-links - **Category:** widgets +- **Allowed Blocks:** core/social-link - **Supports:** align (center, left, right), anchor, color (background, gradients, ~~enableContrastChecker~~, ~~text~~), interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~, ~~allowVerticalAlignment~~), spacing (blockGap, margin, padding, units) - **Attributes:** customIconBackgroundColor, customIconColor, iconBackgroundColor, iconBackgroundColorValue, iconColor, iconColorValue, openInNewTab, showLabels, size