Skip to content

Commit

Permalink
Merge pull request #6374 from ampproject/add/path-suffix-conflict-det…
Browse files Browse the repository at this point in the history
…ails

Indicate what entity(s) are blocking the use of the paired endpoint suffix
  • Loading branch information
westonruter authored Jun 12, 2021
2 parents 8a42c7b + fd93c82 commit 8893d62
Show file tree
Hide file tree
Showing 12 changed files with 303 additions and 61 deletions.
1 change: 0 additions & 1 deletion assets/src/block-editor/components/layout-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { __, sprintf } from '@wordpress/i18n';
* @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 } ) => {
Expand Down
1 change: 0 additions & 1 deletion assets/src/block-editor/components/media-placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { __ } from '@wordpress/i18n';
* @param {Object} props Component props.
* @param {string} props.name Block's name.
* @param {string} props.url URL.
*
* @return {ReactElement} Placeholder.
*/
const MediaPlaceholder = ( { name, url } ) => {
Expand Down
15 changes: 0 additions & 15 deletions assets/src/block-editor/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const ampLayoutOptions = [
*
* @param {Object} settings Block settings.
* @param {string} name Block name.
*
* @return {Object} Modified block settings.
*/
export const addAMPAttributes = ( settings, name ) => {
Expand Down Expand Up @@ -140,7 +139,6 @@ export const addAMPAttributes = ( settings, name ) => {
*
* @param {Object} settings Block settings.
* @param {string} name Block name.
*
* @return {Object} Modified block settings.
*/
export const removeAmpFitTextFromBlocks = ( settings, name ) => {
Expand Down Expand Up @@ -223,9 +221,7 @@ export const removeAmpFitTextFromBlocks = ( settings, name ) => {
* removed and the deprecation of the block and proceed without error.
*
* @see removeAmpFitTextFromBlocks
*
* @param {ReactElement} element Block save result.
*
* @return {ReactElement} Modified block if it is of `amp-fit-text` type, otherwise the original element is returned.
*/
export const removeClassFromAmpFitTextBlocks = ( element ) => {
Expand All @@ -242,7 +238,6 @@ export const removeClassFromAmpFitTextBlocks = ( element ) => {
* Get layout options depending on the block.
*
* @param {string} block Block name.
*
* @return {Object[]} Options.
*/
export const getLayoutOptions = ( block ) => {
Expand Down Expand Up @@ -271,7 +266,6 @@ export const getLayoutOptions = ( block ) => {
* Filters blocks edit function of all blocks.
*
* @param {Function} BlockEdit function.
*
* @return {Function} Edit function.
*/
export const filterBlocksEdit = ( BlockEdit ) => {
Expand Down Expand Up @@ -358,7 +352,6 @@ export const setImageBlockLayoutAttributes = ( props, layout ) => {
* Default setup for inspector controls.
*
* @param {Object} props Props.
*
* @return {ReactElement} Inspector Controls.
*/
export const setUpInspectorControls = ( props ) => {
Expand Down Expand Up @@ -386,9 +379,7 @@ setUpInspectorControls.propTypes = {
* Get AMP Layout select control.
*
* @deprecated As of v2.1. Blocks with the `ampLayout` attribute will still be able to use the control.
*
* @param {Object} props Props.
*
* @return {ReactElement} Element.
*/
export const AmpLayoutControl = ( props ) => {
Expand Down Expand Up @@ -446,9 +437,7 @@ AmpLayoutControl.propTypes = {
* Get AMP Noloading toggle control.
*
* @deprecated As of v2.1. Blocks with the `ampNoLoading` attribute will still be able to use the control.
*
* @param {Object} props Props.
*
* @return {ReactElement} Element.
*/
export const AmpNoloadingToggle = ( props ) => {
Expand Down Expand Up @@ -495,7 +484,6 @@ AmpNoloadingToggle.propTypes = {
* Get AMP Lightbox toggle control.
*
* @param {Object} props Props.
*
* @return {ReactElement} Element.
*/
const AmpLightboxToggle = ( props ) => {
Expand Down Expand Up @@ -538,7 +526,6 @@ AmpLightboxToggle.propTypes = {
* @param {Object} props.attributes Block attributes.
* @param {Object} props.attributes.ampCarousel AMP Carousel toggle value.
* @param {Function} props.setAttributes Callback to update attributes.
*
* @return {Object} Element.
*/
const AmpCarouselToggle = ( props ) => {
Expand All @@ -565,7 +552,6 @@ AmpCarouselToggle.propTypes = {
*
* @param {Object} props Props.
* @param {boolean} props.isSelected Whether the current block has been selected or not.
*
* @return {Object} Inspector Controls.
*/
const setUpImageInspectorControls = ( props ) => {
Expand Down Expand Up @@ -596,7 +582,6 @@ setUpImageInspectorControls.propTypes = {
*
* @param {Object} props Props.
* @param {boolean} props.isSelected Whether the current block has been selected or not.
*
* @return {Object} Inspector controls.
*/
const setUpGalleryInspectorControls = ( props ) => {
Expand Down
7 changes: 0 additions & 7 deletions assets/src/block-editor/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Returns whether the current theme has AMP support.
*
* @param {Object} state Editor state.
*
* @return {boolean} Whether the current theme has AMP support.
*/
export function hasThemeSupport( state ) {
Expand All @@ -13,7 +12,6 @@ export function hasThemeSupport( state ) {
* Returns whether the current user has the AMP DevTools enabled.
*
* @param {Object} state The editor state.
*
* @return {boolean} Whether the DevTools are enabled.
*/
export function isDevToolsEnabled( state ) {
Expand All @@ -24,7 +22,6 @@ export function isDevToolsEnabled( state ) {
* Returns whether the current site is in Standard mode (AMP-first) as opposed to Transitional (paired).
*
* @param {Object} state Editor state.
*
* @return {boolean} Whether the current site is AMP-first.
*/
export function isStandardMode( state ) {
Expand All @@ -35,7 +32,6 @@ export function isStandardMode( state ) {
* Returns the AMP validation error messages.
*
* @param {Object} state The editor state.
*
* @return {string[]} The validation error messages.
*/
export function getErrorMessages( state ) {
Expand All @@ -46,7 +42,6 @@ export function getErrorMessages( state ) {
* Returns the AMP preview link (URL).
*
* @param {Object} state The editor state.
*
* @return {string} The AMP preview link URL.
*/
export function getAmpPreviewLink( state ) {
Expand All @@ -57,7 +52,6 @@ export function getAmpPreviewLink( state ) {
* Returns the AMP URL.
*
* @param {Object} state The editor state.
*
* @return {string} The AMP URL.
*/
export function getAmpUrl( state ) {
Expand All @@ -68,7 +62,6 @@ export function getAmpUrl( state ) {
* Returns the list of AMP blocks found in the post.
*
* @param {Object} state The editor state.
*
* @return {string[]} The list of AMP blocks in post.
*/
export function getAmpBlocksInUse( state ) {
Expand Down
1 change: 0 additions & 1 deletion assets/src/classic-editor/amp-post-meta-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import jQuery from 'jquery';
* AMP Post Meta Box.
*
* @todo Rename this to be just the ampEditPostScreen?
*
* @since 0.6
*/
window.ampPostMetaBox = ( function( $ ) {
Expand Down
1 change: 0 additions & 1 deletion assets/src/common/components/pre-publish-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { validateFeaturedImage } from '../helpers';
* @param {Object} props.featuredMedia Media object.
* @param {Array} props.dimensions Required image dimensions.
* @param {boolean} props.required Whether selecting a featured image is required.
*
* @return {Function} Either a plain pre-publish panel, or the panel with a featured image notice.
*/
const PrePublishPanel = ( { featuredMedia, dimensions, required } ) => {
Expand Down
5 changes: 1 addition & 4 deletions assets/src/common/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
* @param {Object} dimensions An object with minimum required width and height values.
* @param {number} dimensions.width Required media width in pixels.
* @param {number} dimensions.height Required media height in pixels.
*
* @return {boolean} Whether the media has the minimum dimensions.
*/
export const hasMinimumDimensions = ( media, dimensions ) => {
Expand All @@ -46,15 +45,14 @@ export const hasMinimumDimensions = ( media, dimensions ) => {
/**
* Get minimum dimensions for a featured image.
*
* @see https://developers.google.com/search/docs/data-types/article#article_types
*
* "Images should be at least 1200 pixels wide.
* For best results, provide multiple high-resolution images (minimum of 800,000 pixels when multiplying width and height)
* with the following aspect ratios: 16x9, 4x3, and 1x1."
*
* Given this requirement, this function ensures the right aspect ratio.
* The 16/9 aspect ratio is chosen because it has the smallest height for the given width.
*
* @see https://developers.google.com/search/docs/data-types/article#article_types
* @return {Object} Minimum dimensions including width and height.
*/
export const getMinimumFeaturedImageDimensions = () => {
Expand All @@ -76,7 +74,6 @@ export const getMinimumFeaturedImageDimensions = () => {
* @param {number} dimensions.width Minimum required width value.
* @param {number} dimensions.height Minimum required height value.
* @param {boolean} required Whether the image is required or not.
*
* @return {string[]|null} Validation errors, or null if there were no errors.
*/
export const validateFeaturedImage = ( media, dimensions, required ) => {
Expand Down
1 change: 0 additions & 1 deletion assets/src/components/carousel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ Carousel.propTypes = {
* Styles for the carousel component, rendered as a string in JSX to facilitate dynamic rules.
*
* @todo Installing a styled components library would provide better tooling for this.
*
* @param {Object} props Component props.
* @param {number} props.gutterWidth The amount of space between items.
* @param {number} props.itemWidth The width of items.
Expand Down
Loading

0 comments on commit 8893d62

Please sign in to comment.