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/alert/view.js +2 -1 2.1.6 → 2.1.8 View file →
@@ -1 +1,2 @@
1 -(()=>{"use strict";const t=window.ReactDOM;window.React;const e=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=(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}})(e.value);n?t.setAttribute("href",n):t.removeAttribute("href")}})):t.remove()})),e.body.innerHTML},n="linear-gradient(135deg, #0040E3, #18D4FD)",r=(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},o=t=>{const{width:e="",style:n="solid",color:o="",side:s="all",radius:a=""}=t||{},l=t=>{const e=s?.toLowerCase();return e?.includes("all")||e?.includes(t)},i=`${e} ${n} ${o}`,c=`\n\t\t${e&&0!==parseInt(e)?["top","right","bottom","left"].map((t=>l(t)?`border-${t}: ${i};`:"")).join(""):""}\n\t\t${r("border-radius",a)}\n\t`;return c},s=t=>{const{color:e="",bgType:o="solid",bg:s="",gradient:a=n}=t||{};return`\n\t\t${r("color",e)}\n\t\t${a||s?r("background","gradient"===o?a:s):""}\n\t`},a=(t,e="box")=>{const{hOffset:n="0px",vOffset:r="0px",blur:o="0px",spreed:s="0px",color:a="#7090b0",isInset:l=!1}=t||{},i=`${n} ${r} ${o}`;return("text"===e?`${i} ${a}`:`${i} ${s} ${a} ${l?"inset":""}`)||"none"},l=t=>{const{side:e=2,vertical:n="0px",horizontal:r="0px",top:o="0px",right:s="0px",bottom:a="0px",left:l="0px"}=t||{};return 2===e?`${n} ${r}`:`${o} ${s} ${a} ${l}`},i=(t,e,n=!0)=>{const{fontFamily:o="Default",fontCategory:s="sans-serif",fontVariant:a=400,fontWeight:l,isUploadFont:i=!0,fontSize:c={desktop:null,tablet:null,mobile:null},fontStyle:d,textTransform:$,textDecoration:u,lineHeight:m,letterSpace:p}=e||{},f=!n||!o||"Default"===o,g=c?.desktop||c,h=c?.tablet||g,b=c?.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${f?"":`font-family: '${o}', ${s};`}\n\t\t${r("font-weight",l)}\n\t\t${r("font-size",x(g))}\n\t\t${r("font-style",d)}\n\t\t${r("text-transform",$)}\n\t\t${r("text-decoration",u)}\n\t\t${r("line-height",m)}\n\t\t${r("letter-spacing",p)}\n\t`,w=a&&400!==a?"400i"===a?":ital@1":a?.includes("00i")?`: ital, wght@1, ${a?.replace("00i","00")} `:`: wght@${a} `:"",S=f?"":`https://fonts.googleapis.com/css2?family=${o?.split(" ").join("+")}${w.replace(/ /g,"")}&display=swap`;return{googleFontLink:!i||f?"":`@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${r("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${r("font-size",x(b))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},c="bBlocksAlert",d=window.ReactJSXRuntime,$=({attributes:t,id:e})=>{const{width:n,alignment:r,textAlign:$,typography:u,colors:m,padding:p,border:f,shadow:g}=t,h=`#${e} .${c} .alert`;return(0,d.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${i("",u)?.googleFontLink}\n\t\t${i(h,u)?.styles}\n\n\t\t${h}{\n\t\t\ttext-align: ${r};\n\t\t}\n\t\t${h}{\n\t\t\ttext-align: ${$};\n\t\t\twidth: ${["0px","0%","0em"].includes(n)?"auto":n};\n\t\t\t${s(m)}\n\t\t\tpadding: ${l(p)};\n\t\t\t${o(f)}\n\t\t\tbox-shadow: ${a(g)};\n\t\t}\n\t\t${h} .alertIcon{\n\t\t\tfont-size: ${u?.fontSize?.desktop};\n\t\t\tcolor: ${m?.color};\n\t\t}\n\t\t${h} .alertClose{\n\t\t\tcolor: ${m?.color};\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${h} .alertIcon{\n\t\t\t\tfont-size: ${u?.fontSize?.tablet};\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${h} .alertIcon{\n\t\t\t\tfont-size: ${u?.fontSize?.mobile};\n\t\t\t}c\n\t\t}\n\t\t`.replace(/\s+/g," ")}})},u=({attributes:t,alertEl:n=null})=>{const{message:r,icon:o,isDismiss:s}=t;return(0,d.jsx)("div",{className:c,children:(0,d.jsxs)("div",{className:"alert",children:[o?.class&&(0,d.jsx)("i",{className:`alertIcon ${o?.class}`}),r&&(0,d.jsx)("span",{className:"alertMessage",dangerouslySetInnerHTML:{__html:e(r)}}),s&&(0,d.jsx)("i",{className:"alertClose fa fa-times-circle",onClick:()=>{n&&(n.classList.add("transformHidden"),setTimeout((()=>{n.style.display="none"}),400))}})]})})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-alert").forEach((e=>{const n=JSON.parse(e.dataset.attributes);(0,t.createRoot)(e).render((0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)($,{attributes:n,id:e.id}),(0,d.jsx)(u,{attributes:n,alertEl:e})]})),e?.removeAttribute("data-attributes")}))}))})();
1 +(()=>{"use strict";const t=window.ReactDOM;window.React;const e=t=>{const e=(new DOMParser).parseFromString(t,"text/html"),s=["b","strong","i","em","span","a","br"],r=["style","href","target","rel","class"];return e.body.querySelectorAll("*").forEach((t=>{s.includes(t.tagName.toLowerCase())?[...t.attributes].forEach((e=>{if(r.includes(e.name)||t.removeAttribute(e.name),"href"===e.name){const s=(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}})(e.value);s?t.setAttribute("href",s):t.removeAttribute("href")}})):t.remove()})),e.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"),s=e.documentElement;return!s||"svg"!==s.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),s=await e.text();return this.sanitize(`${s}`)}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 s=e.name,r=s.toLowerCase(),n=e.value;if(this.options.removeEvents&&r.startsWith("on"))return void t.removeAttribute(s);if(this.options.removeExternalResources&&("href"===r||r.endsWith(":href"))&&!this.isAllowedUrl(n))return void t.removeAttribute(s);const i=r.replace("xlink:","");this.allowedAttributeSet.has(r)||this.allowedAttributeSet.has(i)?this.options.removeExternalResources&&this.hasExternalUrl(n)?t.removeAttribute(s):"style"===r&&this.options.sanitizeStyle&&t.setAttribute(s,this.sanitizeCss(n)):t.removeAttribute(s)}))}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")}};const s="linear-gradient(135deg, #0040E3, #18D4FD)",r=(t,e)=>{return null==(s=e)||""===s||Array.isArray(s)&&0===s.length||"object"==typeof s&&0===Object.keys(s).length||"string"==typeof s&&""===s.trim()||"number"==typeof s&&0===s?"":`${t}: ${e};`;var s},n=t=>{const{width:e="",style:s="solid",color:n="",side:i="all",radius:o=""}=t||{},a=t=>{const e=i?.toLowerCase();return e?.includes("all")||e?.includes(t)},l=`${e} ${s} ${n}`,c=`\n\t\t${e&&0!==parseInt(e)?["top","right","bottom","left"].map((t=>a(t)?`border-${t}: ${l};`:"")).join(""):""}\n\t\t${r("border-radius",o)}\n\t`;return c},i=t=>{const{color:e="",bgType:n="solid",bg:i="",gradient:o=s}=t||{};return`\n\t\t${r("color",e)}\n\t\t${o||i?r("background","gradient"===n?o:i):""}\n\t`},o=(t,e="box")=>{const{hOffset:s="0px",vOffset:r="0px",blur:n="0px",spreed:i="0px",color:o="#7090b0",isInset:a=!1}=t||{},l=`${s} ${r} ${n}`;return("text"===e?`${l} ${o}`:`${l} ${i} ${o} ${a?"inset":""}`)||"none"},a=t=>{const{side:e=2,vertical:s="0px",horizontal:r="0px",top:n="0px",right:i="0px",bottom:o="0px",left:a="0px"}=t||{};return 2===e?`${s} ${r}`:`${n} ${i} ${o} ${a}`},l=(t,e,s=!0)=>{const{fontFamily:n="Default",fontCategory:i="sans-serif",fontVariant:o=400,fontWeight:a,isUploadFont:l=!0,fontSize:c={desktop:null,tablet:null,mobile:null},fontStyle:d,textTransform:p,textDecoration:m,lineHeight:h,letterSpace:u}=e||{},f=!s||!n||"Default"===n,g=c?.desktop||c,y=c?.tablet||g,$=c?.mobile||y,b=t=>{const e=String(t);return["px","em","rem","%","vh","vw"].some((t=>e.endsWith(t)))?e:"number"==typeof t?`${e}px`:""},x=`\n\t\t${f?"":`font-family: '${n}', ${i};`}\n\t\t${r("font-weight",a)}\n\t\t${r("font-size",b(g))}\n\t\t${r("font-style",d)}\n\t\t${r("text-transform",p)}\n\t\t${r("text-decoration",m)}\n\t\t${r("line-height",h)}\n\t\t${r("letter-spacing",u)}\n\t`,w=o&&400!==o?"400i"===o?":ital@1":o?.includes("00i")?`: ital, wght@1, ${o?.replace("00i","00")} `:`: wght@${o} `:"",v=f?"":`https://fonts.googleapis.com/css2?family=${n?.split(" ").join("+")}${w.replace(/ /g,"")}&display=swap`;return{googleFontLink:!l||f?"":`@import url(${v});`,styles:`${t}{\n\t\t\t${x}\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${t}{\n\t\t\t\t${r("font-size",b(y))}\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${r("font-size",b($))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},c="bBlocksAlert",d=window.ReactJSXRuntime,p=({attributes:t,id:e})=>{const{width:s,alignment:r,textAlign:p,typography:m,colors:h,padding:u,border:f,shadow:g}=t,y=`#${e} .${c} .alert`;return(0,d.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${l("",m)?.googleFontLink}\n\t\t${l(y,m)?.styles}\n\n\t\t${y}{\n\t\t\ttext-align: ${r};\n\t\t}\n\t\t${y}{\n\t\t\ttext-align: ${p};\n\t\t\twidth: ${["0px","0%","0em"].includes(s)?"auto":s};\n\t\t\t${i(h)}\n\t\t\tpadding: ${a(u)};\n\t\t\t${n(f)}\n\t\t\tbox-shadow: ${o(g)};\n\t\t}\n\t\t${y} .alertIcon{\n\t\t\tfont-size: ${m?.fontSize?.desktop};\n\t\t\tcolor: ${h?.color};\n\t\t}\n\t\t${y} .alertClose{\n\t\t\tcolor: ${h?.color};\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${y} .alertIcon{\n\t\t\t\tfont-size: ${m?.fontSize?.tablet};\n\t\t\t}\n\t\t}\n\t\t@media only screen and (max-width: 640px) {\n\t\t\t${y} .alertIcon{\n\t\t\t\tfont-size: ${m?.fontSize?.mobile};\n\t\t\t}c\n\t\t}\n\t\t`.replace(/\s+/g," ")}})},m=({attributes:t,alertEl:s=null})=>{const{message:r,icon:n,isDismiss:i}=t;return(0,d.jsx)("div",{className:c,children:(0,d.jsxs)("div",{className:"alert",children:[n?.class&&(0,d.jsx)("i",{className:`alertIcon ${n?.class}`}),r&&(0,d.jsx)("span",{className:"alertMessage",dangerouslySetInnerHTML:{__html:e(r)}}),i&&(0,
2 +d.jsx)("i",{className:"alertClose fa fa-times-circle",onClick:()=>{s&&(s.classList.add("transformHidden"),setTimeout((()=>{s.style.display="none"}),400))}})]})})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-alert").forEach((e=>{const s=JSON.parse(e.dataset.attributes);(0,t.createRoot)(e).render((0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(p,{attributes:s,id:e.id}),(0,d.jsx)(m,{attributes:s,alertEl:e})]})),e?.removeAttribute("data-attributes")}))}))})();