PluginProbe
bBlocks – Essential Gutenberg Blocks & Patterns Collection / 2.0.39
bBlocks – Essential Gutenberg Blocks & Patterns Collection v2.0.39
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
b-blocks / build / lottie-player / view.js

view.js in bBlocks – Essential Gutenberg Blocks & Patterns Collection 2.0.39, at build/lottie-player/view.js

1 lines 5.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (()=>{"use strict";var t={5795:t=>{t.exports=window.ReactDOM},8744:(t,e,n)=>{var o=n(5795);e.H=o.createRoot,o.hydrateRoot}},e={};const n=window.React;var o=function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,n),i.exports}(8744);const 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}},i="linear-gradient(135deg, #0040E3, #18D4FD)",l=(t,e,n=!1)=>{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}${n?" !important":""};`;var o},a=t=>{const{color:e="",bgType:n="solid",bg:o="",gradient:r=i}=t||{};return`\n\t\t${l("color",e)}\n\t\t${r||o?l("background","gradient"===n?r:o):""}\n\t`},c=t=>{const{side:e=2,vertical:n="0px",horizontal:o="0px",top:r="0px",right:i="0px",bottom:l="0px",left:a="0px"}=t||{};return 2===e?`${n} ${o}`:`${r} ${i} ${l} ${a}`},s=(t,e,n=!0)=>{const{fontFamily:o="Default",fontCategory:r="sans-serif",fontVariant:i=400,fontWeight:a,isUploadFont:c=!0,fontSize:s={desktop:null,tablet:null,mobile:null},fontStyle:p,textTransform:u,textDecoration:d,lineHeight:$,letterSpace:y}=e||{},m=!n||!o||"Default"===o,g=s?.desktop||s,f=s?.tablet||g,b=s?.mobile||f,h=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${m?"":`font-family: '${o}', ${r};`}\n\t\t${l("font-weight",a)}\n\t\t${l("font-size",h(g))}\n\t\t${l("font-style",p)}\n\t\t${l("text-transform",u)}\n\t\t${l("text-decoration",d)}\n\t\t${l("line-height",$)}\n\t\t${l("letter-spacing",y)}\n\t`,x=i&&400!==i?"400i"===i?":ital@1":i?.includes("00i")?`: ital, wght@1, ${i?.replace("00i","00")} `:`: wght@${i} `:"",k=m?"":`https://fonts.googleapis.com/css2?family=${o?.split(" ").join("+")}${x.replace(/ /g,"")}&display=swap`;return{googleFontLink:!c||m?"":`@import url(${k});`,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${l("font-size",h(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${l("font-size",h(b))}\n\t\t\t}\n\t\t}`.replace(/\s+/g," ").trim()}},p="bBlocksLottiePlayer",u=({attributes:t,id:e})=>{const{playerAlign:o,link:r,width:i,controlsHeight:l,controlsBG:u,controlsIconColor:d,controlsIconHoverColor:$,controlsIconActiveColor:y,controlsTrackColor:m,controlsThumbColor:g,capAlign:f="center",capTypo:b={},capColors:h={color:"#333"},capPadding:v={},capMargin:x={}}=t,k=`#${e} .${p}`;return(0,n.createElement)("style",{dangerouslySetInnerHTML:{__html:`\n\t\t${s("",b)?.googleFontLink}\n\t\t${s(`${k} .caption`,b)?.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: ${i};\n\t\t\tcursor: ${r?"pointer":"auto"};\n\t\t\t--lottie-player-toolbar-height: ${l};\n\t\t\t--lottie-player-toolbar-background-color: ${u};\n\t\t\t--lottie-player-toolbar-icon-color: ${d};\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: ${m};\n\t\t\t--lottie-player-seeker-thumb-color: ${g};\n\t\t}\n\t\t${k} .caption{\n\t\t\twidth: ${i};\n\t\t\ttext-align: ${f};\n\t\t\t${a(h)};\n\t\t\tpadding: ${c(v)};\n\t\t\tmargin: ${c(x)};\n\t\t}\n\t\t`.replace(/\s+/g," ")}})},d=(t,e,n,o)=>{e&&t?.setAttribute(n,o),!e&&t?.removeAttribute(n,o)},$=(0,n.forwardRef)((({attributes:t},e)=>{const{file:o,isControls:r,isAutoplay:i,isLoop:l,isHover:a,mode:c,direction:s=1,count:p,speed:u,intermission:$,background:y}=t;return(0,n.useEffect)((()=>{if(e?.current){const t=!!l&&(!(0<p)||p);d(e?.current,r,"controls",""),d(e?.current,i,"autoplay",""),d(e?.current,l,"loop",t),d(e?.current,a,"hover","")}}),[e]),(0,n.createElement)("dotlottie-player",{ref:e,src:o,autoplay:!0,loop:!0,mode:c,speed:u,direction:s,intermission:1e3*$,background:y,debug:!0})}));document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-lottie-player").forEach((t=>{const e=JSON.parse(t.dataset.attributes);(0,o.H)(t).render((0,n.createElement)(n.Fragment,null,(0,n.createElement)(u,{attributes:e,id:t.id}),(0,n.createElement)(y,{attributes:e,id:t.id}))),t?.removeAttribute("data-attributes")}))}));const y=({attributes:t,id:e})=>{const{isControls:o,isAutoplay:i,isLoop:l,isHover:a,count:c,link:s,isLinkInNewTab:u=!1,interactivity:y="noInteractivity",interactivityMode:m="",interactivityContainer:g=".wp-block-b-blocks-lottie-player",interactivityActions:f=[],isCap:b=!1,caption:h=""}=t,v=(0,n.useRef)(null);return(0,n.useEffect)((()=>{const t=document.querySelector(`#${e} .${p} lottie-player`),n=!!l&&(!(0<c)||c);d(t,o,"controls",""),d(t,i,"autoplay",""),d(t,l,"loop",n),d(t,a,"hover","")}),[]),(0,n.useEffect)((()=>{const t=v?.current;t&&y&&"noInteractivity"!==y&&t.addEventListener("ready",(()=>{LottieInteractivity.create({player:t.getLottie(),container:"scrollRelativeToContainer"===y?g:`#${e}`,mode:m,actions:f})}))}),[v?.current]),(0,n.createElement)("div",{className:p},s?(0,n.createElement)("a",{href:r(s),target:u?"_blank":"_self",rel:"noreferrer"},(0,n.createElement)($,{ref:v,attributes:t})):(0,n.createElement)($,{ref:v,attributes:t}),b&&(0,n.createElement)(n.Fragment,null,(0,n.createElement)("br",null),(0,n.createElement)("span",{className:"caption"},h)))}})();