PluginProbe
bBlocks – Essential Gutenberg Blocks & Patterns Collection / 2.1.8
bBlocks – Essential Gutenberg Blocks & Patterns Collection v2.1.8
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
← All changes | build/button-group/view.js +2 -1 2.0.41 → 2.1.8 View file →
@@ -1 +1,2 @@
1 -(()=>{"use strict";var t={5795:t=>{t.exports=window.ReactDOM},9940:(t,e,n)=>{var r=n(5795);e.H=r.createRoot,r.hydrateRoot}},e={};const n=window.React;var r=function n(r){var o=e[r];if(void 0!==o)return o.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,n),a.exports}(9940);const o=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}},a=t=>{const e=(new DOMParser).parseFromString(t,"text/html"),n=["b","strong","i","em","span","a","br"],r=["style","href","target","rel","class"];return e.body.querySelectorAll("*").forEach((t=>{n.includes(t.tagName.toLowerCase())?[...t.attributes].forEach((e=>{if(r.includes(e.name)||t.removeAttribute(e.name),"href"===e.name){const n=o(e.value);n?t.setAttribute("href",n):t.removeAttribute("href")}})):t.remove()})),e.body.innerHTML},s="linear-gradient(135deg, #0040E3, #18D4FD)",i=(t,e,n=!1)=>{return null==(r=e)||""===r||Array.isArray(r)&&0===r.length||"object"==typeof r&&0===Object.keys(r).length||"string"==typeof r&&""===r.trim()||"number"==typeof r&&0===r?"":`${t}: ${e}${n?" !important":""};`;var r},l=t=>{const{width:e="",style:n="solid",color:r="",side:o="all",radius:a=""}=t||{},s=t=>{const e=o?.toLowerCase();return e?.includes("all")||e?.includes(t)},l=`${e} ${n} ${r}`,c=`\n\t\t${e&&0!==parseInt(e)?["top","right","bottom","left"].map((t=>s(t)?`border-${t}: ${l};`:"")).join(""):""}\n\t\t${i("border-radius",a)}\n\t`;return c},c=t=>{const{color:e="",bgType:n="solid",bg:r="",gradient:o=s}=t||{};return`\n\t\t${i("color",e)}\n\t\t${o||r?i("background","gradient"===n?o:r):""}\n\t`},d=(t,e=!0,n=!0)=>{const{fontSize:r=16,colorType:o="solid",color:a="inherit",gradient:l=s}=t||{},c="gradient"===o?`color: transparent; background-image: ${l}; -webkit-background-clip: text; background-clip: text;`:i("color",a);return`\n\t\t${r&&e?i("font-size",r?`${r}px`:""):""}\n\t\t${n?c:""}\n\t`},p=t=>{const{side:e=2,vertical:n="0px",horizontal:r="0px",top:o="0px",right:a="0px",bottom:s="0px",left:i="0px"}=t||{};return 2===e?`${n} ${r}`:`${o} ${a} ${s} ${i}`},$=(t,e,n=!0)=>{const{fontFamily:r="Default",fontCategory:o="sans-serif",fontVariant:a=400,fontWeight:s,isUploadFont:l=!0,fontSize:c={desktop:null,tablet:null,mobile:null},fontStyle:d,textTransform:p,textDecoration:$,lineHeight:u,letterSpace:b}=e||{},m=!n||!r||"Default"===r,g=c?.desktop||c,f=c?.tablet||g,h=c?.mobile||f,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${m?"":`font-family: '${r}', ${o};`}\n\t\t${i("font-weight",s)}\n\t\t${i("font-size",x(g))}\n\t\t${i("font-style",d)}\n\t\t${i("text-transform",p)}\n\t\t${i("text-decoration",$)}\n\t\t${i("line-height",u)}\n\t\t${i("letter-spacing",b)}\n\t`,w=a&&400!==a?"400i"===a?":ital@1":a?.includes("00i")?`: ital, wght@1, ${a?.replace("00i","00")} `:`: wght@${a} `:"",v=m?"":`https://fonts.googleapis.com/css2?family=${r?.split(" ").join("+")}${w.replace(/ /g,"")}&display=swap`;return{googleFontLink:!l||m?"":`@import url(${v});`,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${i("font-size",x(f))}\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${i("font-size",x(h))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},u="bBlocksButtonGroup",b=({attributes:t,id:e})=>{const{width:r,btnAlign:o,btnTypo:a,btnPadding:s,btnOneBorder:i,btnOneColors:b,btnOneHovColors:m,btnTwoBorder:g,btnTwoColors:f,btnTwoHovColors:h,sepType:x,sepTextTypo:y,sepTextColor:w,sepIcon:v,sepBGColor:k}=t,T=`#${e}`,S=`${T} .${u}`,B=`${S} .btnSeparator`,E=y?.fontSize?.desktop||y?.fontSize;return(0,n.createElement)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${$("",a)?.googleFontLink}\n\t\t${$("",y)?.googleFontLink}\n\t\t${$(`${S} .bBlocksBtn a`,a)?.styles}\n\t\t${$(`${B} span`,y)?.styles}\n\n\t\t${T}{\n\t\t\ttext-align: ${o};\n\t\t}\n\t\t${S}{\n\t\t\twidth: ${"0px"!==r&&"0%"!==r&&"0em"!==r?r:"auto"};\n\t\t}\n\t\t${S} .bBlocksBtn{\n\t\t\tmin-width: ${"0px"!==r&&"0%"!==r&&"0em"!==r?"50%":"auto"};\n\t\t}\n\t\t${S} .bBlocksBtn a{\n\t\t\tpadding: ${p(s)};\n\t\t}\n\n\t\t${S} .btnOne{\n\t\t\t${l(i)||"border-radius: 50px;"}\n\t\t\t${c(b)}\n\t\t\tborder-radius: ${i?.radius||"50px"} 0 0 ${i?.radius||"50px"};\n\t\t}\n\t\t${S} .btnOne:hover{\n\t\t\t${c(m)}\n\t\t}\n\n\t\t${S} .btnTwo{\n\t\t\t${l(g)||"border-radius: 50px;"}\n\t\t\t${c(f)}\n\t\t\tborder-radius: 0 ${g?.radius||"50px"} ${g?.radius||"50px"} 0;\n\t\t}\n\t\t${S} .btnTwo:hover{\n\t\t\t${c(h)}\n\t\t}\n\n\t\t${B}{\n\t\t\twidth: ${"text"===x?1.75*E+"px":1.65*v?.fontSize+"px"};\n\t\t\theight: ${"text"===x?1.75*E+"px":1.65*v?.fontSize+"px"};\n\t\t\tbackground-color: ${k};\n\t\t}\n\t\t${B} span{\n\t\t\tcolor: ${w};\n\t\t}\n\t\t${B} i{\n\t\t\t${d(v)}\n\t\t}\n\t\t`.replace(/\s+/g," ")}})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-button-group").forEach((t=>{const e=JSON.parse(t.dataset.attributes),{btnType:s,btnOne:i,btnOneLink:l,btnTwo:c,btnTwoLink:d,isSep:p,sepType:$,sepText:m,sepIcon:g}=e;(0,r.H)(t).render((0,n.createElement)(n.Fragment,null,(0,n.createElement)(b,{attributes:e,id:t.id}),(0,n.createElement)("div",{className:u},(0,n.createElement)("div",{className:"bBlocksBtn firstBtn"},(0,n.createElement)("a",{className:`btnOne btn-${s}`,href:o(l),dangerouslySetInnerHTML:{__html:a(i)}}),p&&(0,n.createElement)("div",{className:"btnSeparator"},"text"===$?(0,n.createElement)("span",null,m):"icon"===$&&g?.class?(0,n.createElement)("i",{className:g?.class}):"")),(0,n.createElement)("div",{className:"bBlocksBtn secondBtn"},(0,n.createElement)("a",{className:`btnTwo btn-${s}`,href:o(d),dangerouslySetInnerHTML:{__html:a(c)}}))))),t?.removeAttribute("data-attributes")}))}))})();
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};new class{constructor(t={}){this.defaultOptions={allowedTags:["svg","g","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","defs","clipPath","mask","linearGradient","radialGradient","stop","style","title","desc"],allowedAttributes:["id","class","style","transform","xmlns","xmlns:xlink","version","baseProfile","xml:space","d","x","y","width","height","cx","cy","r","rx","ry","points","x1","y1","x2","y2","viewBox","preserveAspectRatio","overflow","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","opacity","color","paint-order","vector-effect","shape-rendering","display","visibility","clip-path","clip-rule","clipPathUnits","mask","maskUnits","maskContentUnits","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","fx","fy","fr","dx","dy","text-anchor","dominant-baseline","alignment-baseline","font-family","font-size","font-style","font-weight","letter-spacing","word-spacing","textLength","lengthAdjust","role","focusable","aria-hidden","aria-label","aria-labelledby","aria-describedby"],allowedProtocols:["http","https","data"],removeScripts:!0,removeEvents:!0,removeExternalResources:!0,sanitizeStyle:!0},this.options={...this.defaultOptions,...t},this.allowedTagSet=new Set(this.options.allowedTags.map((t=>t.toLowerCase()))),this.allowedAttributeSet=new Set(this.options.allowedAttributes.map((t=>t.toLowerCase())))}sanitize(t){if("string"!=typeof t||""===t.trim())return"";const e=(new DOMParser).parseFromString(t,"image/svg+xml"),n=e.documentElement;return!n||"svg"!==n.localName.toLowerCase()||e.getElementsByTagName("parsererror").length?"":(this.removeScripts(e),this.sanitizeElements(e),(new XMLSerializer).serializeToString(e.documentElement))}async sanitizeFile(t){const e=await fetch(t),n=await e.text();return this.sanitize(`${n}`)}removeScripts(t){this.options.removeScripts&&Array.from(t.querySelectorAll("*")).forEach((t=>{t.localName.toLowerCase().includes("script")&&t.remove()}))}sanitizeElements(t){Array.from(t.querySelectorAll("*")).forEach((t=>{const e=t.localName.toLowerCase();this.allowedTagSet.has(e)?("style"===e&&this.options.sanitizeStyle&&(t.textContent=this.sanitizeCss(t.textContent)),this.sanitizeAttributes(t)):t.remove()}))}sanitizeAttributes(t){Array.from(t.attributes).forEach((e=>{const n=e.name,r=n.toLowerCase(),o=e.value;if(this.options.removeEvents&&r.startsWith("on"))return void t.removeAttribute(n);if(this.options.removeExternalResources&&("href"===r||r.endsWith(":href"))&&!this.isAllowedUrl(o))return void t.removeAttribute(n);const s=r.replace("xlink:","");this.allowedAttributeSet.has(r)||this.allowedAttributeSet.has(s)?this.options.removeExternalResources&&this.hasExternalUrl(o)?t.removeAttribute(n):"style"===r&&this.options.sanitizeStyle&&t.setAttribute(n,this.sanitizeCss(o)):t.removeAttribute(n)}))}hasExternalUrl(t){return!("string"!=typeof t||!/url\s*\(/i.test(t))&&Array.from(t.matchAll(/url\s*\(\s*['"]?([^'")]*)/gi)).some((([,t])=>!t.trim().startsWith("#")))}isAllowedUrl(t){const e=String(t||"").trim();if(e.startsWith("#"))return!0;if(/^data:/i.test(e))return this.options.allowedProtocols.includes("data")&&/^data:image\/(png|jpe?g|gif|webp);base64,/i.test(e);try{return this.options.allowedProtocols.includes(new URL(e).protocol.replace(":",""))}catch{return!1}}sanitizeCss(t){return String(t||"").replace(/expression\s*\(/gi,"").replace(/javascript:/gi,"").replace(/behavior\s*:/gi,"").replace(/binding\s*:/gi,"").replace(/@import[^;]*;?/gi,"").replace(/url\s*\(\s*(['"]?)(?!#)[^)]*\)/gi,"none")}},window.React;const r="linear-gradient(135deg, #0040E3, #18D4FD)",o=(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},s=t=>{const{width:e="",style:n="solid",color:r="",side:s="all",radius:i=""}=t||{},a=t=>{const e=s?.toLowerCase();return e?.includes("all")||e?.includes(t)},l=`${e} ${n} ${r}`,c=`\n\t\t${e&&0!==parseInt(e)?["top","right","bottom","left"].map((t=>a(t)?`border-${t}: ${l};`:"")).join(""):""}\n\t\t${o("border-radius",i)}\n\t`;return c},i=t=>{const{color:e="",bgType:n="solid",bg:s="",gradient:i=r}=t||{};return`\n\t\t${o("color",e)}\n\t\t${i||s?o("background","gradient"===n?i:s):""}\n\t`},a=(t,e=!0,n=!0)=>{const{fontSize:s=16,colorType:i="solid",color:a="inherit",gradient:l=r}=t||{},c="gradient"===i?`color: transparent; background-image: ${l}; -webkit-background-clip: text; background-clip: text;`:o("color",a);return`\n\t\t${s&&e?o("font-size",s?`${s}px`:""):""}\n\t\t${n?c:""}\n\t`},l=t=>{const{side:e=2,vertical:n="0px",horizontal:r="0px",top:o="0px",right:s="0px",bottom:i="0px",left:a="0px"}=t||{};return 2===e?`${n} ${r}`:`${o} ${s} ${i} ${a}`},c=(t,e,n=!0)=>{const{fontFamily:r="Default",fontCategory:s="sans-serif",fontVariant:i=400,fontWeight:a,isUploadFont:l=!0,fontSize:c={desktop:null,tablet:null,mobile:null},fontStyle:p,textTransform:d,textDecoration:u,lineHeight:h,letterSpace:m}=e||{},g=!n||!r||"Default"===r,b=c?.desktop||c,$=c?.tablet||b,f=c?.mobile||$,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${g?"":`font-family: '${r}', ${s};`}\n\t\t${o("font-weight",a)}\n\t\t${o("font-size",x(b))}\n\t\t${o("font-style",p)}\n\t\t${o("text-transform",d)}\n\t\t${o("text-decoration",u)}\n\t\t${o("line-height",h)}\n\t\t${o("letter-spacing",m)}\n\t`,w=i&&400!==i?"400i"===i?":ital@1":i?.includes("00i")?`: ital, wght@1, ${i?.replace("00i","00")} `:`: wght@${i} `:"",v=g?"":`https://fonts.googleapis.com/css2?family=${r?.split(" ").join("+")}${w.replace(/ /g,"")}&display=swap`;return{googleFontLink:!l||g?"":`@import url(${v});`,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${o("font-size",x($))}\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${o("font-size",x(f))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},p="bBlocksButtonGroup",d=window.ReactJSXRuntime,u=({attributes:t,id:e})=>{const{width:n,btnAlign:r,btnTypo:u,btnPadding:h,btnOneBorder:m,btnOneColors:g,btnOneHovColors:b,btnTwoBorder:$,btnTwoColors:f,btnTwoHovColors:x,sepType:y,sepTextTypo:w,sepTextColor:v,sepIcon:S,sepBGColor:k,alignment:z={},layout:A="row",gap:T={}}=t,L=`#${e}`,C=`${L} .${p}`,j=`${C} .btnSeparator`,E=w?.fontSize?.desktop||w?.fontSize;return(0,d.jsx)("style",{dangerouslySetInnerHTML:{
2 +__html:`\n\t\t${c("",u)?.googleFontLink}\n\t\t${c("",w)?.googleFontLink}\n\t\t${c(`${C} .bBlocksBtn a`,u)?.styles}\n\t\t${c(`${j} span`,w)?.styles}\n\n\t\t${L}{\n\t\t\ttext-align: ${r};\n\t\t\t${"column"===A?o("text-align",z.desktop.vertical):""}\n\t\t}\n\t\t${C}{\n\t\t\twidth: ${"0px"!==n&&"0%"!==n&&"0em"!==n?n:"auto"};\n\t\t\t${o("gap",T?.desktop)}\n\t\t}\n\t\t${C}.layout-row{\n\t\t\t${o("justify-content",z.desktop.horizontal)}\n\t\t}\n\t\t${C}.layout-column{\n\t\t\t${o("justify-content",z.desktop.vertical)}\n\t\t}\n\t\t${C} .bBlocksBtn{\n\t\t\tmin-width: ${"0px"!==n&&"0%"!==n&&"0em"!==n?"50%":"auto"};\n\t\t}\n\t\t${C} .bBlocksBtn a{\n\t\t\tpadding: ${l(h)};\n\t\t}\n\n\t\t${C} .btnOne{\n\t\t\t${s(m)||"border-radius: 50px;"}\n\t\t\t${i(g)}\n\t\t\tborder-radius: ${m?.radius||"50px"} 0 0 ${m?.radius||"50px"};\n\t\t}\n\t\t${C} .btnOne:hover{\n\t\t\t${i(b)}\n\t\t}\n\n\t\t${C} .btnTwo{\n\t\t\t${s($)||"border-radius: 50px;"}\n\t\t\t${i(f)}\n\t\t\tborder-radius: 0 ${$?.radius||"50px"} ${$?.radius||"50px"} 0;\n\t\t}\n\t\t${C} .btnTwo:hover{\n\t\t\t${i(x)}\n\t\t}\n\n\t\t${j}{\n\t\t\twidth: ${"text"===y?1.75*E+"px":1.65*S?.fontSize+"px"};\n\t\t\theight: ${"text"===y?1.75*E+"px":1.65*S?.fontSize+"px"};\n\t\t\tbackground-color: ${k};\n\t\t\t${(()=>{const t=`margin-top: -${"text"===y?1.75*E/2:1.65*S?.fontSize/2}px;\n\t\t\tmargin-bottom: -${"text"===y?1.75*E/2:1.65*S?.fontSize/2}px;`;return"row"===A?`margin-left: -${"text"===y?1.75*E/2:1.65*S?.fontSize/2}px;\n\t\t\tmargin-right: -${"text"===y?1.75*E/2:1.65*S?.fontSize/2}px;`:t})()}\n\t\t}\n\t\t${j} span{\n\t\t\tcolor: ${v};\n\t\t}\n\t\t${j} i{\n\t\t\t${a(S)}\n\t\t}\n\t\t`.replace(/\s+/g," ")}})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-button-group").forEach((r=>{const o=JSON.parse(r.dataset.attributes),{btnType:s,btnOne:i,btnOneLink:a,btnTwo:l,btnTwoLink:c,isSep:h,sepType:m,sepText:g,sepIcon:b,layout:$="row"}=o;(0,t.createRoot)(r).render((0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u,{attributes:o,id:r.id}),(0,d.jsxs)("div",{className:`${p} layout-${$}`,children:[(0,d.jsx)("div",{className:"bBlocksBtn firstBtn",children:(0,d.jsx)("a",{className:`btnOne btn-${s}`,href:e(a),dangerouslySetInnerHTML:{__html:n(i)}})}),h&&(0,d.jsx)("div",{className:"btnSeparator",children:"text"===m?(0,d.jsx)("span",{children:g}):"icon"===m&&b?.class?(0,d.jsx)("i",{className:b?.class}):""}),(0,d.jsx)("div",{className:"bBlocksBtn secondBtn",children:(0,d.jsx)("a",{className:`btnTwo btn-${s}`,href:e(c),dangerouslySetInnerHTML:{__html:n(l)}})})]})]})),r?.removeAttribute("data-attributes")}))}))})();