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/lottie-player/view.js +2 -1 2.1.3 → 2.1.8 View file →
@@ -1 +1,2 @@
1 -(()=>{"use strict";const t=window.React,e=window.ReactDOM,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}},n="linear-gradient(135deg, #0040E3, #18D4FD)",r=(t,e)=>{return null==(o=e)||""===o||Array.isArray(o)&&0===o.length||"object"==typeof o&&0===Object.keys(o).length||"string"==typeof o&&""===o.trim()||"number"==typeof o&&0===o?"":`${t}: ${e};`;var o},i=t=>{const{color:e="",bgType:o="solid",bg:i="",gradient:l=n}=t||{};return`\n\t\t${r("color",e)}\n\t\t${l||i?r("background","gradient"===o?l:i):""}\n\t`},l=t=>{const{side:e=2,vertical:o="0px",horizontal:n="0px",top:r="0px",right:i="0px",bottom:l="0px",left:a="0px"}=t||{};return 2===e?`${o} ${n}`:`${r} ${i} ${l} ${a}`},a=(t,e,o=!0)=>{const{fontFamily:n="Default",fontCategory:i="sans-serif",fontVariant:l=400,fontWeight:a,isUploadFont:s=!0,fontSize:c={desktop:null,tablet:null,mobile:null},fontStyle:p,textTransform:d,textDecoration:u,lineHeight:$,letterSpace:y}=e||{},g=!o||!n||"Default"===n,b=c?.desktop||c,f=c?.tablet||b,h=c?.mobile||f,m=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${g?"":`font-family: '${n}', ${i};`}\n\t\t${r("font-weight",a)}\n\t\t${r("font-size",m(b))}\n\t\t${r("font-style",p)}\n\t\t${r("text-transform",d)}\n\t\t${r("text-decoration",u)}\n\t\t${r("line-height",$)}\n\t\t${r("letter-spacing",y)}\n\t`,v=l&&400!==l?"400i"===l?":ital@1":l?.includes("00i")?`: ital, wght@1, ${l?.replace("00i","00")} `:`: wght@${l} `:"",k=g?"":`https://fonts.googleapis.com/css2?family=${n?.split(" ").join("+")}${v.replace(/ /g,"")}&display=swap`;return{googleFontLink:!s||g?"":`@import url(${k});`,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",m(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${r("font-size",m(h))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},s="bBlocksLottiePlayer",c=window.ReactJSXRuntime,p=({attributes:t,id:e})=>{const{playerAlign:o,link:n,width:r,controlsHeight:p,controlsBG:d,controlsIconColor:u,controlsIconHoverColor:$,controlsIconActiveColor:y,controlsTrackColor:g,controlsThumbColor:b,capAlign:f="center",capTypo:h={},capColors:m={color:"#333"},capPadding:x={},capMargin:v={}}=t,k=`#${e} .${s}`;return(0,c.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${a("",h)?.googleFontLink}\n\t\t${a(`${k} .caption`,h)?.styles}\n\n\t\t${k}{\n\t\t\ttext-align: ${o};\n\t\t}\n\t\t${k} dotlottie-player{\n\t\t\twidth: ${r};\n\t\t\tcursor: ${n?"pointer":"auto"};\n\t\t\t--lottie-player-toolbar-height: ${p};\n\t\t\t--lottie-player-toolbar-background-color: ${d};\n\t\t\t--lottie-player-toolbar-icon-color: ${u};\n\t\t\t--lottie-player-toolbar-icon-hover-color: ${$};\n\t\t\t--lottie-player-toolbar-icon-active-color: ${y};\n\t\t\t--lottie-player-seeker-track-color: ${g};\n\t\t\t--lottie-player-seeker-thumb-color: ${b};\n\t\t}\n\t\t${k} .caption{\n\t\t\twidth: ${r};\n\t\t\ttext-align: ${f};\n\t\t\t${i(m)};\n\t\t\tpadding: ${l(x)};\n\t\t\tmargin: ${l(v)};\n\t\t}\n\t\t`.replace(/\s+/g," ")}})},d=(t,e,o,n)=>{e&&t?.setAttribute(o,n),!e&&t?.removeAttribute(o,n)},u=(0,t.forwardRef)((({attributes:e},o)=>{const{file:n,isControls:r,isAutoplay:i,isLoop:l,isHover:a,mode:s,direction:p=1,count:u,speed:$,intermission:y,background:g}=e;return(0,t.useEffect)((()=>{if(o?.current){const t=!!l&&(!(0<u)||u);d(o?.current,r,"controls",""),d(o?.current,i,"autoplay",""),d(o?.current,l,"loop",t),d(o?.current,a,"hover","")}}),[o]),(0,c.jsx)("dotlottie-player",{ref:o,src:n,autoplay:!0,loop:!0,mode:s,speed:$,direction:p,intermission:1e3*y,background:g,debug:!0})}));document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-lottie-player").forEach((t=>{const o=JSON.parse(t.dataset.attributes);(0,e.createRoot)(t).render((0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p,{attributes:o,id:t.id}),(0,c.jsx)($,{attributes:o,id:t.id})]})),t?.removeAttribute("data-attributes")}))}));const $=({attributes:e,id:n})=>{const{isControls:r,isAutoplay:i,isLoop:l,isHover:a,count:p,link:$,isLinkInNewTab:y=!1,interactivity:g="noInteractivity",interactivityMode:b="",interactivityContainer:f=".wp-block-b-blocks-lottie-player",interactivityActions:h=[],isCap:m=!1,caption:x=""}=e,v=(0,t.useRef)(null);return(0,t.useEffect)((()=>{const t=document.querySelector(`#${n} .${s} lottie-player`),e=!!l&&(!(0<p)||p);d(t,r,"controls",""),d(t,i,"autoplay",""),d(t,l,"loop",e),d(t,a,"hover","")}),[]),(0,t.useEffect)((()=>{const t=v?.current;t&&g&&"noInteractivity"!==g&&t.addEventListener("ready",(()=>{LottieInteractivity.create({player:t.getLottie(),container:"scrollRelativeToContainer"===g?f:`#${n}`,mode:b,actions:h})}))}),[v?.current]),(0,c.jsxs)("div",{className:s,children:[$?(0,c.jsx)("a",{href:o($),target:y?"_blank":"_self",rel:"noreferrer",children:(0,c.jsx)(u,{ref:v,attributes:e})}):(0,c.jsx)(u,{ref:v,attributes:e}),m&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("br",{}),(0,c.jsx)("span",{className:"caption",children:x})]})]})}})();
1 +(()=>{"use strict";const t=window.React,e=window.ReactDOM,r=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}};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(),i=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(i))return void t.removeAttribute(r);const n=o.replace("xlink:","");this.allowedAttributeSet.has(o)||this.allowedAttributeSet.has(n)?this.options.removeExternalResources&&this.hasExternalUrl(i)?t.removeAttribute(r):"style"===o&&this.options.sanitizeStyle&&t.setAttribute(r,this.sanitizeCss(i)):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 o="linear-gradient(135deg, #0040E3, #18D4FD)",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},n=t=>{const{color:e="",bgType:r="solid",bg:n="",gradient:s=o}=t||{};return`\n\t\t${i("color",e)}\n\t\t${s||n?i("background","gradient"===r?s:n):""}\n\t`},s=t=>{const{side:e=2,vertical:r="0px",horizontal:o="0px",top:i="0px",right:n="0px",bottom:s="0px",left:a="0px"}=t||{};return 2===e?`${r} ${o}`:`${i} ${n} ${s} ${a}`},a=(t,e,r=!0)=>{const{fontFamily:o="Default",fontCategory:n="sans-serif",fontVariant:s=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||{},y=!r||!o||"Default"===o,g=c?.desktop||c,f=c?.tablet||g,b=c?.mobile||f,$=t=>{const e=String(t);return["px","em","rem","%","vh","vw"].some((t=>e.endsWith(t)))?e:"number"==typeof t?`${e}px`:""},v=`\n\t\t${y?"":`font-family: '${o}', ${n};`}\n\t\t${i("font-weight",a)}\n\t\t${i("font-size",$(g))}\n\t\t${i("font-style",p)}\n\t\t${i("text-transform",d)}\n\t\t${i("text-decoration",u)}\n\t\t${i("line-height",h)}\n\t\t${i("letter-spacing",m)}\n\t`,w=s&&400!==s?"400i"===s?":ital@1":s?.includes("00i")?`: ital, wght@1, ${s?.replace("00i","00")} `:`: wght@${s} `:"",x=y?"":`https://fonts.googleapis.com/css2?family=${o?.split(" ").join("+")}${w.replace(/ /g,"")}&display=swap`;return{googleFontLink:!l||y?"":`@import url(${x});`,styles:`${t}{\n\t\t\t${v}\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",$(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",$(b))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},l="bBlocksLottiePlayer",c=window.ReactJSXRuntime,p=({attributes:t,id:e})=>{const{playerAlign:r,link:o,width:i,controlsHeight:p,controlsBG:d,controlsIconColor:u,controlsIconHoverColor:h,controlsIconActiveColor:m,controlsTrackColor:y,controlsThumbColor:g,capAlign:f="center",capTypo:b={},capColors:$={color:"#333"},capPadding:v={},capMargin:w={}}=t,x=`#${e} .${l}`;return(0,c.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${a("",b)?.googleFontLink}\n\t\t${a(`${x} .caption`,b)?.styles}\n\n\t\t${x}{\n\t\t\ttext-align: ${r};\n\t\t}\n\t\t${x} dotlottie-player{\n\t\t\twidth: ${i};\n\t\t\tcursor: ${o?"pointer":"auto"};\n\t\t\t--lottie-player-toolbar-height: ${p};\n\t\t\t--lottie-player-toolbar-background-color: ${d};\n\t\t\t--lottie-player-toolbar-icon-color: ${u};\n\t\t\t--lottie-player-toolbar-icon-hover-color: ${h};\n\t\t\t--lottie-player-toolbar-icon-active-color: ${m};\n\t\t\t--lottie-player-seeker-track-color: ${y};\n\t\t\t--lottie-player-seeker-thumb-color: ${g};\n\t\t}\n\t\t${x} .caption{\n\t\t\twidth: ${i};\n\t\t\ttext-align: ${f};\n\t\t\t${n($)};\n\t\t\tpadding: ${s(v)};\n\t\t\tmargin: ${s(w)};\n\t\t}\n\t\t`.replace(/\s+/g," ")}})},d=(t,e,r,o)=>{e&&t?.setAttribute(r,o),!e&&t?.removeAttribute(r,o)},u=(0,t.forwardRef)((({attributes:e},r)=>{const{file:o,isControls:i,isAutoplay:n,isLoop:s,isHover:a,mode:l,direction:p=1,count:u,speed:h,intermission:m,background:y}=e;return(0,t.useEffect)((()=>{if(r?.current){const t=!!s&&(!(0<u)||u);d(r?.current,i,"controls",""),d(r?.current,n,"autoplay",""),d(r?.current,s,"loop",t),d(r?.current,a,"hover","")}}),[r]),(0,c.jsx)("dotlottie-player",{ref:r,src:o,autoplay:!0,loop:!0,mode:l,speed:h,direction:p,intermission:1e3*m,background:y,debug:!0})}));document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-lottie-player").forEach((t=>{const r=JSON.parse(t.dataset.attributes);(0,e.createRoot)(t).render((0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p,{attributes:r,id:t.id}),(0,c.jsx)(h,{attributes:r,id:t.id})]})),t?.removeAttribute("data-attributes")}))}));const h=({attributes:e,id:o})=>{
2 +const{isControls:i,isAutoplay:n,isLoop:s,isHover:a,count:p,link:h,isLinkInNewTab:m=!1,interactivity:y="noInteractivity",interactivityMode:g="",interactivityContainer:f=".wp-block-b-blocks-lottie-player",interactivityActions:b=[],isCap:$=!1,caption:v=""}=e,w=(0,t.useRef)(null);return(0,t.useEffect)((()=>{const t=document.querySelector(`#${o} .${l} lottie-player`),e=!!s&&(!(0<p)||p);d(t,i,"controls",""),d(t,n,"autoplay",""),d(t,s,"loop",e),d(t,a,"hover","")}),[]),(0,t.useEffect)((()=>{const t=w?.current;t&&y&&"noInteractivity"!==y&&t.addEventListener("ready",(()=>{LottieInteractivity.create({player:t.getLottie(),container:"scrollRelativeToContainer"===y?f:`#${o}`,mode:g,actions:b})}))}),[w?.current]),(0,c.jsxs)("div",{className:l,children:[h?(0,c.jsx)("a",{href:r(h),target:m?"_blank":"_self",rel:"noreferrer",children:(0,c.jsx)(u,{ref:w,attributes:e})}):(0,c.jsx)(u,{ref:w,attributes:e}),$&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("br",{}),(0,c.jsx)("span",{className:"caption",children:v})]})]})}})();