index.js
1 lines
| 1 | (()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var o in a)e.o(a,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:a[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,a=window.wp.i18n,o=window.wp.blockEditor,l=window.wp.components,r=window.wp.serverSideRender;var s=e.n(r);const n=window.wp.element,i=window.ReactJSXRuntime,b=JSON.parse('{"apiVersion":3,"name":"awt/author-pro-book-hero","version":"1.0.2","title":"Book Hero [Author Pro]","category":"author-website-templates","icon":"book-alt","description":"A dynamic hero section for the single book template.","supports":{"html":false,"anchor":true,"align":["full"]},"textdomain":"author-website-templates","attributes":{"blockId":{"type":"string"},"anchor":{"type":"string"},"showBreadcrumbs":{"type":"boolean","default":true},"showStats":{"type":"boolean","default":true},"showBadge":{"type":"boolean","default":true},"showReviewCount":{"type":"boolean","default":true},"badgeText":{"type":"string","default":"#1 New York Times Bestseller"},"subTitle":{"type":"string","default":""},"formatsText":{"type":"string","default":"Available in Hardcover, Paperback, Audiobook & Kindle"},"formatsTitle":{"type":"string","default":"Available Formats"},"pagesLabel":{"type":"string","default":"Pages"},"yearLabel":{"type":"string","default":"Year"},"languageLabel":{"type":"string","default":"Language"},"reviewLinkText":{"type":"string","default":"Read %s Reviews"},"sectionBg":{"type":"string","default":""},"titleColor":{"type":"string","default":""},"primaryColor":{"type":"string","default":""},"secondaryColor":{"type":"string","default":""},"accentColor":{"type":"string","default":""},"btnBg":{"type":"string","default":""},"btnText":{"type":"string","default":""},"btnHoverBg":{"type":"string","default":""},"btnHoverText":{"type":"string","default":""}},"editorScript":"file:./index.js","render":"file:./render.php","style":"file:./style.css"}');(0,t.registerBlockType)(b.name,{...b,edit:function({attributes:e,setAttributes:t,clientId:r}){const{blockId:b,showBreadcrumbs:u,showStats:g,showBadge:p,showReviewCount:h,badgeText:d,subTitle:w,formatsText:c,formatsTitle:m,pagesLabel:_,yearLabel:C,languageLabel:x,reviewLinkText:y,sectionBg:v,titleColor:T,primaryColor:f,secondaryColor:B,textColor:k,accentColor:j,btnBg:L,btnText:S,btnHoverBg:P,btnHoverText:H,anchor:R}=e;return(0,n.useEffect)(()=>{b||t({blockId:`awt-book-hero-${r}`})},[b,r]),(0,i.jsxs)("div",{...(0,o.useBlockProps)({id:R?void 0:b}),children:[(0,i.jsxs)(o.InspectorControls,{children:[(0,i.jsxs)(l.PanelBody,{title:(0,a.__)("Content Visibility","author-website-templates"),initialOpen:!0,children:[(0,i.jsx)(l.ToggleControl,{label:(0,a.__)("Show Breadcrumbs","author-website-templates"),checked:u,onChange:e=>t({showBreadcrumbs:e})}),(0,i.jsx)(l.ToggleControl,{label:(0,a.__)("Show Stats","author-website-templates"),checked:g,onChange:e=>t({showStats:e})}),(0,i.jsx)(l.ToggleControl,{label:(0,a.__)("Show Badge","author-website-templates"),checked:p,onChange:e=>t({showBadge:e})}),(0,i.jsx)(l.ToggleControl,{label:(0,a.__)("Show Review Count","author-website-templates"),checked:h,onChange:e=>t({showReviewCount:e})})]}),(0,i.jsxs)(l.PanelBody,{title:(0,a.__)("Text Content","author-website-templates"),initialOpen:!1,children:[(0,i.jsx)(l.TextControl,{label:(0,a.__)("Badge Text","author-website-templates"),value:d,onChange:e=>t({badgeText:e}),help:(0,a.__)("Leave empty to hide badge if toggle is on.","author-website-templates")}),(0,i.jsx)(l.TextControl,{label:(0,a.__)("Subtitle / Tagline","author-website-templates"),value:w,onChange:e=>t({subTitle:e}),help:(0,a.__)("Appears below the main title. Falls back to Reading Age if empty.","author-website-templates")}),(0,i.jsx)(l.TextControl,{label:(0,a.__)("Formats Bottom Text","author-website-templates"),value:c,onChange:e=>t({formatsText:e}),help:(0,a.__)('Text below buttons ("Available in...")',"author-website-templates")}),(0,i.jsx)(l.TextControl,{label:(0,a.__)("Formats List Title","author-website-templates"),value:m,onChange:e=>t({formatsTitle:e}),help:(0,a.__)("Title for the sidebar formats list","author-website-templates")})]}),(0,i.jsxs)(l.PanelBody,{title:(0,a.__)("Labels","author-website-templates"),initialOpen:!1,children:[(0,i.jsx)(l.TextControl,{label:(0,a.__)("Pages Label","author-website-templates"),value:_,onChange:e=>t({pagesLabel:e})}),(0,i.jsx)(l.TextControl,{label:(0,a.__)("Year Label","author-website-templates"),value:C,onChange:e=>t({yearLabel:e})}),(0,i.jsx)(l.TextControl,{label:(0,a.__)("Language Label","author-website-templates"),value:x,onChange:e=>t({languageLabel:e})}),(0,i.jsx)(l.TextControl,{label:(0,a.__)("Review Link Text","author-website-templates"),value:y,onChange:e=>t({reviewLinkText:e})})]}),(0,i.jsx)(o.PanelColorSettings,{title:(0,a.__)("Design Settings","author-website-templates"),initialOpen:!1,colorSettings:[{value:v,onChange:e=>t({sectionBg:e}),label:(0,a.__)("Section Background","author-website-templates")},{value:j,onChange:e=>t({accentColor:e}),label:(0,a.__)("Accent Color","author-website-templates")},{value:f,onChange:e=>t({primaryColor:e}),label:(0,a.__)("Primary Color (Headings)","author-website-templates")},{value:B,onChange:e=>t({secondaryColor:e}),label:(0,a.__)("Secondary Color (Body)","author-website-templates")},{value:L,onChange:e=>t({btnBg:e}),label:(0,a.__)("Button Background","author-website-templates")},{value:S,onChange:e=>t({btnText:e}),label:(0,a.__)("Button Text","author-website-templates")},{value:P,onChange:e=>t({btnHoverBg:e}),label:(0,a.__)("Button Hover Background","author-website-templates")},{value:H,onChange:e=>t({btnHoverText:e}),label:(0,a.__)("Button Hover Text","author-website-templates")}]})]}),(0,i.jsx)(s(),{block:"awt/author-pro-book-hero",attributes:e})]})}})})(); |