@cleartrip/ct-platform-lazy-image 3.9.1-beta.8 → 3.9.1-beta.9
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"),t=require("react/jsx-runtime"),i=require("react"),a=require("@cleartrip/ct-platform-io-hoc"),r=require("@cleartrip/ct-platform-constants"),s=require("@cleartrip/ct-platform-utils");var o="index-module_placeholder__5zI9P",c="index-module_placeholder-img__nUyer",n="index-module_placeholder-img-wrapper__mcqYX";!function(e,t){void 0===t&&(t={});var i=t.insertAt;if("undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".index-module_placeholder__5zI9P{box-sizing:border-box;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;width:100%}");exports.LazyImage=function(d){var l=d.src,h=d.width,p=d.height,g=d.isLazy,m=void 0===g||g,u=d.inSwiper,_=void 0!==u&&u,x=d.isLoading,y=void 0!==x&&x,f=d.customPlaceholder,v=d.imgStyles,j=e.__rest(d,["src","width","height","isLazy","inSwiper","isLoading","customPlaceholder","imgStyles"]),w=i.useState(!m),b=w[0],q=w[1],I=i.useState(m?f||r.placeholderLogo:l),S=I[0],C=I[1],L=i.useMemo((function(){var e=s.getWidthFromImgUrl(l),t=s.getHeightFromImgUrl(l),i=e&&t&&e/t;return _?{}:{phWidth:h||e,phHeight:p||t,aspectRatio:_&&i?"".concat(i):"auto"}}),[l]),R=i.useCallback((function(){return t.jsx("div",e.__assign({style:{height:"100%"}},{children:t.jsx("div",e.__assign({className:f?"":o,style:{width:_?"auto":"".concat(L.phWidth,"px"),height:_?"100%":"".concat(L.phHeight,"px"),aspectRatio:_&&L.aspectRatio?"".concat(L.aspectRatio):"auto"}},{children:f?t.jsx("img",{src:f,alt:"placeholder_image",style:v,fetchPriority:"high"}):t.jsx("div",e.__assign({className:n},{children:t.jsx("img",{src:r.placeholderLogo,className:c,style:v})}))}))}))}),[L,y]),z=i.useCallback((function(){var e=new Image;e.onload=function(){C(l),q(!0)},e.src=l}),[l]);return t.jsx(a.IntersectionObserverHOC,e.__assign({onIntersection:z},{children:b?y?t.jsx(t.Fragment,{children:R()}):t.jsx("div",e.__assign({style:{width:_?"auto":"".concat(L.phWidth,"px"),height:_?"auto":"".concat(L.phHeight,"px"),aspectRatio:_&&L.aspectRatio?"".concat(L.aspectRatio):"auto"}},{children:t.jsx("img",e.__assign({src:S},j,{style:e.__assign(
|
|
1
|
+
"use strict";var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),a=require("@cleartrip/ct-platform-io-hoc"),r=require("@cleartrip/ct-platform-constants"),s=require("@cleartrip/ct-platform-utils");var o="index-module_placeholder__5zI9P",c="index-module_placeholder-img__nUyer",n="index-module_placeholder-img-wrapper__mcqYX";!function(e,t){void 0===t&&(t={});var i=t.insertAt;if("undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".index-module_placeholder__5zI9P{box-sizing:border-box;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;width:100%}");exports.LazyImage=function(d){var l=d.src,h=d.width,p=d.height,g=d.isLazy,m=void 0===g||g,u=d.inSwiper,_=void 0!==u&&u,x=d.isLoading,y=void 0!==x&&x,f=d.customPlaceholder,v=d.imgStyles,j=e.__rest(d,["src","width","height","isLazy","inSwiper","isLoading","customPlaceholder","imgStyles"]),w=i.useState(!m),b=w[0],q=w[1],I=i.useState(m?f||r.placeholderLogo:l),S=I[0],C=I[1],L=i.useMemo((function(){var e=s.getWidthFromImgUrl(l),t=s.getHeightFromImgUrl(l),i=e&&t&&e/t;return _?{}:{phWidth:h||e,phHeight:p||t,aspectRatio:_&&i?"".concat(i):"auto"}}),[l]),R=i.useCallback((function(){return t.jsx("div",e.__assign({style:{height:"100%"}},{children:t.jsx("div",e.__assign({className:f?"":o,style:{width:_?"auto":"".concat(L.phWidth,"px"),height:_?"100%":"".concat(L.phHeight,"px"),aspectRatio:_&&L.aspectRatio?"".concat(L.aspectRatio):"auto"}},{children:f?t.jsx("img",{src:f,alt:"placeholder_image",style:v,fetchPriority:"high"}):t.jsx("div",e.__assign({className:n},{children:t.jsx("img",{src:r.placeholderLogo,className:c,style:v})}))}))}))}),[L,y]),z=i.useCallback((function(){var e=new Image;e.onload=function(){C(l),q(!0)},e.src=l}),[l]);return t.jsx(a.IntersectionObserverHOC,e.__assign({onIntersection:z},{children:b?y?t.jsx(t.Fragment,{children:R()}):t.jsx("div",e.__assign({style:{width:_?"auto":"".concat(L.phWidth,"px"),height:_?"auto":"".concat(L.phHeight,"px"),aspectRatio:_&&L.aspectRatio?"".concat(L.aspectRatio):"auto"}},{children:t.jsx("img",e.__assign({src:S},j,{style:e.__assign({width:"100%",height:"100%"},v)}))})):t.jsx(t.Fragment,{children:R()})}))};
|
|
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","_d","isLoading","customPlaceholder","imgStyles","props","__rest","_e","useState","visible","setVisible","_f","placeholderLogo","imgSrc","setImgSrc","phDimensions","useMemo","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","phWidth","phHeight","concat","showPlaceholders","useCallback","_jsx","jsx","__assign","children","className","styles","alt","fetchPriority","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_Fragment"
|
|
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","_d","isLoading","customPlaceholder","imgStyles","props","__rest","_e","useState","visible","setVisible","_f","placeholderLogo","imgSrc","setImgSrc","phDimensions","useMemo","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","phWidth","phHeight","concat","showPlaceholders","useCallback","_jsx","jsx","__assign","children","className","styles","alt","fetchPriority","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_Fragment"],"mappings":"0VAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,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,2UCV4C,SAACe,GACzC,IAAAC,EAAGD,EAAAC,IACHC,EAAKF,EAAAE,MACLC,EAAMH,EAAAG,OACNC,EAAAJ,EAAAK,OAAAA,OAAM,IAAAD,GAAOA,EACbE,aAAAC,OAAW,IAAAD,KACXE,EAAAR,EAAAS,UAAAA,OAAS,IAAAD,GAAQA,EACjBE,EAAiBV,EAAAU,kBACjBC,EAASX,EAAAW,UACNC,EAAKC,EAAAA,OAAAb,EATiC,0FAWnCc,EAAwBC,EAAAA,UAAUV,GAAjCW,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GACpBI,EAAsBH,EAAQA,SAChCV,EAASK,GAAqBS,EAAeA,gBAAGlB,GAD7CmB,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAIlBI,EAAeC,EAAAA,SAAQ,WACzB,IAAMC,EAAaC,qBAAmBxB,GAChCyB,EAAcC,sBAAoB1B,GAClC2B,EACFJ,GAAcE,GAAeF,EAAaE,EAE9C,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IrB,GAAYe,EAAaM,YACnB,GAAAG,OAAGT,EAAaM,aAChB,SACb,CAAAS,SAEDH,EACIC,IAAA,MAAAC,EAAAA,SAAA,CAAAnC,IAAKmB,GACDR,EAAK,CACTrB,MAAK6C,EAAAA,SAAA,CACDlC,MAAO,OACPC,OAAQ,QACLQ,SAMnBuB,EAAAA,IAAAc,EAAAA,SAAA,CAAAX,SAAGL,QAInB","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as t}from"tslib";import{jsx as i,Fragment as o}from"react/jsx-runtime";import{useState as r,useMemo as a,useCallback as c}from"react";import{IntersectionObserverHOC as d}from"@cleartrip/ct-platform-io-hoc";import{placeholderLogo as n}from"@cleartrip/ct-platform-constants";import{getWidthFromImgUrl as l,getHeightFromImgUrl as h}from"@cleartrip/ct-platform-utils";var p="index-module_placeholder__5zI9P",s="index-module_placeholder-img__nUyer",m="index-module_placeholder-img-wrapper__mcqYX";!function(e,t){void 0===t&&(t={});var i=t.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".index-module_placeholder__5zI9P{box-sizing:border-box;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;width:100%}");var u=function(u){var g=u.src,f=u.width,x=u.height,y=u.isLazy,_=void 0===y||y,v=u.inSwiper,w=void 0!==v&&v,R=u.isLoading,b=void 0!==R&&R,S=u.customPlaceholder,z=u.imgStyles,N=e(u,["src","width","height","isLazy","inSwiper","isLoading","customPlaceholder","imgStyles"]),P=r(!_),C=P[0],I=P[1],L=r(_?S||n:g),H=L[0],T=L[1],W=a((function(){var e=l(g),t=h(g),i=e&&t&&e/t;return w?{}:{phWidth:f||e,phHeight:x||t,aspectRatio:w&&i?"".concat(i):"auto"}}),[g]),j=c((function(){return i("div",t({style:{height:"100%"}},{children:i("div",t({className:S?"":p,style:{width:w?"auto":"".concat(W.phWidth,"px"),height:w?"100%":"".concat(W.phHeight,"px"),aspectRatio:w&&W.aspectRatio?"".concat(W.aspectRatio):"auto"}},{children:S?i("img",{src:S,alt:"placeholder_image",style:z,fetchPriority:"high"}):i("div",t({className:m},{children:i("img",{src:n,className:s,style:z})}))}))}))}),[W,b]),q=c((function(){var e=new Image;e.onload=function(){T(g),I(!0)},e.src=g}),[g]);return i(d,t({onIntersection:q},{children:C?b?i(o,{children:j()}):i("div",t({style:{width:w?"auto":"".concat(W.phWidth,"px"),height:w?"auto":"".concat(W.phHeight,"px"),aspectRatio:w&&W.aspectRatio?"".concat(W.aspectRatio):"auto"}},{children:i("img",t({src:H},N,{style:t(
|
|
1
|
+
import{__rest as e,__assign as t}from"tslib";import{jsx as i,Fragment as o}from"react/jsx-runtime";import{useState as r,useMemo as a,useCallback as c}from"react";import{IntersectionObserverHOC as d}from"@cleartrip/ct-platform-io-hoc";import{placeholderLogo as n}from"@cleartrip/ct-platform-constants";import{getWidthFromImgUrl as l,getHeightFromImgUrl as h}from"@cleartrip/ct-platform-utils";var p="index-module_placeholder__5zI9P",s="index-module_placeholder-img__nUyer",m="index-module_placeholder-img-wrapper__mcqYX";!function(e,t){void 0===t&&(t={});var i=t.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".index-module_placeholder__5zI9P{box-sizing:border-box;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;width:100%}");var u=function(u){var g=u.src,f=u.width,x=u.height,y=u.isLazy,_=void 0===y||y,v=u.inSwiper,w=void 0!==v&&v,R=u.isLoading,b=void 0!==R&&R,S=u.customPlaceholder,z=u.imgStyles,N=e(u,["src","width","height","isLazy","inSwiper","isLoading","customPlaceholder","imgStyles"]),P=r(!_),C=P[0],I=P[1],L=r(_?S||n:g),H=L[0],T=L[1],W=a((function(){var e=l(g),t=h(g),i=e&&t&&e/t;return w?{}:{phWidth:f||e,phHeight:x||t,aspectRatio:w&&i?"".concat(i):"auto"}}),[g]),j=c((function(){return i("div",t({style:{height:"100%"}},{children:i("div",t({className:S?"":p,style:{width:w?"auto":"".concat(W.phWidth,"px"),height:w?"100%":"".concat(W.phHeight,"px"),aspectRatio:w&&W.aspectRatio?"".concat(W.aspectRatio):"auto"}},{children:S?i("img",{src:S,alt:"placeholder_image",style:z,fetchPriority:"high"}):i("div",t({className:m},{children:i("img",{src:n,className:s,style:z})}))}))}))}),[W,b]),q=c((function(){var e=new Image;e.onload=function(){T(g),I(!0)},e.src=g}),[g]);return i(d,t({onIntersection:q},{children:C?b?i(o,{children:j()}):i("div",t({style:{width:w?"auto":"".concat(W.phWidth,"px"),height:w?"auto":"".concat(W.phHeight,"px"),aspectRatio:w&&W.aspectRatio?"".concat(W.aspectRatio):"auto"}},{children:i("img",t({src:H},N,{style:t({width:"100%",height:"100%"},z)}))})):i(o,{children:j()})}))};export{u 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","_d","isLoading","customPlaceholder","imgStyles","props","__rest","_e","useState","visible","setVisible","_f","placeholderLogo","imgSrc","setImgSrc","phDimensions","useMemo","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","phWidth","phHeight","concat","showPlaceholders","useCallback","_jsx","__assign","children","className","styles","alt","fetchPriority","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_Fragment"],"mappings":"ygBAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,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,yTCVM,IAAAe,EAAsC,SAACC,GACzC,IAAAC,EAAGD,EAAAC,IACHC,EAAKF,EAAAE,MACLC,EAAMH,EAAAG,OACNC,EAAAJ,EAAAK,OAAAA,OAAM,IAAAD,GAAOA,EACbE,aAAAC,OAAW,IAAAD,KACXE,EAAAR,EAAAS,UAAAA,OAAS,IAAAD,GAAQA,EACjBE,EAAiBV,EAAAU,k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A,CAACW,eAAgBL,GAAW,CAAAL,SAC/CpB,EACGP,EACIyB,EAAGa,EAAA,CAAAX,SAAAJ,MAEHE,EAAA,MAAAC,EAAA,CACI7C,MAAO,CACHY,MAAOK,EACD,OACA,GAAAwB,OAAGT,EAAaO,QAAW,MACjC1B,OAAQI,EACF,OACA,GAAAwB,OAAGT,EAAaQ,SAAY,MAClCF,YACIrB,GAAYe,EAAaM,YACnB,GAAAG,OAAGT,EAAaM,aAChB,SACb,CAAAQ,SAEDF,EACI,MAAAC,EAAA,CAAAlC,IAAKmB,GACDR,EAAK,CACTtB,MAAK6C,
|
|
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","_d","isLoading","customPlaceholder","imgStyles","props","__rest","_e","useState","visible","setVisible","_f","placeholderLogo","imgSrc","setImgSrc","phDimensions","useMemo","imageWidth","getWidthFromImgUrl","imageHeight","getHeightFromImgUrl","aspectRatio","phWidth","phHeight","concat","showPlaceholders","useCallback","_jsx","__assign","children","className","styles","alt","fetchPriority","showContent","img","Image","onload","IntersectionObserverHOC","onIntersection","_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|
-
"version": "3.9.1-beta.
|
|
3
|
+
"version": "3.9.1-beta.9",
|
|
4
4
|
"description": "Lazy Image Component",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/ct-platform-lazy-image.cjs.js",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
],
|
|
12
12
|
"devDependencies": {},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@cleartrip/ct-platform-io-hoc": "3.0.3-beta.16",
|
|
15
14
|
"@cleartrip/ct-platform-constants": "3.6.1-beta.5",
|
|
15
|
+
"@cleartrip/ct-platform-io-hoc": "3.0.3-beta.16",
|
|
16
16
|
"@cleartrip/ct-platform-utils": "3.18.1-beta.5"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|