From 80df07c65b09ccd1f39ce575943dc043666a3f34 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Thu, 13 Apr 2023 13:21:59 -0400 Subject: [PATCH 1/9] Try innerblocks based details block --- docs/reference-guides/core-blocks.md | 24 ++------- lib/blocks.php | 2 - .../src/details-content/block.json | 50 ----------------- .../block-library/src/details-content/edit.js | 29 ---------- .../src/details-content/index.js | 23 -------- .../block-library/src/details-content/save.js | 12 ----- .../src/details-summary/block.json | 53 ------------------- .../block-library/src/details-summary/edit.js | 27 ---------- .../src/details-summary/editor.scss | 3 -- .../src/details-summary/index.js | 23 -------- .../block-library/src/details-summary/save.js | 13 ----- .../src/details-summary/style.scss | 3 -- packages/block-library/src/details/block.json | 18 ++++--- packages/block-library/src/details/edit.js | 32 +++++++++-- .../block-library/src/details/editor.scss | 3 ++ packages/block-library/src/details/index.js | 15 ++++-- packages/block-library/src/details/save.js | 7 ++- packages/block-library/src/details/style.scss | 12 +++++ packages/block-library/src/editor.scss | 2 +- packages/block-library/src/index.js | 4 -- packages/block-library/src/style.scss | 1 - packages/icons/src/library/details.js | 10 ++-- 22 files changed, 77 insertions(+), 289 deletions(-) delete mode 100644 packages/block-library/src/details-content/block.json delete mode 100644 packages/block-library/src/details-content/edit.js delete mode 100644 packages/block-library/src/details-content/index.js delete mode 100644 packages/block-library/src/details-content/save.js delete mode 100644 packages/block-library/src/details-summary/block.json delete mode 100644 packages/block-library/src/details-summary/edit.js delete mode 100644 packages/block-library/src/details-summary/editor.scss delete mode 100644 packages/block-library/src/details-summary/index.js delete mode 100644 packages/block-library/src/details-summary/save.js delete mode 100644 packages/block-library/src/details-summary/style.scss create mode 100644 packages/block-library/src/details/editor.scss diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 34eebc7bb25bd..8cd38f72d3f39 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -235,30 +235,12 @@ Add an image or video with a text overlay — great for headers. ([Source](https ## Details -A block that displays a summary and shows or hides additional content. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/details)) +Hide and show additional content. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/details)) - **Name:** core/details - **Category:** text -- **Supports:** align, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ -- **Attributes:** showContent - -## Details Content - -Add content that may be shown or hidden via a Details block. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/details-content)) - -- **Name:** core/details-content -- **Category:** text -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~align~~, ~~html~~, ~~lock~~, ~~multiple~~, ~~reusable~~ -- **Attributes:** - -## Details Summary - -Provide summary text used to toggle the display of content inside a Details block. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/details-summary)) - -- **Name:** core/details-summary -- **Category:** text -- **Supports:** color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~align~~, ~~html~~, ~~lock~~, ~~multiple~~, ~~reusable~~ -- **Attributes:** summary +- **Supports:** align (full, wide), color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Attributes:** showContent, summary ## Embed diff --git a/lib/blocks.php b/lib/blocks.php index f7ad8a11c88d9..5d7cb3e4eb5e8 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -23,8 +23,6 @@ function gutenberg_reregister_core_block_types() { 'columns', 'comments', 'details', - 'details-content', - 'details-summary', 'group', 'html', 'list', diff --git a/packages/block-library/src/details-content/block.json b/packages/block-library/src/details-content/block.json deleted file mode 100644 index 4a990cb37d453..0000000000000 --- a/packages/block-library/src/details-content/block.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "__experimental": true, - "name": "core/details-content", - "title": "Details Content", - "category": "text", - "parent": [ "core/details" ], - "description": "Add content that may be shown or hidden via a Details block.", - "textdomain": "default", - "supports": { - "align": false, - "color": { - "gradients": true, - "link": true, - "__experimentalDefaultControls": { - "background": true, - "text": true, - "link": true - } - }, - "__experimentalBorder": { - "radius": true, - "color": true, - "width": true, - "style": true - }, - "html": false, - "lock": false, - "multiple": false, - "reusable": false, - "spacing": { - "margin": true, - "padding": true - }, - "typography": { - "fontSize": true, - "lineHeight": true, - "__experimentalFontFamily": true, - "__experimentalFontWeight": true, - "__experimentalFontStyle": true, - "__experimentalTextTransform": true, - "__experimentalTextDecoration": true, - "__experimentalLetterSpacing": true, - "__experimentalDefaultControls": { - "fontSize": true - } - } - } -} diff --git a/packages/block-library/src/details-content/edit.js b/packages/block-library/src/details-content/edit.js deleted file mode 100644 index a4e0c71109274..0000000000000 --- a/packages/block-library/src/details-content/edit.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * WordPress dependencies - */ -import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor'; -import { __ } from '@wordpress/i18n'; -import { View } from '@wordpress/primitives'; - -const TEMPLATE = [ - [ - 'core/paragraph', - { - placeholder: __( - 'Add text or blocks that will display when the details block is opened.' - ), - }, - ], -]; - -function DetailsContentEdit() { - const blockProps = useBlockProps(); - const innerBlocksProps = useInnerBlocksProps( blockProps, { - template: TEMPLATE, - templateLock: false, - } ); - - return ; -} - -export default DetailsContentEdit; diff --git a/packages/block-library/src/details-content/index.js b/packages/block-library/src/details-content/index.js deleted file mode 100644 index 1c7dbeaf193ad..0000000000000 --- a/packages/block-library/src/details-content/index.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * WordPress dependencies - */ -import { postContent as icon } from '@wordpress/icons'; - -/** - * Internal dependencies - */ -import initBlock from '../utils/init-block'; -import metadata from './block.json'; -import edit from './edit'; -import save from './save'; - -const { name } = metadata; -export { metadata, name }; - -export const settings = { - icon, - save, - edit, -}; - -export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/details-content/save.js b/packages/block-library/src/details-content/save.js deleted file mode 100644 index fe3f0641b1b22..0000000000000 --- a/packages/block-library/src/details-content/save.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * WordPress dependencies - */ -import { useBlockProps, InnerBlocks } from '@wordpress/block-editor'; -export default function save() { - const blockProps = useBlockProps.save(); - return ( -
- -
- ); -} diff --git a/packages/block-library/src/details-summary/block.json b/packages/block-library/src/details-summary/block.json deleted file mode 100644 index 314873e453667..0000000000000 --- a/packages/block-library/src/details-summary/block.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "__experimental": true, - "name": "core/details-summary", - "title": "Details Summary", - "category": "text", - "parent": [ "core/details" ], - "description": "Provide summary text used to toggle the display of content inside a Details block.", - "textdomain": "default", - "attributes": { - "summary": { - "type": "string" - } - }, - "supports": { - "align": false, - "color": { - "gradients": true, - "__experimentalDefaultControls": { - "background": true, - "text": true - } - }, - "__experimentalBorder": { - "radius": true, - "color": true, - "width": true, - "style": true - }, - "html": false, - "lock": false, - "multiple": false, - "reusable": false, - "spacing": { - "margin": true, - "padding": true - }, - "typography": { - "fontSize": true, - "lineHeight": true, - "__experimentalFontFamily": true, - "__experimentalFontWeight": true, - "__experimentalFontStyle": true, - "__experimentalTextTransform": true, - "__experimentalTextDecoration": true, - "__experimentalLetterSpacing": true, - "__experimentalDefaultControls": { - "fontSize": true - } - } - } -} diff --git a/packages/block-library/src/details-summary/edit.js b/packages/block-library/src/details-summary/edit.js deleted file mode 100644 index 9e091382ab211..0000000000000 --- a/packages/block-library/src/details-summary/edit.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * WordPress dependencies - */ -import { RichText, useBlockProps } from '@wordpress/block-editor'; -import { __ } from '@wordpress/i18n'; - -function DetailsSummaryEdit( { attributes, setAttributes } ) { - const summary = attributes.summary ? attributes.summary : __( 'Details' ); - return ( - event.preventDefault() } - > - - setAttributes( { summary: newSummary } ) - } - /> - - ); -} - -export default DetailsSummaryEdit; diff --git a/packages/block-library/src/details-summary/editor.scss b/packages/block-library/src/details-summary/editor.scss deleted file mode 100644 index 168e2f8a0d35c..0000000000000 --- a/packages/block-library/src/details-summary/editor.scss +++ /dev/null @@ -1,3 +0,0 @@ -.wp-block-details-summary div { - display: inline; -} diff --git a/packages/block-library/src/details-summary/index.js b/packages/block-library/src/details-summary/index.js deleted file mode 100644 index 874d806c4bbda..0000000000000 --- a/packages/block-library/src/details-summary/index.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * WordPress dependencies - */ -import { heading as icon } from '@wordpress/icons'; - -/** - * Internal dependencies - */ -import initBlock from '../utils/init-block'; -import metadata from './block.json'; -import edit from './edit'; -import save from './save'; - -const { name } = metadata; -export { metadata, name }; - -export const settings = { - icon, - save, - edit, -}; - -export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/details-summary/save.js b/packages/block-library/src/details-summary/save.js deleted file mode 100644 index 0f73adb10093a..0000000000000 --- a/packages/block-library/src/details-summary/save.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * WordPress dependencies - */ -import { RichText, useBlockProps } from '@wordpress/block-editor'; - -export default function save( { attributes } ) { - const summary = attributes.summary ? attributes.summary : 'Details'; - return ( - - - - ); -} diff --git a/packages/block-library/src/details-summary/style.scss b/packages/block-library/src/details-summary/style.scss deleted file mode 100644 index 9249d861cbe92..0000000000000 --- a/packages/block-library/src/details-summary/style.scss +++ /dev/null @@ -1,3 +0,0 @@ -.wp-block-details-summary { - cursor: pointer; -} diff --git a/packages/block-library/src/details/block.json b/packages/block-library/src/details/block.json index 5d3ac00afbad1..70dabe1776e02 100644 --- a/packages/block-library/src/details/block.json +++ b/packages/block-library/src/details/block.json @@ -5,31 +5,36 @@ "name": "core/details", "title": "Details", "category": "text", - "description": "A block that displays a summary and shows or hides additional content.", - "keywords": [ "disclosure", "summary", "hide", "transcript" ], + "description": "Hide and show additional content.", + "keywords": [ "disclosure", "summary", "hide", "accordion" ], "textdomain": "default", "attributes": { "showContent": { "type": "boolean", "default": false + }, + "summary": { + "type": "string" } }, "supports": { - "align": true, + "align": [ "wide", "full" ], "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, - "text": true, - "link": true + "text": true } }, "__experimentalBorder": { "radius": true, "color": true, "width": true, - "style": true + "style": true, + "__experimentalDefaultControls": { + "radius": false + } }, "html": false, "spacing": { @@ -50,5 +55,6 @@ } } }, + "editorStyle": "wp-block-details-editor", "style": "wp-block-details" } diff --git a/packages/block-library/src/details/edit.js b/packages/block-library/src/details/edit.js index fb202829e5079..bc0c206aa2d26 100644 --- a/packages/block-library/src/details/edit.js +++ b/packages/block-library/src/details/edit.js @@ -2,6 +2,7 @@ * WordPress dependencies */ import { + RichText, useBlockProps, useInnerBlocksProps, store as blockEditorStore, @@ -11,15 +12,21 @@ import { useSelect } from '@wordpress/data'; import { PanelBody, ToggleControl } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; -const TEMPLATE = [ [ 'core/details-summary' ], [ 'core/details-content' ] ]; +const TEMPLATE = [ + [ + 'core/paragraph', + { + placeholder: __( 'Type / to add a hidden block' ), + }, + ], +]; function DetailsEdit( { attributes, setAttributes, clientId } ) { - const { showContent } = attributes; + const { showContent, summary } = attributes; const blockProps = useBlockProps(); const innerBlocksProps = useInnerBlocksProps( blockProps, { - allowedBlocks: TEMPLATE, template: TEMPLATE, - templateLock: 'all', + __experimentalCaptureToolbars: true, } ); // Check if either the block or the inner blocks are selected. @@ -51,7 +58,22 @@ function DetailsEdit( { attributes, setAttributes, clientId } ) {
+ > + event.preventDefault() }> + + setAttributes( { summary: newSummary } ) + } + multiline={ false } + /> + + { innerBlocksProps.children } + ); } diff --git a/packages/block-library/src/details/editor.scss b/packages/block-library/src/details/editor.scss new file mode 100644 index 0000000000000..76c676974d4d0 --- /dev/null +++ b/packages/block-library/src/details/editor.scss @@ -0,0 +1,3 @@ +.wp-block-details summary div { + display: inline; +} diff --git a/packages/block-library/src/details/index.js b/packages/block-library/src/details/index.js index 24ad75282ee0f..e30d1a8e04974 100644 --- a/packages/block-library/src/details/index.js +++ b/packages/block-library/src/details/index.js @@ -18,13 +18,18 @@ export { metadata, name }; export const settings = { icon, example: { + attributes: { + summary: 'La Mancha', + showContent: true, + }, innerBlocks: [ { - name: 'core/details-summary', - attributes: { summary: __( 'Details' ) }, - }, - { - name: 'core/details-content', + name: 'core/paragraph', + attributes: { + content: __( + 'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.' + ), + }, }, ], }, diff --git a/packages/block-library/src/details/save.js b/packages/block-library/src/details/save.js index da5d0c1c35f4b..6e9d80aea7869 100644 --- a/packages/block-library/src/details/save.js +++ b/packages/block-library/src/details/save.js @@ -1,14 +1,19 @@ /** * WordPress dependencies */ -import { useBlockProps, InnerBlocks } from '@wordpress/block-editor'; +import { RichText, useBlockProps, InnerBlocks } from '@wordpress/block-editor'; +import { __ } from '@wordpress/i18n'; export default function save( { attributes } ) { const { showContent } = attributes; + const summary = attributes.summary ? attributes.summary : __( 'Summary' ); const blockProps = useBlockProps.save(); return (
+ + +
); diff --git a/packages/block-library/src/details/style.scss b/packages/block-library/src/details/style.scss index 59bf9c8b73005..4a384de575468 100644 --- a/packages/block-library/src/details/style.scss +++ b/packages/block-library/src/details/style.scss @@ -1,3 +1,15 @@ .wp-block-details { + box-sizing: border-box; overflow: hidden; } + +// Use block gap for block; falls back to browser default if not supported. +.wp-block-details > *:not(summary) { + margin-block-start: var(--wp--style--block-gap); + margin-block-end: 0; +} + +// Remove excess margin from the last block. +.wp-block-details > *:last-child { + margin-bottom: 0; +} diff --git a/packages/block-library/src/editor.scss b/packages/block-library/src/editor.scss index eec1a25e5f6d8..07c58599c5098 100644 --- a/packages/block-library/src/editor.scss +++ b/packages/block-library/src/editor.scss @@ -13,7 +13,7 @@ @import "./comments-pagination-numbers/editor.scss"; @import "./comments-title/editor.scss"; @import "./cover/editor.scss"; -@import "./details-summary/editor.scss"; +@import "./details/editor.scss"; @import "./embed/editor.scss"; @import "./file/editor.scss"; @import "./freeform/editor.scss"; diff --git a/packages/block-library/src/index.js b/packages/block-library/src/index.js index 581b2658fa52d..a0c7b75eac19b 100644 --- a/packages/block-library/src/index.js +++ b/packages/block-library/src/index.js @@ -46,8 +46,6 @@ import * as commentsPaginationNumbers from './comments-pagination-numbers'; import * as commentsTitle from './comments-title'; import * as cover from './cover'; import * as details from './details'; -import * as detailsContent from './details-content'; -import * as detailsSummary from './details-summary'; import * as embed from './embed'; import * as file from './file'; import * as gallery from './gallery'; @@ -230,8 +228,6 @@ const getAllBlocks = () => { ]; if ( window?.__experimentalEnableDetailsBlocks ) { blocks.push( details ); - blocks.push( detailsContent ); - blocks.push( detailsSummary ); } return blocks.filter( Boolean ); }; diff --git a/packages/block-library/src/style.scss b/packages/block-library/src/style.scss index d3cb9667f3d0a..8fe8b904c23f5 100644 --- a/packages/block-library/src/style.scss +++ b/packages/block-library/src/style.scss @@ -12,7 +12,6 @@ @import "./comment-template/style.scss"; @import "./cover/style.scss"; @import "./details/style.scss"; -@import "./details-summary/style.scss"; @import "./embed/style.scss"; @import "./file/style.scss"; @import "./gallery/style.scss"; diff --git a/packages/icons/src/library/details.js b/packages/icons/src/library/details.js index 11fa97eb8cb33..11d5835620648 100644 --- a/packages/icons/src/library/details.js +++ b/packages/icons/src/library/details.js @@ -4,17 +4,13 @@ import { SVG, Path } from '@wordpress/primitives'; const details = ( - + + ); From 5f6125f6aa27cbec5e53b89505445113adcec532 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Fri, 14 Apr 2023 12:03:52 -0400 Subject: [PATCH 2/9] Cursor --- packages/block-library/src/details/editor.scss | 4 ++++ packages/block-library/src/details/style.scss | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/block-library/src/details/editor.scss b/packages/block-library/src/details/editor.scss index 76c676974d4d0..69c2ce259f9eb 100644 --- a/packages/block-library/src/details/editor.scss +++ b/packages/block-library/src/details/editor.scss @@ -1,3 +1,7 @@ +.wp-block-details summary { + cursor: unset; +} + .wp-block-details summary div { display: inline; } diff --git a/packages/block-library/src/details/style.scss b/packages/block-library/src/details/style.scss index 4a384de575468..415a3210a50ae 100644 --- a/packages/block-library/src/details/style.scss +++ b/packages/block-library/src/details/style.scss @@ -3,6 +3,10 @@ overflow: hidden; } +.wp-block-details summary { + cursor: pointer; +} + // Use block gap for block; falls back to browser default if not supported. .wp-block-details > *:not(summary) { margin-block-start: var(--wp--style--block-gap); From 8cc3d36ec62c37eacd046101a167b921ee1054a9 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Mon, 17 Apr 2023 11:24:31 -0400 Subject: [PATCH 3/9] Update save.js --- packages/block-library/src/details/save.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/block-library/src/details/save.js b/packages/block-library/src/details/save.js index 6e9d80aea7869..aa06789c76812 100644 --- a/packages/block-library/src/details/save.js +++ b/packages/block-library/src/details/save.js @@ -2,11 +2,10 @@ * WordPress dependencies */ import { RichText, useBlockProps, InnerBlocks } from '@wordpress/block-editor'; -import { __ } from '@wordpress/i18n'; export default function save( { attributes } ) { const { showContent } = attributes; - const summary = attributes.summary ? attributes.summary : __( 'Summary' ); + const summary = attributes.summary ? attributes.summary : 'Summary'; const blockProps = useBlockProps.save(); return ( From 5f952b1cff0f3ea86a33875fc529678108c48ad9 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Tue, 25 Apr 2023 12:25:23 +0200 Subject: [PATCH 4/9] Use "Details" as the fallback summary title --- packages/block-library/src/details/save.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/details/save.js b/packages/block-library/src/details/save.js index aa06789c76812..0df5f63ce9410 100644 --- a/packages/block-library/src/details/save.js +++ b/packages/block-library/src/details/save.js @@ -5,7 +5,7 @@ import { RichText, useBlockProps, InnerBlocks } from '@wordpress/block-editor'; export default function save( { attributes } ) { const { showContent } = attributes; - const summary = attributes.summary ? attributes.summary : 'Summary'; + const summary = attributes.summary ? attributes.summary : 'Details'; const blockProps = useBlockProps.save(); return ( From 7d94a7232858692744a04c90b4f0176c5ee86147 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Thu, 27 Apr 2023 11:08:33 +0200 Subject: [PATCH 5/9] Use tagName in RichText for summary --- packages/block-library/src/details/edit.js | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/block-library/src/details/edit.js b/packages/block-library/src/details/edit.js index bc0c206aa2d26..4eeca781d3154 100644 --- a/packages/block-library/src/details/edit.js +++ b/packages/block-library/src/details/edit.js @@ -59,19 +59,19 @@ function DetailsEdit( { attributes, setAttributes, clientId } ) { { ...innerBlocksProps } open={ hasSelection || showContent } > - event.preventDefault() }> - - setAttributes( { summary: newSummary } ) - } - multiline={ false } - /> - + + setAttributes( { summary: newSummary } ) + } + onClick={ ( event ) => event.preventDefault() } + multiline={ false } + /> { innerBlocksProps.children } From dc16d1a73f2a65b277de24bc4b255900f34f830e Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Thu, 27 Apr 2023 11:08:49 +0200 Subject: [PATCH 6/9] Remove unset cursor in editor --- packages/block-library/src/details/editor.scss | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/block-library/src/details/editor.scss b/packages/block-library/src/details/editor.scss index 69c2ce259f9eb..76c676974d4d0 100644 --- a/packages/block-library/src/details/editor.scss +++ b/packages/block-library/src/details/editor.scss @@ -1,7 +1,3 @@ -.wp-block-details summary { - cursor: unset; -} - .wp-block-details summary div { display: inline; } From 4430c73ce2eaa31c3abe793776cb672ea7a1b86b Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Wed, 3 May 2023 15:38:15 -0400 Subject: [PATCH 7/9] Remove tagName summary Resolves the space bar issue --- packages/block-library/src/details/edit.js | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/block-library/src/details/edit.js b/packages/block-library/src/details/edit.js index 4eeca781d3154..2c3eb93eef414 100644 --- a/packages/block-library/src/details/edit.js +++ b/packages/block-library/src/details/edit.js @@ -59,19 +59,20 @@ function DetailsEdit( { attributes, setAttributes, clientId } ) { { ...innerBlocksProps } open={ hasSelection || showContent } > - - setAttributes( { summary: newSummary } ) - } - onClick={ ( event ) => event.preventDefault() } - multiline={ false } - /> + + + setAttributes( { summary: newSummary } ) + } + onClick={ ( event ) => event.preventDefault() } + multiline={ false } + /> + { innerBlocksProps.children } From 1f6190b29b4ec9c8ff06abcd880d383e8f0c248d Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Wed, 3 May 2023 15:43:47 -0400 Subject: [PATCH 8/9] Remove border radius from supports --- packages/block-library/src/details/block.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/block-library/src/details/block.json b/packages/block-library/src/details/block.json index 70dabe1776e02..40321ee6b0c9c 100644 --- a/packages/block-library/src/details/block.json +++ b/packages/block-library/src/details/block.json @@ -28,13 +28,9 @@ } }, "__experimentalBorder": { - "radius": true, "color": true, "width": true, - "style": true, - "__experimentalDefaultControls": { - "radius": false - } + "style": true }, "html": false, "spacing": { From 398b130f9fc9117bc4dcfa338176196e98415db1 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Wed, 3 May 2023 15:45:23 -0400 Subject: [PATCH 9/9] Move preventDefault to summary --- packages/block-library/src/details/edit.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/block-library/src/details/edit.js b/packages/block-library/src/details/edit.js index 2c3eb93eef414..bc0c206aa2d26 100644 --- a/packages/block-library/src/details/edit.js +++ b/packages/block-library/src/details/edit.js @@ -59,7 +59,7 @@ function DetailsEdit( { attributes, setAttributes, clientId } ) { { ...innerBlocksProps } open={ hasSelection || showContent } > - + event.preventDefault() }> setAttributes( { summary: newSummary } ) } - onClick={ ( event ) => event.preventDefault() } multiline={ false } />