Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getAccessibilityLabel = () => {
if ( accessibilityLabel || ! showValue ) {
return accessibilityLabel || label;
}
return isEmpty( value ) ?
sprintf(
/* translators: accessibility text. Empty state of a inline textinput cell. %s: The cell's title */
_x( '%s. Empty', 'inline textinput cell' ),
label
) :
// Separating by ',' is necessary to make a pause on urls (non-capitalized text)
sprintf(
/* translators: accessibility text. Inline textinput title and value.%1: Cell title, %2: cell value. */
_x( '%1$s, %2$s', 'inline textinput cell' ),
label,
value
);
};
/>
);
export const settings = {
attributes: blockAttributes,
category: 'jetpack',
description: __(
"Display multiple images in an elegantly organized tiled layout. Serves images using Jetpack's fast global network of servers.",
'jetpack'
),
icon,
keywords: [
_x( 'images', 'block search term', 'jetpack' ),
_x( 'photos', 'block search term', 'jetpack' ),
_x( 'pictures', 'block search term', 'jetpack' ),
],
styles: layoutStylesWithLabels,
supports: {
align: [ 'center', 'wide', 'full' ],
customClassName: false,
html: false,
},
title: __( 'Tiled Gallery', 'jetpack' ),
transforms: {
from: [
{
type: 'block',
isMultiBlock: true,
blocks: [ 'core/image' ],
isMatch: images => getValidImages( images ).length > 0,
transform: images => {
checked={ muted }
/>
setAttributes( { preload: value } ) }
options={ [
{ value: 'auto', label: _x( 'Auto', 'VideoPress preload setting', 'jetpack' ) },
{
value: 'metadata',
label: _x( 'Metadata', 'VideoPress preload setting', 'jetpack' ),
},
{ value: 'none', label: _x( 'None', 'VideoPress preload setting', 'jetpack' ) },
] }
/>
(
.then( ( term ) => {
const hasTerm = !! find( this.state.availableTerms, ( availableTerm ) => availableTerm.id === term.id );
const newAvailableTerms = hasTerm ? this.state.availableTerms : [ term, ...this.state.availableTerms ];
const termAddedMessage = sprintf(
_x( '%s added', 'term' ),
get(
this.props.taxonomy,
[ 'labels', 'singular_name' ],
slug === 'category' ? __( 'Category' ) : __( 'Term' )
)
);
this.props.speak( termAddedMessage, 'assertive' );
this.addRequest = null;
this.setState( {
adding: false,
formName: '',
formParent: '',
availableTerms: newAvailableTerms,
availableTermsTree: this.sortBySelected( buildTermsTree( newAvailableTerms ) ),
} );
onUpdateTerms( [ ...terms, term.id ], taxonomy.rest_base );
function WritingMenu() {
return (
ref={ this.inserterResults }
tabIndex="0"
role="region"
aria-label={ __( 'Available block types' ) }
>
{ !! suggestedItems.length &&
}
{ map( getCategories(), ( category ) => {
const categoryItems = itemsPerCategory[ category.slug ];
if ( ! categoryItems || ! categoryItems.length ) {
return null;
}
return (
<svg aria-hidden="true" role="img" viewBox="0 0 24 24" height="24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0V0z" fill="none"></path>
<path d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM10 5.47l4 1.4v11.66l-4-1.4V5.47zm-5 .99l3-1.01v11.7l-3 1.16V6.46zm14 11.08l-3 1.01V6.86l3-1.16v11.84z"></path>
</svg>
),
category: 'jetpack',
keywords: [
_x( 'map', 'block search term', 'jetpack' ),
_x( 'location', 'block search term', 'jetpack' ),
_x( 'navigation', 'block search term', 'jetpack' ),
],
description: __( 'Add an interactive map showing one or more locations.', 'jetpack' ),
attributes: {
align: {
type: 'string',
},
points: {
type: 'array',
default: [],
},
mapStyle: {
type: 'string',
default: 'default',
},
function _x(single: string, context: string, ...args: any[]): string {
return wpi18n.sprintf(wpi18n._x(single, context, slug), ...args) as string;
}
type="url"
value={ editedUrl }
className="components-placeholder__input"
aria-label={ __( 'Eventbrite URL', 'jetpack' ) }
placeholder={ __( 'Enter an event URL to embed hereā¦', 'jetpack' ) }
onChange={ event => this.setState( { editedUrl: event.target.value } ) }
/>
<button type="submit">
{ _x( 'Embed', 'button label', 'jetpack' ) }
</button>
{ this.cannotEmbed() && (
<p>
{ __( 'Sorry, this content could not be embedded.', 'jetpack' ) }
<br>
<button> fallback( editedUrl, this.props.onReplace ) }>
{ _x( 'Convert to link', 'button label', 'jetpack' ) }
</button>
</p>
) }
);
}
title: __( 'Related Posts', 'jetpack' ),
icon: (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<g stroke="currentColor">
<path d="M4,4 L4,19 M4,4 L19,4 M4,9 L19,9 M4,14 L19,14 M4,19 L19,19 M9,4 L9,19 M19,4 L19,19"></path>
</g>
</svg>
),
category: 'embed',
keywords: [
_x( 'similar content', 'block search term', 'jetpack' ),
_x( 'linked', 'block search term', 'jetpack' ),
_x( 'connected', 'block search term', 'jetpack' ),
],
attributes: {
postLayout: {
type: 'string',
default: 'grid',
},
displayDate: {
type: 'boolean',
default: true,
},
displayThumbnails: {
type: 'boolean',
default: false,
},
displayContext: {