@cleartrip/ct-platform-lazy-image 1.0.0-beta.4 → 1.0.0-beta.5
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,70 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var tslib = require('tslib');
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var react = require('react');
|
|
6
|
-
var ctPlatformIoHoc = require('@cleartrip/ct-platform-io-hoc');
|
|
7
|
-
var ctPlatformConstants = require('@cleartrip/ct-platform-constants');
|
|
8
|
-
var ctPlatformUtils = require('@cleartrip/ct-platform-utils');
|
|
9
|
-
|
|
10
|
-
function styleInject(css, ref) {
|
|
11
|
-
if (ref === void 0) ref = {};
|
|
12
|
-
var insertAt = ref.insertAt;
|
|
13
|
-
if (!css || typeof document === 'undefined') {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
17
|
-
var style = document.createElement('style');
|
|
18
|
-
style.type = 'text/css';
|
|
19
|
-
if (insertAt === 'top') {
|
|
20
|
-
if (head.firstChild) {
|
|
21
|
-
head.insertBefore(style, head.firstChild);
|
|
22
|
-
} else {
|
|
23
|
-
head.appendChild(style);
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
head.appendChild(style);
|
|
27
|
-
}
|
|
28
|
-
if (style.styleSheet) {
|
|
29
|
-
style.styleSheet.cssText = css;
|
|
30
|
-
} else {
|
|
31
|
-
style.appendChild(document.createTextNode(css));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
var css_248z = ".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%}";
|
|
36
|
-
var styles = {"placeholder":"index-module_placeholder__5zI9P","placeholder-img":"index-module_placeholder-img__nUyer","placeholder-img-wrapper":"index-module_placeholder-img-wrapper__mcqYX"};
|
|
37
|
-
styleInject(css_248z);
|
|
38
|
-
|
|
39
|
-
var LazyImage = function (_a) {
|
|
40
|
-
var src = _a.src, width = _a.width, height = _a.height, _b = _a.isLazy, isLazy = _b === void 0 ? true : _b, _c = _a.inSwiper, inSwiper = _c === void 0 ? false : _c, props = tslib.__rest(_a, ["src", "width", "height", "isLazy", "inSwiper"]);
|
|
41
|
-
var _d = react.useState(!isLazy), visible = _d[0], setVisible = _d[1];
|
|
42
|
-
var _e = react.useState(isLazy ? ctPlatformConstants.placeholderLogo : src), imgSrc = _e[0], setImgSrc = _e[1];
|
|
43
|
-
var showPlaceholders = react.useCallback(function () {
|
|
44
|
-
var phWidth = NaN, phHeight = NaN;
|
|
45
|
-
var imageWidth = ctPlatformUtils.getWidthFromImgUrl(src);
|
|
46
|
-
var imageHeight = ctPlatformUtils.getHeightFromImgUrl(src);
|
|
47
|
-
var aspectRatio = imageWidth && imageHeight && imageWidth / imageHeight;
|
|
48
|
-
if (!inSwiper) {
|
|
49
|
-
phWidth = width || imageWidth;
|
|
50
|
-
phHeight = height || imageHeight;
|
|
51
|
-
}
|
|
52
|
-
return (jsxRuntime.jsx("div", tslib.__assign({ className: "".concat(styles['utilswrapper'], " utilswrapper") }, { children: jsxRuntime.jsx("div", tslib.__assign({ className: styles['placeholder'], style: {
|
|
53
|
-
width: inSwiper ? 'auto' : "".concat(phWidth, "px"),
|
|
54
|
-
height: inSwiper ? 'auto' : "".concat(phHeight, "px"),
|
|
55
|
-
aspectRatio: inSwiper && aspectRatio ? "".concat(aspectRatio) : 'auto',
|
|
56
|
-
} }, { children: jsxRuntime.jsx("div", tslib.__assign({ className: styles['placeholder-img-wrapper'] }, { children: jsxRuntime.jsx("img", { src: ctPlatformConstants.placeholderLogo, className: styles['placeholder-img'] }) })) })) })));
|
|
57
|
-
}, [src]);
|
|
58
|
-
var showContent = react.useCallback(function () {
|
|
59
|
-
var img = new Image();
|
|
60
|
-
img.onload = function () {
|
|
61
|
-
setImgSrc(src);
|
|
62
|
-
setVisible(true);
|
|
63
|
-
};
|
|
64
|
-
img.src = src;
|
|
65
|
-
}, [src]);
|
|
66
|
-
return (jsxRuntime.jsx(ctPlatformIoHoc.IntersectionObserverHOC, tslib.__assign({ onIntersection: showContent }, { children: visible ? (jsxRuntime.jsx("img", tslib.__assign({ src: imgSrc }, props))) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: showPlaceholders() })) })));
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
exports.LazyImage = LazyImage;
|
|
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()})}))};
|
|
70
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":["
|
|
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,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,oUCV4C,SAACe,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,EAAAA,OAAAT,EAAA,CAAA,MAAA,QAAA,SAAA,SAAA,aAQnCU,EAAwBC,EAAAA,UAAUN,GAAjCO,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GACpBI,EAAsBH,EAAQA,SAACN,EAASU,EAAAA,gBAAkBd,GAAzDe,OAAQC,OAETC,EAAmBC,EAAAA,aAAY,WACjC,IAAIC,EAAkBC,IAClBC,EAAmBD,IACjBE,EAAaC,qBAAmBvB,GAChCwB,EAAcC,sBAAoBzB,GAClC0B,EACFJ,GAAcE,GAAeF,EAAaE,EAO9C,OALKlB,IACDa,EAAUlB,GAAUqB,EACpBD,EAAWnB,GAAWsB,GAItBG,wBAAKC,UAAW,UAAGC,EAAqB,aAAC,4BACrCF,EACIG,IAAA,MAAAC,EAAAA,SAAA,CAAAH,UAAWC,EAAoB,YAC/BvC,MAAO,CACHW,MAAOK,EAAW,OAAS,GAAG0B,OAAAb,EAAW,MACzCjB,OAAQI,EAAW,OAAS,GAAG0B,OAAAX,EAAY,MAC3CK,YACIpB,GAAYoB,EAAc,GAAAM,OAAGN,GAAgB,SAGrD,CAAAO,SAAAN,EAAAG,IAAA,MAAAC,EAAAA,SAAA,CAAKH,UAAWC,EAAO,4BAA0B,CAAAI,SAC7CN,EAAAA,IACI,MAAA,CAAA3B,IAAKc,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,68 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { useState, useCallback } from 'react';
|
|
4
|
-
import { IntersectionObserverHOC } from '@cleartrip/ct-platform-io-hoc';
|
|
5
|
-
import { placeholderLogo } from '@cleartrip/ct-platform-constants';
|
|
6
|
-
import { getWidthFromImgUrl, getHeightFromImgUrl } from '@cleartrip/ct-platform-utils';
|
|
7
|
-
|
|
8
|
-
function styleInject(css, ref) {
|
|
9
|
-
if (ref === void 0) ref = {};
|
|
10
|
-
var insertAt = ref.insertAt;
|
|
11
|
-
if (!css || typeof document === 'undefined') {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
15
|
-
var style = document.createElement('style');
|
|
16
|
-
style.type = 'text/css';
|
|
17
|
-
if (insertAt === 'top') {
|
|
18
|
-
if (head.firstChild) {
|
|
19
|
-
head.insertBefore(style, head.firstChild);
|
|
20
|
-
} else {
|
|
21
|
-
head.appendChild(style);
|
|
22
|
-
}
|
|
23
|
-
} else {
|
|
24
|
-
head.appendChild(style);
|
|
25
|
-
}
|
|
26
|
-
if (style.styleSheet) {
|
|
27
|
-
style.styleSheet.cssText = css;
|
|
28
|
-
} else {
|
|
29
|
-
style.appendChild(document.createTextNode(css));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
var css_248z = ".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%}";
|
|
34
|
-
var styles = {"placeholder":"index-module_placeholder__5zI9P","placeholder-img":"index-module_placeholder-img__nUyer","placeholder-img-wrapper":"index-module_placeholder-img-wrapper__mcqYX"};
|
|
35
|
-
styleInject(css_248z);
|
|
36
|
-
|
|
37
|
-
var LazyImage = function (_a) {
|
|
38
|
-
var src = _a.src, width = _a.width, height = _a.height, _b = _a.isLazy, isLazy = _b === void 0 ? true : _b, _c = _a.inSwiper, inSwiper = _c === void 0 ? false : _c, props = __rest(_a, ["src", "width", "height", "isLazy", "inSwiper"]);
|
|
39
|
-
var _d = useState(!isLazy), visible = _d[0], setVisible = _d[1];
|
|
40
|
-
var _e = useState(isLazy ? placeholderLogo : src), imgSrc = _e[0], setImgSrc = _e[1];
|
|
41
|
-
var showPlaceholders = useCallback(function () {
|
|
42
|
-
var phWidth = NaN, phHeight = NaN;
|
|
43
|
-
var imageWidth = getWidthFromImgUrl(src);
|
|
44
|
-
var imageHeight = getHeightFromImgUrl(src);
|
|
45
|
-
var aspectRatio = imageWidth && imageHeight && imageWidth / imageHeight;
|
|
46
|
-
if (!inSwiper) {
|
|
47
|
-
phWidth = width || imageWidth;
|
|
48
|
-
phHeight = height || imageHeight;
|
|
49
|
-
}
|
|
50
|
-
return (jsx("div", __assign({ className: "".concat(styles['utilswrapper'], " utilswrapper") }, { children: jsx("div", __assign({ className: styles['placeholder'], style: {
|
|
51
|
-
width: inSwiper ? 'auto' : "".concat(phWidth, "px"),
|
|
52
|
-
height: inSwiper ? 'auto' : "".concat(phHeight, "px"),
|
|
53
|
-
aspectRatio: inSwiper && aspectRatio ? "".concat(aspectRatio) : 'auto',
|
|
54
|
-
} }, { children: jsx("div", __assign({ className: styles['placeholder-img-wrapper'] }, { children: jsx("img", { src: placeholderLogo, className: styles['placeholder-img'] }) })) })) })));
|
|
55
|
-
}, [src]);
|
|
56
|
-
var showContent = useCallback(function () {
|
|
57
|
-
var img = new Image();
|
|
58
|
-
img.onload = function () {
|
|
59
|
-
setImgSrc(src);
|
|
60
|
-
setVisible(true);
|
|
61
|
-
};
|
|
62
|
-
img.src = src;
|
|
63
|
-
}, [src]);
|
|
64
|
-
return (jsx(IntersectionObserverHOC, __assign({ onIntersection: showContent }, { children: visible ? (jsx("img", __assign({ src: imgSrc }, props))) : (jsx(Fragment, { children: showPlaceholders() })) })));
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export { LazyImage };
|
|
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};
|
|
68
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":["
|
|
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]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleartrip/ct-platform-lazy-image",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.5",
|
|
4
4
|
"description": "Lazy Image Component",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/ct-platform-lazy-image.cjs.js",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
],
|
|
12
12
|
"devDependencies": {},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@cleartrip/ct-platform-
|
|
15
|
-
"@cleartrip/ct-platform-
|
|
16
|
-
"@cleartrip/ct-platform-utils": "1.0.0-beta.
|
|
14
|
+
"@cleartrip/ct-platform-io-hoc": "1.0.0-beta.3",
|
|
15
|
+
"@cleartrip/ct-platform-constants": "1.0.0-beta.3",
|
|
16
|
+
"@cleartrip/ct-platform-utils": "1.0.0-beta.3"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": ">=16.8.0",
|