PluginProbe
bBlocks – Essential Gutenberg Blocks & Patterns Collection / 2.1.2
bBlocks – Essential Gutenberg Blocks & Patterns Collection v2.1.2
2.1.8 2.1.7 2.1.6 2.1.5 2.1.4 2.1.3 2.1.2 2.1.1 2.1.0 2.0.43 2.0.42 2.0.41 2.0.40 2.0.39 2.0.38 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 1.5.2 1.5.3 All 108 releases
b-blocks / build / team-members / view.js

view.js in bBlocks – Essential Gutenberg Blocks & Patterns Collection 2.1.2, at build/team-members/view.js

1 lines 7.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";const t=window.ReactDOM,e=t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)?e.toString():null}catch(e){return"string"==typeof t&&t.startsWith("/")&&!t.startsWith("//")?t:null}},n=t=>{const n=(new DOMParser).parseFromString(t,"text/html"),r=["b","strong","i","em","span","a","br"],o=["style","href","target","rel","class"];return n.body.querySelectorAll("*").forEach((t=>{r.includes(t.tagName.toLowerCase())?[...t.attributes].forEach((n=>{if(o.includes(n.name)||t.removeAttribute(n.name),"href"===n.name){const r=e(n.value);r?t.setAttribute("href",r):t.removeAttribute("href")}})):t.remove()})),n.body.innerHTML};window.React;const r="#85b4fa",o="linear-gradient(135deg, #0040E3, #18D4FD)",a=(t,e)=>{return null==(n=e)||""===n||Array.isArray(n)&&0===n.length||"object"==typeof n&&0===Object.keys(n).length||"string"==typeof n&&""===n.trim()||"number"==typeof n&&0===n?"":`${t}: ${e};`;var n},i=t=>{const{width:e="",style:n="solid",color:r="",side:o="all",radius:i=""}=t||{},l=t=>{const e=o?.toLowerCase();return e?.includes("all")||e?.includes(t)},s=`${e} ${n} ${r}`,m=`\n\t\t${e&&0!==parseInt(e)?["top","right","bottom","left"].map((t=>l(t)?`border-${t}: ${s};`:"")).join(""):""}\n\t\t${a("border-radius",i)}\n\t`;return m},l=t=>{const{color:e="",bgType:n="solid",bg:r="",gradient:i=o}=t||{};return`\n\t\t${a("color",e)}\n\t\t${i||r?a("background","gradient"===n?i:r):""}\n\t`},s=(t,e="box")=>{let n="";return t?.map(((r,o)=>{const{hOffset:a="0px",vOffset:i="0px",blur:l="0px",spreed:s="0px",color:m="#e7f0fe",isInset:$=!1}=r||{},c=$?"inset":"",d=`${a} ${i} ${l}`,b=o+1>=t.length?"":", ";n+="text"===e?`${d} ${m}${b}`:`${d} ${s} ${m} ${c}${b}`})),n||""},m=t=>{const{side:e=2,vertical:n="0px",horizontal:r="0px",top:o="0px",right:a="0px",bottom:i="0px",left:l="0px"}=t||{};return 2===e?`${n} ${r}`:`${o} ${a} ${i} ${l}`},$=(t,e,n=!0)=>{const{fontFamily:r="Default",fontCategory:o="sans-serif",fontVariant:i=400,fontWeight:l,isUploadFont:s=!0,fontSize:m={desktop:null,tablet:null,mobile:null},fontStyle:$,textTransform:c,textDecoration:d,lineHeight:b,letterSpace:g}=e||{},p=!n||!r||"Default"===r,u=m?.desktop||m,h=m?.tablet||u,f=m?.mobile||h,x=t=>{const e=String(t);return["px","em","rem","%","vh","vw"].some((t=>e.endsWith(t)))?e:"number"==typeof t?`${e}px`:""},y=`\n\t\t${p?"":`font-family: '${r}', ${o};`}\n\t\t${a("font-weight",l)}\n\t\t${a("font-size",x(u))}\n\t\t${a("font-style",$)}\n\t\t${a("text-transform",c)}\n\t\t${a("text-decoration",d)}\n\t\t${a("line-height",b)}\n\t\t${a("letter-spacing",g)}\n\t`,w=i&&400!==i?"400i"===i?":ital@1":i?.includes("00i")?`: ital, wght@1, ${i?.replace("00i","00")} `:`: wght@${i} `:"",S=p?"":`https://fonts.googleapis.com/css2?family=${r?.split(" ").join("+")}${w.replace(/ /g,"")}&display=swap`;return{googleFontLink:!s||p?"":`@import url(${S});`,styles:`${t}{\n\t\t\t${y}\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${t}{\n\t\t\t\t${a("font-size",x(h))}\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${t}{\n\t\t\t\t${a("font-size",x(f))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},c="bBlocksTeamMembers",d=window.ReactJSXRuntime,b=({attributes:t,id:n})=>{const{members:b=[],columnGap:g,rowGap:p,layout:u,textAlign:h,padding:f,photoWidth:x,photoMargin:y,nameTypo:w,nameMargin:S,titleTypo:k,titleMargin:j,sepMargin:v,bioTypo:M,bioMargin:N,socialSize:T,socialIconMargin:L}=t,A=`#${n}`,D=`${A} .${c}`,z=`${D} .teamMember`,C=`${z} .memberDetails`,I=`${C} .memberSocial`;return(0,d.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${$("",w)?.googleFontLink}\n\t\t${$("",k)?.googleFontLink}\n\t\t${$("",M)?.googleFontLink}\n\t\t${$(`${C} .memberName`,w)?.styles}\n\t\t${$(`${C} .memberTitle`,k)?.styles}\n\t\t${$(`${C} .memberBio`,M)?.styles}\n\n\t\t${D}{\n\t\t\tgrid-gap: ${p} ${g};\n\t\t}\n\t\t${z}{\n\t\t\ttext-align: ${h};\n\t\t\tpadding: ${m(f)};\n\t\t}\n\t\t${z} .memberPhoto{\n\t\t\twidth: ${x};\n\t\t\tmargin: ${"horizontal"===u?"0 20px 0 0":`${m(y)}`};\n\t\t}\n\t\t${C} .memberName{\n\t\t\tmargin: ${m(S)};\n\t\t}\n\t\t${C} .memberTitle{\n\t\t\tmargin: ${m(j)};\n\t\t}\n\t\t${C} .memberSeparator{\n\t\t\tmargin: ${m(v)};\n\t\t}\n\t\t${C} .memberBio{\n\t\t\tmargin: ${m(N)};\n\t\t}\n\t\t${I} .icon,\n\t\t${I} .memberSocialAdd{\n\t\t\tmargin: ${m(L)};\n\t\t}\n\t\t${I} .icon i,\n\t\t${I} .memberSocialAdd i{\n\t\t\tfont-size: ${T};\n\t\t\twidth: ${T};\n\t\t}\n\n\t\t${b.map(((t,n)=>{const{background:m,border:$,shadow:c,photoBorder:d,nameColor:b,titleColor:g,separator:p,bioColor:u,socialIconColors:f,iconStyle:x={}}=t,y=`${A} #teamMember-${n}`,w=`${y} .memberDetails`,S=`${w} .memberSocial`;return`\n\t\t\t\t${y}{\n\t\t\t\t\t${((t,n=!0,r=!0,i=!0)=>{const{type:l="solid",color:s="",gradient:m=o,image:$={},position:c="center center",attachment:d="",repeat:b="no-repeat",size:g="",overlayColor:p=""}=t||{};return"gradient"===l&&r?a("background",m):"image"===l&&i?`background: ${(t=>{const n=e(t);return n?`url('${n.replace(/['"()]/g,"")}')`:"none"})($?.url)};\n\t\t\t\t${a("background-color",p)}\n\t\t\t\t${a("background-position",c)}\n\t\t\t\t${a("background-size",g)}\n\t\t\t\t${a("background-repeat",b)}\n\t\t\t\t${a("background-attachment",d)}\n\t\t\t\t${a("background-repeat",b)}\n\t\t\t\tbackground-blend-mode: overlay;`:n&&a("background",s)})(m)}\n\t\t\t\t\t${i($)}\n\t\t\t\t\tbox-shadow: ${s(c?.shadow||(c?.color?[c]:c))};\n\t\t\t\t}\n\t\t\t\t${y} .memberPhoto{\n\t\t\t\t\t${i(d)}\n\t\t\t\t}\n\t\t\t\t${w} .memberName{\n\t\t\t\t\tcolor: ${b};\n\t\t\t\t}\n\t\t\t\t${w} .memberTitle{\n\t\t\t\t\tcolor: ${g};\n\t\t\t\t}\n\t\t\t\t${y} .memberSeparator{\n\t\t\t\t\t${(t=>{const{width:e="50%",height:n="2px",style:o="solid",color:i=r}=t||{};return`\n\t\t${a("width",e)}\n\t\t${0===parseInt(n)?"":`border-top: ${n} ${o} ${i};`}\n\t`})(p)}\n\t\t\t\t}\n\t\t\t\t${w} .memberBio{\n\t\t\t\t\tcolor: ${u};\n\t\t\t\t}\n\t\t\t\t${S}{\n\t\t\t\t\tjustify-content: ${"center"===h?"center":"right"===h?"flex-end":"flex-start"}\n\t\t\t\t}\n\t\t\t\t${S} li a{\n\t\t\t\t\t${l(f)}\n\t\t\t\t\t${i(x?.normal?.border)}\n\t\t\t\t\t${s(x?.normal?.shadow)}\n\t\t\t\t\ttransition:all 0.2s ease-in-out;\n\t\t\t\t}\n\t\t\t\t${S} li a:hover{\n\t\t\t\t\t${l(x?.hover?.socialIconColors)}\n\t\t\t\t\t${i(x?.hover?.border)}\n\t\t\t\t\t${s(x?.hover?.shadow)}\n\t\t\t\t}\n\t\t\t\t${S} li.isSelected{\n\t\t\t\t\tborder: 2px solid ${f?.bg};\n\t\t\t\t}\n\t\t\t\t${S} li.memberSocialAdd button i{\n\t\t\t\t\tcolor: ${f?.bg};\n\t\t\t\t}\n\t\t\t`})).join(" ")}\n\t\t`.replace(/\s+/g," ")}})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-team-members").forEach((r=>{const o=JSON.parse(r.dataset.attributes),{members:a=[],columns:i,layout:l,isLinkNewTab:s,isTitle:m,isSep:$,isBio:g,isSocial:p}=o,{desktop:u,tablet:h,mobile:f}=i||{};(0,t.createRoot)(r).render((0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(b,{attributes:o,id:r.id}),(0,d.jsx)("div",{className:`${c} ${l||"vertical"} columns-${u} columns-tablet-${h} columns-mobile-${f}`,children:a.map(((t,r)=>{const{photo:o,name:a,title:i,bio:l,social:c=[]}=t;return(0,d.jsxs)("div",{className:"teamMember",id:`teamMember-${r}`,children:[o?.url&&(0,d.jsx)("img",{className:"memberPhoto",src:o.url,alt:o?.alt}),(0,d.jsxs)("div",{className:"memberDetails",children:[a&&(0,d.jsx)("h4",{className:"memberName",dangerouslySetInnerHTML:{__html:n(a)}}),m&&i&&(0,d.jsx)("p",{className:"memberTitle",dangerouslySetInnerHTML:{__html:n(i)}}),$&&(0,d.jsx)("span",{className:"memberSeparator"}),g&&l&&(0,d.jsx)("p",{className:"memberBio",dangerouslySetInnerHTML:{__html:n(l)}}),p&&(0,d.jsx)("ul",{className:"memberSocial",children:c?.map(((t,n)=>{const{link:o,icon:a}=t;return(0,d.jsx)("li",{className:`icon icon-${r}-${n}`,children:(0,d.jsx)("a",{href:e(o),target:s?"_blank":"_self",rel:"noreferrer",children:(0,d.jsx)("i",{className:a?.class})})},n)}))})]})]},r)}))})]})),r?.removeAttribute("data-attributes")}))}))})();