diff --git a/assets/src/admin/paired-browsing/app.js b/assets/src/admin/paired-browsing/app.js index bc9fdb5ff73..99c9b70772c 100644 --- a/assets/src/admin/paired-browsing/app.js +++ b/assets/src/admin/paired-browsing/app.js @@ -429,12 +429,12 @@ class PairedBrowsingApp { /** * Receive loaded. * - * @param {Object} data Data. - * @param {boolean} data.isAmpDocument Whether the document is actually an AMP page. - * @param {string} data.ampUrl The AMP URL. - * @param {string} data.nonAmpUrl The non-AMP URL. - * @param {string} data.documentTitle The title of the document. - * @param {Window} sourceWindow The source window. + * @param {Object} data Data. + * @param {boolean} data.isAmpDocument Whether the document is actually an AMP page. + * @param {string} data.ampUrl The AMP URL. + * @param {string} data.nonAmpUrl The non-AMP URL. + * @param {string} data.documentTitle The title of the document. + * @param {Window} sourceWindow The source window. */ receiveLoaded( { isAmpDocument, ampUrl, nonAmpUrl, documentTitle }, sourceWindow ) { const isAmpSource = this.isAmpWindow( sourceWindow ); diff --git a/assets/src/amp-validation/amp-validated-url-post-edit-screen.js b/assets/src/amp-validation/amp-validated-url-post-edit-screen.js index 8b3ff87db6e..7dff6498b63 100644 --- a/assets/src/amp-validation/amp-validated-url-post-edit-screen.js +++ b/assets/src/amp-validation/amp-validated-url-post-edit-screen.js @@ -91,7 +91,7 @@ const onBeforeUnload = ( event ) => { * If this does not exist yet, it creates the element. * * @param {number} numberErrorsDisplaying - The number of errors displaying. - * @param {number} totalErrors - The total number of errors, displaying or not. + * @param {number} totalErrors - The total number of errors, displaying or not. */ const updateShowingErrorsRow = ( numberErrorsDisplaying, totalErrors ) => { const showAllButton = document.getElementById( showAllId ); diff --git a/assets/src/amp-validation/amp-validation-detail-toggle.js b/assets/src/amp-validation/amp-validation-detail-toggle.js index 2322de2ad26..6c763cffea0 100644 --- a/assets/src/amp-validation/amp-validation-detail-toggle.js +++ b/assets/src/amp-validation/amp-validation-detail-toggle.js @@ -17,7 +17,7 @@ const OPEN_CLASS = 'is-open'; * table column via backend code. * * @param {string} containerSelector Selector for elements that will have the button added. - * @param {string} ariaLabel Screen reader label for the button. + * @param {string} ariaLabel Screen reader label for the button. * @return {Array} Array of added buttons. */ function addToggleButtons( containerSelector, ariaLabel ) { diff --git a/assets/src/amp-validation/copy-to-clipboard-buttons.js b/assets/src/amp-validation/copy-to-clipboard-buttons.js index d19bbcdbc66..df6870e3c59 100644 --- a/assets/src/amp-validation/copy-to-clipboard-buttons.js +++ b/assets/src/amp-validation/copy-to-clipboard-buttons.js @@ -16,7 +16,7 @@ import { getURLValidationTableRows } from './get-url-validation-table-rows'; /** * Success handler, called when data is copied to the clipboard. * - * @param {Object} event + * @param {Object} event * @param {HTMLElement} event.trigger The element triggering the event. */ function onSuccess( { trigger } ) { diff --git a/assets/src/amp-validation/counts/index.js b/assets/src/amp-validation/counts/index.js index de49fe3c391..2a3f2a7dd3f 100644 --- a/assets/src/amp-validation/counts/index.js +++ b/assets/src/amp-validation/counts/index.js @@ -16,7 +16,7 @@ import './style.css'; * If the count is not a number or is `0`, the element that contains the count is instead removed (as it would be no longer relevant). * * @param {HTMLElement} itemEl Menu item element. - * @param {number} count Count to set. + * @param {number} count Count to set. */ function updateMenuItem( itemEl, count ) { if ( isNaN( count ) || count === 0 ) { @@ -29,9 +29,9 @@ function updateMenuItem( itemEl, count ) { /** * Updates the 'Validated URLs' and 'Error Index' menu items with their respective unreviewed count. * - * @param {Object} counts Counts for menu items. + * @param {Object} counts Counts for menu items. * @param {number} counts.validated_urls Unreviewed validated URLs count. - * @param {number} counts.errors Unreviewed validation errors count. + * @param {number} counts.errors Unreviewed validation errors count. */ function updateMenuItemCounts( counts ) { const { validated_urls: newValidatedUrlCount, errors: newErrorCount } = counts; diff --git a/assets/src/amp-validation/get-url-validation-table-rows.js b/assets/src/amp-validation/get-url-validation-table-rows.js index 9d654c6f343..dbf6660839e 100644 --- a/assets/src/amp-validation/get-url-validation-table-rows.js +++ b/assets/src/amp-validation/get-url-validation-table-rows.js @@ -1,7 +1,7 @@ /** * Gets the table rows on a single URL validation screen. * - * @param {Object} options + * @param {Object} options * @param {boolean} options.checkedOnly Whether to return only checked rows. */ export function getURLValidationTableRows( options = {} ) { diff --git a/assets/src/block-editor/components/layout-controls.js b/assets/src/block-editor/components/layout-controls.js index d75bc0790cd..922ba4b7dee 100644 --- a/assets/src/block-editor/components/layout-controls.js +++ b/assets/src/block-editor/components/layout-controls.js @@ -13,10 +13,10 @@ import { __, sprintf } from '@wordpress/i18n'; /** * Layout controls for AMP blocks' attributes: layout, width, height. * - * @param {Object} props Component props. - * @param {Object} props.attributes Block attributes. - * @param {Function} props.setAttributes Callback to update block attributes. - * @param {Array} props.ampLayoutOptions Layout options. + * @param {Object} props Component props. + * @param {Object} props.attributes Block attributes. + * @param {Function} props.setAttributes Callback to update block attributes. + * @param {Array} props.ampLayoutOptions Layout options. * @return {ReactElement} Controls. */ const LayoutControls = ( { attributes, setAttributes, ampLayoutOptions } ) => { diff --git a/assets/src/block-editor/components/media-placeholder.js b/assets/src/block-editor/components/media-placeholder.js index 60df5f04eb7..cb7f89f026a 100644 --- a/assets/src/block-editor/components/media-placeholder.js +++ b/assets/src/block-editor/components/media-placeholder.js @@ -13,9 +13,9 @@ import { __ } from '@wordpress/i18n'; /** * Display media placeholder. * - * @param {Object} props Component props. + * @param {Object} props Component props. * @param {string} props.name Block's name. - * @param {string} props.url URL. + * @param {string} props.url URL. * @return {ReactElement} Placeholder. */ const MediaPlaceholder = ( { name, url } ) => { diff --git a/assets/src/block-editor/helpers/index.js b/assets/src/block-editor/helpers/index.js index 0c1cc6e7b88..6ebb8daeaeb 100644 --- a/assets/src/block-editor/helpers/index.js +++ b/assets/src/block-editor/helpers/index.js @@ -316,10 +316,10 @@ export const filterBlocksEdit = ( BlockEdit ) => { /** * Set width and height in case of image block. * - * @param {Object} props Props. + * @param {Object} props Props. * @param {Function} props.setAttributes Callback to set attributes. - * @param {Object} props.attributes Attributes. - * @param {string} layout Layout. + * @param {Object} props.attributes Attributes. + * @param {string} layout Layout. */ export const setImageBlockLayoutAttributes = ( props, layout ) => { const { attributes, setAttributes } = props; diff --git a/assets/src/block-validation/components/amp-validation-status/test/__snapshots__/status-notification.js.snap b/assets/src/block-validation/components/amp-validation-status/test/__snapshots__/status-notification.js.snap index dce8d0d4f79..488b856432c 100644 --- a/assets/src/block-validation/components/amp-validation-status/test/__snapshots__/status-notification.js.snap +++ b/assets/src/block-validation/components/amp-validation-status/test/__snapshots__/status-notification.js.snap @@ -2,12 +2,12 @@ exports[`AMPValidationStatusNotification renders error message when API request error is present 1`] = `"

request error message

"`; -exports[`AMPValidationStatusNotification renders error message when there are kept issues 1`] = `"

AMP is disabled due to invalid markup being kept for 2 issues.

"`; +exports[`AMPValidationStatusNotification renders error message when there are kept issues 1`] = `"

AMP is disabled due to invalid markup being kept for 2 issues.

"`; exports[`AMPValidationStatusNotification renders message when the post is new 1`] = `"

Validation will be checked upon saving.

"`; exports[`AMPValidationStatusNotification renders message when there are no AMP validation errors 1`] = `"

No AMP validation issues detected.

"`; -exports[`AMPValidationStatusNotification renders message when there are reviewed issues 1`] = `"

AMP is valid. 1 issue was reviewed.

"`; +exports[`AMPValidationStatusNotification renders message when there are reviewed issues 1`] = `"

AMP is valid. 1 issue was reviewed.

"`; -exports[`AMPValidationStatusNotification renders message when there are unreviewed issues 1`] = `"

AMP is valid, but 3 issues need review.

"`; +exports[`AMPValidationStatusNotification renders message when there are unreviewed issues 1`] = `"

AMP is valid, but 3 issues need review.

"`; diff --git a/assets/src/block-validation/components/error/error-content.js b/assets/src/block-validation/components/error/error-content.js index cb7975aa504..339e75ed41f 100644 --- a/assets/src/block-validation/components/error/error-content.js +++ b/assets/src/block-validation/components/error/error-content.js @@ -24,10 +24,10 @@ import AMPDelete from '../../../../images/amp-delete.svg'; import { getErrorSourceTitle } from './get-error-source-title'; /** - * @param {Object} props - * @param {string} props.clientId Error client ID. - * @param {string} props.blockTypeName Block type name. - * @param {Object[]} props.sources List of source objects from the PHP backtrace. + * @param {Object} props + * @param {string} props.clientId Error client ID. + * @param {string} props.blockTypeName Block type name. + * @param {Object[]} props.sources List of source objects from the PHP backtrace. */ function ErrorSource( { clientId, blockTypeName, sources } ) { let source; @@ -145,7 +145,7 @@ MarkupStatus.propTypes = { /** * @param {Object} props - * @param {Object} props.blockTypeIcon Block type icon. + * @param {Object} props.blockTypeIcon Block type icon. * @param {string} props.blockTypeTitle Title of the block type. */ function BlockType( { blockTypeIcon, blockTypeTitle } ) { @@ -175,20 +175,20 @@ BlockType.propTypes = { /** * Content inside an error panel. * - * @param {Object} props Component props. - * @param {Object} props.blockType Block type details. - * @param {boolean} props.external Flag indicating if the error comes from outside of post content. - * @param {boolean} props.removed Flag indicating if the block has been removed. - * @param {string} props.clientId Block client ID - * @param {number} props.status Number indicating the error status. - * @param {Object} props.error Error details. + * @param {Object} props Component props. + * @param {Object} props.blockType Block type details. + * @param {boolean} props.isExternal Flag indicating if the error comes from outside of post content. + * @param {boolean} props.removed Flag indicating if the block has been removed. + * @param {string} props.clientId Block client ID + * @param {number} props.status Number indicating the error status. + * @param {Object} props.error Error details. * @param {Object[]} props.error.sources Sources from the PHP backtrace for the error. */ export function ErrorContent( { blockType, clientId, error: { sources }, - external, + isExternal, removed, status, } ) { @@ -203,13 +203,13 @@ export function ErrorContent( { { __( 'This error is no longer detected, either because the block was removed or the editor mode was switched.', 'amp' ) }

) } - { external && ( + { isExternal && (

{ __( 'This error comes from outside the content (e.g. header or footer).', 'amp' ) }

) }
- { ! ( removed || external ) && ( + { ! ( removed || isExternal ) && ( . * - * @param {Object} args Component props. + * @param {Object} args Component props. * @param {string} args.clientId * @param {number} args.error * @param {number} args.status @@ -39,7 +39,7 @@ export function Error( { clientId, error, status, term_id: termId, title } ) { const reviewLink = useSelect( ( select ) => select( BLOCK_VALIDATION_STORE_KEY ).getReviewLink(), [] ); const reviewed = status === VALIDATION_ERROR_ACK_ACCEPTED_STATUS || status === VALIDATION_ERROR_ACK_REJECTED_STATUS; const kept = status === VALIDATION_ERROR_ACK_REJECTED_STATUS || status === VALIDATION_ERROR_NEW_REJECTED_STATUS; - const external = ! Boolean( clientId ); + const isExternal = ! Boolean( clientId ); const { blockType, removed } = useSelect( ( select ) => { const blockName = select( 'core/block-editor' ).getBlockName( clientId ); @@ -80,13 +80,13 @@ export function Error( { clientId, error, status, term_id: termId, title } ) { blockType={ blockType } clientId={ clientId } error={ error } - external={ external } + isExternal={ isExternal } removed={ removed } status={ status } />
- { ! ( removed || external ) && ( + { ! ( removed || isExternal ) && (