Skip to content

Commit

Permalink
Update placeholder text across blocks: (#30404)
Browse files Browse the repository at this point in the history
- Favor more concise wording such as "Add caption".
- Remove trailing ellipsis.

This is meant to work better with the new persistent placeholder
text until the user types in RichText.
  • Loading branch information
mtias authored Apr 1, 2021
1 parent 367620e commit f98f2d2
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Caption = ( {
onBlur,
onChange,
onFocus,
placeholder = __( 'Write caption' ),
placeholder = __( 'Add caption' ),
placeholderTextColor,
shouldDisplay = true,
style,
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/audio/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function AudioEdit( {
<RichText
tagName="figcaption"
aria-label={ __( 'Audio caption text' ) }
placeholder={ __( 'Write caption' ) }
placeholder={ __( 'Add caption' ) }
value={ caption }
onChange={ ( value ) =>
setAttributes( { caption: value } )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ exports[`Audio block renders audio block error state without crashing 1`] = `
onResponderTerminationRequest={[Function]}
onSelectionChange={[Function]}
onStartShouldSetResponder={[Function]}
placeholder="Write caption"
placeholder="Add caption"
placeholderTextColor="gray"
style={
Object {
Expand Down Expand Up @@ -291,7 +291,7 @@ exports[`Audio block renders audio file without crashing 1`] = `
onResponderTerminationRequest={[Function]}
onSelectionChange={[Function]}
onStartShouldSetResponder={[Function]}
placeholder="Write caption"
placeholder="Add caption"
placeholderTextColor="gray"
style={
Object {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/embed/embed-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class EmbedPreview extends Component {
{ ( ! RichText.isEmpty( caption ) || isSelected ) && (
<RichText
tagName="figcaption"
placeholder={ __( 'Write caption' ) }
placeholder={ __( 'Add caption' ) }
value={ caption }
onChange={ onCaptionChange }
inlineToolbar
Expand Down
4 changes: 1 addition & 3 deletions packages/block-library/src/gallery/gallery-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@ class GalleryImage extends Component {
<RichText
tagName="figcaption"
aria-label={ __( 'Image caption text' ) }
placeholder={
isSelected ? __( 'Write caption…' ) : null
}
placeholder={ isSelected ? __( 'Add caption' ) : null }
value={ caption }
isSelected={ this.state.captionSelected }
onChange={ ( newCaption ) =>
Expand Down
4 changes: 1 addition & 3 deletions packages/block-library/src/gallery/gallery-image.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,7 @@ class GalleryImage extends Component {
onChange={ this.onCaptionChange }
onFocus={ this.onSelectCaption }
placeholder={
isSelected
? __( 'Write caption…' )
: null
isSelected ? __( 'Add caption' ) : null
}
placeholderTextColor={
captionPlaceholderStyle.color
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/heading/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function HeadingEdit( {
onReplace={ onReplace }
onRemove={ () => onReplace( [] ) }
aria-label={ __( 'Heading text' ) }
placeholder={ placeholder || __( 'Write heading…' ) }
placeholder={ placeholder || __( 'Heading' ) }
textAlign={ textAlign }
{ ...blockProps }
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ export default function Image( {
ref={ captionRef }
tagName="figcaption"
aria-label={ __( 'Image caption text' ) }
placeholder={ __( 'Write caption' ) }
placeholder={ __( 'Add caption' ) }
value={ caption }
unstableOnFocus={ onFocusCaption }
onChange={ ( value ) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/list/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export default function ListEdit( {
}
value={ values }
aria-label={ __( 'List text' ) }
placeholder={ __( 'Write list…' ) }
placeholder={ __( 'List' ) }
onMerge={ mergeBlocks }
onSplit={ ( value ) =>
createBlock( name, { ...attributes, values: value } )
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/pullquote/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function PullQuoteEdit( {
aria-label={ __( 'Pullquote text' ) }
placeholder={
// translators: placeholder text used for the quote
__( 'Write quote' )
__( 'Add quote' )
}
textAlign="center"
/>
Expand All @@ -138,7 +138,7 @@ function PullQuoteEdit( {
aria-label={ __( 'Pullquote citation text' ) }
placeholder={
// translators: placeholder text used for the citation
__( 'Write citation' )
__( 'Add citation' )
}
onChange={ ( nextCitation ) =>
setAttributes( {
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/quote/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function QuoteEdit( {
aria-label={ __( 'Quote text' ) }
placeholder={
// translators: placeholder text used for the quote
__( 'Write quote' )
__( 'Add quote' )
}
onReplace={ onReplace }
onSplit={ ( piece ) =>
Expand Down Expand Up @@ -94,7 +94,7 @@ export default function QuoteEdit( {
aria-label={ __( 'Quote citation text' ) }
placeholder={
// translators: placeholder text used for the citation
__( 'Write citation' )
__( 'Add citation' )
}
className="wp-block-quote__citation"
textAlign={ align }
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/table/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ function TableEdit( {
<RichText
tagName="figcaption"
aria-label={ __( 'Table caption text' ) }
placeholder={ __( 'Write caption' ) }
placeholder={ __( 'Add caption' ) }
value={ caption }
onChange={ ( value ) =>
setAttributes( { caption: value } )
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/video/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function VideoEdit( {
<RichText
tagName="figcaption"
aria-label={ __( 'Video caption text' ) }
placeholder={ __( 'Write caption' ) }
placeholder={ __( 'Add caption' ) }
value={ caption }
onChange={ ( value ) =>
setAttributes( { caption: value } )
Expand Down

0 comments on commit f98f2d2

Please sign in to comment.