whatmore-react-assets 1.0.1220 → 1.0.1222
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/static/js/{824.852cc9d1.chunk.js → 824.e81a1723.chunk.js} +1 -1
- package/static/js/{carousel-template-b.3d0d0023.chunk.js → carousel-template-b.acda07ed.chunk.js} +1 -1
- package/static/js/stories-template-a.757101e4.chunk.js +1 -0
- package/whatmore.js +2 -2
- package/static/js/stories-template-a.b5e7991d.chunk.js +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[441],{3580:function(t,e,r){r.r(e),r.d(e,{default:function(){return m}});var o=r(7313),i=r(8866),n=r(7753),l=(r(9111),r(123),r(9778),r(9854)),a=r(868),s=r(9363),c=r(4892),p=r(6417);var d=function(t){var e,r;const i=(0,n.MO)("whatmorePrimaryFont"),d=(0,n.MO)("whatmoreSecondaryColor"),u=(0,n.MO)("whatmoreShopId"),[h,f]=(0,o.useState)(!1),m=t.storyId,x=(0,a.V)(t.imageUrl),g=t.title,v=t.onClick,w=t.template,y=(0,l.f63)(u),b="template-stories-a"===w?"50%":"30%",j=Math.floor(t.tileSize),S=.12*j*(0,l.LM2)(u),k=null!==(e=(0,l.QaQ)(u))&&void 0!==e?e:i,C=null!==(r=(0,l.u2W)(u))&&void 0!==r?r:[d,y,d,y,d],F=(0,o.useRef)(0),_=(0,o.useRef)(null),R=(0,o.useRef)(null);return(0,o.useEffect)((()=>{R.current&&R.current.play()}),[]),(0,p.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",alignItems:"center",flexShrink:0,height:"fit-content",width:j*(0,l.jJ6)(u)+"px",marginLeft:"10px",marginRight:"10px",marginTop:"10px",marginBottom:"10px",cursor:"pointer"},onClick:()=>{f(!0),v(m)},className:[h?"whatmore-scale-on-tap":""].join(" "),children:[(0,p.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",flexShrink:0,height:"fit-content",width:"fit-content",borderRadius:b,boxShadow:"0px 2px 1px 0px "+C[0]+"50, 0px -2px 1px 0px "+C[1]+"50, 2px 0px 1px 0px "+C[2]+"50, -2px 0px 1px 0px "+C[3]+"80, 2px -2px 1px 0px "+C[4]+"80, -2px 2px 1px 0px "+C[0]+"DA, 2px 2px 1px 0px "+C[1]+"DA, -2px -2px 1px 0px "+C[2]+"DA"},children:(0,p.jsx)("div",{className:"whatmore-story-thumbnail-wrapper",style:{flexShrink:0,objectFit:"cover",height:j+"px",width:j+"px",borderRadius:b,border:"3px solid white",backgroundColor:"#343434"===d?"#d3d3d3":d,overflow:"hidden"},children:"video"==(0,s.$)(x)?(0,p.jsx)(c.Z,{height:"100%",width:"100%",url:x,isPlaying:!0,event:{event_type:"video"},borderRadius:b}):(0,p.jsx)("img",{ref:_,className:"whatmore-story-thumbnail",src:x.startsWith("https://cdn.shopify.com")?x.split("?")[0]+"?width=400&height=400":x,loading:"lazy",style:{objectFit:"cover",height:j+"px",width:j+"px",backgroundColor:"white"},alt:"story",onError:function(){if(F.current<3){let e=(0,a.V)(t.imageUrl);_.current.src="",_.current.src=e,F.current=F.current+1}else console.log("Failed to load image after several attempts"),_.current.src="https://d2oouab8j9eigo.cloudfront.net/background_white.png"}})})}),(0,p.jsx)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"center",flexShrink:0,height:"fit-content",width:"100%",marginTop:"10px"},children:(0,p.jsx)("p",{ref:t=>{t&&t.style.setProperty("font-size",S+"px","important")},style:{textAlign:"center",color:(0,l.WS3)(u),fontFamily:k,fontWeight:"normal",lineHeight:"110%",margin:0,padding:0,overflow:"hidden",textOverflow:"ellipsis",width:"auto"},children:null===g||void 0===g?void 0:g.substring(0,24)})})]})},u=r(32),h=r(9302);const f=(0,r(2575).Z)({key:"whatmore-stories-css"});var m=function(t){const[e,r,a]=(0,i.Z)(),[s]=(0,n.j1)("whatmoreStoryTileSize"),[c]=(0,n.j1)("whatmoreStoryTileSizeDesktop"),[m]=(0,n.j1)("whatmoreShopId"),[x,g]=(0,o.useState)("portrait"===e?"flex-start":"center"),v=(0,o.useRef)(null);var w=t.eventsStories;const y=t.onClick,b=t.template;(0,o.useEffect)((()=>{u.IR.forEach((t=>{var e;if(!(null!==(e=t.querySelector('.whatmore-template-type[data-wh="template-stories-a"]'))&&void 0!==e?e:t.querySelector('.whatmore-template-type[data="template-stories-a"]')))return;t&&(t.style.minHeight="0px")}))}),[]);const j=t=>{if(v.current){const e="left"===t?4*-C:4*C;v.current.scrollBy({left:e,behavior:"smooth"})}};(0,o.useEffect)((()=>{!function(){if(v.current){const t=v.current.scrollWidth,e=v.current.offsetWidth;g(t>e?"flex-start":"center")}}()}),[x,a]);const[S,k]=(0,o.useState)([]);(0,o.useEffect)((()=>{k(w.map((t=>t.storyset_dynamic_thumbnail?Math.floor(Math.random()*(t.events.length-1)):0)))}),[]);const C="landscape"===e?r*(c/100)*.3:a*(s/100)*.5;return(0,p.jsx)(h.C,{value:f,children:"landscape"==e&&!(0,l.DF0)(m)||"portrait"==e&&!(0,l.JaA)(m)?(0,p.jsx)(p.Fragment,{}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:x,height:"fit-content",width:"100%"},className:"whatmore-story-horizontal-flex",ref:v,children:w.map(((t,e)=>{var r,o,i,n,a;const s=t.storyset_dynamic_thumbnail?null!==(r=null===(o=t.events[S[e]])||void 0===o?void 0:o.poster_image)&&void 0!==r?r:t.thumbnail_image:null!==(i=t.thumbnail_image)&&void 0!==i?i:null===t||void 0===t||null===(n=t.events)||void 0===n||null===(a=n[0])||void 0===a?void 0:a.thumbnail_image;return(0,p.jsx)(d,{storyId:t.id,tileSize:(0,l.OFP)(m)?100:C,onClick:t=>{y(e)},template:b,imageUrl:s,fallbackUrl:t.thumbnail_image,title:t.title},"whatmore-story-"+t.id)}))}),"landscape"===e&&(0,l.sMW)(m)&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("button",{onClick:()=>j("left"),style:{borderRadius:"4px",backgroundColor:"rgba(0, 0, 0, 0.4)",position:"absolute",top:"40%",transform:"translateY(-50%)",left:0},children:(0,p.jsx)("p",{style:{fontSize:"22px",color:"white",padding:"8px"},children:"<"})}),(0,p.jsx)("button",{onClick:()=>j("right"),style:{borderRadius:"4px",backgroundColor:"rgba(0, 0, 0, 0.4)",position:"absolute",top:"40%",transform:"translateY(-50%)",right:0},children:(0,p.jsx)("p",{style:{fontSize:"22px",color:"white",padding:"8px"},children:">"})})]})]})})}},9363:function(t,e,r){r.d(e,{$:function(){return l},s:function(){return n}});var o=r(9854),i=r(7753);function n(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=(0,i.MO)("whatmoreShopId");return"shopify"!=(0,o.Ipo)(r)?"STRNV8MHJTF"==r?t+"?format=webp":t:t+e}function l(t){var e;if(null!==t&&void 0!==t&&t.includes("https://w-media.b-cdn.net/process-media"))return"image";const r=null===t||void 0===t||null===(e=t.trim())||void 0===e?void 0:e.split("?")[0],o=/\.(jpeg|jpg|gif|png|svg|webp)$/i,i=/\.(mp4|mov|wmv|avi|flv|mkv)$/i;return null!==o&&void 0!==o&&o.test(r)?"image":null!==i&&void 0!==i&&i.test(r)?"video":void 0}},9111:function(){},9778:function(){}}]);
|