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 / featured-in / index.js
author-website-templates / build / blocks / author-pro / featured-in Last commit date
block.json 4 months ago index.asset.php 4 months ago index.js 4 months ago render.php 4 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 l in o)e.o(o,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:o[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,o=window.wp.i18n,l=window.wp.blockEditor,i=window.wp.components,a=window.wp.element,r=window.wp.serverSideRender;var s=e.n(r);const n=window.ReactJSXRuntime,d=({isLocked:e,children:t})=>e?(0,n.jsxs)("div",{style:{position:"relative",opacity:.5},children:[(0,n.jsx)("div",{style:{pointerEvents:"none"},children:t}),(0,n.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)"},children:(0,n.jsxs)("div",{style:{background:"#fff",padding:"6px 12px",borderRadius:"4px",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",fontWeight:"500",fontSize:"12px",color:"#333",display:"flex",alignItems:"center",gap:"4px"},children:[(0,n.jsx)("span",{role:"img","aria-label":"lock",children:"🔒"})," ",(0,o.__)("Upgrade","author-website-templates")]})})]}):t,p=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"awt/author-pro-featured-in","version":"1.0.0","title":"Featured In [Author Pro]","category":"awt-blocks","description":"Featured In section with text or image logos","keywords":["featured","logos","author","pro"],"textdomain":"author-website-templates","editorScript":"file:./index.js","render":"file:./render.php","attributes":{"blockId":{"type":"string","default":""},"sectionTitle":{"type":"string","default":"Featured In"},"align":{"type":"string","default":"full"},"logos":{"type":"array","default":[{"id":1,"text":"Forbes","url":"","link":"#"},{"id":2,"text":"The New York Times","url":"","link":"#"},{"id":3,"text":"Wall Street Journal","url":"","link":"#"},{"id":4,"text":"TIME","url":"","link":"#"}]},"paddingTop":{"type":"number","default":32},"paddingBottom":{"type":"number","default":32},"bgColor":{"type":"string","default":"bg-primary"},"anchor":{"type":"string","default":""}},"supports":{"html":false,"anchor":true,"align":["full"]}}');(0,t.registerBlockType)(p.name,{...p,edit:function({attributes:e,setAttributes:t}){const{blockId:r,sectionTitle:p,logos:c,paddingTop:u,paddingBottom:h,bgColor:x}=e;(0,a.useEffect)(()=>{r||t({blockId:`featured-in-${Date.now()}`})},[]);const g=(0,l.useBlockProps)({className:"awt-author-pro-featured-in-editor"}),m=window.awtVars?.isPro||!1,b=(e,o,l)=>{const i=[...c];i[e]={...i[e],[o]:l},t({logos:i})};return(0,n.jsxs)("div",{...g,children:[(0,n.jsx)(l.InspectorControls,{children:(0,n.jsxs)(i.PanelBody,{title:(0,o.__)("Content Settings","author-website-templates"),initialOpen:!0,children:[(0,n.jsx)(i.TextControl,{label:(0,o.__)("Section Title","author-website-templates"),value:p,onChange:e=>t({sectionTitle:e}),placeholder:(0,o.__)("Featured In","author-website-templates")}),(0,n.jsx)("hr",{style:{margin:"16px 0"}}),(0,n.jsx)("h3",{children:(0,o.__)("Logos","author-website-templates")}),(0,n.jsx)("div",{className:"awt-logos-list",children:c.map((e,a)=>(0,n.jsxs)("div",{style:{marginBottom:"20px",padding:"15px",border:"1px solid #ddd",borderRadius:"4px"},children:[(0,n.jsx)("div",{style:{marginBottom:"10px",textAlign:"center",background:"#f0f0f0",padding:"10px",borderRadius:"4px"},children:e.url?(0,n.jsx)("img",{src:e.url,alt:e.text,style:{maxWidth:"100%",height:"auto",maxHeight:"40px"}}):(0,n.jsx)("span",{style:{fontWeight:"bold",textTransform:"uppercase",color:"#666"},children:e.text||"LOGO"})}),(0,n.jsx)(i.TextControl,{label:(0,o.__)("Logo Text / Name","author-website-templates"),value:e.text,onChange:e=>b(a,"text",e),placeholder:"Forbes"}),(0,n.jsx)(l.MediaUploadCheck,{children:(0,n.jsx)(l.MediaUpload,{onSelect:e=>((e,o)=>{const l=[...c];l[e]={...l[e],url:o.url,id:o.id,alt:o.alt||l[e].text||"Logo"},t({logos:l})})(a,e),allowedTypes:["image"],value:e.id,render:({open:t})=>(0,n.jsxs)("div",{style:{marginBottom:"10px"},children:[(0,n.jsx)("label",{className:"components-base-control__label",style:{display:"block",marginBottom:"4px"},children:(0,o.__)("Or Upload Image","author-website-templates")}),e.url?(0,n.jsxs)("div",{style:{display:"flex",gap:"5px"},children:[(0,n.jsx)(i.Button,{onClick:t,variant:"secondary",size:"small",style:{flex:1},children:(0,o.__)("Replace","author-website-templates")}),(0,n.jsx)(i.Button,{onClick:()=>b(a,"url",""),variant:"secondary",isDestructive:!0,size:"small",children:(0,o.__)("X","author-website-templates")})]}):(0,n.jsx)(i.Button,{onClick:t,variant:"secondary",size:"small",style:{width:"100%"},children:(0,o.__)("Upload Image","author-website-templates")})]})})}),(0,n.jsx)(i.TextControl,{label:(0,o.__)("Link URL","author-website-templates"),value:e.link,onChange:e=>b(a,"link",e),placeholder:"#"}),(0,n.jsx)(i.Button,{onClick:()=>(e=>{const o=c.filter((t,o)=>o!==e);t({logos:o})})(a),isDestructive:!0,variant:"link",size:"small",children:(0,o.__)("Remove Logo","author-website-templates")})]},a))}),(0,n.jsx)(d,{isLocked:!m,children:(0,n.jsx)(i.Button,{onClick:m?()=>{t({logos:[...c,{id:Date.now(),text:"New Logo",url:"",link:"#"}]})}:void 0,variant:"primary",disabled:!m,style:{width:"100%",justifyContent:"center"},children:(0,o.__)("Add New Logo","author-website-templates")})})]})}),(0,n.jsxs)(l.InspectorControls,{group:"styles",children:[(0,n.jsxs)(i.PanelBody,{title:(0,o.__)("Spacing","author-website-templates"),initialOpen:!0,children:[(0,n.jsx)(i.RangeControl,{label:(0,o.__)("Top Padding (px)","author-website-templates"),value:u,onChange:e=>t({paddingTop:e}),min:0,max:200,initialPosition:32}),(0,n.jsx)(i.RangeControl,{label:(0,o.__)("Bottom Padding (px)","author-website-templates"),value:h,onChange:e=>t({paddingBottom:e}),min:0,max:200,initialPosition:32})]}),(0,n.jsx)(d,{isLocked:!m,children:(0,n.jsx)(l.PanelColorSettings,{title:(0,o.__)("Colors","author-website-templates"),initialOpen:!0,colorSettings:[{value:"bg-primary"===x?"":x,onChange:e=>t({bgColor:e}),label:(0,o.__)("Background Color","author-website-templates")}]})})]}),(0,n.jsx)("div",{className:"awt-editor-preview",children:(0,n.jsx)(s(),{block:"awt/author-pro-featured-in",attributes:e})})]})},save:()=>null})})();