Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Details Block: Remove experimental flag and stabilize #50997

Merged
merged 3 commits into from
May 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ Add an image or video with a text overlay. ([Source](https://github.com/WordPres
Hide and show additional content. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/details))

- **Name:** core/details
- **Experimental:** true
- **Category:** text
- **Supports:** align (full, wide), color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** showContent, summary
Expand Down
3 changes: 0 additions & 3 deletions lib/experimental/editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ function gutenberg_enable_experiments() {
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-group-grid-variation', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableGroupGridVariation = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-details-blocks', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableDetailsBlocks = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-pattern-enhancements', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnablePatternEnhancements = true', 'before' );
}
Expand Down
12 changes: 0 additions & 12 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,6 @@ function gutenberg_initialize_experiments_settings() {
)
);

add_settings_field(
'gutenberg-details-blocks',
__( 'Details block', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Test the Details block', 'gutenberg' ),
'id' => 'gutenberg-details-blocks',
)
);

add_settings_field(
'gutenberg-theme-previews',
__( 'Block Theme Previews', 'gutenberg' ),
Expand Down
1 change: 0 additions & 1 deletion packages/block-library/src/details/block.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"__experimental": true,
"name": "core/details",
"title": "Details",
"category": "text",
Expand Down
4 changes: 1 addition & 3 deletions packages/block-library/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ const getAllBlocks = () => {
columns,
commentAuthorAvatar,
cover,
details,
embed,
file,
group,
Expand Down Expand Up @@ -226,9 +227,6 @@ const getAllBlocks = () => {
queryTitle,
postAuthorBiography,
];
if ( window?.__experimentalEnableDetailsBlocks ) {
blocks.push( details );
}
return blocks.filter( Boolean );
};

Expand Down
7 changes: 7 additions & 0 deletions test/integration/fixtures/blocks/core__details.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- wp:details {"summary":"Details Summary"} -->
<details class="wp-block-details"><summary>Details Summary</summary>
<!-- wp:paragraph {"placeholder":"Type / to add a hidden block"} -->
<p>Details Content</p>
<!-- /wp:paragraph -->
</details>
<!-- /wp:details -->
22 changes: 22 additions & 0 deletions test/integration/fixtures/blocks/core__details.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"name": "core/details",
"isValid": true,
"attributes": {
"showContent": false,
"summary": "Details Summary"
},
"innerBlocks": [
{
"name": "core/paragraph",
"isValid": true,
"attributes": {
"content": "Details Content",
"dropCap": false,
"placeholder": "Type / to add a hidden block"
},
"innerBlocks": []
}
]
}
]
25 changes: 25 additions & 0 deletions test/integration/fixtures/blocks/core__details.parsed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[
{
"blockName": "core/details",
"attrs": {
"summary": "Details Summary"
},
"innerBlocks": [
{
"blockName": "core/paragraph",
"attrs": {
"placeholder": "Type / to add a hidden block"
},
"innerBlocks": [],
"innerHTML": "\n\t<p>Details Content</p>\n\t",
"innerContent": [ "\n\t<p>Details Content</p>\n\t" ]
}
],
"innerHTML": "\n<details class=\"wp-block-details\"><summary>Details Summary</summary>\n\t\n</details>\n",
"innerContent": [
"\n<details class=\"wp-block-details\"><summary>Details Summary</summary>\n\t",
null,
"\n</details>\n"
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- wp:details {"summary":"Details Summary"} -->
<details class="wp-block-details"><summary>Details Summary</summary><!-- wp:paragraph {"placeholder":"Type / to add a hidden block"} -->
<p>Details Content</p>
<!-- /wp:paragraph --></details>
<!-- /wp:details -->