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 / child-author / activities / index.js
author-website-templates / build / blocks / child-author / activities Last commit date
block.json 1 month ago index.asset.php 1 month ago index.js 1 month ago
index.js
1 lines
1 (()=>{"use strict";const e=window.wp.blocks,t=window.wp.blockEditor,l=window.wp.components,o=window.wp.i18n,i=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)(l.Tooltip,{text:"🔒 Pro Feature - Click to Upgrade",children:(0,a.jsx)("div",{style:{width:"100%",height:"100%"}})})})]}),s=[["awt/child-author-activity-card",{title:"Free Coloring Pages",description:"Download and print characters.",hoverEffect:"rotate-left",imageUrl:"https://via.placeholder.com/300"}],["awt/child-author-activity-card",{title:"How-To-Draw",description:"Learn to draw in 5 steps.",hoverEffect:"scale",imageUrl:"https://via.placeholder.com/300"}],["awt/child-author-activity-card",{title:"Reading Guides",description:"Fun questions for parents.",hoverEffect:"rotate-right",imageUrl:"https://via.placeholder.com/300"}]],n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"awt/child-author-activities","version":"1.0.0","title":"Activities (Child Author)","category":"theme","icon":"grid-view","description":"Display activity cards with Pro Locking for styling controls.","keywords":["activities","cards","grid","author"],"textdomain":"author-website-templates","editorScript":"file:./index.js","attributes":{"align":{"type":"string","default":"full"},"heading":{"type":"string","default":"Fun Stuff To Do!"},"activityStyle":{"type":"string","default":"fun"},"sectionBgColor":{"type":"string","default":""},"sectionPadding":{"type":"number","default":null},"cardBgColor":{"type":"string","default":""},"headingColor":{"type":"string","default":""},"textColor":{"type":"string","default":""},"hideCurve":{"type":"boolean","default":false},"curveColor":{"type":"string","default":"#FFFDF5"},"blockId":{"type":"string","default":""}},"providesContext":{"awt/activityStyle":"activityStyle"},"supports":{"html":false,"align":["full"],"alignWide":true}}');(0,e.registerBlockType)(n.name,{...n,edit:function({attributes:e,setAttributes:n,clientId:d}){const{heading:c,sectionBgColor:u,sectionPadding:p,headingColor:h,hideCurve:g,curveColor:v,blockId:x,activityStyle:m}=e,f=window.awtVars?.isPro||!1;(0,i.useEffect)(()=>{x||n({blockId:d})},[x,d,n]);const w="fun"===m,y="elegant"===m,b=u||null!==p?"relative":`py-24 ${y?"bg-gray-50":"bg-blue-sky/10"} relative`,C=y?"text-3xl md:text-5xl font-serif font-bold text-brand-dark text-center mb-12":"text-4xl md:text-5xl font-black text-center mb-12",k=h?`${C}`:`${C} ${w?"text-navy":""}`,j=y?"mt-0":"mt-12",$=(0,t.useBlockProps)({className:`block-${x} ${b}`,style:{backgroundColor:u||void 0,paddingTop:null!==p?`${p}px`:void 0,paddingBottom:null!==p?`${p}px`:void 0}}),B=(0,t.useInnerBlocksProps)({className:"grid grid-cols-1 md:grid-cols-3 gap-8"},{allowedBlocks:["awt/child-author-activity-card"],template:s});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.InspectorControls,{children:(0,a.jsxs)(l.PanelBody,{title:(0,o.__)("Design Settings","author-website-templates"),initialOpen:!1,children:[(0,a.jsx)(l.SelectControl,{label:(0,o.__)("Section Style","author-website-templates"),value:m,options:[{label:(0,o.__)("Fun (Child)","author-website-templates"),value:"fun"},{label:(0,o.__)("Elegant (Author)","author-website-templates"),value:"elegant"}],onChange:e=>n({activityStyle:e})}),(0,a.jsxs)(r,{isPro:f,children:[(0,a.jsx)(t.PanelColorSettings,{title:(0,o.__)("Colors","author-website-templates"),colorSettings:[{value:u,onChange:e=>n({sectionBgColor:e}),label:"Background"},{value:v,onChange:e=>n({curveColor:e}),label:"Curve Color"},{value:h,onChange:e=>n({headingColor:e}),label:"Heading Color"}]}),(0,a.jsx)(l.ToggleControl,{label:"Hide Top Curve",checked:g,onChange:e=>n({hideCurve:e})})]})]})}),(0,a.jsxs)("section",{...$,children:[!g&&w&&(0,a.jsx)("div",{className:"absolute top-0 left-0 w-full pointer-events-none",children:(0,a.jsx)("svg",{viewBox:"0 0 1440 100",fill:"none",className:"w-full h-auto",children:(0,a.jsx)("path",{d:"M0 0H1440V100C1192.5 50.503 919.5 25.503 720 25.503C520.5 25.503 247.5 50.503 0 100V0Z",fill:v})})}),(0,a.jsxs)("div",{className:`awt-container mx-auto px-6 relative z-10 ${j}`,children:[(0,a.jsx)(t.RichText,{tagName:"h2",className:k,value:c,onChange:e=>n({heading:e}),style:{color:h}}),(0,a.jsx)("div",{...B})]})]})]})},save:function({attributes:e}){const{heading:l,sectionBgColor:o,sectionPadding:i,headingColor:r,hideCurve:s,curveColor:n,blockId:d,activityStyle:c}=e,u="fun"===c,p="elegant"===c,h=o||null!==i?"relative":`py-24 ${p?"bg-gray-50":"bg-blue-sky/10"} relative`,g=p?"text-3xl md:text-5xl font-serif font-bold text-brand-dark text-center mb-12":"text-4xl md:text-5xl font-black text-center mb-12",v=r?`${g}`:`${g} ${u?"text-navy":""}`,x=p?"mt-0":"mt-12",m=t.useBlockProps.save({className:`block-${d} ${h}`,style:{backgroundColor:o||void 0,paddingTop:null!==i?`${i}px`:void 0,paddingBottom:null!==i?`${i}px`:void 0}}),f=t.useInnerBlocksProps.save({className:"grid grid-cols-1 md:grid-cols-3 gap-8"});return(0,a.jsxs)("section",{...m,children:[!s&&u&&(0,a.jsx)("div",{className:"absolute top-0 left-0 w-full pointer-events-none",children:(0,a.jsx)("svg",{viewBox:"0 0 1440 100",fill:"none",className:"w-full h-auto",children:(0,a.jsx)("path",{d:"M0 0H1440V100C1192.5 50.503 919.5 25.503 720 25.503C520.5 25.503 247.5 50.503 0 100V0Z",fill:n})})}),(0,a.jsxs)("div",{className:`awt-container mx-auto px-6 relative z-10 ${x}`,children:[(0,a.jsx)(t.RichText.Content,{tagName:"h2",className:v,value:l,style:{color:r}}),(0,a.jsx)("div",{...f})]})]})}})})();