PluginProbe ʕ •ᴥ•ʔ
Author Website Templates – Create Writer, Author & Publisher Websites Easily / 1.1.9
Author Website Templates – Create Writer, Author & Publisher Websites Easily v1.1.9
trunk 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9
author-website-templates / build / blocks / author-pro / book-carousel / index.js
author-website-templates / build / blocks / author-pro / book-carousel Last commit date
block.json 1 month ago index.asset.php 1 month ago index.js 1 month ago render.php 1 month ago style-index-rtl.css 1 month ago style-index.css 1 month ago view.asset.php 1 month ago view.js 1 month ago
index.js
1 lines
1 (()=>{"use strict";var e,t={9981:(e,t,o)=>{const l=window.wp.blocks,r=window.wp.i18n,n=window.wp.blockEditor,a=window.wp.components,i=window.wp.serverSideRender;var s=o.n(i);const u=window.wp.element,c=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"awt/author-pro-book-carousel","version":"1.0.0","title":"Author Pro Book Carousel","category":"theme","icon":"book","description":"A dynamic carousel showcasing books.","attributes":{"postCount":{"type":"number","default":10},"columns":{"type":"number","default":3},"gap":{"type":"number","default":32},"enableAutoplay":{"type":"boolean","default":false},"autoplaySpeed":{"type":"number","default":3000},"enableTitleTrim":{"type":"boolean","default":false},"titleTrimLength":{"type":"number","default":10},"sectionBgColor":{"type":"string"},"cardBgColor":{"type":"string"},"titleColor":{"type":"string"},"authorColor":{"type":"string"},"priceColor":{"type":"string"},"accentColor":{"type":"string"},"arrowBgColor":{"type":"string"},"arrowIconColor":{"type":"string"},"align":{"type":"string","default":"full"},"sectionTitle":{"type":"string","default":"More Books by Author"},"sectionSubtitle":{"type":"string","default":"Library"},"showSectionTitle":{"type":"boolean","default":true},"viewAllText":{"type":"string","default":"View All Books"},"viewAllLink":{"type":"string","default":"/books"},"showViewAll":{"type":"boolean","default":true}},"supports":{"align":["full","wide"],"spacing":{"margin":true,"padding":true},"anchor":true,"html":false,"color":{"background":true,"text":true}},"textdomain":"author-website-templates","editorScript":["awt-glide-js","file:./view.js","file:./index.js"],"viewScript":["awt-glide-js","file:./view.js"],"style":["file:./style-index.css","awt-glide-css"],"render":"file:./render.php"}'),p=window.ReactJSXRuntime;(0,l.registerBlockType)(c.name,{...c,edit:function({attributes:e,setAttributes:t}){const{postCount:o,columns:l,gap:i,enableAutoplay:d,autoplaySpeed:h,enableTitleTrim:b,titleTrimLength:g,sectionBgColor:w,cardBgColor:C,titleColor:m,authorColor:f,priceColor:y,accentColor:v,arrowBgColor:_,arrowIconColor:x,sectionTitle:k,sectionSubtitle:j,showSectionTitle:T,viewAllText:S,viewAllLink:A,showViewAll:B}=e,L=(0,n.useBlockProps)(),O=(0,u.useRef)(null),R=(0,u.useRef)(null),[I,P]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if("undefined"!=typeof window&&window.Glide)return void P(!0);const e=setInterval(()=>{"undefined"!=typeof window&&window.Glide&&(P(!0),clearInterval(e))},200);return()=>clearInterval(e)},[]),(0,u.useEffect)(()=>{const t=O.current;if(!t||!I)return;const o=()=>{const o=t.querySelector(".glide");if(!o){if(R.current){try{R.current.destroy()}catch(e){}R.current=null}return}if("true"===o.getAttribute("data-glide-initialized"))return;if(R.current){try{R.current.destroy()}catch(e){}R.current=null}const r={type:"carousel",perView:l,gap:e.gap||32,autoplay:!1,hoverpause:!0,breakpoints:{1024:{perView:2},640:{perView:1}}};try{const e=new window.Glide(o,r);o.setAttribute("data-glide-initialized","true"),e.mount(),R.current=e}catch(e){console.error("Glide init error:",e)}},r=new MutationObserver(e=>{let t=!1;for(const o of e)if("childList"===o.type){t=!0;break}t&&o()});return r.observe(t,{childList:!0,subtree:!0}),o(),()=>{if(r.disconnect(),R.current){try{R.current.destroy()}catch(e){}R.current=null}}},[e,I]),(0,p.jsxs)("div",{...L,children:[(0,p.jsx)(n.InspectorControls,{children:(0,p.jsxs)(a.PanelBody,{title:(0,r.__)("Settings","author-website-templates"),initialOpen:!0,children:[(0,p.jsx)(a.RangeControl,{label:(0,r.__)("Post Count","author-website-templates"),value:o,onChange:e=>t({postCount:e}),min:1,max:50}),(0,p.jsx)(a.RangeControl,{label:(0,r.__)("Columns (Desktop)","author-website-templates"),value:l,onChange:e=>t({columns:e}),min:1,max:4}),(0,p.jsx)(a.RangeControl,{label:(0,r.__)("Gap (px)","author-website-templates"),value:i,onChange:e=>t({gap:e}),min:0,max:100}),(0,p.jsx)(a.ToggleControl,{label:(0,r.__)("Enable Autoplay","author-website-templates"),checked:d,onChange:e=>t({enableAutoplay:e}),help:(0,r.__)("Autoplay is disabled inside the editor to prevent layout issues.","author-website-templates")}),d&&(0,p.jsx)(a.RangeControl,{label:(0,r.__)("Autoplay Speed (ms)","author-website-templates"),value:h,onChange:e=>t({autoplaySpeed:e}),min:1e3,max:1e4,step:100}),(0,p.jsx)(a.ToggleControl,{label:(0,r.__)("Trim Titles","author-website-templates"),checked:b,onChange:e=>t({enableTitleTrim:e})}),b&&(0,p.jsx)(a.RangeControl,{label:(0,r.__)("Title Length (Words)","author-website-templates"),value:g,onChange:e=>t({titleTrimLength:e}),min:2,max:30}),(0,p.jsxs)(a.PanelBody,{title:(0,r.__)("Content Settings","author-website-templates"),initialOpen:!1,children:[(0,p.jsx)(a.ToggleControl,{label:(0,r.__)("Show Section Title","author-website-templates"),checked:T,onChange:e=>t({showSectionTitle:e})}),T&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(a.TextControl,{label:(0,r.__)("Section Title","author-website-templates"),value:k,onChange:e=>t({sectionTitle:e})}),(0,p.jsx)(a.TextControl,{label:(0,r.__)("Section Subtitle","author-website-templates"),value:j,onChange:e=>t({sectionSubtitle:e})})]}),(0,p.jsx)(a.ToggleControl,{label:(0,r.__)('Show "View All" Link',"author-website-templates"),checked:B,onChange:e=>t({showViewAll:e})}),B&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(a.TextControl,{label:(0,r.__)("Link Text","author-website-templates"),value:S,onChange:e=>t({viewAllText:e})}),(0,p.jsx)(a.TextControl,{label:(0,r.__)("Link URL","author-website-templates"),value:A,onChange:e=>t({viewAllLink:e})})]})]}),(0,p.jsx)(n.PanelColorSettings,{title:(0,r.__)("Color Settings","author-website-templates"),initialOpen:!1,colorSettings:[{value:w,onChange:e=>t({sectionBgColor:e}),label:(0,r.__)("Section Background","author-website-templates")},{value:C,onChange:e=>t({cardBgColor:e}),label:(0,r.__)("Card Background","author-website-templates")},{value:m,onChange:e=>t({titleColor:e}),label:(0,r.__)("Title Color","author-website-templates")},{value:f,onChange:e=>t({authorColor:e}),label:(0,r.__)("Author Color","author-website-templates")},{value:y,onChange:e=>t({priceColor:e}),label:(0,r.__)("Price Color","author-website-templates")},{value:v,onChange:e=>t({accentColor:e}),label:(0,r.__)("Accent Color (Button/Links)","author-website-templates")},{value:_,onChange:e=>t({arrowBgColor:e}),label:(0,r.__)("Arrow Background","author-website-templates")},{value:x,onChange:e=>t({arrowIconColor:e}),label:(0,r.__)("Arrow Icon Color","author-website-templates")}]})]})}),(0,p.jsxs)("div",{ref:O,style:{position:"relative"},children:[(0,p.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:50,cursor:"default"},"aria-hidden":"true"}),(0,p.jsx)("div",{style:{pointerEvents:"none"},children:(0,p.jsx)(s(),{block:c.name,attributes:e,LoadingResponsePlaceholder:()=>(0,p.jsx)("div",{style:{height:"300px",background:"#f0f0f0",display:"flex",alignItems:"center",justifyContent:"center"},children:"Loading..."})})})]})]})}})}},o={};function l(e){var r=o[e];if(void 0!==r)return r.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,l),n.exports}l.m=t,e=[],l.O=(t,o,r,n)=>{if(!o){var a=1/0;for(c=0;c<e.length;c++){for(var[o,r,n]=e[c],i=!0,s=0;s<o.length;s++)(!1&n||a>=n)&&Object.keys(l.O).every(e=>l.O[e](o[s]))?o.splice(s--,1):(i=!1,n<a&&(a=n));if(i){e.splice(c--,1);var u=r();void 0!==u&&(t=u)}}return t}n=n||0;for(var c=e.length;c>0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[o,r,n]},l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={7527:0,8143:0};l.O.j=t=>0===e[t];var t=(t,o)=>{var r,n,[a,i,s]=o,u=0;if(a.some(t=>0!==e[t])){for(r in i)l.o(i,r)&&(l.m[r]=i[r]);if(s)var c=s(l)}for(t&&t(o);u<a.length;u++)n=a[u],l.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return l.O(c)},o=globalThis.webpackChunkauthor_website_templates=globalThis.webpackChunkauthor_website_templates||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var r=l.O(void 0,[8143],()=>l(9981));r=l.O(r)})();