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

Cherry Pick PR's for WordPress 5.4 beta 3 #20424

Merged
merged 12 commits into from Feb 24, 2020
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Some generated files are not rendered by default. Learn more.

@@ -78,7 +78,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
onClick={[Function]}
type="button"
>
Custom Color
Custom color
</button>
</div>
<button
@@ -86,7 +86,7 @@ describe( 'ColorPaletteControl', () => {

// Is showing the custom color picker.
expect(
wrapper.root.findAll( getButtonWithTestPredicate( 'Custom Color' ) )
wrapper.root.findAll( getButtonWithTestPredicate( 'Custom color' ) )
).toHaveLength( 1 );
} );

@@ -128,7 +128,7 @@ describe( 'ColorPaletteControl', () => {

// Is showing the custom color picker.
expect(
wrapper.root.findAll( getButtonWithTestPredicate( 'Custom Color' ) )
wrapper.root.findAll( getButtonWithTestPredicate( 'Custom color' ) )
).toHaveLength( 1 );
} );

@@ -304,7 +304,7 @@ export default function __experimentalUseColors(

panelLabel = colorConfig.label ||
COMMON_COLOR_LABELS[ name ] ||
startCase( name ), // E.g. 'Background Color'.
startCase( name ), // E.g. 'Background color'.
componentName = startCase( name ).replace( /\s/g, '' ), // E.g. 'BackgroundColor'.

color = colorConfig.color,
@@ -50,7 +50,7 @@ class ImageSizeControl extends Component {
<>
{ ! isEmpty( imageSizeOptions ) && (
<SelectControl
label={ __( 'Image Size' ) }
label={ __( 'Image size' ) }
value={ slug }
options={ imageSizeOptions }
onChange={ onChangeImage }
@@ -59,7 +59,7 @@ class ImageSizeControl extends Component {
{ isResizable && (
<div className="block-editor-image-size-control">
<p className="block-editor-image-size-control__row">
{ __( 'Image Dimensions' ) }
{ __( 'Image dimensions' ) }
</p>
<div className="block-editor-image-size-control__row">
<TextControl
@@ -72,11 +72,11 @@ export const withInspectorControl = createHigherOrderComponent(
<InspectorAdvancedControls>
<TextControl
className="html-anchor-control"
label={ __( 'HTML Anchor' ) }
label={ __( 'HTML anchor' ) }
help={
<>
{ __(
'Enter a word or two — without spaces — to make a unique web address just for this heading, called an “anchor.” Then, you’ll be able to link directly to this section of your page.'
'Enter a word or two — without spaces — to make a unique web address just for this heading, called an “anchor.” Then, you’ll be able to link directly to this section of your page.'
) }

<ExternalLink
@@ -65,7 +65,7 @@ export const withInspectorControl = createHigherOrderComponent(
<BlockEdit { ...props } />
<InspectorAdvancedControls>
<TextControl
label={ __( 'Additional CSS Class(es)' ) }
label={ __( 'Additional CSS class(es)' ) }
value={ props.attributes.className || '' }
onChange={ ( nextValue ) => {
props.setAttributes( {
@@ -14,7 +14,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
<InspectorControls>
<PanelBody title={ __( 'Archives settings' ) }>
<ToggleControl
label={ __( 'Display as Dropdown' ) }
label={ __( 'Display as dropdown' ) }
checked={ displayAsDropdown }
onChange={ () =>
setAttributes( {
@@ -23,7 +23,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
}
/>
<ToggleControl
label={ __( 'Show Post Counts' ) }
label={ __( 'Show post counts' ) }
checked={ showPostCounts }
onChange={ () =>
setAttributes( {
@@ -72,7 +72,7 @@ function BorderPanel( { borderRadius = '', setAttributes } ) {
<PanelBody title={ __( 'Border settings' ) }>
<RangeControl
value={ borderRadius }
label={ __( 'Border Radius' ) }
label={ __( 'Border radius' ) }
min={ MIN_BORDER_RADIUS_VALUE }
max={ MAX_BORDER_RADIUS_VALUE }
initialPosition={ INITIAL_BORDER_RADIUS_POSITION }
@@ -232,7 +232,7 @@ function ButtonEdit( {
{
colorValue: textColor.color,
onColorChange: setTextColor,
label: __( 'Text Color' ),
label: __( 'Text color' ),
},
{
colorValue: backgroundColor.color,
@@ -176,17 +176,17 @@ class CategoriesEdit extends Component {
<InspectorControls>
<PanelBody title={ __( 'Categories settings' ) }>
<ToggleControl
label={ __( 'Display as Dropdown' ) }
label={ __( 'Display as dropdown' ) }
checked={ displayAsDropdown }
onChange={ this.toggleDisplayAsDropdown }
/>
<ToggleControl
label={ __( 'Show Hierarchy' ) }
label={ __( 'Show hierarchy' ) }
checked={ showHierarchy }
onChange={ this.toggleShowHierarchy }
/>
<ToggleControl
label={ __( 'Show Post Counts' ) }
label={ __( 'Show post counts' ) }
checked={ showPostCounts }
onChange={ this.toggleShowPostCounts }
/>
@@ -99,4 +99,10 @@
&.is-vertically-aligned-bottom {
align-self: flex-end;
}

&.is-vertically-aligned-top,
&.is-vertically-aligned-center,
&.is-vertically-aligned-bottom {
width: 100%;
}
}
@@ -329,15 +329,15 @@ function CoverEdit( {
<PanelBody title={ __( 'Media settings' ) }>
{ IMAGE_BACKGROUND_TYPE === backgroundType && (
<ToggleControl
label={ __( 'Fixed Background' ) }
label={ __( 'Fixed background' ) }
checked={ hasParallax }
onChange={ toggleParallax }
/>
) }
{ IMAGE_BACKGROUND_TYPE === backgroundType &&
! hasParallax && (
<FocalPointPicker
label={ __( 'Focal Point Picker' ) }
label={ __( 'Focal point picker' ) }
url={ url }
value={ focalPoint }
onChange={ ( newFocalPoint ) =>
@@ -396,7 +396,7 @@ function CoverEdit( {
>
{ !! url && (
<RangeControl
label={ __( 'Background Opacity' ) }
label={ __( 'Background opacity' ) }
value={ dimRatio }
onChange={ ( newDimRation ) =>
setAttributes( {
@@ -18,7 +18,7 @@ export default function FileBlockInspector( {
let linkDestinationOptions = [ { value: href, label: __( 'URL' ) } ];
if ( attachmentPage ) {
linkDestinationOptions = [
{ value: href, label: __( 'Media File' ) },
{ value: href, label: __( 'Media file' ) },
{ value: attachmentPage, label: __( 'Attachment page' ) },
];
}
@@ -28,7 +28,7 @@ export default function FileBlockInspector( {
<InspectorControls>
<PanelBody title={ __( 'Text link settings' ) }>
<SelectControl
label={ __( 'Link To' ) }
label={ __( 'Link to' ) }
value={ textLinkHref }
options={ linkDestinationOptions }
onChange={ changeLinkDestinationOption }
@@ -376,22 +376,22 @@ class GalleryEdit extends Component {
/>
) }
<ToggleControl
label={ __( 'Crop Images' ) }
label={ __( 'Crop images' ) }
{ ...MOBILE_CONTROL_PROPS }
checked={ !! imageCrop }
onChange={ this.toggleImageCrop }
help={ this.getImageCropHelp }
/>
<SelectControl
label={ __( 'Link To' ) }
label={ __( 'Link to' ) }
{ ...mobileLinkToProps }
value={ linkTo }
onChange={ this.setLinkTo }
options={ linkOptions }
/>
{ shouldShowSizeOptions && (
<SelectControl
label={ __( 'Images Size' ) }
label={ __( 'Images size' ) }
{ ...MOBILE_CONTROL_PROPS_SEPARATOR_NONE }
value={ sizeSlug }
options={ imageSizeOptions }
@@ -48,6 +48,7 @@ class HeadingToolbar extends Component {
controls={ range( minLevel, maxLevel ).map( ( index ) =>
this.createLevelControl( index, selectedLevel, onChange )
) }
label={ __( 'Change heading level' ) }
/>
);
}
@@ -446,7 +446,7 @@ export class ImageEdit extends Component {
<InspectorControls>
<PanelBody title={ __( 'Image settings' ) }>
<TextareaControl
label={ __( 'Alt Text (Alternative Text)' ) }
label={ __( 'Alt text (alternative text)' ) }
value={ alt }
onChange={ this.updateAlt }
help={
@@ -477,7 +477,7 @@ export class ImageEdit extends Component {
</InspectorControls>
<InspectorAdvancedControls>
<TextControl
label={ __( 'Title Attribute' ) }
label={ __( 'Title attribute' ) }
value={ title || '' }
onChange={ this.onSetTitle }
help={
@@ -69,22 +69,22 @@ class LatestComments extends Component {
<InspectorControls>
<PanelBody title={ __( 'Latest comments settings' ) }>
<ToggleControl
label={ __( 'Display Avatar' ) }
label={ __( 'Display avatar' ) }
checked={ displayAvatar }
onChange={ this.toggleDisplayAvatar }
/>
<ToggleControl
label={ __( 'Display Date' ) }
label={ __( 'Display date' ) }
checked={ displayDate }
onChange={ this.toggleDisplayDate }
/>
<ToggleControl
label={ __( 'Display Excerpt' ) }
label={ __( 'Display excerpt' ) }
checked={ displayExcerpt }
onChange={ this.toggleDisplayExcerpt }
/>
<RangeControl
label={ __( 'Number of Comments' ) }
label={ __( 'Number of comments' ) }
value={ commentsToShow }
onChange={ this.setCommentsToShow }
min={ MIN_COMMENTS }
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { get, isUndefined, pickBy } from 'lodash';
import { get, invoke, isUndefined, pickBy } from 'lodash';
import classnames from 'classnames';

/**
@@ -100,7 +100,7 @@ class LatestPostsEdit extends Component {
<InspectorControls>
<PanelBody title={ __( 'Post content settings' ) }>
<ToggleControl
label={ __( 'Post Content' ) }
label={ __( 'Post content' ) }
checked={ displayPostContent }
onChange={ ( value ) =>
setAttributes( { displayPostContent: value } )
@@ -113,7 +113,7 @@ class LatestPostsEdit extends Component {
options={ [
{ label: __( 'Excerpt' ), value: 'excerpt' },
{
label: __( 'Full Post' ),
label: __( 'Full post' ),
value: 'full_post',
},
] }
@@ -148,7 +148,7 @@ class LatestPostsEdit extends Component {
/>
</PanelBody>

<PanelBody title={ __( 'Featured Image Settings' ) }>
<PanelBody title={ __( 'Featured image settings' ) }>
<ToggleControl
label={ __( 'Display featured image' ) }
checked={ displayFeaturedImage }
@@ -187,7 +187,7 @@ class LatestPostsEdit extends Component {
/>
<BaseControl>
<BaseControl.VisualLabel>
{ __( 'Image Alignment' ) }
{ __( 'Image alignment' ) }
</BaseControl.VisualLabel>
<BlockAlignmentToolbar
value={ featuredImageAlign }
@@ -305,7 +305,11 @@ class LatestPostsEdit extends Component {
} ) }
>
{ displayPosts.map( ( post, i ) => {
const titleTrimmed = post.title.rendered.trim();
const titleTrimmed = invoke( post, [
'title',
'rendered',
'trim',
] );
let excerpt = post.excerpt.rendered;

const excerptElement = document.createElement( 'div' );
@@ -9,7 +9,7 @@ const OrderedListSettings = ( { setAttributes, reversed, start } ) => (
<InspectorControls>
<PanelBody title={ __( 'Ordered list settings' ) }>
<TextControl
label={ __( 'Start Value' ) }
label={ __( 'Start value' ) }
type="number"
onChange={ ( value ) => {
const int = parseInt( value, 10 );
@@ -24,7 +24,7 @@ const OrderedListSettings = ( { setAttributes, reversed, start } ) => (
step="1"
/>
<ToggleControl
label={ __( 'Reverse List Numbering' ) }
label={ __( 'Reverse list numbering' ) }
checked={ reversed || false }
onChange={ ( value ) => {
setAttributes( {
@@ -228,7 +228,7 @@ class MediaTextEdit extends Component {
{
value: backgroundColor.color,
onChange: setBackgroundColor,
label: __( 'Background Color' ),
label: __( 'Background color' ),
},
];
const toolbarControls = [
@@ -275,7 +275,7 @@ class MediaTextEdit extends Component {
) }
{ imageFill && (
<FocalPointPicker
label={ __( 'Focal Point Picker' ) }
label={ __( 'Focal point picker' ) }
url={ mediaUrl }
value={ focalPoint }
onChange={ ( value ) =>
@@ -285,7 +285,7 @@ class MediaTextEdit extends Component {
) }
{ mediaType === 'image' && (
<TextareaControl
label={ __( 'Alt Text (Alternative Text)' ) }
label={ __( 'Alt text (alternative text)' ) }
value={ mediaAlt }
onChange={ onMediaAltChange }
help={
@@ -131,7 +131,7 @@ function ParagraphBlock( {
onChange={ setFontSize }
/>
<ToggleControl
label={ __( 'Drop Cap' ) }
label={ __( 'Drop cap' ) }
checked={ !! dropCap }
onChange={ () =>
setAttributes( { dropCap: ! dropCap } )
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.