import {
registerBlockType,
__,
InspectorControls,
BlockControls,
RichText,
ToggleControl,
TextControl,
BlockAlignmentToolbar,
ColorPalette,
PanelColorSettings,
IconButton,
Dashicon,
SelectControl,
RangeControl,
URLInput,
PanelBody,
Toolbar,
ContrastChecker,
ServerSideRender,
omit,
merge,
Fragment,
} from '../../wp-imports'
import { PenciIcon } from '../../icons'
const MIN_NUMBER= 1;
const MAX_NUMBER = 100;
// Rendering in PHP
export const save = ( props ) => { return null }
export const edit = ( props ) => {
const { isSelected, className, setAttributes } = props;
const { title,cat,numbers_posts,columns,display_title,display_cat,primary_cat,display_date,display_image,image_size,cat_link, cat_link_text } = props.attributes;
const selectcolumns = [
{ value: '2', label: __( '2 Columns' ) },
{ value: '3', label: __( '3 Columns' ) },
{ value: '4', label: __( '4 Columns' ) },
];
const selectImageSize = [
{ value: 'landscape', label: __( 'Landscape' ) },
{ value: 'square', label: __( 'Square' ) },
{ value: 'vertical', label: __( 'Vertical' ) },
];
return (
setAttributes( { title: newValue } ) }
/>
setAttributes( { cat: newValue } ) }
/>
setAttributes( { numbers_posts: newValue } ) }
min={ MIN_NUMBER }
max={ MAX_NUMBER }
/>
( {
value: value,
label: label,
} ) ) }
onChange={ ( newValue ) => { setAttributes( { columns: newValue } ) } }
/>
setAttributes( { display_title: ! display_title } ) }
/>
setAttributes( { display_cat: ! display_cat } ) }
/>
setAttributes( { primary_cat: ! primary_cat } ) }
/>
setAttributes( { display_date: ! display_date } ) }
/>
setAttributes( { display_image: ! display_image } ) }
/>
( {
value: value,
label: label,
} ) ) }
onChange={ ( newValue ) => { setAttributes( { image_size: newValue } ) } }
/>
setAttributes( { cat_link: ! cat_link } ) }
/>
setAttributes( { cat_link_text: newValue } ) }
/>
);
}
registerBlockType( 'penci-gutenberg/recipe-index', {
title: __( 'Penci: Recipe Index' ),
icon: PenciIcon,
category: 'penci-blocks',
edit: edit,
save: save,
} );
x
Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586