From 525916871b4715ab175195ea99718d3c797674ab Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Tue, 2 Feb 2021 10:08:53 +0200 Subject: [PATCH] Add element-selector to group block (#28576) * Add element-selector * Inline in the main return * template-port: inline advanced controls in main return for consistency --- packages/block-library/src/group/edit.js | 43 +++++++++++++++---- .../src/template-part/edit/index.js | 38 ++++++++-------- 2 files changed, 52 insertions(+), 29 deletions(-) diff --git a/packages/block-library/src/group/edit.js b/packages/block-library/src/group/edit.js index 9920b05c334b56..8863007910b2ab 100644 --- a/packages/block-library/src/group/edit.js +++ b/packages/block-library/src/group/edit.js @@ -5,12 +5,17 @@ import { useSelect } from '@wordpress/data'; import { InnerBlocks, useBlockProps, + InspectorAdvancedControls, __experimentalUseInnerBlocksProps as useInnerBlocksProps, } from '@wordpress/block-editor'; -import { __experimentalBoxControl as BoxControl } from '@wordpress/components'; +import { + SelectControl, + __experimentalBoxControl as BoxControl, +} from '@wordpress/components'; +import { __ } from '@wordpress/i18n'; const { __Visualizer: BoxControlVisualizer } = BoxControl; -function GroupEdit( { attributes, clientId } ) { +function GroupEdit( { attributes, setAttributes, clientId } ) { const hasInnerBlocks = useSelect( ( select ) => { const { getBlock } = select( 'core/block-editor' ); @@ -34,13 +39,33 @@ function GroupEdit( { attributes, clientId } ) { ); return ( - - -
- + <> + + )' ), value: 'div' }, + { label: '
', value: 'header' }, + { label: '
', value: 'main' }, + { label: '
', value: 'section' }, + { label: '
', value: 'article' }, + { label: '