Skip to content

Commit

Permalink
Block Library: Unify block title with a strict title case (#51912)
Browse files Browse the repository at this point in the history
* Block Library: Unify block title with a strict title case

* Try to fix unit tests

* Unify block variation title

Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: richtabor <richtabor@git.wordpress.org>
  • Loading branch information
3 people authored Jan 18, 2025
1 parent a900e03 commit 0b1c453
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ An organized collection of items displayed in a specific order. ([Source](https:
- **Supports:** __unstablePasteTextInline, anchor, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** ordered, placeholder, reversed, start, type, values

## List item
## List Item

An individual item within a list. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/list-item))

Expand Down Expand Up @@ -534,7 +534,7 @@ Start with the basic building block of all narrative. ([Source](https://github.c
- **Supports:** __unstablePasteTextInline, anchor, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), splitting, typography (fontSize, lineHeight), ~~className~~
- **Attributes:** align, content, direction, dropCap, placeholder

## Pattern placeholder
## Pattern Placeholder

Show a block pattern. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/pattern))

Expand Down Expand Up @@ -672,7 +672,7 @@ Post terms. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages
- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** prefix, separator, suffix, term, textAlign

## Time To Read
## Time to Read

Show minutes required to finish reading the post. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/post-time-to-read))

Expand Down Expand Up @@ -718,7 +718,7 @@ An advanced block that allows displaying post types based on different query par
- **Supports:** align (full, wide), interactivity, layout, ~~html~~
- **Attributes:** enhancedPagination, namespace, query, queryId, tagName

## No results
## No Results

Contains the block elements used to render content when no query results are found. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/query-no-results))

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/form/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const variations = [
},
{
name: 'wp-privacy-form',
title: __( 'Experimental privacy request form' ),
title: __( 'Experimental Privacy Request Form' ),
keywords: [ 'GDPR' ],
description: __( 'A form to request data exports and/or deletion.' ),
attributes: {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/list-item/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "core/list-item",
"title": "List item",
"title": "List Item",
"category": "text",
"parent": [ "core/list" ],
"allowedBlocks": [ "core/list" ],
Expand Down
18 changes: 9 additions & 9 deletions packages/block-library/src/list/test/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe( 'List block', () => {
await triggerBlockListLayout( listBlock );

// Get List item
const listItemBlock = await getBlock( screen, 'List item' );
const listItemBlock = await getBlock( screen, 'List Item' );
fireEvent.press( listItemBlock );

expect( listItemBlock ).toBeVisible();
Expand All @@ -75,7 +75,7 @@ describe( 'List block', () => {

// Select List Item block
const [ listItemBlock ] = screen.getAllByLabelText(
/List item Block\. Row 1/
/List Item Block\. Row 1/
);
fireEvent.press( listItemBlock );

Expand Down Expand Up @@ -124,7 +124,7 @@ describe( 'List block', () => {

// Select List Item block
const [ firstNestedLevelBlock ] = within( listBlock ).getAllByLabelText(
/List item Block\. Row 2/
/List Item Block\. Row 2/
);
fireEvent.press( firstNestedLevelBlock );
await triggerBlockListLayout( firstNestedLevelBlock );
Expand Down Expand Up @@ -159,7 +159,7 @@ describe( 'List block', () => {

// Select Second List Item block
const [ listItemBlock ] = screen.getAllByLabelText(
/List item Block\. Row 2/
/List Item Block\. Row 2/
);
fireEvent.press( listItemBlock );

Expand All @@ -169,7 +169,7 @@ describe( 'List block', () => {

// Await recently indented list item layout
const [ listItemBlock1 ] = screen.getAllByLabelText(
/List item Block\. Row 1/
/List Item Block\. Row 1/
);
await triggerBlockListLayout( listItemBlock1 );

Expand Down Expand Up @@ -203,7 +203,7 @@ describe( 'List block', () => {

// Select List Item block
const [ firstNestedLevelBlock ] = within( listBlock ).getAllByLabelText(
/List item Block\. Row 1/
/List Item Block\. Row 1/
);
fireEvent.press( firstNestedLevelBlock );
await triggerBlockListLayout( firstNestedLevelBlock );
Expand All @@ -217,7 +217,7 @@ describe( 'List block', () => {

// Select nested List Item block
const [ listItemBlock ] = within( innerBlockList ).getAllByLabelText(
/List item Block\. Row 1/
/List Item Block\. Row 1/
);
fireEvent.press( listItemBlock );

Expand Down Expand Up @@ -500,7 +500,7 @@ describe( 'List block', () => {

// Select List Item block
const [ listItemBlock ] = within( listBlock ).getAllByLabelText(
/List item Block\. Row 1/
/List Item Block\. Row 1/
);
fireEvent.press( listItemBlock );

Expand Down Expand Up @@ -560,7 +560,7 @@ describe( 'List block', () => {

// Select List Item block
const [ listItemBlock ] = within( listBlock ).getAllByLabelText(
/List item Block\. Row 1/
/List Item Block\. Row 1/
);
fireEvent.press( listItemBlock );

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/pattern/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "core/pattern",
"title": "Pattern placeholder",
"title": "Pattern Placeholder",
"category": "theme",
"description": "Show a block pattern.",
"supports": {
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/post-navigation-link/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const variations = [
{
isDefault: true,
name: 'post-next',
title: __( 'Next post' ),
title: __( 'Next Post' ),
description: __(
'Displays the post link that follows the current post.'
),
Expand All @@ -24,7 +24,7 @@ const variations = [
},
{
name: 'post-previous',
title: __( 'Previous post' ),
title: __( 'Previous Post' ),
description: __(
'Displays the post link that precedes the current post.'
),
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-time-to-read/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"apiVersion": 3,
"__experimental": true,
"name": "core/post-time-to-read",
"title": "Time To Read",
"title": "Time to Read",
"category": "theme",
"description": "Show minutes required to finish reading the post.",
"textdomain": "default",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/query-no-results/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "core/query-no-results",
"title": "No results",
"title": "No Results",
"category": "theme",
"description": "Contains the block elements used to render content when no query results are found.",
"ancestor": [ "core/query" ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ const blockNames = {
image: 'Image',
latestPosts: 'Latest Posts',
list: 'List',
listItem: 'List item',
listItem: 'List Item',
more: 'More',
paragraph: 'Paragraph',
search: 'Search',
Expand Down

1 comment on commit 0b1c453

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 0b1c453.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12840080258
📝 Reported issues:

Please sign in to comment.