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 / child-author / signup / index.js
author-website-templates / build / blocks / child-author / signup Last commit date
block.json 5 months ago index.asset.php 5 months ago index.js 5 months ago
index.js
1 lines
1 (()=>{"use strict";const e=window.wp.blocks,t=window.wp.blockEditor,o=window.wp.components,l=window.wp.i18n,n=window.wp.element,a=window.ReactJSXRuntime,r=({isPro:e,children:t})=>e?t:(0,a.jsxs)("div",{className:"pro-lock-wrapper",style:{position:"relative",cursor:"not-allowed"},children:[(0,a.jsx)("div",{style:{opacity:.4,pointerEvents:"none",filter:"grayscale(100%)"},children:t}),(0,a.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:10,cursor:"pointer"},"aria-label":"Upgrade to Pro",children:(0,a.jsx)(o.Tooltip,{text:"🔒 Pro Feature - Click to Upgrade",children:(0,a.jsx)("div",{style:{width:"100%",height:"100%"}})})})]}),s=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"awt/child-author-signup","version":"1.0.0","title":"Newsletter Signup (Child Author)","category":"theme","icon":"email","description":"Newsletter signup form with Smart Pro Locking for styling controls.","keywords":["signup","newsletter","form","child-author"],"textdomain":"author-website-templates","editorScript":"file:./index.js","attributes":{"align":{"type":"string","default":"full"},"signupStyle":{"type":"string","default":"fun"},"heading":{"type":"string","default":"Join the Story Club!"},"description":{"type":"string","default":"Get free coloring pages, activities, and updates about my new books!"},"disclaimer":{"type":"string","default":"No spam, just fun. Unsubscribe anytime."},"buttonText":{"type":"string","default":"Sign Me Up!"},"buttonUrl":{"type":"string","default":"#"},"useShortcode":{"type":"boolean","default":false},"customShortcode":{"type":"string","default":""},"sectionBgColor":{"type":"string","default":""},"sectionPadding":{"type":"number","default":null},"headingColor":{"type":"string","default":""},"textColor":{"type":"string","default":""},"inputBgColor":{"type":"string","default":""},"btnBgColor":{"type":"string","default":""},"btnTextColor":{"type":"string","default":""},"btnHoverBgColor":{"type":"string","default":""},"btnHoverTextColor":{"type":"string","default":""},"blockId":{"type":"string","default":""}},"supports":{"html":false,"color":false,"typography":false,"spacing":false,"align":["full"],"alignWide":true},"style":"file:./index.css"}');(0,e.registerBlockType)(s.name,{...s,edit:function({attributes:e,setAttributes:s,clientId:i}){const{heading:d,description:u,disclaimer:c,buttonText:x,buttonUrl:p,useShortcode:g,customShortcode:h,sectionBgColor:m,sectionPadding:b,headingColor:w,textColor:f,inputBgColor:y,btnBgColor:C,btnTextColor:v,btnHoverBgColor:_,btnHoverTextColor:j,blockId:k,signupStyle:T}=e,B=window.awtVars?.isPro||!1;(0,n.useEffect)(()=>{k||s({blockId:i})},[k,i,s]);const S="elegant"===T,N=m||null!==b?"":S?"bg-gray-900 py-24":"bg-coral-pop py-24",P=w?S?"text-3xl md:text-4xl font-serif font-bold mb-4 text-center text-white":"text-4xl md:text-5xl font-black text-center mb-4":S?"text-3xl md:text-4xl font-serif font-bold mb-4 text-center text-white":"section-heading",$=f?"text-center text-lg mb-8 max-w-2xl mx-auto":S?"text-center text-lg text-gray-300 max-w-2xl mx-auto mb-10 font-light":"text-center text-lg mb-8 text-white/90 max-w-2xl mx-auto",H=f?"text-center text-sm mt-4":S?"text-center text-xs mt-6 text-gray-500":"text-center text-sm text-white/70 mt-4",R=y?"flex-1 px-6 py-4 rounded-full text-lg":S?"flex-1 px-6 py-4 rounded bg-white/10 border border-white/20 text-white placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-white transition-all":"flex-1 px-6 py-4 rounded-full text-lg bg-white text-navy",U=C?"btn-signup px-8 py-4 rounded-full font-bold text-lg transition-all duration-300":S?"btn-signup px-8 py-4 rounded bg-white text-gray-900 font-bold hover:bg-gray-200 transition-colors flex-shrink-0":"btn-fun btn-yellow btn-signup px-8 py-4 rounded-full font-bold text-lg transition-all duration-300",E=`\n .block-${k} .btn-signup:hover {\n ${_?`background-color: ${_} !important;`:""}\n ${j?`color: ${j} !important;`:""}\n }\n `,I=(0,t.useBlockProps)({className:`alignfull block-${k} awt-child-author-signup ${N}`,style:{backgroundColor:m||void 0,paddingTop:null!==b?`${b}px`:void 0,paddingBottom:null!==b?`${b}px`:void 0}});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.InspectorControls,{children:[(0,a.jsx)(o.PanelBody,{title:(0,l.__)("Design Settings","author-website-templates"),children:(0,a.jsx)(o.SelectControl,{label:(0,l.__)("Block Style","author-website-templates"),value:T,options:[{label:(0,l.__)("Fun (Child)","author-website-templates"),value:"fun"},{label:(0,l.__)("Elegant (Author)","author-website-templates"),value:"elegant"}],onChange:e=>s({signupStyle:e})})}),(0,a.jsxs)(o.PanelBody,{title:(0,l.__)("Content Settings","author-website-templates"),initialOpen:!0,children:[(0,a.jsx)(o.TextControl,{label:(0,l.__)("Heading","author-website-templates"),value:d,onChange:e=>s({heading:e}),help:(0,l.__)("You can also edit directly on the canvas","author-website-templates")}),(0,a.jsx)(o.TextareaControl,{label:(0,l.__)("Description","author-website-templates"),value:u,onChange:e=>s({description:e}),rows:3,help:(0,l.__)("You can also edit directly on the canvas","author-website-templates")}),(0,a.jsx)(o.TextareaControl,{label:(0,l.__)("Disclaimer Text","author-website-templates"),value:c,onChange:e=>s({disclaimer:e}),rows:2}),(0,a.jsx)("hr",{style:{margin:"16px 0"}}),(0,a.jsx)("h4",{style:{marginBottom:"12px",fontWeight:"bold"},children:(0,l.__)("Form Settings","author-website-templates")}),(0,a.jsx)(o.ToggleControl,{label:(0,l.__)("Use Custom Shortcode","author-website-templates"),checked:g,onChange:e=>s({useShortcode:e}),help:(0,l.__)("Enable to use your own form plugin shortcode (e.g., Contact Form 7, WPForms)","author-website-templates")}),g?(0,a.jsx)(o.TextareaControl,{label:(0,l.__)("Paste Shortcode Here","author-website-templates"),value:h,onChange:e=>s({customShortcode:e}),placeholder:"[contact-form-7 id='123']",rows:3,help:(0,l.__)('Example: [contact-form-7 id="123"] or [wpforms id="456"]',"author-website-templates")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.TextControl,{label:(0,l.__)("Button Text","author-website-templates"),value:x,onChange:e=>s({buttonText:e})}),(0,a.jsx)(o.TextControl,{label:(0,l.__)("Button URL","author-website-templates"),value:p,onChange:e=>s({buttonUrl:e}),placeholder:"#",help:(0,l.__)("Where should the button link to?","author-website-templates")})]})]}),(0,a.jsxs)(o.PanelBody,{title:(0,l.__)("Design Settings","author-website-templates"),initialOpen:!1,children:[!B&&(0,a.jsx)(o.Notice,{status:"warning",isDismissible:!1,children:(0,l.__)("🔒 Upgrade to Pro to unlock styling controls","author-website-templates")}),(0,a.jsx)(r,{isPro:B,children:(0,a.jsx)(t.PanelColorSettings,{title:(0,l.__)("Section Colors","author-website-templates"),colorSettings:[{value:m,onChange:B?e=>s({sectionBgColor:e}):void 0,label:(0,l.__)("Section Background","author-website-templates"),disableCustomColors:!B},{value:w,onChange:B?e=>s({headingColor:e}):void 0,label:(0,l.__)("Heading Color","author-website-templates"),disableCustomColors:!B},{value:f,onChange:B?e=>s({textColor:e}):void 0,label:(0,l.__)("Text Color","author-website-templates"),disableCustomColors:!B}]})}),(0,a.jsx)(r,{isPro:B,children:(0,a.jsx)(o.RangeControl,{label:(0,l.__)("Section Padding (px)","author-website-templates"),value:null!==b?b:96,onChange:B?e=>s({sectionPadding:e}):void 0,min:0,max:200,step:8,disabled:!B,help:B?(0,l.__)("Default: 96px (py-24)","author-website-templates"):(0,l.__)("Pro feature","author-website-templates")})}),(0,a.jsx)(r,{isPro:B,children:(0,a.jsx)(t.PanelColorSettings,{title:(0,l.__)("Form Colors","author-website-templates"),colorSettings:[{value:y,onChange:B?e=>s({inputBgColor:e}):void 0,label:(0,l.__)("Input Background","author-website-templates"),disableCustomColors:!B},{value:C,onChange:B?e=>s({btnBgColor:e}):void 0,label:(0,l.__)("Button Background","author-website-templates"),disableCustomColors:!B},{value:v,onChange:B?e=>s({btnTextColor:e}):void 0,label:(0,l.__)("Button Text","author-website-templates"),disableCustomColors:!B},{value:_,onChange:B?e=>s({btnHoverBgColor:e}):void 0,label:(0,l.__)("Button Hover Background","author-website-templates"),disableCustomColors:!B},{value:j,onChange:B?e=>s({btnHoverTextColor:e}):void 0,label:(0,l.__)("Button Hover Text","author-website-templates"),disableCustomColors:!B}]})})]})]}),(0,a.jsxs)("section",{...I,children:[(0,a.jsx)("style",{children:E}),(0,a.jsxs)("div",{className:"awt-container mx-auto px-6",children:[(0,a.jsx)(t.RichText,{tagName:"h2",className:P,value:d,onChange:e=>s({heading:e}),placeholder:(0,l.__)("Enter heading...","author-website-templates"),style:{color:w||void 0}}),(0,a.jsx)(t.RichText,{tagName:"p",className:$,value:u,onChange:e=>s({description:e}),placeholder:(0,l.__)("Enter description...","author-website-templates"),style:{color:f||void 0}}),g?(0,a.jsx)("div",{className:"shortcode-placeholder",style:{background:"rgba(255, 255, 255, 0.1)",border:"2px dashed rgba(255, 255, 255, 0.3)",padding:"40px",borderRadius:"12px",textAlign:"center",marginBottom:"20px"},children:h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{style:{color:"#fff",marginBottom:"10px",fontWeight:"bold"},children:(0,l.__)("📋 Shortcode Preview","author-website-templates")}),(0,a.jsx)("code",{style:{background:"rgba(0, 0, 0, 0.2)",padding:"10px 15px",borderRadius:"4px",color:"#fff",fontSize:"14px",display:"inline-block"},children:h}),(0,a.jsx)("p",{style:{color:"rgba(255, 255, 255, 0.7)",marginTop:"10px",fontSize:"13px"},children:(0,l.__)("This shortcode will render on the frontend","author-website-templates")})]}):(0,a.jsx)("p",{style:{color:"rgba(255, 255, 255, 0.7)"},children:(0,l.__)("⚠️ Please paste your shortcode in the sidebar settings","author-website-templates")})}):(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 max-w-2xl mx-auto items-center",children:[(0,a.jsx)("input",{type:"email",placeholder:"your.email@example.com",className:R,style:{backgroundColor:y||void 0},disabled:!0}),(0,a.jsx)(t.RichText,{tagName:"span",value:x,onChange:e=>s({buttonText:e}),placeholder:(0,l.__)("Button text...","author-website-templates"),className:U,style:{backgroundColor:C||void 0,color:v||void 0}})]}),(0,a.jsx)(t.RichText,{tagName:"p",className:H,value:c,onChange:e=>s({disclaimer:e}),placeholder:(0,l.__)("Enter disclaimer...","author-website-templates"),style:{color:f||void 0}})]})]})]})},save:function({attributes:e}){const{heading:o,description:l,disclaimer:n,buttonText:r,buttonUrl:s,useShortcode:i,customShortcode:d,sectionBgColor:u,sectionPadding:c,headingColor:x,textColor:p,inputBgColor:g,btnBgColor:h,btnTextColor:m,btnHoverBgColor:b,btnHoverTextColor:w,blockId:f,signupStyle:y}=e,C="elegant"===y,v=u||null!==c?"":C?"bg-gray-900 py-24":"bg-coral-pop py-24",_=x?C?"text-3xl md:text-4xl font-serif font-bold mb-4 text-center":"text-4xl md:text-5xl font-black text-center mb-4":C?"text-3xl md:text-4xl font-serif font-bold mb-4 text-center text-white":"section-heading",j=p?"text-center text-lg mb-8 max-w-2xl mx-auto":C?"text-center text-lg text-gray-300 max-w-2xl mx-auto mb-10 font-light":"text-center text-lg mb-8 text-white/90 max-w-2xl mx-auto",k=p?"text-center text-sm mt-4":C?"text-center text-xs mt-6 text-gray-500":"text-center text-sm text-white/70 mt-4",T=g?"flex-1 px-6 py-4 rounded-full text-lg":C?"flex-1 px-6 py-4 rounded bg-white/10 border border-white/20 text-white placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-white transition-all":"flex-1 px-6 py-4 rounded-full text-lg bg-white text-navy",B=h?"btn-signup px-8 py-4 rounded-full font-bold text-lg transition-all duration-300":C?"btn-signup px-8 py-4 rounded bg-white text-gray-900 font-bold hover:bg-gray-200 transition-colors flex-shrink-0":"btn-fun btn-yellow btn-signup px-8 py-4 rounded-full font-bold text-lg transition-all duration-300",S=`\n .block-${f} .btn-signup:hover {\n ${b?`background-color: ${b} !important;`:""}\n ${w?`color: ${w} !important;`:""}\n }\n `,N=t.useBlockProps.save({className:`alignfull block-${f} awt-child-author-signup ${v}`,style:{backgroundColor:u||void 0,paddingTop:null!==c?`${c}px`:void 0,paddingBottom:null!==c?`${c}px`:void 0}});return(0,a.jsxs)("section",{...N,id:"signup",children:[(b||w)&&(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:S}}),(0,a.jsxs)("div",{className:"awt-container mx-auto px-6",children:[(0,a.jsx)(t.RichText.Content,{tagName:"h2",className:_,value:o,style:{color:x||void 0}}),(0,a.jsx)(t.RichText.Content,{tagName:"p",className:j,value:l,style:{color:p||void 0}}),i?(0,a.jsx)("div",{className:"shortcode-render max-w-2xl mx-auto mb-4",children:(0,a.jsx)("div",{dangerouslySetInnerHTML:{__html:d}})}):(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 max-w-2xl mx-auto items-center",children:[(0,a.jsx)("input",{type:"email",placeholder:"your.email@example.com",className:T,style:{backgroundColor:g||void 0},"aria-label":"Email address"}),(0,a.jsx)("a",{href:s,className:B,style:{backgroundColor:h||void 0,color:m||void 0,textDecoration:"none",display:"inline-block"},children:r})]}),(0,a.jsx)(t.RichText.Content,{tagName:"p",className:k,value:n,style:{color:p||void 0}})]})]})}})})();