From 0b1c453e6ab536f67ef61e14025b651dcc097d99 Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Sat, 18 Jan 2025 11:32:14 +0900 Subject: [PATCH] Block Library: Unify block title with a strict title case (#51912) * Block Library: Unify block title with a strict title case * Try to fix unit tests * Unify block variation title Co-authored-by: t-hamano Co-authored-by: richtabor --- docs/reference-guides/core-blocks.md | 8 ++++---- packages/block-library/src/form/variations.js | 2 +- .../block-library/src/list-item/block.json | 2 +- .../block-library/src/list/test/edit.native.js | 18 +++++++++--------- packages/block-library/src/pattern/block.json | 2 +- .../src/post-navigation-link/variations.js | 4 ++-- .../src/post-time-to-read/block.json | 2 +- .../src/query-no-results/block.json | 2 +- .../__device-tests__/pages/editor-page.js | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 158432cca5c48a..10ceb797e28c0f 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -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)) @@ -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)) @@ -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)) @@ -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)) diff --git a/packages/block-library/src/form/variations.js b/packages/block-library/src/form/variations.js index cf12cef2ea38f2..5eab3e247f88b3 100644 --- a/packages/block-library/src/form/variations.js +++ b/packages/block-library/src/form/variations.js @@ -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: { diff --git a/packages/block-library/src/list-item/block.json b/packages/block-library/src/list-item/block.json index 6eb30cfe6d0af0..1cdba86f19b2e8 100644 --- a/packages/block-library/src/list-item/block.json +++ b/packages/block-library/src/list-item/block.json @@ -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" ], diff --git a/packages/block-library/src/list/test/edit.native.js b/packages/block-library/src/list/test/edit.native.js index 35678aabe4a694..3084b11ecbd146 100644 --- a/packages/block-library/src/list/test/edit.native.js +++ b/packages/block-library/src/list/test/edit.native.js @@ -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(); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); @@ -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 ); diff --git a/packages/block-library/src/pattern/block.json b/packages/block-library/src/pattern/block.json index 13fc9d154b15a4..c30be8458e6360 100644 --- a/packages/block-library/src/pattern/block.json +++ b/packages/block-library/src/pattern/block.json @@ -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": { diff --git a/packages/block-library/src/post-navigation-link/variations.js b/packages/block-library/src/post-navigation-link/variations.js index e49be1542685e7..125f10942cd15e 100644 --- a/packages/block-library/src/post-navigation-link/variations.js +++ b/packages/block-library/src/post-navigation-link/variations.js @@ -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.' ), @@ -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.' ), diff --git a/packages/block-library/src/post-time-to-read/block.json b/packages/block-library/src/post-time-to-read/block.json index ce0ab2be6c02f3..a9f09895556c74 100644 --- a/packages/block-library/src/post-time-to-read/block.json +++ b/packages/block-library/src/post-time-to-read/block.json @@ -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", diff --git a/packages/block-library/src/query-no-results/block.json b/packages/block-library/src/query-no-results/block.json index c2b7224aa40b14..44d2ceef987e2f 100644 --- a/packages/block-library/src/query-no-results/block.json +++ b/packages/block-library/src/query-no-results/block.json @@ -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" ], diff --git a/packages/react-native-editor/__device-tests__/pages/editor-page.js b/packages/react-native-editor/__device-tests__/pages/editor-page.js index 77f4a700b11370..2333d2dc899d5e 100644 --- a/packages/react-native-editor/__device-tests__/pages/editor-page.js +++ b/packages/react-native-editor/__device-tests__/pages/editor-page.js @@ -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',