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.0.42 → 2.1.8 View file →
@@ -1 +1,2 @@
1 -(()=>{"use strict";var t={5338:(t,e,n)=>{var r=n(5795);e.H=r.createRoot,r.hydrateRoot},5795:t=>{t.exports=window.ReactDOM}},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}(5338);const o=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},a="linear-gradient(135deg, #0040E3, #18D4FD)",s=(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||{},l=t=>{const e=o?.toLowerCase();return e?.includes("all")||e?.includes(t)},i=`${e} ${n} ${r}`,c=`\n\t\t${e&&0!==parseInt(e)?["top","right","bottom","left"].map((t=>l(t)?`border-${t}: ${i};`:"")).join(""):""}\n\t\t${s("border-radius",a)}\n\t`;return c},i=t=>{const{color:e="",bgType:n="solid",bg:r="",gradient:o=a}=t||{};return`\n\t\t${s("color",e)}\n\t\t${o||r?s("background","gradient"===n?o:r):""}\n\t`},c=(t,e="box")=>{const{hOffset:n="0px",vOffset:r="0px",blur:o="0px",spreed:a="0px",color:s="#7090b0",isInset:l=!1}=t||{},i=`${n} ${r} ${o}`;return("text"===e?`${i} ${s}`:`${i} ${a} ${s} ${l?"inset":""}`)||"none"},d=t=>{const{side:e=2,vertical:n="0px",horizontal:r="0px",top:o="0px",right:a="0px",bottom:s="0px",left:l="0px"}=t||{};return 2===e?`${n} ${r}`:`${o} ${a} ${s} ${l}`},$=(t,e,n=!0)=>{const{fontFamily:r="Default",fontCategory:o="sans-serif",fontVariant:a=400,fontWeight:l,isUploadFont:i=!0,fontSize:c={desktop:null,tablet:null,mobile:null},fontStyle:d,textTransform:$,textDecoration:m,lineHeight:p,letterSpace:u}=e||{},f=!n||!r||"Default"===r,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: '${r}', ${o};`}\n\t\t${s("font-weight",l)}\n\t\t${s("font-size",x(g))}\n\t\t${s("font-style",d)}\n\t\t${s("text-transform",$)}\n\t\t${s("text-decoration",m)}\n\t\t${s("line-height",p)}\n\t\t${s("letter-spacing",u)}\n\t`,w=a&&400!==a?"400i"===a?":ital@1":a?.includes("00i")?`: ital, wght@1, ${a?.replace("00i","00")} `:`: wght@${a} `:"",v=f?"":`https://fonts.googleapis.com/css2?family=${r?.split(" ").join("+")}${w.replace(/ /g,"")}&display=swap`;return{googleFontLink:!i||f?"":`@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${s("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${s("font-size",x(b))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},m="bBlocksAlert",p=({attributes:t,id:e})=>{const{width:r,alignment:o,textAlign:a,typography:s,colors:p,padding:u,border:f,shadow:g}=t,h=`#${e} .${m} .alert`;return(0,n.createElement)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${$("",s)?.googleFontLink}\n\t\t${$(h,s)?.styles}\n\n\t\t${h}{\n\t\t\ttext-align: ${o};\n\t\t}\n\t\t${h}{\n\t\t\ttext-align: ${a};\n\t\t\twidth: ${["0px","0%","0em"].includes(r)?"auto":r};\n\t\t\t${i(p)}\n\t\t\tpadding: ${d(u)};\n\t\t\t${l(f)}\n\t\t\tbox-shadow: ${c(g)};\n\t\t}\n\t\t${h} .alertIcon{\n\t\t\tfont-size: ${s?.fontSize?.desktop};\n\t\t\tcolor: ${p?.color};\n\t\t}\n\t\t${h} .alertClose{\n\t\t\tcolor: ${p?.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: ${s?.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: ${s?.fontSize?.mobile};\n\t\t\t}c\n\t\t}\n\t\t`.replace(/\s+/g," ")}})},u=({attributes:t,alertEl:e=null})=>{const{message:r,icon:a,isDismiss:s}=t;return(0,n.createElement)("div",{className:m},(0,n.createElement)("div",{className:"alert"},a?.class&&(0,n.createElement)("i",{className:`alertIcon ${a?.class}`}),r&&(0,n.createElement)("span",{className:"alertMessage",dangerouslySetInnerHTML:{__html:o(r)}}),s&&(0,n.createElement)("i",{className:"alertClose fa fa-times-circle",onClick:()=>{e&&(e.classList.add("transformHidden"),setTimeout((()=>{e.style.display="none"}),400))}})))};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-alert").forEach((t=>{const e=JSON.parse(t.dataset.attributes);(0,r.H)(t).render((0,n.createElement)(n.Fragment,null,(0,n.createElement)(p,{attributes:e,id:t.id}),(0,n.createElement)(u,{attributes:e,alertEl:t}))),t?.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")}))}))})();