PluginProbe
bBlocks – Essential Gutenberg Blocks & Patterns Collection / 2.1.3
bBlocks – Essential Gutenberg Blocks & Patterns Collection v2.1.3
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 / social-share / view.js

view.js in bBlocks – Essential Gutenberg Blocks & Patterns Collection 2.1.3, at build/social-share/view.js

1 lines 2.9 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;window.React;const n="linear-gradient(135deg, #0040E3, #18D4FD)",e=t=>{const n=(t=>{try{const n=new URL(t);return["http:","https:"].includes(n.protocol)?n.toString():null}catch(n){return"string"==typeof t&&t.startsWith("/")&&!t.startsWith("//")?t:null}})(t);return n?`url('${n.replace(/['"()]/g,"")}')`:"none"},r=(t,n)=>{return null==(e=n)||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&""===e.trim()||"number"==typeof e&&0===e?"":`${t}: ${n};`;var e},o=(t,o=!0,i=!0,a=!0)=>{const{type:c="solid",color:s="",gradient:l=n,image:d={},position:$="center center",attachment:u="",repeat:g="no-repeat",size:b="",overlayColor:p=""}=t||{};return"gradient"===c&&i?r("background",l):"image"===c&&a?`background: ${e(d?.url)};\n\t\t\t\t${r("background-color",p)}\n\t\t\t\t${r("background-position",$)}\n\t\t\t\t${r("background-size",b)}\n\t\t\t\t${r("background-repeat",g)}\n\t\t\t\t${r("background-attachment",u)}\n\t\t\t\t${r("background-repeat",g)}\n\t\t\t\tbackground-blend-mode: overlay;`:o&&r("background",s)},i=t=>{const{width:n="",style:e="solid",color:o="",side:i="all",radius:a=""}=t||{},c=t=>{const n=i?.toLowerCase();return n?.includes("all")||n?.includes(t)},s=`${n} ${e} ${o}`,l=`\n\t\t${n&&0!==parseInt(n)?["top","right","bottom","left"].map((t=>c(t)?`border-${t}: ${s};`:"")).join(""):""}\n\t\t${r("border-radius",a)}\n\t`;return l},a=(t,n="box")=>{const{hOffset:e="0px",vOffset:r="0px",blur:o="0px",spreed:i="0px",color:a="#7090b0",isInset:c=!1}=t||{},s=`${e} ${r} ${o}`;return("text"===n?`${s} ${a}`:`${s} ${i} ${a} ${c?"inset":""}`)||"none"},c="bBlocksSocialShare",s=window.ReactJSXRuntime,l=({attributes:t,id:e})=>{const{socials:l,alignment:d,background:$,size:u,padding:g,margin:b,border:p,shadow:h}=t,m=`#${e}`,k=`${m} ul.${c}`;return(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${m}{\n\t\t\ttext-align: ${d};\n\t\t}\n\t\t${k} li.icon{\n\t\t\tfont-size: ${u};\n\t\t\t${o($)}\n\t\t\twidth: calc( ${u} + ${g} + ${g} );\n\t\t\theight: calc( ${u} + ${g} + ${g} );\n\t\t\tmargin: 0 calc( ${b} / 2 );\n\t\t\t${i(p)}\n\t\t\tbox-shadow: ${a(h)||"none"};\n\t\t}\n\t\t${k} li.icon img{\n\t\t\twidth: ${u};\n\t\t}\n\n\t\t${l?.map(((t,e)=>`\n\t\t\t${k} li.icon-${e} i{\n\t\t\t\t${((t,e=!0,o=!0)=>{const{fontSize:i=16,colorType:a="solid",color:c="inherit",gradient:s=n}=t||{},l="gradient"===a?`color: transparent; background-image: ${s}; -webkit-background-clip: text; background-clip: text;`:r("color",c);return`\n\t\t${i&&e?r("font-size",i?`${i}px`:""):""}\n\t\t${o?l:""}\n\t`})(t?.icon)}\n\t\t\t\tfont-size: inherit;\n\t\t\t}`)).join(" ")}\n\t\t`.replace(/\s+/g," ")}})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-social-share").forEach((n=>{const e=JSON.parse(n.dataset.attributes),r=document.querySelector(`#${n.id} .${c}Style`);(0,t.createRoot)(r).render((0,s.jsx)(l,{attributes:e,id:n.id})),n?.removeAttribute("data-attributes")}))}))})();