import { blueGrey, indigo } from '@material-ui/core/colors';
import React from 'react';
// UI
import { CustomSlider } from '../editorcomponents';
const BLOCKS_TEMPLATE_THEME = [['agenda/slickslide'],];
const SLIDE_BLOCKS_TEMPLATE_THEME = [['agendahelsinki/tailwindblock'],];
const ALLOWED_BLOCKS_THEME = [ 'agenda/slickslide' ];
const wp = window.wp;
const { InnerBlocks, InspectorControls } = wp.blockEditor
/**
* Slide
*/
wp.blocks.registerBlockType( 'agenda/slickslide', {
title: 'Slick.js Slide (Agenda Theme)',
category: 'agendahelsinki',
icon: {background: '#ff2e44',foreground:'#000',src:'tagcloud'},
parent: [ 'agenda/slick' ],
supports: {
inserter: true
},
example:()=>null,
getEditWrapperProps:(attributes)=>{
return{
style:{border:'solid 1px black'}
}
},
edit: ( props ) => {
return (
{( 'undefined' !== typeof props.insertBlocksAfter ) ?
: null}
);
},
save: () => {
return (
);
},
});
const CustomBlockAppender = () =>
/**
* Slick Block
*/
wp.blocks.registerBlockType( 'agenda/slick', {
title: 'Slick.js',
category: 'agendahelsinki',
icon: {background: '#eee',foreground:'#000',src:'admin-page'},
supports: {
defaultStylePicker:false,
inserter: true
},
attributes: {
className:{type:'string',default:''},
editorlabel:{type:'string',default:''},
//SLICK CHOICES
slidesToShow:{type:'integer',default:1},
slidesToScroll:{type:'integer',default:1},
dots:{type:'boolean',default:true},
infinite:{type:'boolean',default:true},
speed:{type:'integer',default:500},
fade:{type:'boolean',default:true},
cssEase:{type:'string',default:'linear'},
autoplay:{type:'boolean',default:true},
autoplaySpeed:{type:'integer',default:4000},
pauseOnHover:{type:'boolean',default:false},
centerMode: {type: 'boolean',default:true},
adaptiveHeight: {type:'boolean',default:true},
variableWidth:{type:'boolean',default:true},
arrows:{type:'boolean',default:true}
},
getEditWrapperProps:(attributes)=>{
return{
style:{border:'solid 1px black'}
}
},
edit: props => {
const {attributes,setAttributes} = props;
const checkedcolor=indigo[500];
return (
Slick.js Carousel
Options
Dots
Infinite scroll
Fade
Autoplay
Pause on hover
Center Mode
Adaptive Height
Variable Width
Arrows
Slides
} />
);
},
save: props => {
const {attributes} = props;
let dataslickobject={
dots: attributes.dots,
infinite: attributes.infinite,
speed: attributes.speed,
fade: attributes.fade,
cssEase: attributes.cssEase,
slidesToShow:attributes.slidesToShow,
slidesToScroll:attributes.slidesToScroll,
autoplay: attributes.autoplay,
autoplaySpeed: attributes.autoplaySpeed,
pauseOnHover: attributes.pauseOnHover,
centerMode: attributes.centerMode,
adaptiveHeight: attributes.adaptiveHeight,
variableWidth: attributes.variableWidth,
arrows:attributes.arrows
},
dataslickstring=JSON.stringify(dataslickobject);
return (
);
},
});