From cc9ccfb326596a891064b241cdfdc009ecc64765 Mon Sep 17 00:00:00 2001 From: yogeshbhutkar Date: Mon, 24 Feb 2025 15:30:02 +0530 Subject: [PATCH] feat: add `blockGap` support to `Comment Template` --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/comment-template/block.json | 6 +++++- packages/block-library/src/comment-template/edit.js | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 6a8f3255297c46..40197c8dd34274 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -178,7 +178,7 @@ Contains the block elements used to display a comment, like the title, date, aut - **Name:** core/comment-template - **Category:** design - **Parent:** core/comments -- **Supports:** align, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, interactivity (clientNavigation), layout, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ ## Comments diff --git a/packages/block-library/src/comment-template/block.json b/packages/block-library/src/comment-template/block.json index 08fd591b42409b..f20aba0fbf285b 100644 --- a/packages/block-library/src/comment-template/block.json +++ b/packages/block-library/src/comment-template/block.json @@ -12,9 +12,13 @@ "align": true, "html": false, "reusable": false, + "layout": true, "spacing": { "margin": true, - "padding": true + "padding": true, + "blockGap": { + "__experimentalDefault": "1.25em" + } }, "typography": { "fontSize": true, diff --git a/packages/block-library/src/comment-template/edit.js b/packages/block-library/src/comment-template/edit.js index 038583e68c85cb..0f57fe289dc872 100644 --- a/packages/block-library/src/comment-template/edit.js +++ b/packages/block-library/src/comment-template/edit.js @@ -116,7 +116,7 @@ function CommentTemplateInnerBlocks( { } ) { const { children, ...innerBlocksProps } = useInnerBlocksProps( {}, - { template: TEMPLATE } + { template: TEMPLATE, __unstableDisableLayoutClassNames: true } ); return ( @@ -241,8 +241,9 @@ const CommentsList = ( { export default function CommentTemplateEdit( { clientId, context: { postId }, + __unstableLayoutClassNames: layoutClassNames, } ) { - const blockProps = useBlockProps(); + const blockProps = useBlockProps( { className: layoutClassNames } ); const [ activeCommentId, setActiveCommentId ] = useState(); const {