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/emoji-stack-separator/view.js +1 -1 2.1.0 → 2.1.8 View file →
@@ -1 +1 @@
1 -(()=>{"use strict";const t=window.ReactDOM,e=window.React,r=window.ReactJSXRuntime,o=({attributes:t})=>{const{emoji:o,height:n,align:a,emojiSize:i,density:s,animationStyle:c}=t,l=(0,e.useRef)(null);(0,e.useEffect)((()=>{if(l.current){const t=setTimeout((()=>{d(l.current,o,n,i,s)}),50);return()=>clearTimeout(t)}}),[o,n,a,i,s]);const d=(t,e,r,o,n)=>{t.innerHTML="";const a=(t=>{const e={small:{fontSize:2.5,overlap:-1},medium:{fontSize:3.75,overlap:-1.4},large:{fontSize:5,overlap:-1.8},xlarge:{fontSize:6.5,overlap:-2.3}};return e[t]||e.medium})(o),i=(t=>{const e={sparse:{overlapFactor:.5,rowMargin:-2,emojisExtra:2},normal:{overlapFactor:.65,rowMargin:-3,emojisExtra:4},dense:{overlapFactor:.75,rowMargin:-3.5,emojisExtra:6}};return e[t]||e.normal})(n),s=t.offsetWidth,c=Math.ceil(s/(60*i.overlapFactor))+i.emojisExtra;for(let r=0;r<4;r++){const o=document.createElement("div");o.className="b-blocks-emoji-stack-iemoji-row",r>0&&(o.style.marginTop=`${i.rowMargin}rem`);for(let t=0;t<c;t++){const r=document.createElement("span");r.textContent=e,r.className="b-blocks-emoji-stack-item";const n=60*Math.random()-30,i=20*Math.random()-10;r.style.fontSize=`${a.fontSize}rem`,r.style.marginRight=`${a.overlap}rem`,r.style.setProperty("--b-blocks-emoji-stack-separator-rotation",`${n}deg`),r.style.setProperty("--b-blocks-emoji-stack-separator-index",t),r.style.transform=`rotate(${n}deg) translateY(${i}px)`,o.appendChild(r)}t.appendChild(o)}};return(0,r.jsx)("div",{className:"b-blocks-emoji-stack-separator-container "+(c?`b-blocks-emoji-stack-separator-animation-${c}`:""),children:(0,r.jsx)("div",{ref:l,className:"b-blocks-emoji-stack-container"})})},n="linear-gradient(135deg, #0040E3, #18D4FD)",a=t=>{const 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}})(t);return e?`url('${e.replace(/['"()]/g,"")}')`:"none"},i=(t,e)=>{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};`;var r},s=(t,e=!0,r=!0,o=!0)=>{const{type:s="solid",color:c="",gradient:l=n,image:d={},position:m="center center",attachment:u="",repeat:p="no-repeat",size:b="",overlayColor:g=""}=t||{};return"gradient"===s&&r?i("background",l):"image"===s&&o?`background: ${a(d?.url)};\n\t\t\t\t${i("background-color",g)}\n\t\t\t\t${i("background-position",m)}\n\t\t\t\t${i("background-size",b)}\n\t\t\t\t${i("background-repeat",p)}\n\t\t\t\t${i("background-attachment",u)}\n\t\t\t\t${i("background-repeat",p)}\n\t\t\t\tbackground-blend-mode: overlay;`:e&&i("background",c)},c=t=>{if(!t)return"";const e=t=>{const{color:e="#000000",style:r="solid",width:o="0px"}=t;return`${o} ${r} ${e}`};return"object"!=typeof t||Array.isArray(t)?"":t.hasOwnProperty("top")||t.hasOwnProperty("right")||t.hasOwnProperty("bottom")||t.hasOwnProperty("left")?["top","right","bottom","left"].map((r=>t[r]?`border-${r}: ${e(t[r])};`:"")).join(" ").trim():i("border",e(t))},l=t=>{if(!t)return"";if("string"==typeof t)return t;if("object"==typeof t&&!Array.isArray(t)){const e=["top","right","bottom","left"];return e.map((e=>t[e]||"")).every((t=>!t))?"":e.map((e=>t[e]||"0")).join(" ")}return""},d=({attributes:t,id:e})=>{const{background:o,height:n,padding:a,margin:d,border:m,borderRadius:u}=t,p=`#${e} .b-blocks-emoji-stack-separator-container`;return(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n ${p}{\n ${s(o)}\n ${i("height",n)}\n ${i("padding",l(a))}\n ${i("margin",l(d))}\n ${c(m)}\n ${i("border-radius",l(u))}\n }\n `}})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-emoji-stack-separator").forEach((e=>{let n={};try{const t=e.dataset.attributes;t&&"undefined"!==t&&""!==t&&(n=JSON.parse(t))}catch(t){console.warn("Emoji Stack Separator: Invalid attributes JSON",t)}(0,t.createRoot)(e).render((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d,{attributes:n,id:e.id}),(0,r.jsx)(o,{attributes:n})]})),e?.removeAttribute("data-attributes")}))}))})();
1 +(()=>{"use strict";const t=window.ReactDOM,e=window.React,r=window.ReactJSXRuntime,o=({attributes:t})=>{const{emoji:o,height:s,align:i,emojiSize:a,density:n,animationStyle:l}=t,c=(0,e.useRef)(null);(0,e.useEffect)((()=>{if(c.current){const t=setTimeout((()=>{d(c.current,o,s,a,n)}),50);return()=>clearTimeout(t)}}),[o,s,i,a,n]);const d=(t,e,r,o,s)=>{t.innerHTML="";const i=(t=>{const e={small:{fontSize:2.5,overlap:-1},medium:{fontSize:3.75,overlap:-1.4},large:{fontSize:5,overlap:-1.8},xlarge:{fontSize:6.5,overlap:-2.3}};return e[t]||e.medium})(o),a=(t=>{const e={sparse:{overlapFactor:.5,rowMargin:-2,emojisExtra:2},normal:{overlapFactor:.65,rowMargin:-3,emojisExtra:4},dense:{overlapFactor:.75,rowMargin:-3.5,emojisExtra:6}};return e[t]||e.normal})(s),n=t.offsetWidth,l=Math.ceil(n/(60*a.overlapFactor))+a.emojisExtra;for(let r=0;r<4;r++){const o=document.createElement("div");o.className="b-blocks-emoji-stack-iemoji-row",r>0&&(o.style.marginTop=`${a.rowMargin}rem`);for(let t=0;t<l;t++){const r=document.createElement("span");r.textContent=e,r.className="b-blocks-emoji-stack-item";const s=60*Math.random()-30,a=20*Math.random()-10;r.style.fontSize=`${i.fontSize}rem`,r.style.marginRight=`${i.overlap}rem`,r.style.setProperty("--b-blocks-emoji-stack-separator-rotation",`${s}deg`),r.style.setProperty("--b-blocks-emoji-stack-separator-index",t),r.style.transform=`rotate(${s}deg) translateY(${a}px)`,o.appendChild(r)}t.appendChild(o)}};return(0,r.jsx)("div",{className:"b-blocks-emoji-stack-separator-container "+(l?`b-blocks-emoji-stack-separator-animation-${l}`:""),children:(0,r.jsx)("div",{ref:c,className:"b-blocks-emoji-stack-container"})})};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"),r=e.documentElement;return!r||"svg"!==r.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),r=await e.text();return this.sanitize(`${r}`)}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 r=e.name,o=r.toLowerCase(),s=e.value;if(this.options.removeEvents&&o.startsWith("on"))return void t.removeAttribute(r);if(this.options.removeExternalResources&&("href"===o||o.endsWith(":href"))&&!this.isAllowedUrl(s))return void t.removeAttribute(r);const i=o.replace("xlink:","");this.allowedAttributeSet.has(o)||this.allowedAttributeSet.has(i)?this.options.removeExternalResources&&this.hasExternalUrl(s)?t.removeAttribute(r):"style"===o&&this.options.sanitizeStyle&&t.setAttribute(r,this.sanitizeCss(s)):t.removeAttribute(r)}))}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)",i=t=>{const 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}})(t);return e?`url('${e.replace(/['"()]/g,"")}')`:"none"},a=(t,e)=>{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};`;var r},n=(t,e=!0,r=!0,o=!0)=>{const{type:n="solid",color:l="",gradient:c=s,image:d={},position:p="center center",attachment:m="",repeat:u="no-repeat",size:h="",overlayColor:g=""}=t||{};return"gradient"===n&&r?a("background",c):"image"===n&&o?`background: ${i(d?.url)};\n\t\t\t\t${a("background-color",g)}\n\t\t\t\t${a("background-position",p)}\n\t\t\t\t${a("background-size",h)}\n\t\t\t\t${a("background-repeat",u)}\n\t\t\t\t${a("background-attachment",m)}\n\t\t\t\t${a("background-repeat",u)}\n\t\t\t\tbackground-blend-mode: overlay;`:e&&a("background",l)},l=t=>{if(!t)return"";const e=t=>{const{color:e="#000000",style:r="solid",width:o="0px"}=t;return`${o} ${r} ${e}`};return"object"!=typeof t||Array.isArray(t)?"":t.hasOwnProperty("top")||t.hasOwnProperty("right")||t.hasOwnProperty("bottom")||t.hasOwnProperty("left")?["top","right","bottom","left"].map((r=>t[r]?`border-${r}: ${e(t[r])};`:"")).join(" ").trim():a("border",e(t))},c=t=>{if(!t)return"";if("string"==typeof t)return t;if("object"==typeof t&&!Array.isArray(t)){const e=["top","right","bottom","left"];return e.map((e=>t[e]||"")).every((t=>!t))?"":e.map((e=>t[e]||"0")).join(" ")}return""},d=({attributes:t,id:e})=>{const{background:o,height:s,padding:i,margin:d,border:p,borderRadius:m}=t,u=`#${e} .b-blocks-emoji-stack-separator-container`;return(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n ${u}{\n ${n(o)}\n ${a("height",s)}\n ${a("padding",c(i))}\n ${a("margin",c(d))}\n ${l(p)}\n ${a("border-radius",c(m))}\n }\n `}})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-emoji-stack-separator").forEach((e=>{let s={};try{const t=e.dataset.attributes;t&&"undefined"!==t&&""!==t&&(s=JSON.parse(t))}catch(t){console.warn("Emoji Stack Separator: Invalid attributes JSON",t)}(0,t.createRoot)(e).render((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d,{attributes:s,id:e.id}),(0,r.jsx)(o,{attributes:s})]})),e?.removeAttribute("data-attributes")}))}))})();