From 064b879feec21ec3d019274b9ade0f8a279b38ab Mon Sep 17 00:00:00 2001 From: tomoki shimomura Date: Fri, 17 Jan 2025 13:24:16 +0900 Subject: [PATCH 1/3] Post Content add heading color support (#67783) Co-authored-by: shimotmk Co-authored-by: aaronrobertshaw --- docs/reference-guides/core-blocks.md | 2 +- packages/block-library/src/post-content/block.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 3b251813e41c0..820f0afccc2b5 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -616,7 +616,7 @@ Displays the contents of a post or page. ([Source](https://github.com/WordPress/ - **Name:** core/post-content - **Category:** theme -- **Supports:** align (full, wide), background (backgroundImage, backgroundSize), color (background, gradients, link, text), dimensions (minHeight), layout, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), background (backgroundImage, backgroundSize), color (background, gradients, heading, link, text), dimensions (minHeight), layout, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ ## Date diff --git a/packages/block-library/src/post-content/block.json b/packages/block-library/src/post-content/block.json index e5d455b97a8a3..1348cb296af08 100644 --- a/packages/block-library/src/post-content/block.json +++ b/packages/block-library/src/post-content/block.json @@ -35,6 +35,7 @@ }, "color": { "gradients": true, + "heading": true, "link": true, "__experimentalDefaultControls": { "background": false, From 4b60f9ececa96ba51d9cae4d6d7a9a1311d8b9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20K=C3=A4gy?= Date: Fri, 17 Jan 2025 07:04:29 +0100 Subject: [PATCH 2/3] Fix: Add `rel="tag"` to individual anchor links in editor markup of the post terms block (#68722) Co-authored-by: fabiankaegy Co-authored-by: Mamaduka --- packages/block-library/src/post-terms/edit.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/block-library/src/post-terms/edit.js b/packages/block-library/src/post-terms/edit.js index 13d5b61ad13d6..802e5ab5898b4 100644 --- a/packages/block-library/src/post-terms/edit.js +++ b/packages/block-library/src/post-terms/edit.js @@ -122,6 +122,7 @@ export default function PostTermsEdit( { key={ postTerm.id } href={ postTerm.link } onClick={ ( event ) => event.preventDefault() } + rel="tag" > { decodeEntities( postTerm.name ) } From aec60be54dfeb45191bbf3bb4b284a486303da23 Mon Sep 17 00:00:00 2001 From: Benazeer Hassan <66269472+benazeer-ben@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:04:49 +0530 Subject: [PATCH 3/3] Search Block: Refactoring settings panel (#67907) * Refactoring settings panel * Feedback changes * Feedback changes * Update packages/block-library/src/search/edit.js Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * Update packages/block-library/src/search/edit.js Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * Update packages/block-library/src/search/edit.js Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * Feedback changes * Final Suggestion change --------- Co-authored-by: benazeer-ben Co-authored-by: fabiankaegy Co-authored-by: t-hamano --- packages/block-library/src/search/edit.js | 173 +++++++++++++--------- 1 file changed, 99 insertions(+), 74 deletions(-) diff --git a/packages/block-library/src/search/edit.js b/packages/block-library/src/search/edit.js index ed8edf4a5aca8..16eb62daa6abb 100644 --- a/packages/block-library/src/search/edit.js +++ b/packages/block-library/src/search/edit.js @@ -25,12 +25,13 @@ import { ToolbarGroup, ToolbarButton, ResizableBox, - PanelBody, - __experimentalVStack as VStack, __experimentalUseCustomUnits as useCustomUnits, __experimentalUnitControl as UnitControl, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, + __experimentalToolsPanel as ToolsPanel, + __experimentalToolsPanelItem as ToolsPanelItem, + __experimentalVStack as VStack, } from '@wordpress/components'; import { useInstanceId } from '@wordpress/compose'; import { Icon, search } from '@wordpress/icons'; @@ -54,6 +55,7 @@ import { MIN_WIDTH, isPercentageUnit, } from './utils.js'; +import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; // Used to calculate border radius adjustment to avoid "fat" corners when // button is placed inside wrapper. @@ -370,6 +372,7 @@ export default function SearchEdit( { ); }; + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const controls = ( <> @@ -408,79 +411,101 @@ export default function SearchEdit( { - - { + setAttributes( { + width: undefined, + widthUnit: undefined, + } ); + } } + dropdownMenuProps={ dropdownMenuProps } + > + !! width } + label={ __( 'Width' ) } + onDeselect={ () => { + setAttributes( { + width: undefined, + widthUnit: undefined, + } ); + } } + isShownByDefault > - { - const parsedNewWidth = - newWidth === '' - ? undefined - : parseInt( newWidth, 10 ); - setAttributes( { - width: parsedNewWidth, - } ); - } } - onUnitChange={ ( newUnit ) => { - setAttributes( { - width: - '%' === newUnit - ? PC_WIDTH_DEFAULT - : PX_WIDTH_DEFAULT, - widthUnit: newUnit, - } ); - } } - __unstableInputWidth="80px" - value={ `${ width }${ widthUnit }` } - units={ units } - /> - { - setAttributes( { - width: newWidth, - widthUnit: '%', - } ); - } } - isBlock - __next40pxDefaultSize - __nextHasNoMarginBottom - > - { PERCENTAGE_WIDTHS.map( ( widthValue ) => { - return ( - - ); - } ) } - - - + + { + const parsedNewWidth = + newWidth === '' + ? undefined + : parseInt( newWidth, 10 ); + setAttributes( { + width: parsedNewWidth, + } ); + } } + onUnitChange={ ( newUnit ) => { + setAttributes( { + width: + '%' === newUnit + ? PC_WIDTH_DEFAULT + : PX_WIDTH_DEFAULT, + widthUnit: newUnit, + } ); + } } + __unstableInputWidth="80px" + value={ `${ width }${ widthUnit }` } + units={ units } + /> + { + setAttributes( { + width: newWidth, + widthUnit: '%', + } ); + } } + isBlock + __next40pxDefaultSize + __nextHasNoMarginBottom + > + { PERCENTAGE_WIDTHS.map( ( widthValue ) => { + return ( + + ); + } ) } + + + + );