Skip to content

Commit

Permalink
Automatic reformat with yarn reformat-files
Browse files Browse the repository at this point in the history
  • Loading branch information
scinos committed Apr 20, 2020
1 parent 1f228c2 commit 4537033
Show file tree
Hide file tree
Showing 3,679 changed files with 18,662 additions and 16,110 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion apps/full-site-editing/bin/npm-run-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const argsToCommands = {
'--sync': 'wpcom-sync',
};

const commands = args.map( arg => argsToCommands[ arg ] ).filter( val => !! val );
const commands = args.map( ( arg ) => argsToCommands[ arg ] ).filter( ( val ) => !! val );

console.log( `Running the following commands: ${ commands.toString() }` );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const NavigationMenuEdit = ( {
<BlockControls>
<AlignmentToolbar
value={ textAlign }
onChange={ nextAlign => {
onChange={ ( nextAlign ) => {
setAttributes( { textAlign: nextAlign } );
} }
/>
Expand Down Expand Up @@ -90,7 +90,7 @@ const NavigationMenuEdit = ( {
export default compose( [
withColors( 'backgroundColor', { textColor: 'color' } ),
withFontSizes( 'fontSize' ),
withSelect( select => {
withSelect( ( select ) => {
return {
isPublished: select( 'core/editor' ).isCurrentPostPublished(),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ registerBlockType( 'a8c/post-content', {
save,
} );

const addContentSlotClassname = createHigherOrderComponent( BlockListBlock => {
return props => {
const addContentSlotClassname = createHigherOrderComponent( ( BlockListBlock ) => {
return ( props ) => {
if ( props.name !== 'a8c/post-content' ) {
return <BlockListBlock { ...props } />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function SiteCreditEdit( {
<BlockControls>
<AlignmentToolbar
value={ textAlign }
onChange={ nextAlign => {
onChange={ ( nextAlign ) => {
setAttributes( { textAlign: nextAlign } );
} }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function SiteDescriptionEdit( {
<BlockControls>
<AlignmentToolbar
value={ textAlign }
onChange={ nextAlign => {
onChange={ ( nextAlign ) => {
setAttributes( { textAlign: nextAlign } );
} }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function SiteTitleEdit( {
<BlockControls>
<AlignmentToolbar
value={ textAlign }
onChange={ nextAlign => {
onChange={ ( nextAlign ) => {
setAttributes( { textAlign: nextAlign } );
} }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const TemplateEdit = compose(

const { align, className } = attributes;

const save = event => {
const save = ( event ) => {
event.stopPropagation();
setNavigateToTemplate( true );
if ( ! isDirty ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ if ( 'wp_template_part' !== fullSiteEditing.editorPostType ) {
} );
}

const addFSETemplateClassname = createHigherOrderComponent( BlockListBlock => {
return props => {
const addFSETemplateClassname = createHigherOrderComponent( ( BlockListBlock ) => {
return ( props ) => {
if ( props.name !== 'a8c/template' ) {
return <BlockListBlock { ...props } />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import { createHigherOrderComponent } from '@wordpress/compose';
import { addFilter } from '@wordpress/hooks';

const addFSESiteLogoClassname = createHigherOrderComponent( BlockListBlock => {
return props => {
const addFSESiteLogoClassname = createHigherOrderComponent( ( BlockListBlock ) => {
return ( props ) => {
if ( props.attributes.className !== 'fse-site-logo' ) {
return <BlockListBlock { ...props } />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { compose } from '@wordpress/compose';
import { withSelect } from '@wordpress/data';

const PostContentBlockAppender = compose(
withSelect( select => {
withSelect( ( select ) => {
const { getEditorSettings } = select( 'core/editor' );
const { getBlocks } = select( 'core/block-editor' );
const { getEditorMode } = select( 'core/edit-post' );

const postContentBlock = getBlocks().find( block => block.name === 'a8c/post-content' );
const postContentBlock = getBlocks().find( ( block ) => block.name === 'a8c/post-content' );

return {
rootClientId: postContentBlock ? postContentBlock.clientId : '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import { use } from '@wordpress/data';

// The purpose of this override is to prevent Switch to Draft action for template CPTs.
use( registry => {
use( ( registry ) => {
return {
dispatch: namespace => {
dispatch: ( namespace ) => {
const actions = { ...registry.dispatch( namespace ) };
const { editorPostType } = fullSiteEditing;

Expand All @@ -19,7 +19,7 @@ use( registry => {
) {
const originalEditPost = actions.editPost;

actions.editPost = edits => {
actions.editPost = ( edits ) => {
const { status } = edits;

// Bail if editPost is attempting to set draft as status.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import { use } from '@wordpress/data';

// The purpose of this override is to prevent trash action from deleting template CPTs.
use( registry => {
use( ( registry ) => {
return {
dispatch: namespace => {
dispatch: ( namespace ) => {
const actions = { ...registry.dispatch( namespace ) };
const { editorPostType } = fullSiteEditing;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function useSiteOptions(

function loadSiteOption() {
apiFetch( { path: '/wp/v2/settings' } )
.then( result =>
.then( ( result ) =>
setSiteOptions( {
...siteOptions,
option: decodeEntities( result[ siteOption ] ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ import { useSiteOptions } from './use-site-options';
* ] )( Component );
*
*/
export const withSiteOptions = options =>
export const withSiteOptions = ( options ) =>
createHigherOrderComponent(
WrappedComponent =>
pure( ownProps => {
const shouldUpdateSiteOption = useSelect( select => {
( WrappedComponent ) =>
pure( ( ownProps ) => {
const shouldUpdateSiteOption = useSelect( ( select ) => {
const {
isSavingPost,
isPublishingPost,
Expand All @@ -71,7 +71,7 @@ export const withSiteOptions = options =>
} );

const createErrorNotice = useDispatch(
dispatch => dispatch( 'core/notices' ).createErrorNotice
( dispatch ) => dispatch( 'core/notices' ).createErrorNotice
);

const { isSelected, setAttributes } = ownProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import './style.scss';
function BackButtonOverride( { defaultLabel, defaultUrl } ) {
const [ label, updateLabel ] = useState( defaultLabel );
const [ url, updateUrl ] = useState( defaultUrl );
window.wp.hooks.addAction( 'updateCloseButtonOverrides', 'a8c-fse', data => {
window.wp.hooks.addAction( 'updateCloseButtonOverrides', 'a8c-fse', ( data ) => {
updateLabel( data.label );
updateUrl( data.closeUrl );
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { endsWith, get, map } from 'lodash';
import { withSelect } from '@wordpress/data';
import { registerPlugin } from '@wordpress/plugins';

const EditorTemplateClasses = withSelect( select => {
const EditorTemplateClasses = withSelect( ( select ) => {
const { getEntityRecord } = select( 'core' );
const { getEditedPostAttribute } = select( 'core/editor' );
const templateClasses = map( getEditedPostAttribute( 'template_part_types' ), typeId => {
const templateClasses = map( getEditedPostAttribute( 'template_part_types' ), ( typeId ) => {
const typeName = get(
getEntityRecord( 'taxonomy', 'wp_template_part_type', typeId ),
'name',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const edit = ( { attributes, setAttributes, className } ) => {
<input
type="text"
value={ attributes.eventTitle }
onChange={ evt => setAttributes( { eventTitle: evt.target.value } ) }
onChange={ ( evt ) => setAttributes( { eventTitle: evt.target.value } ) }
placeholder={ __( 'Event Title', 'full-site-editing' ) }
className="event-countdown__event-title"
aria-label={ __( 'Event Title', 'full-site-editing' ) }
Expand All @@ -62,7 +62,7 @@ const edit = ( { attributes, setAttributes, className } ) => {
renderContent={ () => (
<DateTimePicker
key="event-countdown-picker"
onChange={ eventDate => setAttributes( { eventDate } ) }
onChange={ ( eventDate ) => setAttributes( { eventDate } ) }
currentDate={ attributes.eventDate }
/>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ registerBlockType( 'jetpack/event-countdown', {
},
},

edit: props => {
edit: ( props ) => {
if ( props.isSelected ) {
return edit( props );
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Event Countdown Block
// JavaScript that loads on front-end to update the block
( function() {
( function () {
// loop through all event countdown blocks on page
const intervalIds = [];
const cals = document.getElementsByClassName( 'wp-block-jetpack-event-countdown' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ registerDOMUpdater( [ FONT_BASE, FONT_HEADINGS ], select( STORE_NAME ).getOption

registerPlugin( PLUGIN_NAME, {
render: compose(
withSelect( getSelectors => ( {
withSelect( ( getSelectors ) => ( {
siteName: getSelectors( STORE_NAME ).getOption( SITE_NAME ),
fontHeadings: getSelectors( STORE_NAME ).getOption( FONT_HEADINGS ),
fontHeadingsDefault: getSelectors( STORE_NAME ).getOption( FONT_HEADINGS_DEFAULT ),
Expand All @@ -42,7 +42,7 @@ registerPlugin( PLUGIN_NAME, {
fontOptions: getSelectors( STORE_NAME ).getOption( FONT_OPTIONS ),
hasLocalChanges: getSelectors( STORE_NAME ).hasLocalChanges(),
} ) ),
withDispatch( dispatch => ( {
withDispatch( ( dispatch ) => ( {
updateOptions: dispatch( STORE_NAME ).updateOptions,
publishOptions: dispatch( STORE_NAME ).publishOptions,
resetLocalChanges: dispatch( STORE_NAME ).resetLocalChanges,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default ( options, getOptionValue ) => {
const currentOptions = {};
let previousOptions = {};
const cssVariables = {};
options.forEach( option => {
options.forEach( ( option ) => {
cssVariables[ option ] = `--${ option.replace( '_', '-' ) }`;
} );

Expand All @@ -44,7 +44,7 @@ export default ( options, getOptionValue ) => {
}

// Maybe bail-out early.
options.forEach( option => {
options.forEach( ( option ) => {
currentOptions[ option ] = getOptionValue( option );
} );
if ( isEmpty( currentOptions ) || isEqual( currentOptions, previousOptions ) ) {
Expand All @@ -55,7 +55,7 @@ export default ( options, getOptionValue ) => {
// Update style node. We need this to be a stylesheet rather than inline styles
// so the styles apply to all editor instances incl. previews.
let declarationList = '';
Object.keys( currentOptions ).forEach( key => {
Object.keys( currentOptions ).forEach( ( key ) => {
declarationList += `${ cssVariables[ key ] }:${ currentOptions[ key ] };`;
} );
styleElement.textContent = `.editor-styles-wrapper{${ declarationList }}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default ( { fontPairings, fontBase, fontHeadings, update } ) => {
aria-selected={ isSelected }
className={ classes }
onClick={ () => update( { headings, base } ) }
onKeyDown={ event =>
onKeyDown={ ( event ) =>
event.keyCode === ENTER ? update( { headings, base } ) : null
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ export default ( {
label={ __( 'Heading Font' ) }
value={ fontHeadings }
options={ fontHeadingsOptions }
onChange={ newValue => updateHeadingsFont( newValue ) }
onChange={ ( newValue ) => updateHeadingsFont( newValue ) }
style={ { fontFamily: fontHeadings !== 'unset' ? fontHeadings : fontHeadingsDefault } }
/>
<SelectControl
label={ __( 'Base Font' ) }
value={ fontBase }
options={ fontBaseOptions }
onChange={ newValue => updateBaseFont( newValue ) }
onChange={ ( newValue ) => updateBaseFont( newValue ) }
style={ { fontFamily: fontBase !== 'unset' ? fontBase : fontBaseDefault } }
/>
<hr />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,20 @@ import { FONT_BASE, FONT_HEADINGS } from './constants';

const ANY_PROPERTY = 'ANY_PROPERTY';

const isFor = filterProperty => option =>
const isFor = ( filterProperty ) => ( option ) =>
option.prop === ANY_PROPERTY || option.prop === filterProperty;

const toOption = font => {
const toOption = ( font ) => {
if ( typeof font === 'object' ) {
const { label, value, prop = ANY_PROPERTY } = font;
return { label, value, prop };
}
return { label: font, value: font, prop: ANY_PROPERTY };
};
const isNotNull = option => option.value !== null && option.label !== null;
const isNotNull = ( option ) => option.value !== null && option.label !== null;

const toOptions = ( options, filterProperty ) =>
! options
? []
: options
.map( toOption )
.filter( isNotNull )
.filter( isFor( filterProperty ) );
! options ? [] : options.map( toOption ).filter( isNotNull ).filter( isFor( filterProperty ) );

const PanelActionButtons = ( {
hasLocalChanges,
Expand Down Expand Up @@ -88,8 +83,10 @@ export default ( {
>
<PanelBody>
<p>
{ /* translators: %s: Name of site. */
sprintf( __( 'You are customizing %s.' ), siteName ) }
{
/* translators: %s: Name of site. */
sprintf( __( 'You are customizing %s.' ), siteName )
}
</p>
<p>{ __( 'Any change you make here will apply to the entire website.' ) }</p>
{ hasLocalChanges ? (
Expand All @@ -113,8 +110,8 @@ export default ( {
fontHeadingsDefault={ fontHeadingsDefault }
fontBaseOptions={ toOptions( fontOptions, FONT_BASE ) }
fontHeadingsOptions={ toOptions( fontOptions, FONT_HEADINGS ) }
updateBaseFont={ value => updateOptions( { [ FONT_BASE ]: value } ) }
updateHeadingsFont={ value => updateOptions( { [ FONT_HEADINGS ]: value } ) }
updateBaseFont={ ( value ) => updateOptions( { [ FONT_BASE ]: value } ) }
updateHeadingsFont={ ( value ) => updateOptions( { [ FONT_HEADINGS ]: value } ) }
/>
<FontPairingsPanel
fontHeadings={ fontHeadings }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { __, sprintf } from '@wordpress/i18n';

export default ( { unsupportedFeature } ) => (
<p>
{ /* translators: %s: feature name (i.e. font pairings, etc) */
sprintf( __( "Your active theme doesn't support %s." ), unsupportedFeature ) }
{
/* translators: %s: feature name (i.e. font pairings, etc) */
sprintf( __( "Your active theme doesn't support %s." ), unsupportedFeature )
}
</p>
);
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default ( storeName, optionsPath ) => {
return state ? state[ key ] : undefined;
},
hasLocalChanges( state ) {
return !! state && Object.keys( cache ).some( key => cache[ key ] !== state[ key ] );
return !! state && Object.keys( cache ).some( ( key ) => cache[ key ] !== state[ key ] );
},
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { __ } from '@wordpress/i18n';
* WordPress dependencies
*/

export const BlockAppender = props => {
export const BlockAppender = ( props ) => {
const { onClick } = props;
return (
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function registerTimelineItemBlock() {
colorSettings={ [
{
value: attributes.background,
onChange: background => setAttributes( { background } ),
onChange: ( background ) => setAttributes( { background } ),
label: __( 'Background Color', 'full-site-editing' ),
},
] }
Expand Down
Loading

0 comments on commit 4537033

Please sign in to comment.