Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'height',
] );
mediaProps.url =
get( media, [ 'sizes', sizeSlug, 'url' ] ) ||
get( media, [ 'media_details', 'sizes', sizeSlug, 'source_url' ] ) ||
get( media, [ 'media_details', 'videopress', 'original' ] ) ||
get( media, [ 'media_details', 'original', 'url' ] ) ||
media.url;
mediaProps.type = media.media_type || media.type;
mediaProps.mime = media.mime_type || media.mime;
mediaProps.width = mediaProps.width || get( media, [ 'media_details', 'width' ] );
mediaProps.height = mediaProps.height || get( media, [ 'media_details', 'height' ] );
return mediaProps;
};
export default withNotices( function StoryEdit( {
attributes,
className,
isSelected,
noticeOperations,
noticeUI,
setAttributes,
} ) {
const { mediaFiles } = attributes;
const { lockPostSaving, unlockPostSaving } = useDispatch( 'core/editor' );
const lockName = 'storyBlockLock';
const onSelectMedia = newMediaFiles => {
const allMedia = newMediaFiles.map( file => pickRelevantMediaFiles( file ) );
const uploadedMedias = allMedia.filter( media => ! isBlobURL( media.url ) );
// prevent saving blob urls in mediaFiles block attribute
if ( allMedia.length !== uploadedMedias.length ) {
/** @format */
/* eslint-disable wpcalypso/jsx-classname-namespace */
/**
* External dependencies
*/
import React from 'react';
/**
* WordPress Dependencies
*/
import { createSlotFill, withFocusReturn } from '@wordpress/components';
import { withSelect } from '@wordpress/data';
import { ifCondition, compose } from '@wordpress/compose';
const { Fill, Slot } = createSlotFill( 'Sidebar' );
/**
* Renders a sidebar with its content.
*
* @return {Object} The rendered sidebar.
*/
const Sidebar = ( { children, label } ) => {
return (
<div tabindex="-1" label="" aria-label="{" role="region">
{ children }
</div>
);
};
/**
* WordPress dependencies
*/
import { createSlotFill, PanelBody } from '@wordpress/components';
const { Fill, Slot } = createSlotFill( 'PluginPrePublishPanel' );
/**
* Renders provided content to the pre-publish side panel in the publish flow
* (side panel that opens when a user first pushes "Publish" from the main editor).
*
* @param {Object} props Component props.
* @param {string} [props.className] An optional class name added to the panel.
* @param {string} [props.title] Title displayed at the top of the panel.
* @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.
*
* @example ES5
* ```js
* // Using ES5 syntax
* var __ = wp.i18n.__;
* var PluginPrePublishPanel = wp.editPost.PluginPrePublishPanel;
*
* The attributes for this block.
*/
attributes: PropTypes.object.isRequired,
/**
* The register block name.
*/
name: PropTypes.string.isRequired,
/**
* A callback to update attributes.
*/
setAttributes: PropTypes.func.isRequired,
// from withSpokenMessages
debouncedSpeak: PropTypes.func.isRequired,
};
export default withSpokenMessages( ReviewsByProductEditor );
* The attributes for this block.
*/
attributes: PropTypes.object.isRequired,
/**
* The register block name.
*/
name: PropTypes.string.isRequired,
/**
* A callback to update attributes.
*/
setAttributes: PropTypes.func.isRequired,
// from withSpokenMessages
debouncedSpeak: PropTypes.func.isRequired,
};
export default withSpokenMessages( ReviewsByCategoryEditor );
* The attributes for this block
*/
attributes: PropTypes.object.isRequired,
/**
* The register block name.
*/
name: PropTypes.string.isRequired,
/**
* A callback to update attributes
*/
setAttributes: PropTypes.func.isRequired,
// from withSpokenMessages
debouncedSpeak: PropTypes.func.isRequired,
};
export default withSpokenMessages( ProductsBlock );
* The attributes for this block
*/
attributes: PropTypes.object.isRequired,
/**
* The register block name.
*/
name: PropTypes.string.isRequired,
/**
* A callback to update attributes
*/
setAttributes: PropTypes.func.isRequired,
// from withSpokenMessages
debouncedSpeak: PropTypes.func.isRequired,
};
export default withSpokenMessages( ProductsByAttributeBlock );
setAttributes( { caption: value } ) }
inlineToolbar
/>
) }
);
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */
}
}
export default withNotices( AudioEdit );
// Generate a class name for the block's editable form
const generatedClassName = hasBlockSupport( blockType, 'className', true ) ?
getBlockDefaultClassName( name ) :
null;
const className = classnames( generatedClassName, attributes.className );
// `edit` and `save` are functions or components describing the markup
// with which a block is displayed. If `blockType` is valid, assign
// them preferentially as the render value for the block.
const Component = blockType.edit || blockType.save;
return ;
};
export default withFilters( 'editor.BlockEdit' )( Edit );
toggleSelection( selectionEnabled ) {
toggleSelection( selectionEnabled );
},
setNavigationMode,
};
} );
export default compose(
pure,
withViewportMatch( { isLargeViewport: 'medium' } ),
applyWithSelect,
applyWithDispatch,
// block is sometimes not mounted at the right time, causing it be undefined
// see issue for more info https://github.com/WordPress/gutenberg/issues/17013
ifCondition( ( { block } ) => !! block ),
withFilters( 'editor.BlockListBlock' )
)( BlockListBlock );