PluginProbe ʕ •ᴥ•ʔ
Author Website Templates – Create Writer, Author & Publisher Websites Easily / 1.1.5
Author Website Templates – Create Writer, Author & Publisher Websites Easily v1.1.5
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 / synopsis / index.js
author-website-templates / build / blocks / author-pro / synopsis Last commit date
block.json 5 months ago index.asset.php 5 months ago index.js 5 months ago render.php 5 months ago
index.js
1 lines
1 (()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var a in o)e.o(o,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:o[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,o=window.wp.i18n,a=window.wp.blockEditor,l=window.wp.components,i=window.wp.serverSideRender;var r=e.n(i);const s=window.wp.element,n=window.ReactJSXRuntime,u=JSON.parse('{"apiVersion":3,"name":"awt/author-pro-book-synopsis","version":"1.0.1","title":"Book Synopsis [Author Pro]","category":"author-website-templates","icon":"text-page","description":"A dynamic synopsis section with book details and author profile.","supports":{"html":false,"anchor":true,"align":["full"]},"textdomain":"author-website-templates","attributes":{"blockId":{"type":"string"},"anchor":{"type":"string"},"headline":{"type":"string","default":"A System for Transformation"},"showQuote":{"type":"boolean","default":true},"quoteText":{"type":"string","default":"This book completely changed my perspective on daily habits."},"quoteAuthor":{"type":"string","default":"- Reader Review"},"authorImage":{"type":"object","default":{}},"authorSubtitle":{"type":"string","default":"Author"},"viewProfileLabel":{"type":"string","default":"View Profile"}},"editorScript":"file:./index.js","render":"file:./render.php"}');(0,t.registerBlockType)(u.name,{...u,edit:function({attributes:e,setAttributes:t,clientId:i}){const{blockId:u,anchor:d,headline:h,showQuote:p,quoteText:c,quoteAuthor:b,authorImage:w,authorSubtitle:m,viewProfileLabel:g}=e;(0,s.useEffect)(()=>{u||t({blockId:`awt-book-synopsis-${i}`})},[u,i]);const x=()=>{t({authorImage:{}})};return(0,n.jsxs)("div",{...(0,a.useBlockProps)({id:d?void 0:u}),children:[(0,n.jsxs)(a.InspectorControls,{children:[(0,n.jsx)(l.PanelBody,{title:(0,o.__)("Content Settings","author-website-templates"),initialOpen:!0,children:(0,n.jsx)(l.TextControl,{label:(0,o.__)("Headline","author-website-templates"),value:h,onChange:e=>t({headline:e})})}),(0,n.jsxs)(l.PanelBody,{title:(0,o.__)("Quote Settings","author-website-templates"),initialOpen:!1,children:[(0,n.jsx)(l.ToggleControl,{label:(0,o.__)("Show Quote Box","author-website-templates"),checked:p,onChange:e=>t({showQuote:e})}),p&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.TextareaControl,{label:(0,o.__)("Quote Text","author-website-templates"),value:c,onChange:e=>t({quoteText:e})}),(0,n.jsx)(l.TextControl,{label:(0,o.__)("Quote Author","author-website-templates"),value:b,onChange:e=>t({quoteAuthor:e})})]})]}),(0,n.jsxs)(l.PanelBody,{title:(0,o.__)("Author Settings","author-website-templates"),initialOpen:!1,children:[(0,n.jsx)(l.TextControl,{label:(0,o.__)("Subtitle / Role","author-website-templates"),value:m,onChange:e=>t({authorSubtitle:e})}),(0,n.jsx)(l.TextControl,{label:(0,o.__)("View Profile Label","author-website-templates"),value:g,onChange:e=>t({viewProfileLabel:e})}),(0,n.jsxs)("div",{className:"awt-author-image-control",style:{marginTop:"1rem"},children:[(0,n.jsx)("label",{className:"components-base-control__label",children:(0,o.__)("Author Image","author-website-templates")}),(0,n.jsx)(a.MediaUploadCheck,{children:(0,n.jsx)(a.MediaUpload,{onSelect:e=>{t({authorImage:{id:e.id,url:e.url,alt:e.alt}})},allowedTypes:["image"],value:w?w.id:null,render:({open:e})=>(0,n.jsx)(n.Fragment,{children:w&&w.url?(0,n.jsxs)("div",{className:"awt-author-image-preview",style:{marginBottom:"10px"},children:[(0,n.jsx)("img",{src:w.url,alt:w.alt,style:{maxWidth:"100%",height:"auto",borderRadius:"4px"}}),(0,n.jsx)(l.Button,{onClick:x,isDestructive:!0,variant:"link",style:{marginTop:"5px"},children:(0,o.__)("Remove Image","author-website-templates")})]}):(0,n.jsx)(l.Button,{onClick:e,variant:"secondary",children:(0,o.__)("Upload Author Image","author-website-templates")})})})})]})]})]}),(0,n.jsx)(r(),{block:"awt/author-pro-book-synopsis",attributes:e})]})}})})();