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 / about / index.js
author-website-templates / build / blocks / author-pro / about 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";const e=window.wp.blocks,t=window.wp.i18n,o=window.wp.blockEditor,a=window.wp.components,r=window.wp.element,l=window.ReactJSXRuntime,n=({isLocked:e,children:o})=>e?(0,l.jsxs)("div",{style:{position:"relative",opacity:.5},children:[(0,l.jsx)("div",{style:{pointerEvents:"none"},children:o}),(0,l.jsx)("a",{href:"https://rswpthemes.com/author-portfolio-pro-wordpress-theme/",target:"_blank",rel:"noopener noreferrer",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:20,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",background:"rgba(255, 255, 255, 0.4)"},title:(0,t.__)("Click to Upgrade to Pro","author-website-templates"),children:(0,l.jsx)("div",{style:{background:"#fff",padding:"6px 12px",borderRadius:"4px",boxShadow:"0 2px 5px rgba(0,0,0,0.1)",fontSize:"12px",fontWeight:"bold",color:"#333"},children:"🔒 Upgrade to Pro"})})]}):o,s=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"awt/author-pro-about","version":"1.0.1","title":"About [Author Pro]","category":"theme","icon":"nametag","description":"A premium About section with author bio, image, and features list.","attributes":{"blockId":{"type":"string"},"badgeText":{"type":"string","default":"The Author"},"title":{"type":"string","default":"Crafting Stories That Matter"},"description":{"type":"string","default":"<p>Hello! I\'m James, a writer and speaker focused on habits, decision-making, and continuous improvement. My work has been translated into over 50 languages and has sold millions of copies worldwide.</p>"},"authorImageId":{"type":"number"},"authorImageUrl":{"type":"string","default":""},"authorImageAlt":{"type":"string","default":"Author"},"features":{"type":"array","default":["New York Times Bestseller","Keynote Speaker at Fortune 500s","Featured in Major Publications"]},"btnText":{"type":"string","default":"Read Full Bio"},"btnUrl":{"type":"string","default":"#"},"paddingTop":{"type":"number","default":128},"paddingBottom":{"type":"number","default":128},"bgColor":{"type":"string","default":""},"align":{"type":"string","default":"full"},"accentColor":{"type":"string","default":""},"btnBgColor":{"type":"string","default":""},"btnTextColor":{"type":"string","default":""},"btnBorderColor":{"type":"string","default":""},"btnHoverBgColor":{"type":"string","default":""},"btnHoverTextColor":{"type":"string","default":""},"btnHoverBorderColor":{"type":"string","default":""},"anchor":{"type":"string","default":""}},"supports":{"html":false,"anchor":true,"align":["full"],"spacing":{"margin":true,"padding":true,"__experimentalSkipSerialization":true}},"textdomain":"author-website-templates","editorScript":"file:./index.js","render":"file:./render.php"}');(0,e.registerBlockType)(s.name,{...s,edit:function({attributes:e,setAttributes:s}){const{blockId:i,badgeText:d,title:c,description:u,authorImageId:p,authorImageUrl:h,authorImageAlt:g,features:b,btnText:m,btnUrl:x,paddingTop:w,paddingBottom:f,bgColor:C,accentColor:v,btnBgColor:_,btnTextColor:y,btnBorderColor:j,btnHoverBgColor:k,btnHoverTextColor:B,btnHoverBorderColor:T,anchor:N}=e,I=window.awtVars?.isPro||!1;(0,r.useEffect)(()=>{i||s({blockId:`author-pro-about-${Math.floor(1e4*Math.random())}`})},[]);const S=N||i,$=`\n #${S} .awt-accent { color: ${v} !important; }\n #${S} .awt-accent svg { color: ${v} !important; }\n #${S} .awt-btn {\n background-color: ${_};\n color: ${y};\n border-color: ${j};\n }\n #${S} .awt-btn:hover {\n background-color: ${k};\n color: ${B};\n border-color: ${T};\n }\n `,A=(0,o.useBlockProps)({className:"awt-author-pro-about relative",id:N?void 0:i,style:{paddingTop:`${w}px`,paddingBottom:`${f}px`,backgroundColor:C&&!C.includes("bg-")?C:void 0}}),H=(e,t)=>{const o=[...b];o[e]=t,s({features:o})},P=e=>{const t=b.filter((t,o)=>o!==e);s({features:t})};return(0,l.jsxs)("div",{...A,children:[(0,l.jsx)("style",{children:$}),(0,l.jsxs)(o.InspectorControls,{children:[(0,l.jsxs)(a.PanelBody,{title:(0,t.__)("Content Settings","author-website-templates"),initialOpen:!0,children:[(0,l.jsx)(a.TextControl,{label:(0,t.__)("Badge Text","author-website-templates"),value:d,onChange:e=>s({badgeText:e})}),(0,l.jsx)(a.TextControl,{label:(0,t.__)("Button URL","author-website-templates"),value:x,onChange:e=>s({btnUrl:e})}),(0,l.jsx)(a.TextControl,{label:(0,t.__)("Author Image Alt Text","author-website-templates"),value:g,onChange:e=>s({authorImageAlt:e})}),(0,l.jsx)("hr",{className:"my-4"}),(0,l.jsx)("p",{children:(0,l.jsx)("strong",{children:(0,t.__)("Features List","author-website-templates")})}),b.map((e,o)=>(0,l.jsxs)("div",{className:"flex gap-2 mb-2 items-center",children:[(0,l.jsx)(a.TextControl,{value:e,onChange:e=>H(o,e),className:"mb-0 flex-grow"}),(0,l.jsx)(a.Button,{isDestructive:!0,icon:"minus",onClick:()=>P(o),label:(0,t.__)("Remove","author-website-templates")})]},o)),(0,l.jsx)(n,{isLocked:!I,children:(0,l.jsx)(a.Button,{variant:"secondary",onClick:()=>{s({features:[...b,"New Feature"]})},className:"w-full justify-center mt-2",children:(0,t.__)("Add New Feature","author-website-templates")})})]}),(0,l.jsxs)(a.PanelBody,{title:(0,t.__)("Spacing","author-website-templates"),initialOpen:!1,children:[(0,l.jsx)(a.RangeControl,{label:(0,t.__)("Top Padding (px)","author-website-templates"),value:w,onChange:e=>s({paddingTop:e}),min:0,max:300}),(0,l.jsx)(a.RangeControl,{label:(0,t.__)("Bottom Padding (px)","author-website-templates"),value:f,onChange:e=>s({paddingBottom:e}),min:0,max:300})]})]}),(0,l.jsx)(o.InspectorControls,{group:"styles",children:(0,l.jsxs)(n,{isLocked:!I,children:[(0,l.jsx)(o.PanelColorSettings,{title:(0,t.__)("Global Colors","author-website-templates"),initialOpen:!0,colorSettings:[{value:C,onChange:e=>s({bgColor:e}),label:(0,t.__)("Background Color","author-website-templates")}]}),(0,l.jsx)(o.PanelColorSettings,{title:(0,t.__)("Accent & Icon Color","author-website-templates"),initialOpen:!1,colorSettings:[{value:v,onChange:e=>s({accentColor:e}),label:(0,t.__)("Accent Color","author-website-templates")}]}),(0,l.jsx)(o.PanelColorSettings,{title:(0,t.__)("Button Colors (Normal)","author-website-templates"),initialOpen:!1,colorSettings:[{value:y,onChange:e=>s({btnTextColor:e}),label:(0,t.__)("Text Color","author-website-templates")},{value:_,onChange:e=>s({btnBgColor:e}),label:(0,t.__)("Background Color","author-website-templates")},{value:j,onChange:e=>s({btnBorderColor:e}),label:(0,t.__)("Border Color","author-website-templates")}]}),(0,l.jsx)(o.PanelColorSettings,{title:(0,t.__)("Button Colors (Hover)","author-website-templates"),initialOpen:!1,colorSettings:[{value:B,onChange:e=>s({btnHoverTextColor:e}),label:(0,t.__)("Hover Text","author-website-templates")},{value:k,onChange:e=>s({btnHoverBgColor:e}),label:(0,t.__)("Hover Background","author-website-templates")},{value:T,onChange:e=>s({btnHoverBorderColor:e}),label:(0,t.__)("Hover Border","author-website-templates")}]})]})}),(0,l.jsx)("div",{className:`awt-container ${C&&C.includes("bg-")?C:""}`,children:(0,l.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-16 items-center",children:[(0,l.jsxs)("div",{className:"relative pl-6 pt-6",children:[(0,l.jsx)("div",{className:"awt-border-accent absolute top-0 left-0 w-full h-full border-2 border-accent/20 rounded-2xl -z-10"}),(0,l.jsx)(o.MediaUploadCheck,{children:(0,l.jsx)(o.MediaUpload,{onSelect:e=>s({authorImageUrl:e.url,authorImageId:e.id}),allowedTypes:["image"],value:p,render:({open:e})=>(0,l.jsx)("div",{onClick:e,className:"cursor-pointer group",children:h?(0,l.jsx)("img",{src:h,alt:g,className:"rounded-xl shadow-xl w-full h-[500px] object-cover grayscale hover:grayscale-0 transition duration-500"}):(0,l.jsx)("div",{className:"w-full h-[500px] bg-gray-100 rounded-xl flex items-center justify-center text-gray-400 border-2 border-dashed border-gray-300",children:(0,t.__)("Select Author Image","author-website-templates")})})})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(o.RichText,{tagName:"span",className:"awt-accent text-accent font-bold text-xs uppercase tracking-widest mb-2 block",value:d,onChange:e=>s({badgeText:e}),placeholder:(0,t.__)("Badge Text...","author-website-templates")}),(0,l.jsx)(o.RichText,{tagName:"h2",className:"text-4xl font-serif font-bold text-primary mb-6",value:c,onChange:e=>s({title:e}),placeholder:(0,t.__)("Heading...","author-website-templates")}),(0,l.jsx)(o.RichText,{tagName:"div",className:"text-secondary leading-relaxed mb-6",value:u,onChange:e=>s({description:e}),placeholder:(0,t.__)("Write description...","author-website-templates")}),(0,l.jsx)("ul",{className:"space-y-4 mb-8",children:b.map((e,a)=>(0,l.jsxs)("li",{className:"flex items-center gap-3 text-primary font-medium",children:[(0,l.jsx)("span",{className:"awt-accent",children:(0,l.jsx)("svg",{className:"w-6 h-6 text-accent",fill:"currentColor",viewBox:"0 0 512 512",children:(0,l.jsx)("path",{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"})})}),(0,l.jsx)(o.RichText,{tagName:"span",value:e,onChange:e=>H(a,e),placeholder:(0,t.__)("Feature text...","author-website-templates"),onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();const e=[...b];e.splice(a+1,0,""),s({features:e})}else"Backspace"===t.key&&""===e&&b.length>1&&(t.preventDefault(),P(a))}})]},a))}),(0,l.jsx)("a",{href:"#",onClick:e=>e.preventDefault(),className:(()=>{let e="awt-btn inline-block px-8 py-3 border font-bold rounded transition";return y||(e+=" text-primary"),j||(e+=" border-primary"),k||(e+=" hover:bg-slate-900"),B||(e+=" hover:text-white"),e})(),children:(0,l.jsx)(o.RichText,{tagName:"span",value:m,onChange:e=>s({btnText:e}),placeholder:(0,t.__)("Button Text","author-website-templates"),allowedFormats:[]})})]})]})})]})}})})();