@cleartrip/ct-platform-lazy-image 6.0.1-beta.0 → 6.4.0-SNAPSHOT-native-main.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"LazyImage.d.ts","sourceRoot":"","sources":["../packages/components/LazyImage/src/LazyImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAY9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AASnD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA8HvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"LazyImage.d.ts","sourceRoot":"","sources":["../packages/components/LazyImage/src/LazyImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAW9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AASnD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA0HvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("tslib"),e=require("react/jsx-runtime"),i=require("react"),r=require("@cleartrip/ct-platform-io-hoc"),o=require("@cleartrip/ct-platform-constants"),a=require("@cleartrip/ct-platform-utils"),s=require("@cleartrip/ct-design-components");const c={padding:"8px",boxSizing:"border-box"},n={height:"24px",width:"auto"},h={width:"100%",height:"100%",display:"flex",borderRadius:"8px",alignItems:"center",background:"#fef5f2",justifyContent:"center"};exports.LazyImage=l=>{var{src:g,width:d,height:p,isLazy:u=!0,inSwiper:x=!1,priority:m="auto",isLoading:j=!1,customPlaceholder:y}=l,f=t.__rest(l,["src","width","height","isLazy","inSwiper","priority","isLoading","customPlaceholder"]);const[b,C]=i.useState(!u),[w,R]=i.useState(u?y||o.placeholderLogo:g),q=i.useMemo((()=>{const t=a.getWidthFromImgUrl(g),e=a.getHeightFromImgUrl(g),i=t&&e&&t/e;return x?{}:{phWidth:d||t,phHeight:p||e,aspectRatio:x&&i?`${i}`:"auto"}}),[g]),v=i.useCallback((()=>e.jsx(s.Container,{as:"div",styleConfig:{root:[{height:"100%"}]},children:e.jsx(s.Container,{as:"div",styleConfig:{root:[Object.assign(Object.assign({},y?{}:c),{width:x?"auto":`${q.phWidth}px`,height:x?"100%":`${q.phHeight}px`,aspectRatio:x&&q.aspectRatio?`${q.aspectRatio}`:"auto"})]},children:y?e.jsx("img",{src:y,alt:"placeholder_image",fetchPriority:"high"}):e.jsx(s.Container,{as:"div",styleConfig:{root:[h]},children:e.jsx("img",{src:o.placeholderLogo,style:n})})})})),[q,j]),I=i.useCallback((()=>{const t=new Image;t.onload=()=>{R(g),C(!0)},t.src=g}),[g]);return e.jsx(r.IntersectionObserverHOC,{onIntersection:I,children:b?j?e.jsx(e.Fragment,{children:v()}):e.jsx(s.Container,{as:"div",styleConfig:{root:[{width:x?"auto":`${q.phWidth}px`,height:x?"auto":`${q.phHeight}px`,aspectRatio:x&&q.aspectRatio?`${q.aspectRatio}`:"auto"}]},children:e.jsx("img",Object.assign({src:w,fetchPriority:m},f,{style:{width:"100%",height:"100%"}}))}):e.jsx(e.Fragment,{children:v()})})};
1
+ "use strict";var t=require("tslib"),i=require("react/jsx-runtime"),e=require("react"),r=require("@cleartrip/ct-platform-io-hoc"),a=require("@cleartrip/ct-platform-constants"),o=require("@cleartrip/ct-platform-utils"),s=require("@cleartrip/ct-design-components"),n={padding:"8px",boxSizing:"border-box"},c={height:"24px",width:"auto"},h={width:"100%",height:"100%",display:"flex",borderRadius:"8px",alignItems:"center",background:"#fef5f2",justifyContent:"center"};exports.LazyImage=function(g){var l=g.src,d=g.width,p=g.height,u=g.isLazy,x=void 0===u||u,m=g.inSwiper,f=void 0!==m&&m,_=g.priority,y=void 0===_?"auto":_,v=g.isLoading,j=void 0!==v&&v,C=g.customPlaceholder,w=t.__rest(g,["src","width","height","isLazy","inSwiper","priority","isLoading","customPlaceholder"]),b=e.useState(!x),R=b[0],q=b[1],I=e.useState(x?C||a.placeholderLogo:l),L=I[0],H=I[1],S=e.useMemo(function(){var t=o.getWidthFromImgUrl(l),i=o.getHeightFromImgUrl(l),e=t&&i&&t/i;return f?{}:{phWidth:d||t,phHeight:p||i,aspectRatio:f&&e?"".concat(e):"auto"}},[l]),z=e.useCallback(function(){return i.jsx(s.Container,t.__assign({as:"div",styleConfig:{root:[{height:"100%"}]}},{children:i.jsx(s.Container,t.__assign({as:"div",styleConfig:{root:[t.__assign(t.__assign({},C?{}:n),{width:f?"auto":"".concat(S.phWidth,"px"),height:f?"100%":"".concat(S.phHeight,"px"),aspectRatio:f&&S.aspectRatio?"".concat(S.aspectRatio):"auto"})]}},{children:C?i.jsx("img",{src:C,alt:"placeholder_image",fetchPriority:"high"}):i.jsx(s.Container,t.__assign({as:"div",styleConfig:{root:[h]}},{children:i.jsx("img",{src:a.placeholderLogo,style:c})}))}))}))},[S,j]),F=e.useCallback(function(){var t=new Image;t.onload=function(){H(l),q(!0)},t.src=l},[l]);return i.jsx(r.IntersectionObserverHOC,t.__assign({onIntersection:F},{children:R?j?i.jsx(i.Fragment,{children:z()}):i.jsx(s.Container,t.__assign({as:"div",styleConfig:{root:[{width:f?"auto":"".concat(S.phWidth,"px"),height:f?"auto":"".concat(S.phHeight,"px"),aspectRatio:f&&S.aspectRatio?"".concat(S.aspectRatio):"auto"}]}},{children:i.jsx("img",t.__assign({src:L,fetchPriority:y},w,{style:{width:"100%",height:"100%"}}))})):i.jsx(i.Fragment,{children:z()})}))};
2
2
  //# sourceMappingURL=ct-platform-lazy-image.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-platform-lazy-image.cjs.js","sources":["../packages/components/LazyImage/src/styles.ts","../packages/components/LazyImage/src/LazyImage.tsx"],"sourcesContent":[null,null],"names":["PLACEHOLDER_STYLES","padding","boxSizing","PLACEHOLDER_IMG_STYLES","height","width","PLACEHOLDER_IMG_WRAPPER","display","borderRadius","alignItems","background","justifyContent","_a","src","isLazy","inSwiper","priority","isLoading","customPlaceholder","props","__rest","visible","setVisible","useState","imgSrc","setImgSrc","placeholderLogo","phDimensions","useMemo","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","phWidth","phHeight","showPlaceholders","useCallback","_jsx","Container","as","styleConfig","root","children","Object","assign","jsx","alt","fetchPriority","style","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_Fragment"],"mappings":"sQAEO,MAAMA,EAAoC,CAC7CC,QAAS,MACTC,UAAW,cAGFC,EAAwC,CACjDC,OAAQ,OACRC,MAAO,QAGEC,EAAyC,CAClDD,MAAO,OACPD,OAAQ,OACRG,QAAS,OACTC,aAAc,MACdC,WAAY,SACZC,WAAY,UACZC,eAAgB,4BCEyBC,IAAA,IAAAC,IACzCA,EAAGR,MACHA,EAAKD,OACLA,EAAMU,OACNA,GAAS,EAAIC,SACbA,GAAW,EAAKC,SAChBA,EAAW,OAAMC,UACjBA,GAAY,EAAKC,kBACjBA,GAAiBN,EACdO,EATsCC,EAAAA,OAAAR,EAAA,CAAA,MAAA,QAAA,SAAA,SAAA,WAAA,WAAA,YAAA,sBAWzC,MAAOS,EAASC,GAAcC,EAAAA,UAAUT,IACjCU,EAAQC,GAAaF,EAAAA,SACxBT,EAASI,GAAqBQ,kBAAkBb,GAG9Cc,EAAeC,EAAAA,SAAQ,KACzB,MAAMC,EAAaC,qBAAmBjB,GAChCkB,EAAcC,sBAAoBnB,GAClCoB,EACFJ,GAAcE,GAAeF,EAAaE,EAE9C,OAAQhB,EAOF,GANA,CACImB,QAAS7B,GAAUwB,EACnBM,SAAU/B,GAAW2B,EACrBE,YACIlB,GAAYkB,EAAc,GAAGA,IAAgB,OAEnD,GACT,CAACpB,IAEEuB,EAAmBC,EAAAA,aAAY,IAE7BC,MAACC,EAASA,UAAA,CAACC,GAAG,MAAMC,YAAa,CAC7BC,KAAM,CAAC,CA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}
1
+ {"version":3,"file":"ct-platform-lazy-image.cjs.js","sources":["../packages/components/LazyImage/src/styles.ts","../packages/components/LazyImage/src/LazyImage.tsx"],"sourcesContent":[null,null],"names":["PLACEHOLDER_STYLES","padding","boxSizing","PLACEHOLDER_IMG_STYLES","height","width","PLACEHOLDER_IMG_WRAPPER","display","borderRadius","alignItems","background","justifyContent","_a","src","_b","isLazy","_c","inSwiper","_d","priority","_e","isLoading","customPlaceholder","props","__rest","_f","useState","visible","setVisible","_g","placeholderLogo","imgSrc","setImgSrc","phDimensions","useMemo","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","phWidth","phHeight","concat","showPlaceholders","useCallback","_jsx","Container","__assign","as","styleConfig","root","children","alt","fetchPriority","style","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_Fragment"],"mappings":"sQAEaA,EAAoC,CAC7CC,QAAS,MACTC,UAAW,cAGFC,EAAwC,CACjDC,OAAQ,OACRC,MAAO,QAGEC,EAAyC,CAClDD,MAAO,OACPD,OAAQ,OACRG,QAAS,OACTC,aAAc,MACdC,WAAY,SACZC,WAAY,UACZC,eAAgB,4BCCwB,SAACC,GACzC,IAAAC,EAAGD,EAAAC,IACHR,EAAKO,EAAAP,MACLD,EAAMQ,EAAAR,OACNU,WAAAC,cAAaD,EACbE,EAAAJ,EAAAK,SAAAA,OAAQ,IAAAD,KACRE,EAAAN,EAAAO,SAAAA,OAAQ,IAAAD,EAAG,OAAMA,EACjBE,cAAAC,cAAiBD,EACjBE,EAAiBV,EAAAU,kBACdC,EAAKC,EAAAA,OAAAZ,EATiC,yFAWnCa,EAAwBC,EAAAA,UAAUX,GAAjCY,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GACpBI,EAAsBH,EAAAA,SACxBX,EAASO,GAAqBQ,EAAAA,gBAAkBjB,GAD7CkB,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAIlBI,EAAeC,EAAAA,QAAQ,WACzB,IAAMC,EAAaC,EAAAA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AC/CxB,EACGN,EACIwB,EAAAA,IAAAgB,WAAA,CAAAV,SAAGR,MAEHE,EAAAA,IAACC,wBACGE,GAAG,MACHC,YAAa,CACTC,KAAM,CAAC,CACH7C,MAAOY,EACD,OACA,GAAAyB,OAAGT,EAAaO,QAAO,MAC7BpC,OAAQa,EACF,OACA,GAAAyB,OAAGT,EAAaQ,SAAQ,MAC9BF,YACItB,GAAYgB,EAAaM,YACnB,GAAAG,OAAGT,EAAaM,aAChB,WAEjB,CAAAY,SACDN,MAAA,MAAAE,EAAAA,SAAA,CACIlC,IAAKkB,EACLsB,cAAelC,GACXI,EAAK,CACT+B,MAAO,CACHjD,MAAO,OACPD,OAAQ,cAMxByC,EAAAA,IAAAgB,EAAAA,SAAA,CAAAV,SAAGR,QAInB"}
@@ -1,2 +1,2 @@
1
- import{__rest as t}from"tslib";import{jsx as i,Fragment as o}from"react/jsx-runtime";import{useState as r,useMemo as e,useCallback as a}from"react";import{IntersectionObserverHOC as c}from"@cleartrip/ct-platform-io-hoc";import{placeholderLogo as s}from"@cleartrip/ct-platform-constants";import{getWidthFromImgUrl as h,getHeightFromImgUrl as n}from"@cleartrip/ct-platform-utils";import{Container as p}from"@cleartrip/ct-design-components";const d={padding:"8px",boxSizing:"border-box"},l={height:"24px",width:"auto"},g={width:"100%",height:"100%",display:"flex",borderRadius:"8px",alignItems:"center",background:"#fef5f2",justifyContent:"center"},m=m=>{var{src:f,width:u,height:y,isLazy:x=!0,inSwiper:w=!1,priority:b="auto",isLoading:R=!1,customPlaceholder:$}=m,j=t(m,["src","width","height","isLazy","inSwiper","priority","isLoading","customPlaceholder"]);const[v,C]=r(!x),[L,P]=r(x?$||s:f),z=e((()=>{const t=h(f),i=n(f),o=t&&i&&t/i;return w?{}:{phWidth:u||t,phHeight:y||i,aspectRatio:w&&o?`${o}`:"auto"}}),[f]),H=a((()=>i(p,{as:"div",styleConfig:{root:[{height:"100%"}]},children:i(p,{as:"div",styleConfig:{root:[Object.assign(Object.assign({},$?{}:d),{width:w?"auto":`${z.phWidth}px`,height:w?"100%":`${z.phHeight}px`,aspectRatio:w&&z.aspectRatio?`${z.aspectRatio}`:"auto"})]},children:$?i("img",{src:$,alt:"placeholder_image",fetchPriority:"high"}):i(p,{as:"div",styleConfig:{root:[g]},children:i("img",{src:s,style:l})})})})),[z,R]),I=a((()=>{const t=new Image;t.onload=()=>{P(f),C(!0)},t.src=f}),[f]);return i(c,{onIntersection:I,children:v?R?i(o,{children:H()}):i(p,{as:"div",styleConfig:{root:[{width:w?"auto":`${z.phWidth}px`,height:w?"auto":`${z.phHeight}px`,aspectRatio:w&&z.aspectRatio?`${z.aspectRatio}`:"auto"}]},children:i("img",Object.assign({src:L,fetchPriority:b},j,{style:{width:"100%",height:"100%"}}))}):i(o,{children:H()})})};export{m as LazyImage};
1
+ import{__rest as t,__assign as i}from"tslib";import{jsx as o,Fragment as r}from"react/jsx-runtime";import{useState as e,useMemo as a,useCallback as c}from"react";import{IntersectionObserverHOC as n}from"@cleartrip/ct-platform-io-hoc";import{placeholderLogo as h}from"@cleartrip/ct-platform-constants";import{getWidthFromImgUrl as p,getHeightFromImgUrl as s}from"@cleartrip/ct-platform-utils";import{Container as d}from"@cleartrip/ct-design-components";var l={padding:"8px",boxSizing:"border-box"},g={height:"24px",width:"auto"},m={width:"100%",height:"100%",display:"flex",borderRadius:"8px",alignItems:"center",background:"#fef5f2",justifyContent:"center"},f=function(f){var u=f.src,y=f.width,v=f.height,x=f.isLazy,w=void 0===x||x,R=f.inSwiper,b=void 0!==R&&R,C=f.priority,L=void 0===C?"auto":C,P=f.isLoading,z=void 0!==P&&P,H=f.customPlaceholder,I=t(f,["src","width","height","isLazy","inSwiper","priority","isLoading","customPlaceholder"]),S=e(!w),W=S[0],j=S[1],k=e(w?H||h:u),_=k[0],q=k[1],A=a(function(){var t=p(u),i=s(u),o=t&&i&&t/i;return b?{}:{phWidth:y||t,phHeight:v||i,aspectRatio:b&&o?"".concat(o):"auto"}},[u]),B=c(function(){return o(d,i({as:"div",styleConfig:{root:[{height:"100%"}]}},{children:o(d,i({as:"div",styleConfig:{root:[i(i({},H?{}:l),{width:b?"auto":"".concat(A.phWidth,"px"),height:b?"100%":"".concat(A.phHeight,"px"),aspectRatio:b&&A.aspectRatio?"".concat(A.aspectRatio):"auto"})]}},{children:H?o("img",{src:H,alt:"placeholder_image",fetchPriority:"high"}):o(d,i({as:"div",styleConfig:{root:[m]}},{children:o("img",{src:h,style:g})}))}))}))},[A,z]),D=c(function(){var t=new Image;t.onload=function(){q(u),j(!0)},t.src=u},[u]);return o(n,i({onIntersection:D},{children:W?z?o(r,{children:B()}):o(d,i({as:"div",styleConfig:{root:[{width:b?"auto":"".concat(A.phWidth,"px"),height:b?"auto":"".concat(A.phHeight,"px"),aspectRatio:b&&A.aspectRatio?"".concat(A.aspectRatio):"auto"}]}},{children:o("img",i({src:_,fetchPriority:L},I,{style:{width:"100%",height:"100%"}}))})):o(r,{children:B()})}))};export{f as LazyImage};
2
2
  //# sourceMappingURL=ct-platform-lazy-image.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-platform-lazy-image.esm.js","sources":["../packages/components/LazyImage/src/styles.ts","../packages/components/LazyImage/src/LazyImage.tsx"],"sourcesContent":[null,null],"names":["PLACEHOLDER_STYLES","padding","boxSizing","PLACEHOLDER_IMG_STYLES","height","width","PLACEHOLDER_IMG_WRAPPER","display","borderRadius","alignItems","background","justifyContent","LazyImage","_a","src","isLazy","inSwiper","priority","isLoading","customPlaceholder","props","__rest","visible","setVisible","useState","imgSrc","setImgSrc","placeholderLogo","phDimensions","useMemo","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","phWidth","phHeight","showPlaceholders","useCallback","_jsx","Container","as","styleConfig","root","children","Object","assign","alt","fetchPriority","style","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_Fragment"],"mappings":"sbAEO,MAAMA,EAAoC,CAC7CC,QAAS,MACTC,UAAW,cAGFC,EAAwC,CAC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ACVsC,SACGL,EACI,MAAA,CAAAzB,IAAKa,EACLsB,MAAO9C,WAOhC,CAACyB,EAAcV,IAEZgC,EAAcZ,GAAY,KAC5B,MAAMa,EAAM,IAAIC,MAEhBD,EAAIE,OAAS,KACT3B,EAAUZ,GACVS,GAAW,EAAK,EAGpB4B,EAAIrC,IAAMA,CAAG,GACd,CAACA,IAEJ,OACIyB,EAACe,EAAuB,CAACC,eAAgBL,EACpCN,SAAAtB,EACGJ,EACIqB,EAAAiB,EAAA,CAAAZ,SAAGP,MAEHE,EAACC,GACGC,GAAG,MACHC,YAAa,CACTC,KAAM,CAAC,CAEHtC,MAAOW,EACD,OACA,GAAGY,EAAaO,YAEtB/B,OAAQY,EACF,OACA,GAAGY,EAAaQ,aACtBF,YACIlB,GAAYY,EAAaM,YACnB,GAAGN,EAAaM,cAChB,UAEjBU,SACDL,EACI,MAAAM,OAAAC,OAAA,CAAAhC,IAAKW,EACLuB,cAAe/B,GACXG,EACJ,CAAA6B,MAAO,CACH5C,MAAO,OACPD,OAAQ,aAMxBmC,EAAGiB,EAAA,CAAAZ,SAAAP,OAGb"}
1
+ {"version":3,"file":"ct-platform-lazy-image.esm.js","sources":["../packages/components/LazyImage/src/styles.ts","../packages/components/LazyImage/src/LazyImage.tsx"],"sourcesContent":[null,null],"names":["PLACEHOLDER_STYLES","padding","boxSizing","PLACEHOLDER_IMG_STYLES","height","width","PLACEHOLDER_IMG_WRAPPER","display","borderRadius","alignItems","background","justifyContent","LazyImage","_a","src","_b","isLazy","_c","inSwiper","_d","priority","_e","isLoading","customPlaceholder","props","__rest","_f","useState","visible","setVisible","_g","placeholderLogo","imgSrc","setImgSrc","phDimensions","useMemo","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","phWidth","phHeight","concat","showPlaceholders","useCallback","_jsx","Container","__assign","as","styleConfig","root","children","alt","fetchPriority","style","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_Fragment"],"mappings":"ocAEO,IAAMA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Q,SAAQ,MAC9BF,YACItB,GAAYgB,EAAaM,YACnB,GAAAG,OAAGT,EAAaM,aAChB,YAEjB,CAAAY,SACA7B,EACGuB,EAAA,MAAA,CACIhC,IAAKS,EACL8B,IAAK,oBACLC,cAAe,SAGnBR,EAACC,EAASC,EAAA,CAACC,GAAG,MAAMC,YAAa,CAC7BC,KAAM,CAAC7C,KACV,CAAA8C,SACGN,EAAA,MAAA,CACIhC,IAAKiB,EACLwB,MAAOpD,YAOnC,EAAG,CAAC+B,EAAcZ,IAEZkC,EAAcX,EAAY,WAC5B,IAAMY,EAAM,IAAIC,MAEhBD,EAAIE,OAAS,WACT1B,EAAUnB,GACVe,GAAW,EACf,EAEA4B,EAAI3C,IAAMA,CACd,EAAG,CAACA,IAEJ,OACIgC,EAACc,EAAuBZ,EAAA,CAACa,eAAgBL,GAAW,CAAAJ,SAC/CxB,EACGN,EACIwB,EAAAgB,EAAA,CAAAV,SAAGR,MAEHE,EAACC,KACGE,GAAG,MACHC,YAAa,CACTC,KAAM,CAAC,CACH9C,MAAOa,EACD,OACA,GAAAyB,OAAGT,EAAaO,QAAO,MAC7BrC,OAAQc,EACF,OACA,GAAAyB,OAAGT,EAAaQ,SAAQ,MAC9BF,YACItB,GAAYgB,EAAaM,YACnB,GAAAG,OAAGT,EAAaM,aAChB,WAEjB,CAAAY,SACDN,EAAA,MAAAE,EAAA,CACIlC,IAAKkB,EACLsB,cAAelC,GACXI,EAAK,CACT+B,MAAO,CACHlD,MAAO,OACPD,OAAQ,cAMxB0C,EAAAgB,EAAA,CAAAV,SAAGR,QAInB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-platform-lazy-image",
3
- "version": "6.0.1-beta.0",
3
+ "version": "6.4.0-SNAPSHOT-native-main.0",
4
4
  "description": "Lazy Image Component",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/ct-platform-lazy-image.cjs.js",
@@ -9,13 +9,11 @@
9
9
  "files": [
10
10
  "dist"
11
11
  ],
12
- "devDependencies": {
13
- "@cleartrip/ct-design-types": "5.27.0-SNAPSHOT-native-main.0"
14
- },
12
+ "devDependencies": {},
15
13
  "dependencies": {
16
- "@cleartrip/ct-platform-io-hoc": "6.0.1-beta.0",
17
- "@cleartrip/ct-platform-utils": "6.0.1-beta.0",
18
- "@cleartrip/ct-platform-constants": "6.0.1-beta.0"
14
+ "@cleartrip/ct-platform-constants": "6.4.0-SNAPSHOT-native-main.0",
15
+ "@cleartrip/ct-platform-io-hoc": "6.4.0-SNAPSHOT-native-main.0",
16
+ "@cleartrip/ct-platform-utils": "6.4.0-SNAPSHOT-native-main.0"
19
17
  },
20
18
  "peerDependencies": {
21
19
  "react": ">=16.8.0",