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

Add richText identifier to blocks #59056

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/block-library/src/details/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function DetailsEdit( { attributes, setAttributes, clientId } ) {
>
<summary onClick={ ( event ) => event.preventDefault() }>
<RichText
identifier="summary"
aria-label={ __( 'Write summary' ) }
placeholder={ __( 'Write summary…' ) }
allowedFormats={ [] }
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/file/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
) }
<div className={ 'wp-block-file__content-wrapper' }>
<RichText
identifier="fileName"
tagName="a"
value={ fileName }
placeholder={ __( 'Write file name…' ) }
Expand All @@ -273,6 +274,7 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
>
{ /* Using RichText here instead of PlainText so that it can be styled like a button. */ }
<RichText
identifier="downloadButtonText"
tagName="div" // Must be block-level or else cursor disappears.
aria-label={ __( 'Download button text' ) }
className={ classnames(
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/post-author/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ function PostAuthorEdit( {
<div className="wp-block-post-author__content">
{ ( ! RichText.isEmpty( byline ) || isSelected ) && (
<RichText
identifier="byline"
className="wp-block-post-author__byline"
aria-label={ __( 'Post author byline text' ) }
placeholder={ __( 'Write byline…' ) }
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/post-excerpt/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export default function PostExcerptEditor( {
}
const readMoreLink = (
<RichText
identifier="moreText"
className="wp-block-post-excerpt__more-link"
tagName="a"
aria-label={ __( '“Read more” link text' ) }
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/post-terms/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export default function PostTermsEdit( {
{ isLoading && hasPost && <Spinner /> }
{ ! isLoading && ( isSelected || prefix ) && (
<RichText
identifier="prefix"
allowedFormats={ ALLOWED_FORMATS }
className="wp-block-post-terms__prefix"
aria-label={ __( 'Prefix' ) }
Expand Down Expand Up @@ -138,6 +139,7 @@ export default function PostTermsEdit( {
__( 'Term items not found.' ) ) }
{ ! isLoading && ( isSelected || suffix ) && (
<RichText
identifier="suffix"
allowedFormats={ ALLOWED_FORMATS }
className="wp-block-post-terms__suffix"
aria-label={ __( 'Suffix' ) }
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/read-more/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default function ReadMore( {
</PanelBody>
</InspectorControls>
<RichText
identifier="content"
tagName="a"
aria-label={ __( '“Read more” link text' ) }
placeholder={ __( 'Read more' ) }
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/search/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ export default function SearchEdit( {

{ ! buttonUseIcon && (
<RichText
identifier="buttonText"
className={ buttonClasses }
style={ buttonStyles }
aria-label={ __( 'Button text' ) }
Expand Down Expand Up @@ -546,6 +547,7 @@ export default function SearchEdit( {

{ showLabel && (
<RichText
identifier="label"
className={ labelClassnames }
aria-label={ __( 'Label text' ) }
placeholder={ __( 'Add label…' ) }
Expand Down