FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
cozy-addons
/
cozy-blocks
/
dist
/
post-carousel
/
build
Edit File: index.js
(()=>{"use strict";var o,e={704:()=>{const o=window.wp.blocks,e=window.wp.i18n,n=window.wp.blockEditor,a=window.wp.components,i=window.wp.element,s=window.wp.compose,t=window.ReactJSXRuntime,l=()=>(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"16px",marginBottom:"10px"},children:[(0,t.jsx)("p",{children:(0,t.jsxs)("svg",{width:"41",height:"48",viewBox:"0 0 41 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M0 34.7721L6.88004 38.677V15.8055L20.4542 7.80977L23.9872 9.4833L30.4953 5.57841L20.4542 -7.62939e-06L0 11.9006V34.7721Z",fill:"#38DAC7"}),(0,t.jsx)("path",{d:"M32.9284 6.87939L34.2126 7.61318L12.3825 19.904L12.1991 40.45L20.6376 45.8616L41.0001 33.6625V35.4969L20.6376 47.6043L10.8232 41.2755V18.9868L32.9284 6.87939Z",fill:"#5566CA"}),(0,t.jsx)("path",{d:"M37.6063 9.53936L36.2305 8.71385L14.217 21.3716V38.9824L20.5459 43.5685L41.0001 31.3694V29.5349L20.5459 41.8258L15.5928 38.2486V22.1054L37.6063 9.53936Z",fill:"#5566CA"}),(0,t.jsx)("path",{d:"M41.0001 11.3738L39.5325 10.5483L17.3356 23.2061V37.2397L20.5459 39.6244L41.0001 27.4253V25.6826L20.5459 37.79L18.9866 36.5976V24.1233L41.0001 11.3738Z",fill:"#5566CA"})]})}),(0,t.jsx)("h2",{style:{fontSize:"18px",fontFamily:"Inter",marginTop:"-5px",marginBottom:"15px"},children:(0,e.__)("Access Without Limits!","cozy-addons")}),(0,t.jsx)("p",{style:{textAlign:"center",lineHeight:"20px"},children:(0,e.__)("Access more blocks and advanced features for effortless design. Upgrade today for a richer web-building experience!","cozy-addons")}),(0,t.jsx)("a",{href:"https://cozythemes.com/pricing-and-plans/",target:"_blank",children:(0,t.jsx)("button",{className:"cozy-block-premium-button",style:{backgroundColor:"#5566ca",borderRadius:"20px",padding:"10px",border:"none",color:"#fff",fontFamily:"Inter",fontSize:"10px",fontWeight:"500",cursor:"pointer"},children:(0,t.jsxs)("div",{style:{display:"flex",gap:"5px",margin:"0"},children:[(0,t.jsx)("div",{children:(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M9.29768 0.0630875L0.24397 5.2847C-0.109583 5.48778 -0.0646564 5.97987 0.286944 6.12828L2.36334 6.99919L7.97527 2.05487C8.0827 1.95919 8.23506 2.10565 8.14325 2.21695L3.43767 7.94822V9.52017C3.43767 9.98102 3.99437 10.1626 4.26784 9.8287L5.50821 8.31924L7.94206 9.33857C8.21943 9.45573 8.53588 9.28194 8.58666 8.98317L9.99306 0.547365C10.0595 0.152913 9.6356 -0.132186 9.29768 0.0630875Z",fill:"white"})})}),(0,t.jsx)("div",{children:(0,e.__)("Upgrade to Pro","cozy-addons")})]})})})]})}),r=window.wp.primitives,c=(0,t.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(r.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})}),p=(0,t.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(r.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),d=(0,t.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(r.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})}),u=window.wp.data;function g(o,e){return e&&Object.keys(e).length<4?1===Object.keys(e).length?`\n\t${o}: ${e};\n `:`\n\t${o}: ${e.width} ${e.style} ${e.color};\n `:e&&4===Object.keys(e).length?"border"===o?`\n\t border-top: ${e.top.width} ${e.top.style} ${e.top.color};\n\t border-right: ${e.right.width} ${e.right.style} ${e.right.color};\n\t border-bottom: ${e.bottom.width} ${e.bottom.style} ${e.bottom.color};\n\t border-left: ${e.left.width} ${e.left.style} ${e.left.color};\n\t`:`\n ${o}: ${e.top} ${e.right} ${e.bottom} ${e.left};\n`:""}const h=(0,i.memo)((({layout:o})=>{const e=(0,n.useInnerBlocksProps)({className:`cozy-block-post-${o}`},{template:[["core/query",{className:"cozy-query swiper-container",queryId:1,query:{perPage:"6",postType:"post"},lock:{move:!1,remove:!0}},[["core/post-template",{className:"cozy-layout-grid swiper-wrapper",lock:{move:!1,remove:!0}},[["core/post-featured-image"],["core/post-title",{level:4,isLink:!0,linkTarget:"_blank"}],["core/post-date"],["core/post-excerpt",{excerptLength:29}]]]]]]});return(0,t.jsx)("div",{...e})})),v=(0,i.memo)((({clientId:o,attributes:e})=>{const n=(0,s.useRefEffect)((o=>{const n=[{property:"--cozyGridTemplateColumns",value:e.gridOptions.displayColumn},{property:"--cozyGridGap",value:`${e.gridOptions.columnGap}px`}];null!==o&&n.forEach((e=>{o.style.setProperty(e.property,e.value)}))})),a=(0,s.useRefEffect)((o=>{const n=o.querySelector(".swiper-button-prev"),a=o.querySelector(".swiper-button-next"),i=o.querySelector(".swiper-pagination"),s=[{property:"--cozyNavIconSize",value:`${e.carouselOptions.navigation.iconSize}px`},{property:"--cozyNavWidth",value:`${e.carouselOptions.navigation.iconBoxWidth}px`},{property:"--cozyNavHeight",value:`${e.carouselOptions.navigation.iconBoxHeight}px`},{property:"--cozyNavBorderRadius",value:`${e.carouselOptions.navigation.borderRadius}px`},{property:"--cozyNavIconColor",value:e.carouselOptions.navigation.color},{property:"--cozyNavIconColorHover",value:e.carouselOptions.navigation.colorHover},{property:"--cozyNavBgColor",value:e.carouselOptions.navigation.backgroundColor},{property:"--cozyNavBgColorHover",value:e.carouselOptions.navigation.backgroundColorHover},{property:"--cozyPaginationWidth",value:`${e.carouselOptions.pagination.width}px`},{property:"--cozyPaginationHeight",value:`${e.carouselOptions.pagination.height}px`},{property:"--cozyPaginationBorderRadius",value:`${e.carouselOptions.pagination.borderRadius}px`},{property:"--cozyPaginationActiveWidth",value:`${e.carouselOptions.pagination.activeWidth}px`},{property:"--cozyPaginationActiveBorderRadius",value:`${e.carouselOptions.pagination.activeBorderRadius}px`},{property:"--cozyPaginationColor",value:e.carouselOptions.pagination.color},{property:"--cozyPaginationColorHover",value:e.carouselOptions.pagination.colorHover},{property:"--cozyPaginationActiveColor",value:e.carouselOptions.pagination.activeColor},{property:"--cozyPaginationActiveColorHover",value:e.carouselOptions.pagination.activeColorHover},{property:"--cozyPaginationPositionVertical",value:`${e.carouselOptions.pagination.positionVertical}px`},{property:"--cozyPaginationAlign",value:e.carouselOptions.pagination?.align?e.carouselOptions.pagination?.align:"center"},{property:"--cozyPaginationLeft",value:"left"===e.carouselOptions.pagination?.align?e.carouselOptions.pagination?.left:""},{property:"--cozyPaginationRight",value:"right"===e.carouselOptions.pagination?.align?e.carouselOptions.pagination?.right:""}];null!==o&&s.forEach((e=>{o.style.setProperty(e.property,e.value)}));let t={};const l=setInterval((()=>{if(o){const s=o.querySelectorAll(".wp-block-post");if(s.length>0){clearInterval(l),s.forEach((o=>{o.classList.add("swiper-slide")}));const r=o.querySelector(".swiper-container"),c={init:!0,speed:e.carouselOptions.sliderOptions.speed,centeredSlides:e.carouselOptions.sliderOptions.centeredSlides,slidesPerView:e.carouselOptions.sliderOptions.slidesPerView,spaceBetween:e.carouselOptions.sliderOptions.spaceBetween,navigation:{nextEl:a,prevEl:n},pagination:{clickable:!0,el:i},breakpoints:{400:{slidesPerView:1},767:{slidesPerView:e.carouselOptions.sliderOptions.slidesPerView<=2?e.carouselOptions.sliderOptions.slidesPerView:2},1024:{slidesPerView:e.carouselOptions.sliderOptions.slidesPerView<=3?e.carouselOptions.sliderOptions.slidesPerView:3},1180:{slidesPerView:e.carouselOptions.sliderOptions.slidesPerView}},allowTouchMove:!e.carouselOptions.navigation.enabled};t=new Swiper(r,c)}}return()=>{clearInterval(l)}}),1e3);return()=>{"carousel"===e.layout&&Object.keys(t).length>0&&t.destroy()}}));return(0,t.jsxs)(t.Fragment,{children:["grid"===e.layout&&(0,t.jsx)("div",{className:"cozy-block-post-grid-wrapper "+(e.gridOptions.masonryEnabled?"has-masonry":""),id:`cozyBlock_${o.replace(/-/gi,"_")}`,ref:n,children:(0,t.jsx)(h,{layout:e.layout})}),"carousel"===e.layout&&(0,t.jsxs)("div",{className:"cozy-block-post-carousel-wrapper "+(e.hoverShow?"hover-show":""),id:`cozyBlock_${o.replace(/-/gi,"_")}`,ref:a,children:[(0,t.jsx)(h,{layout:e.layout}),e.carouselOptions.navigation.enabled&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"swiper-button-prev cozy-block-button-prev"}),(0,t.jsx)("div",{className:"swiper-button-next cozy-block-button-next"})]}),e.carouselOptions.pagination.enabled&&(0,t.jsx)("div",{className:"swiper-pagination cozy-pagination"})]})]})})),O=JSON.parse('{"UU":"cozy-block/post-carousel","DD":"Post Grid/Carousel","h_":"Immerse yourself in an engaging browsing journey using our \'Post Carousel\' block, showcasing visually stunning and interactive featured content for effortless exploration."}'),y=(0,t.jsxs)("svg",{width:"27",height:"20",viewBox:"0 0 27 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{fill:"none",x:"1",y:"1",width:"11",height:"14",stroke:"#0C50FF",strokeWidth:"2"}),(0,t.jsx)("rect",{x:"3",y:"3",width:"7",height:"5",fill:"#0C50FF",fillOpacity:"0.5"}),(0,t.jsx)("path",{fill:"none",d:"M3 9H8",stroke:"#0C50FF",strokeOpacity:"0.5"}),(0,t.jsx)("path",{fill:"none",d:"M3 10.5H10",stroke:"#0C50FF",strokeOpacity:"0.5"}),(0,t.jsx)("path",{fill:"none",d:"M3 12H7",stroke:"#0C50FF",strokeOpacity:"0.5"}),(0,t.jsx)("rect",{fill:"none",x:"15",y:"1",width:"11",height:"14",stroke:"#0C50FF",strokeWidth:"2"}),(0,t.jsx)("rect",{x:"17",y:"3",width:"7",height:"5",fill:"#0C50FF",fillOpacity:"0.5"}),(0,t.jsx)("path",{fill:"none",d:"M17 9H22",stroke:"#0C50FF",strokeOpacity:"0.5"}),(0,t.jsx)("path",{fill:"none",d:"M17 10.5H24",stroke:"#0C50FF",strokeOpacity:"0.5"}),(0,t.jsx)("path",{fill:"none",d:"M17 12H21",stroke:"#0C50FF",strokeOpacity:"0.5"}),(0,t.jsx)("rect",{x:"9",y:"18",width:"2",height:"2",rx:"1",fill:"#0C50FF",fillOpacity:"0.5"}),(0,t.jsx)("rect",{x:"12",y:"18",width:"2",height:"2",rx:"1",fill:"#0C50FF"}),(0,t.jsx)("rect",{x:"15",y:"18",width:"2",height:"2",rx:"1",fill:"#0C50FF",fillOpacity:"0.5"})]});(0,o.registerBlockType)(O.UU,{title:(0,e.__)(O.DD,"cozy-addons"),description:(0,e.__)(O.h_,"cozy-addons"),icon:{src:y},example:{attributes:{cover:cozyBlockAssets.imageDir+"/preview_post_carousel.jpg"},viewportWidth:1260},edit:function(o){const{attributes:s,setAttributes:r,clientId:h}=o;if(s.cover)return(0,t.jsx)("img",{src:s.cover});s.blockClientId=h;const O=(0,n.useBlockProps)({className:"cozy-block-wrapper"}),y=`cozyBlock_${h.replace(/-/gi,"_")}`,x=`\n\t#${y} .swiper-button-prev,\n \t#${y} .swiper-button-next {\n\t\t${g("border",s.carouselOptions.navigation?.border)}\n\n\t\t&:hover {\n\t\t\tborder-color: ${s.carouselOptions.navigation?.borderHover};\n\t\t}\n\t}\n\t#${y} .swiper-pagination-bullets .swiper-pagination-bullet {\n\t\tmargin: 0 var(--swiper-pagination-bullet-horizontal-gap, ${s.carouselOptions.pagination?.gap}px);\n\t}\n\t#${y} .swiper-pagination-bullet-active {\n\t\theight: ${s.carouselOptions.pagination?.activeHeight}px !important;\n\t\t${g("outline",s.carouselOptions.pagination?.activeBorder)}\n\t\toutline-offset: ${s.carouselOptions.pagination?.activeOffset}px;\n\t}\n\t`,b=(0,u.select)("core/editor").getEditorSettings().colors,[_,m]=(0,i.useState)("general");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{...O,children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:x}}),(0,t.jsx)(v,{clientId:h,attributes:s})]}),(0,t.jsxs)(n.InspectorControls,{group:"settings",children:[(0,t.jsxs)(a.PanelBody,{title:(0,e.__)("General","cozy-addons"),opened:"general"===_,onToggle:()=>m("general"),children:[(0,t.jsx)(a.SelectControl,{label:(0,e.__)("Layout","cozy-addons"),options:[{label:(0,e.__)("Grid","cozy-addons"),value:"grid"},{label:(0,e.__)("Carousel","cozy-addons"),value:"carousel"}],value:s.layout,onChange:o=>r({...s,layout:o})}),"grid"===s.layout&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Display Column","cozy-addons"),min:1,max:10,step:1,value:s.gridOptions.displayColumn,onChange:o=>r({...s,gridOptions:{...s.gridOptions,displayColumn:o}})}),(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Column gap","cozy-addons"),value:s.gridOptions.columnGap,onChange:o=>r({...s,gridOptions:{...s.gridOptions,columnGap:o}}),min:0,step:1,max:100}),(0,t.jsx)(a.ToggleControl,{label:(0,e.__)("Enable Masonry","cozy-addons"),checked:s.gridOptions.masonryEnabled,onChange:o=>r({...s,gridOptions:{...s.gridOptions,masonryEnabled:o}})})]})]}),"carousel"===s.layout&&(0,t.jsxs)(a.PanelBody,{title:(0,e.__)("Slider Settings","cozy-addons"),opened:"slider-options"===_,onToggle:()=>m("slider-options"),children:[!cozyBlockAssets.isPremium&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.BaseControl,{children:[(0,t.jsxs)("div",{style:{display:"flex",gap:"15px"},children:[(0,t.jsx)(a.BaseControl.VisualLabel,{children:(0,e.__)("Slides per View","cozy-addons")}),(0,t.jsx)("p",{className:"cozy-block-pro-label",children:(0,e.__)("PRO","cozy-addons")})]}),(0,t.jsx)(a.RangeControl,{value:s.carouselOptions.sliderOptions.slidesPerView,help:(0,e.__)("*Note: To enhance the visual impact, activate centered slides and use fractional numbers as input.","cozy-addons"),disabled:!0})]}),(0,t.jsxs)(a.BaseControl,{children:[(0,t.jsxs)("div",{style:{display:"flex",gap:"15px"},children:[(0,t.jsx)(a.BaseControl.VisualLabel,{children:(0,e.__)("Centered Slides","cozy-addons")}),(0,t.jsx)("p",{className:"cozy-block-pro-label",children:(0,e.__)("PRO","cozy-addons")})]}),(0,t.jsx)(a.ToggleControl,{checked:s.carouselOptions.sliderOptions.centeredSlides,disabled:!0})]}),(0,t.jsxs)(a.BaseControl,{children:[(0,t.jsxs)("div",{style:{display:"flex",gap:"15px"},children:[(0,t.jsx)(a.BaseControl.VisualLabel,{children:(0,e.__)("Gap","cozy-addons")}),(0,t.jsx)("p",{className:"cozy-block-pro-label",children:(0,e.__)("PRO","cozy-addons")})]}),(0,t.jsx)(a.RangeControl,{value:s.carouselOptions.sliderOptions.spaceBetween,disabled:!0,min:0,max:100})]})]}),cozyBlockAssets.isPremium&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Slides per View","cozy-addons"),min:1,max:10,step:.1,value:s.carouselOptions.sliderOptions.slidesPerView,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,sliderOptions:{...s.carouselOptions.sliderOptions,slidesPerView:o}}}),help:(0,e.__)("*Note: To enhance the visual impact, activate centered slides and use fractional numbers as input.","cozy-addons")}),(0,t.jsx)(a.ToggleControl,{label:(0,e.__)("Centered Slides","cozy-addons"),checked:s.carouselOptions.sliderOptions.centeredSlides,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,sliderOptions:{...s.carouselOptions.sliderOptions,centeredSlides:o}}})}),(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Gap","cozy-addons"),value:s.carouselOptions.sliderOptions.spaceBetween,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,sliderOptions:{...s.carouselOptions.sliderOptions,spaceBetween:o}}}),min:0,step:1,max:100})]}),(0,t.jsx)(a.ToggleControl,{label:(0,e.__)("Loop","cozy-addons"),checked:s.carouselOptions.sliderOptions.loop,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,sliderOptions:{...s.carouselOptions.sliderOptions,loop:o}}})}),(0,t.jsx)(a.ToggleControl,{label:(0,e.__)("Autoplay","cozy-addons"),checked:s.carouselOptions.sliderOptions.autoplay.enabled,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,sliderOptions:{...s.carouselOptions.sliderOptions,autoplay:{...s.carouselOptions.sliderOptions.autoplay,enabled:o}}}})}),s.carouselOptions.sliderOptions.autoplay.enabled&&(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Autoplay Delay","cozy-addons"),min:0,max:5e3,step:1,value:s.carouselOptions.sliderOptions.autoplay.delay,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,sliderOptions:{...s.carouselOptions.sliderOptions,autoplay:{...s.carouselOptions.sliderOptions.autoplay,delay:Math.abs(o)}}}})}),!cozyBlockAssets.isPremium&&(0,t.jsxs)(a.BaseControl,{children:[(0,t.jsxs)("div",{style:{display:"flex",gap:"15px"},children:[(0,t.jsx)(a.BaseControl.VisualLabel,{children:(0,e.__)("Speed (ms)","cozy-addons")}),(0,t.jsx)("p",{className:"cozy-block-pro-label",children:(0,e.__)("PRO","cozy-addons")})]}),(0,t.jsx)(a.RangeControl,{value:s.carouselOptions.sliderOptions.speed,disabled:!0,help:(0,e.__)("*Note: Greater the value, greater the delay.","cozy-addons")})]}),cozyBlockAssets.isPremium&&(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Speed (ms)","cozy-addons"),value:s.carouselOptions.sliderOptions.speed,min:0,max:5e3,step:1,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,sliderOptions:{...s.carouselOptions.sliderOptions,speed:o}}}),help:(0,e.__)("*Note: Greater the value, greater the delay.","cozy-addons")}),(0,t.jsx)(a.ToggleControl,{label:(0,e.__)("Enable Pagination","cozy-addons"),checked:s.carouselOptions.pagination.enabled,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,enabled:o}}})}),(0,t.jsx)(a.ToggleControl,{label:(0,e.__)("Enable Navigation","cozy-addons"),checked:s.carouselOptions.navigation.enabled,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,navigation:{...s.carouselOptions.navigation,enabled:o}}})}),s.carouselOptions.navigation.enabled&&(0,t.jsx)(a.ToggleControl,{label:(0,e.__)("Display on Hover","cozy-addons"),checked:s.hoverShow,onChange:o=>r({hoverShow:o}),help:(0,e.__)("*Note: Show navigation only after hovering the block.")})]}),!cozyBlockAssets.isPremium&&(0,t.jsx)(l,{})]},"setting"),(0,t.jsxs)(n.InspectorControls,{group:"styles",children:[s.carouselOptions.pagination.enabled&&(0,t.jsxs)(a.PanelBody,{title:(0,e.__)("Pagination Styles","cozy-addons"),opened:"pagination-styles"===_,onToggle:()=>m("pagination-styles"),children:[(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Vertical Positioning","cozy-addons"),value:s.carouselOptions.pagination.positionVertical,min:-300,max:300,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,positionVertical:o}}})}),"left"===s.carouselOptions.pagination?.align&&(0,t.jsx)("div",{className:"components-base-control",children:(0,t.jsx)(n.HeightControl,{label:(0,e.__)("Horizontal Positioning","cozy-addons"),value:s.carouselOptions.pagination?.left,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,left:o}}})})}),"right"===s.carouselOptions.pagination?.align&&(0,t.jsx)("div",{className:"components-base-control",children:(0,t.jsx)(n.HeightControl,{label:(0,e.__)("Horizontal Positioning","cozy-addons"),value:s.carouselOptions.pagination?.right,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,right:o}}})})}),(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Gap","cozy-addons"),value:s.carouselOptions.pagination?.gap,min:0,max:100,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,gap:o}}})}),(0,t.jsxs)(a.__experimentalToggleGroupControl,{label:(0,e.__)("Align","cozy-addons"),value:s.carouselOptions.pagination?.align,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,align:o}}}),children:[(0,t.jsx)(a.__experimentalToggleGroupControlOptionIcon,{label:(0,e.__)("Left","cozy-addons"),value:"left",icon:c}),(0,t.jsx)(a.__experimentalToggleGroupControlOptionIcon,{label:(0,e.__)("Center","cozy-addons"),value:"center",icon:p}),(0,t.jsx)(a.__experimentalToggleGroupControlOptionIcon,{label:(0,e.__)("Right","cozy-addons"),value:"right",icon:d})]}),(0,t.jsx)(a.TabPanel,{className:"cozy-tab-panel",activeClass:"active-tab",tabs:[{name:"cozy-tab__default",title:(0,e.__)("Default","cozy-addons"),className:"tab-one"},{name:"cozy-tab__active",title:(0,e.__)("Active","cozy-addons"),className:"tab-two"}],children:o=>(0,t.jsxs)(t.Fragment,{children:["cozy-tab__default"===o.name&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Width","cozy-addons"),value:s.carouselOptions.pagination.width,min:1,max:100,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,width:o}}})}),(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Height","cozy-addons"),value:s.carouselOptions.pagination.height,min:1,max:100,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,height:o}}})}),(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Border Radius","cozy-addons"),value:s.carouselOptions.pagination.borderRadius,min:0,max:100,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,borderRadius:o}}})})]}),"cozy-tab__active"===o.name&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Width","cozy-addons"),value:s.carouselOptions.pagination.activeWidth,min:1,max:100,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,activeWidth:o}}})}),(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Height","cozy-addons"),value:s.carouselOptions.pagination?.activeHeight,min:1,max:100,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,activeHeight:o}}})}),(0,t.jsx)("div",{className:"components-base-control",children:(0,t.jsx)(a.__experimentalBorderControl,{enableAlpha:!0,colors:b,isCompact:!0,label:(0,e.__)("Border","cozy-addons"),value:s.carouselOptions.pagination?.activeBorder,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,activeBorder:o}}})})}),(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Border Offset","cozy-addons"),value:s.carouselOptions.pagination?.activeOffset,min:0,max:100,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,activeOffset:o}}})}),(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Border Radius","cozy-addons"),value:s.carouselOptions.pagination.activeBorderRadius,min:0,max:100,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,activeBorderRadius:o}}})})]})]})}),(0,t.jsx)(n.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,e.__)("Color","cozy-addons"),colorSettings:[{value:s.carouselOptions.pagination.color,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,color:o}}}),label:(0,e.__)("Default","cozy-addons")},{value:s.carouselOptions.pagination.colorHover,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,colorHover:o}}}),label:(0,e.__)("Default (Hover)","cozy-addons")},{value:s.carouselOptions.pagination.activeColor,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,activeColor:o}}}),label:(0,e.__)("Active","cozy-addons")},{value:s.carouselOptions.pagination.activeColorHover,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,pagination:{...s.carouselOptions.pagination,activeColorHover:o}}}),label:(0,e.__)("Active (Hover)","cozy-addons")}]})]}),s.carouselOptions.navigation.enabled&&(0,t.jsxs)(a.PanelBody,{title:(0,e.__)("Navigation Styles","cozy-addons"),opened:"navigation-styles"===_,onToggle:()=>m("navigation-styles"),children:[(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Icon Size","cozy-addons"),value:s.carouselOptions.navigation.iconSize,min:1,max:50,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,navigation:{...s.carouselOptions.navigation,iconSize:o}}})}),(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Icon Box Width","cozy-addons"),value:s.carouselOptions.navigation.iconBoxWidth,min:1,max:50,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,navigation:{...s.carouselOptions.navigation,iconBoxWidth:o}}})}),(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Icon Box Height","cozy-addons"),min:1,max:50,value:s.carouselOptions.navigation.iconBoxHeight,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,navigation:{...s.carouselOptions.navigation,iconBoxHeight:o}}})}),(0,t.jsx)("div",{className:"components-base-control",children:(0,t.jsx)(a.__experimentalBorderControl,{enableAlpha:!0,isCompact:!0,colors:b,label:(0,e.__)("Border","cozy-addons"),value:s.carouselOptions.navigation?.border,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,navigation:{...s.carouselOptions.navigation,border:o}}})})}),(0,t.jsx)(a.RangeControl,{label:(0,e.__)("Border Radius","cozy-addons"),value:s.carouselOptions.navigation.borderRadius,min:0,max:100,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,navigation:{...s.carouselOptions.navigation,borderRadius:o}}})}),(0,t.jsx)(n.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,e.__)("Color","cozy-addons"),colorSettings:[{value:s.carouselOptions.navigation.color,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,navigation:{...s.carouselOptions.navigation,color:o}}}),label:(0,e.__)("Icon (Default)","cozy-addons")},{value:s.carouselOptions.navigation.colorHover,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,navigation:{...s.carouselOptions.navigation,colorHover:o}}}),label:(0,e.__)("Icon (Hover)","cozy-addons")},{value:s.carouselOptions.navigation.backgroundColor,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,navigation:{...s.carouselOptions.navigation,backgroundColor:o}}}),label:(0,e.__)("Background (Default)","cozy-addons")},{value:s.carouselOptions.navigation.backgroundColorHover,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,navigation:{...s.carouselOptions.navigation,backgroundColorHover:o}}}),label:(0,e.__)("Background (Hover)","cozy-addons")},{value:s.carouselOptions.navigation?.borderHover,onChange:o=>r({...s,carouselOptions:{...s.carouselOptions,navigation:{...s.carouselOptions.navigation,borderHover:o}}}),label:(0,e.__)("Border (Hover)","cozy-addons")}]})]})]},"style")]})},save:function({attributes:o}){const{blockClientId:e,layout:a}=o,i=`cozyBlock_${(s=e,s.replace(/[;=()\s]/g,"")).replace(/-/gi,"_")}`;var s;return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:`cozy-block-post-${a}-wrapper ${"grid"===a&&o.gridOptions.masonryEnabled?"has-masonry":""} ${o.hoverShow?"hover-show":""}`,id:i,children:[(0,t.jsx)(n.InnerBlocks.Content,{}),"carousel"===o.layout&&o.carouselOptions.navigation.enabled&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"swiper-button-prev cozy-block-button-prev"}),(0,t.jsx)("div",{className:"swiper-button-next cozy-block-button-next"})]}),"carousel"===o.layout&&o.carouselOptions.pagination.enabled&&(0,t.jsx)("div",{className:"swiper-pagination cozy-pagination"})]})})}})}},n={};function a(o){var i=n[o];if(void 0!==i)return i.exports;var s=n[o]={exports:{}};return e[o](s,s.exports,a),s.exports}a.m=e,o=[],a.O=(e,n,i,s)=>{if(!n){var t=1/0;for(p=0;p<o.length;p++){for(var[n,i,s]=o[p],l=!0,r=0;r<n.length;r++)(!1&s||t>=s)&&Object.keys(a.O).every((o=>a.O[o](n[r])))?n.splice(r--,1):(l=!1,s<t&&(t=s));if(l){o.splice(p--,1);var c=i();void 0!==c&&(e=c)}}return e}s=s||0;for(var p=o.length;p>0&&o[p-1][2]>s;p--)o[p]=o[p-1];o[p]=[n,i,s]},a.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),(()=>{var o={57:0,350:0};a.O.j=e=>0===o[e];var e=(e,n)=>{var i,s,[t,l,r]=n,c=0;if(t.some((e=>0!==o[e]))){for(i in l)a.o(l,i)&&(a.m[i]=l[i]);if(r)var p=r(a)}for(e&&e(n);c<t.length;c++)s=t[c],a.o(o,s)&&o[s]&&o[s][0](),o[s]=0;return a.O(p)},n=globalThis.webpackChunkpost_carousel=globalThis.webpackChunkpost_carousel||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})();var i=a.O(void 0,[350],(()=>a(704)));i=a.O(i)})();
Save
Back