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/star-rating/view.js +2 -1 2.0.39 → 2.1.8 View file →
@@ -1 +1,2 @@
1 -(()=>{"use strict";var t={5795:t=>{t.exports=window.ReactDOM},8744:(t,e,n)=>{var r=n(5795);e.H=r.createRoot,r.hydrateRoot}},e={};const n=window.React;var r=function n(r){var a=e[r];if(void 0!==a)return a.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}(8744);const a=(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},s=(t,e="box")=>{let n="";return t?.map(((r,a)=>{const{hOffset:s="0px",vOffset:o="0px",blur:l="0px",spreed:i="0px",color:c="#e7f0fe",isInset:p=!1}=r||{},m=p?"inset":"",$=`${s} ${o} ${l}`,u=a+1>=t.length?"":", ";n+="text"===e?`${$} ${c}${u}`:`${$} ${i} ${c} ${m}${u}`})),n||""},o=(t,e,n=!0)=>{const{fontFamily:r="Default",fontCategory:s="sans-serif",fontVariant:o=400,fontWeight:l,isUploadFont:i=!0,fontSize:c={desktop:null,tablet:null,mobile:null},fontStyle:p,textTransform:m,textDecoration:$,lineHeight:u,letterSpace:g}=e||{},f=!n||!r||"Default"===r,d=c?.desktop||c,h=c?.tablet||d,x=c?.mobile||h,y=t=>{const e=String(t);return["px","em","rem","%","vh","vw"].some((t=>e.endsWith(t)))?e:"number"==typeof t?`${e}px`:""},w=`\n\t\t${f?"":`font-family: '${r}', ${s};`}\n\t\t${a("font-weight",l)}\n\t\t${a("font-size",y(d))}\n\t\t${a("font-style",p)}\n\t\t${a("text-transform",m)}\n\t\t${a("text-decoration",$)}\n\t\t${a("line-height",u)}\n\t\t${a("letter-spacing",g)}\n\t`,v=o&&400!==o?"400i"===o?":ital@1":o?.includes("00i")?`: ital, wght@1, ${o?.replace("00i","00")} `:`: wght@${o} `:"",b=f?"":`https://fonts.googleapis.com/css2?family=${r?.split(" ").join("+")}${v.replace(/ /g,"")}&display=swap`;return{googleFontLink:!i||f?"":`@import url(${b});`,styles:`${t}{\n\t\t\t${w}\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${t}{\n\t\t\t\t${a("font-size",y(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${a("font-size",y(x))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},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""},i=t=>Array.from({length:t},((t,e)=>e+1)),c="bBlocksRating",p=({attributes:t,id:e})=>{const{rating:r,gap:p,alignment:m,margin:$,textTypo:u,textColor:g,textShadow:f,iconColor:d="#f0ad4e"}=t,h=`#${e} .${c}`,x=`${h} .stars .star`,y=(r+"").split("."),w=parseInt(y[0]),v=parseInt(y[1]||0);return(0,n.createElement)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${o("",u)?.googleFontLink}\n\t\t${o(`${h} .ratingPrefix`,u)?.styles}\n\n\t\t${h} {\n\t\t\tjustify-content: ${m};\n\t\t\tgap: ${p};\n\t\t\tcolor: ${g};\n\t\t\t${a("margin",l($))}\n\t\t}\n\n\t\t${h} .ratingPrefix{\n\t\t\ttext-shadow: ${s(f,"text")}\n\t\t}\n\n\t\t${x}>.starFill>svg{\n\t\t\t${a("fill",d)}\n\t\t}\n\n\t\t${i(w).map((t=>`${x}:nth-child(${t}) .starFill`)).join(", ")}{\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t${x}:nth-child(${w+1}) .starFill{\n\t\t\twidth: ${(()=>{switch(v){case 1:return 25;case 2:return 30;case 3:return 35;case 4:return 42.5;case 5:return 50;case 6:return 57.5;case 7:return 65;case 8:return 70;case 9:return 75;default:return 0}})()}%;\n\t\t}\n\t`}})},m=((0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)("polygon",{points:"12 4 9.22 9.27 3 10.11 7.5 14.21 6.44 20 12 17.27 17.56 20 16.5 14.21 21 10.11 14.78 9.27 12 4",style:{fill:"none",stroke:"rgb(0, 0, 0)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2}})),(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},(0,n.createElement)("path",{d:"M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"}))),$=(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},(0,n.createElement)("path",{d:"M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.6 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5C270.4 5.2 278.7 0 287.9 0zm0 79L235.4 187.2c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l105.2-56.2c7.1-3.8 15.6-3.8 22.6 0l105.2 56.2L384.2 324.1c-1.3-7.7 1.2-15.5 6.8-21l85.9-85.1L358.6 200.5c-7.8-1.2-14.6-6.1-18.1-13.3L287.9 79z"})),u=({attributes:t})=>{const{ratingScale:e,iconStyle:r,prefix:a}=t;return(0,n.createElement)("div",{className:c},(0,n.createElement)("span",{className:"ratingPrefix"},a),(0,n.createElement)("div",{className:"stars"},i(e).map((t=>(0,n.createElement)("span",{key:t,className:"star"},"solid"===r?m:$,(0,n.createElement)("span",{className:"starFill"},m))))))};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-star-rating").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}))),t?.removeAttribute("data-attributes")}))}))})();
1 +(()=>{"use strict";const t=window.ReactDOM;window.React,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 e=(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},s=(t,e="box")=>{let s="";return t?.map(((r,n)=>{const{hOffset:i="0px",vOffset:a="0px",blur:o="0px",spreed:l="0px",color:c="#e7f0fe",isInset:p=!1}=r||{},d=p?"inset":"",h=`${i} ${a} ${o}`,m=n+1>=t.length?"":", ";s+="text"===e?`${h} ${c}${m}`:`${h} ${l} ${c} ${d}${m}`})),s||""},r=(t,s,r=!0)=>{const{fontFamily:n="Default",fontCategory:i="sans-serif",fontVariant:a=400,fontWeight:o,isUploadFont:l=!0,fontSize:c={desktop:null,tablet:null,mobile:null},fontStyle:p,textTransform:d,textDecoration:h,lineHeight:m,letterSpace:u}=s||{},f=!r||!n||"Default"===n,g=c?.desktop||c,x=c?.tablet||g,y=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`:""},w=`\n\t\t${f?"":`font-family: '${n}', ${i};`}\n\t\t${e("font-weight",o)}\n\t\t${e("font-size",$(g))}\n\t\t${e("font-style",p)}\n\t\t${e("text-transform",d)}\n\t\t${e("text-decoration",h)}\n\t\t${e("line-height",m)}\n\t\t${e("letter-spacing",u)}\n\t`,b=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=${n?.split(" ").join("+")}${b.replace(/ /g,"")}&display=swap`;return{googleFontLink:!l||f?"":`@import url(${v});`,styles:`${t}{\n\t\t\t${w}\n\t\t}\n\t\t@media only screen and (max-width: 1024px) {\n\t\t\t${t}{\n\t\t\t\t${e("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${e("font-size",$(y))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},n=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""},i=t=>Array.from({length:t},((t,e)=>e+1)),a="bBlocksRating",o=window.ReactJSXRuntime,l=({attributes:t,id:l})=>{const{rating:c,gap:p,alignment:d,margin:h,textTypo:m,textColor:u,textShadow:f,iconColor:g="#f0ad4e",iconSize:x="20px",unmarkedColor:y="#ccd6df"}=t,$=`#${l} .${a}`,w=`${$} .stars .star`,b=(c+"").split("."),v=parseInt(b[0]),S=parseInt(b[1]||0);return(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${r("",m)?.googleFontLink}\n\t\t${r(`${$} .ratingPrefix`,m)?.styles}\n\n\t\t${$} {\n\t\t\tjustify-content: ${d};\n\t\t\tgap: ${p};\n\t\t\tcolor: ${u};\n\t\t\t${e("margin",n(h))}\n\t\t}\n\n\t\t${$} .ratingPrefix{\n\t\t\ttext-shadow: ${s(f,"text")}\n\t\t}\n\n\t\t${$} .stars{\n\t\t\t${e("gap",p)}\n\t\t}\n\n\t\t${w}>.starFill>svg{\n\t\t\t${e("fill",g)}\n\t\t\t${e("width",x)}\n\t\t\t${e("height",x)}\n\t\t}\n\n\t\t${w}>svg{\n\t\t\t${e("fill",y)}\n\t\t\t${e("width",x)}\n\t\t\t${e("height",x)}\n\t\t}\n\n\t\t${w}{\n\t\t\t${e("width",x)}\n\t\t\t${e("height",x)}\n\t\t}\n\n\t\t${i(v).map((t=>`${w}:nth-child(${t}) .starFill`)).join(", ")}{\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t${w}:nth-child(${v+1}) .starFill{\n\t\t\twidth: ${(()=>{switch(S){case 1:return 25;case 2:return 30;case 3:return 35;case 4:return 42.5;case 5:return 50;case 6:return 57.5;case 7:return 65;case 8:return 70;case 9:return 75;default:return 0}})()}%;\n\t\t}\n\t`}})},c=(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:(0,o.jsx)("path",{d:"M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"})}),p=(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:(0,o.jsx)("path",{
2 +d:"M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.6 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5C270.4 5.2 278.7 0 287.9 0zm0 79L235.4 187.2c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l105.2-56.2c7.1-3.8 15.6-3.8 22.6 0l105.2 56.2L384.2 324.1c-1.3-7.7 1.2-15.5 6.8-21l85.9-85.1L358.6 200.5c-7.8-1.2-14.6-6.1-18.1-13.3L287.9 79z"})}),d=({attributes:t})=>{const{ratingScale:e,iconStyle:s,prefix:r}=t;return(0,o.jsxs)("div",{className:a,children:[(0,o.jsx)("span",{className:"ratingPrefix",children:r}),(0,o.jsx)("div",{className:"stars",children:i(e).map((t=>(0,o.jsxs)("span",{className:"star",children:["solid"===s?c:p,(0,o.jsx)("span",{className:"starFill",children:c})]},t)))})]})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-star-rating").forEach((e=>{const s=JSON.parse(e.dataset.attributes);(0,t.createRoot)(e).render((0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l,{attributes:s,id:e.id}),(0,o.jsx)(d,{attributes:s})]})),e?.removeAttribute("data-attributes")}))}))})();