@cleartrip/ct-platform-lazy-image 1.0.0-beta.5 → 1.0.0-beta.6

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,2 +1,2 @@
1
- "use strict";var e=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),i=require("@cleartrip/ct-platform-io-hoc"),a=require("@cleartrip/ct-platform-constants"),l=require("@cleartrip/ct-platform-utils");var c={placeholder:"index-module_placeholder__5zI9P","placeholder-img":"index-module_placeholder-img__nUyer","placeholder-img-wrapper":"index-module_placeholder-img-wrapper__mcqYX"};!function(e,r){void 0===r&&(r={});var t=r.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".index-module_placeholder__5zI9P{padding:8px}.index-module_placeholder-img__nUyer{height:24px!important;width:auto!important}.index-module_placeholder-img-wrapper__mcqYX{align-items:center;background:#fef5f2;border-radius:8px;display:flex;height:100%;justify-content:center;padding:20px 0;width:100%}");exports.LazyImage=function(n){var o=n.src,d=n.width,s=n.height,p=n.isLazy,h=void 0===p||p,m=n.inSwiper,u=void 0!==m&&m,g=e.__rest(n,["src","width","height","isLazy","inSwiper"]),_=t.useState(!h),x=_[0],f=_[1],v=t.useState(h?a.placeholderLogo:o),w=v[0],y=v[1],N=t.useCallback((function(){var t=NaN,i=NaN,n=l.getWidthFromImgUrl(o),p=l.getHeightFromImgUrl(o),h=n&&p&&n/p;return u||(t=d||n,i=s||p),r.jsx("div",e.__assign({className:"".concat(c.utilswrapper," utilswrapper")},{children:r.jsx("div",e.__assign({className:c.placeholder,style:{width:u?"auto":"".concat(t,"px"),height:u?"auto":"".concat(i,"px"),aspectRatio:u&&h?"".concat(h):"auto"}},{children:r.jsx("div",e.__assign({className:c["placeholder-img-wrapper"]},{children:r.jsx("img",{src:a.placeholderLogo,className:c["placeholder-img"]})}))}))}))}),[o]),j=t.useCallback((function(){var e=new Image;e.onload=function(){y(o),f(!0)},e.src=o}),[o]);return r.jsx(i.IntersectionObserverHOC,e.__assign({onIntersection:j},{children:x?r.jsx("img",e.__assign({src:w},g)):r.jsx(r.Fragment,{children:N()})}))};
1
+ "use strict";var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),i=require("@cleartrip/ct-platform-io-hoc"),a=require("@cleartrip/ct-platform-constants"),n=require("@cleartrip/ct-platform-utils");var c="index-module_placeholder__5zI9P",d="index-module_placeholder-img__nUyer",o="index-module_placeholder-img-wrapper__mcqYX";!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===r&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".index-module_placeholder__5zI9P{padding:8px}.index-module_placeholder-img__nUyer{height:24px!important;width:auto!important}.index-module_placeholder-img-wrapper__mcqYX{align-items:center;background:#fef5f2;border-radius:8px;display:flex;height:100%;justify-content:center;padding:20px 0;width:100%}");exports.LazyImage=function(s){var l=s.src,p=s.width,h=s.height,m=s.isLazy,u=void 0===m||m,g=s.inSwiper,_=void 0!==g&&g,x=e.__rest(s,["src","width","height","isLazy","inSwiper"]),f=r.useState(!u),v=f[0],y=f[1],w=r.useState(u?a.placeholderLogo:l),j=w[0],N=w[1],q=r.useCallback((function(){var r=NaN,i=NaN,s=n.getWidthFromImgUrl(l),m=n.getHeightFromImgUrl(l),u=s&&m&&s/m;return _||(r=p||s,i=h||m),t.jsx("div",{children:t.jsx("div",e.__assign({className:c,style:{width:_?"auto":"".concat(r,"px"),height:_?"auto":"".concat(i,"px"),aspectRatio:_&&u?"".concat(u):"auto"}},{children:t.jsx("div",e.__assign({className:o},{children:t.jsx("img",{src:a.placeholderLogo,className:d})}))}))})}),[l]),I=r.useCallback((function(){var e=new Image;e.onload=function(){N(l),y(!0)},e.src=l}),[l]);return t.jsx(i.IntersectionObserverHOC,e.__assign({onIntersection:I},{children:v?t.jsx("img",e.__assign({src:j},x)):t.jsx(t.Fragment,{children:q()})}))};
2
2
  //# sourceMappingURL=ct-platform-lazy-image.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-platform-lazy-image.cjs.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/LazyImage/src/LazyImage.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","_a","src","width","height","_b","isLazy","_c","inSwiper","props","__rest","_d","useState","visible","setVisible","_e","placeholderLogo","imgSrc","setImgSrc","showPlaceholders","useCallback","phWidth","NaN","phHeight","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","_jsx","className","styles","jsx","__assign","concat","children","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_Fragment"],"mappings":"gZAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ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,kBACLc,UAAWC,EAAO,6BAM1C,GAAG,CAAC7B,IAEEkC,EAAchB,EAAAA,aAAY,WAC5B,IAAMiB,EAAM,IAAIC,MAEhBD,EAAIE,OAAS,WACTrB,EAAUhB,GACVY,GAAW,EACf,EAEAuB,EAAInC,IAAMA,CACd,GAAG,CAACA,IAEJ,OACI2B,MAACW,EAAAA,wBAAuBP,EAAAA,SAAA,CAACQ,eAAgBL,GACpC,CAAAD,SAAAtB,EACGgB,wBAAK3B,IAAKe,GAAYR,IAEtBoB,EAAAA,IAAGa,EAAAA,SAAA,CAAAP,SAAAhB,QAInB","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ct-platform-lazy-image.cjs.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/LazyImage/src/LazyImage.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","_a","src","width","height","_b","isLazy","_c","inSwiper","props","__rest","_d","useState","visible","setVisible","_e","placeholderLogo","imgSrc","setImgSrc","showPlaceholders","useCallback","phWidth","NaN","phHeight","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","_jsx","children","__assign","className","styles","concat","jsx","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_Fragment"],"mappings":"0VAAA,SAAqBA,EAAKC,QAC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E,SAAAD,EAAAM,IAAA,MAAAJ,EAAAA,SAAA,CAAKC,UAAWC,GAAiC,CAAAH,SAC7CD,EAAAA,IACI,MAAA,CAAA3B,IAAKc,kBACLgB,UAAWC,WAMnC,GAAG,CAAC/B,IAEEkC,EAAchB,EAAAA,aAAY,WAC5B,IAAMiB,EAAM,IAAIC,MAEhBD,EAAIE,OAAS,WACTrB,EAAUhB,GACVY,GAAW,EACf,EAEAuB,EAAInC,IAAMA,CACd,GAAG,CAACA,IAEJ,OACI2B,MAACW,EAAAA,wBAAuBT,EAAAA,SAAA,CAACU,eAAgBL,GACpC,CAAAN,SAAAjB,EACGgB,wBAAK3B,IAAKe,GAAYR,IAEtBoB,EAAAA,IAAGa,EAAAA,SAAA,CAAAZ,SAAAX,QAInB","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as t}from"tslib";import{jsx as r,Fragment as i}from"react/jsx-runtime";import{useState as a,useCallback as o}from"react";import{IntersectionObserverHOC as c}from"@cleartrip/ct-platform-io-hoc";import{placeholderLogo as d}from"@cleartrip/ct-platform-constants";import{getWidthFromImgUrl as l,getHeightFromImgUrl as n}from"@cleartrip/ct-platform-utils";var p={placeholder:"index-module_placeholder__5zI9P","placeholder-img":"index-module_placeholder-img__nUyer","placeholder-img-wrapper":"index-module_placeholder-img-wrapper__mcqYX"};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===r&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".index-module_placeholder__5zI9P{padding:8px}.index-module_placeholder-img__nUyer{height:24px!important;width:auto!important}.index-module_placeholder-img-wrapper__mcqYX{align-items:center;background:#fef5f2;border-radius:8px;display:flex;height:100%;justify-content:center;padding:20px 0;width:100%}");var m=function(m){var h=m.src,s=m.width,u=m.height,f=m.isLazy,g=void 0===f||f,x=m.inSwiper,_=void 0!==x&&x,w=e(m,["src","width","height","isLazy","inSwiper"]),v=a(!g),y=v[0],N=v[1],z=a(g?d:h),C=z[0],I=z[1],S=o((function(){var e=NaN,i=NaN,a=l(h),o=n(h),c=a&&o&&a/o;return _||(e=s||a,i=u||o),r("div",t({className:"".concat(p.utilswrapper," utilswrapper")},{children:r("div",t({className:p.placeholder,style:{width:_?"auto":"".concat(e,"px"),height:_?"auto":"".concat(i,"px"),aspectRatio:_&&c?"".concat(c):"auto"}},{children:r("div",t({className:p["placeholder-img-wrapper"]},{children:r("img",{src:d,className:p["placeholder-img"]})}))}))}))}),[h]),b=o((function(){var e=new Image;e.onload=function(){I(h),N(!0)},e.src=h}),[h]);return r(c,t({onIntersection:b},{children:y?r("img",t({src:C},w)):r(i,{children:S()})}))};export{m as LazyImage};
1
+ import{__rest as e,__assign as t}from"tslib";import{jsx as i,Fragment as r}from"react/jsx-runtime";import{useState as o,useCallback as a}from"react";import{IntersectionObserverHOC as n}from"@cleartrip/ct-platform-io-hoc";import{placeholderLogo as d}from"@cleartrip/ct-platform-constants";import{getWidthFromImgUrl as c,getHeightFromImgUrl as l}from"@cleartrip/ct-platform-utils";var m="index-module_placeholder__5zI9P",p="index-module_placeholder-img__nUyer",s="index-module_placeholder-img-wrapper__mcqYX";!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".index-module_placeholder__5zI9P{padding:8px}.index-module_placeholder-img__nUyer{height:24px!important;width:auto!important}.index-module_placeholder-img-wrapper__mcqYX{align-items:center;background:#fef5f2;border-radius:8px;display:flex;height:100%;justify-content:center;padding:20px 0;width:100%}");var h=function(h){var u=h.src,f=h.width,g=h.height,x=h.isLazy,_=void 0===x||x,v=h.inSwiper,y=void 0!==v&&v,w=e(h,["src","width","height","isLazy","inSwiper"]),N=o(!_),z=N[0],C=N[1],I=o(_?d:u),S=I[0],b=I[1],T=a((function(){var e=NaN,r=NaN,o=c(u),a=l(u),n=o&&a&&o/a;return y||(e=f||o,r=g||a),i("div",{children:i("div",t({className:m,style:{width:y?"auto":"".concat(e,"px"),height:y?"auto":"".concat(r,"px"),aspectRatio:y&&n?"".concat(n):"auto"}},{children:i("div",t({className:s},{children:i("img",{src:d,className:p})}))}))})}),[u]),j=a((function(){var e=new Image;e.onload=function(){b(u),C(!0)},e.src=u}),[u]);return i(n,t({onIntersection:j},{children:z?i("img",t({src:S},w)):i(r,{children:T()})}))};export{h 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":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/LazyImage/src/LazyImage.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","LazyImage","_a","src","width","height","_b","isLazy","_c","inSwiper","props","__rest","_d","useState","visible","setVisible","_e","placeholderLogo","imgSrc","setImgSrc","showPlaceholders","useCallback","phWidth","NaN","phHeight","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","_jsx","className","styles","__assign","concat","children","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_Fragment"],"mappings":"kjBAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,kTCVM,IAAAe,EAAsC,SAACC,GACzC,IAAAC,EAAGD,EAAAC,IACHC,EAAKF,EAAAE,MACLC,EAAMH,EAAAG,OACNC,EAAaJ,EAAAK,OAAbA,OAAM,IAAAD,GAAOA,EACbE,EAAgBN,EAAAO,SAAhBA,OAAQ,IAAAD,GAAQA,EACbE,EANsCC,EAAAT,EAAA,CAAA,MAAA,QAAA,SAAA,SAAA,aAQnCU,EAAwBC,GAAUN,GAAjCO,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GACpBI,EAAsBH,EAASN,EAASU,EAAkBd,GAAzDe,OAAQC,OAETC,EAAmBC,GAAY,WACjC,IAAIC,EAAkBC,IAClBC,EAAmBD,IACjBE,EAAaC,EAAmBvB,GAChCwB,EAAcC,EAAoBzB,GAClC0B,EACFJ,GAAcE,GAAeF,EAAaE,EAO9C,OALKlB,IACDa,EAAUlB,GAAUqB,EACpBD,EAAWnB,GAAWsB,GAItBG,WAAKC,UAAW,UAAGC,EAAqB,aAAC,4BACrCF,EACI,MAAAG,EAAA,CAAAF,UAAWC,EAAoB,YAC/BxC,MAAO,CACHY,MAAOK,EAAW,OAAS,GAAGyB,OAAAZ,EAAW,MACzCjB,OAAQI,EAAW,OAAS,GAAGyB,OAAAV,EAAY,MAC3CK,YACIpB,GAAYoB,EAAc,GAAAK,OAAGL,GAAgB,SAGrD,CAAAM,SAAAL,EAAA,MAAAG,EAAA,CAAKF,UAAWC,EAAO,4BAA0B,CAAAG,SAC7CL,EACI,MAAA,CAAA3B,IAAKc,EACLc,UAAWC,EAAO,6BAM1C,GAAG,CAAC7B,IAEEiC,EAAcf,GAAY,WAC5B,IAAMgB,EAAM,IAAIC,MAEhBD,EAAIE,OAAS,WACTpB,EAAUhB,GACVY,GAAW,EACf,EAEAsB,EAAIlC,IAAMA,CACd,GAAG,CAACA,IAEJ,OACI2B,EAACU,EAAuBP,EAAA,CAACQ,eAAgBL,GACpC,CAAAD,SAAArB,EACGgB,WAAK3B,IAAKe,GAAYR,IAEtBoB,EAAGY,EAAA,CAAAP,SAAAf,QAInB","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ct-platform-lazy-image.esm.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/LazyImage/src/LazyImage.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","LazyImage","_a","src","width","height","_b","isLazy","_c","inSwiper","props","__rest","_d","useState","visible","setVisible","_e","placeholderLogo","imgSrc","setImgSrc","showPlaceholders","useCallback","phWidth","NaN","phHeight","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","_jsx","children","__assign","className","styles","concat","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_Fragment"],"mappings":"4fAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,kTCVM,IAAAe,EAAsC,SAACC,GACzC,IAAAC,EAAGD,EAAAC,IACHC,EAAKF,EAAAE,MACLC,EAAMH,EAAAG,OACNC,EAAaJ,EAAAK,OAAbA,OAAM,IAAAD,GAAOA,EACbE,EAAgBN,EAAAO,SAAhBA,OAAQ,IAAAD,GAAQA,EACbE,EANsCC,EAAAT,EAAA,CAAA,MAAA,QAAA,SAAA,SAAA,aAQnCU,EAAwBC,GAAUN,GAAjCO,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GACpBI,EAAsBH,EAASN,EAASU,EAAkBd,GAAzDe,OAAQC,OAETC,EAAmBC,GAAY,WACjC,IAAIC,EAAkBC,IAClBC,EAAmBD,IACjBE,EAAaC,EAAmBvB,GAChCwB,EAAcC,EAAoBzB,GAClC0B,EACFJ,GAAcE,GAAeF,EAAaE,EAO9C,OALKlB,IACDa,EAAUlB,GAAUqB,EACpBD,EAAWnB,GAAWsB,GAItBG,EACI,MAAA,CAAAC,SAAAD,EAAA,MAAAE,EAAA,CACIC,UAAWC,EACX1C,MAAO,CACHY,MAAOK,EAAW,OAAS,GAAG0B,OAAAb,EAAW,MACzCjB,OAAQI,EAAW,OAAS,GAAG0B,OAAAX,EAAY,MAC3CK,YACIpB,GAAYoB,EAAc,GAAAM,OAAGN,GAAgB,SAGrD,CAAAE,SAAAD,EAAA,MAAAE,EAAA,CAAKC,UAAWC,GAAiC,CAAAH,SAC7CD,EACI,MAAA,CAAA3B,IAAKc,EACLgB,UAAWC,WAMnC,GAAG,CAAC/B,IAEEiC,EAAcf,GAAY,WAC5B,IAAMgB,EAAM,IAAIC,MAEhBD,EAAIE,OAAS,WACTpB,EAAUhB,GACVY,GAAW,EACf,EAEAsB,EAAIlC,IAAMA,CACd,GAAG,CAACA,IAEJ,OACI2B,EAACU,EAAuBR,EAAA,CAACS,eAAgBL,GACpC,CAAAL,SAAAjB,EACGgB,WAAK3B,IAAKe,GAAYR,IAEtBoB,EAAGY,EAAA,CAAAX,SAAAX,QAInB","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-platform-lazy-image",
3
- "version": "1.0.0-beta.5",
3
+ "version": "1.0.0-beta.6",
4
4
  "description": "Lazy Image Component",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/ct-platform-lazy-image.cjs.js",