@times-components/image
Advanced tools
Comparing version 6.18.1 to 6.18.2-alpha.95
@@ -109,3 +109,5 @@ "use strict"; | ||
style: { | ||
paddingBottom: "".concat(100 / aspectRatio, "%") | ||
paddingBottom: "".concat(100 / aspectRatio, "%"), | ||
position: "relative", | ||
overflow: "hidden" | ||
} | ||
@@ -112,0 +114,0 @@ }, this.highResImage({ |
{ | ||
"name": "@times-components/image", | ||
"version": "6.18.1", | ||
"version": "6.18.2-alpha.95+355f101a2b", | ||
"main": "dist/index", | ||
@@ -36,8 +36,8 @@ "dev": "src/index", | ||
"@babel/core": "7.4.4", | ||
"@times-components/eslint-config-thetimes": "0.8.18", | ||
"@times-components/jest-configurator-web": "0.8.2", | ||
"@times-components/jest-serializer": "3.13.20", | ||
"@times-components/storybook": "4.12.34", | ||
"@times-components/test-utils": "2.4.2", | ||
"@times-components/webpack-configurator": "2.1.1", | ||
"@times-components/eslint-config-thetimes": "^0.8.18", | ||
"@times-components/jest-configurator-web": "^0.8.2", | ||
"@times-components/jest-serializer": "^3.13.20", | ||
"@times-components/storybook": "^4.12.34", | ||
"@times-components/test-utils": "^2.4.2", | ||
"@times-components/webpack-configurator": "^2.1.1", | ||
"babel-jest": "24.8.0", | ||
@@ -57,4 +57,4 @@ "babel-loader": "8.0.5", | ||
"dependencies": { | ||
"@times-components/ts-styleguide": "1.50.34", | ||
"@times-components/utils": "6.26.0", | ||
"@times-components/ts-styleguide": "^1.50.34", | ||
"@times-components/utils": "^6.26.0", | ||
"prop-types": "15.7.2", | ||
@@ -74,3 +74,3 @@ "styled-components": "4.3.2" | ||
}, | ||
"gitHead": "14054b4b2f567910b8f5703e311ad2b522f834b3" | ||
"gitHead": "355f101a2b5180229338068a0e1429fd2bbfeb3c" | ||
} |
@@ -1,1 +0,1 @@ | ||
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@times-components/utils/rnw")},function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t,r){"use strict";r.r(t);var n=r(1),o=r.n(n),i=r(2),c=r(0),u=r.n(c),a=(u.a.object,u.a.string,u.a.number,u.a.number,u.a.bool,u.a.bool,u.a.number,u.a.func,u.a.bool,u.a.string,u.a.bool,{aspectRatio:void 0,disablePlaceholder:!1,fadeImageIn:!1,highResSize:null,rounded:!1,uri:null,isLcpItem:!1}),l=r(4),f=r.n(l).a.img.withConfig({displayName:"responsive",componentId:"sc-1nnon4d-0"})(["display:block;position:absolute;width:100%;z-index:",";"],(function(e){return e.zIndex}));function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h(e);if(t){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return O(this,r)}}function O(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(u,e);var t,r,n,c=g(u);function u(){return y(this,u),c.apply(this,arguments)}return t=u,(r=[{key:"highResImage",value:function(e){var t=e.highResSize,r=void 0===t?300:t,n=e.url,c=this.props.accessibilityLabel,u=Object(i.appendToImageURL)(n,"resize",r);return o.a.createElement(f,{alt:c,loading:"lazy",src:u,zIndex:2})}},{key:"render",value:function(){var e=this.props,t=e.aspectRatio,r=e.highResSize,n=e.style,c=e.uri,u=e.onLayout,a=e.rounded,l=e.isLcpItem,f=Object(i.addMissingProtocol)(c),s=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},n);return Object.assign(s,{backgroundColor:"#efefef"}),a&&Object.assign(s,{borderRadius:"50%",overflow:"hidden"}),o.a.createElement(i.TcView,{onLayout:u,style:s,testID:"Image",className:l?"lcpItem":""},o.a.createElement("div",{style:{paddingBottom:"".concat(100/t,"%")}},this.highResImage({highResSize:r,url:f})))}}])&&d(t.prototype,r),n&&d(t,n),u}(n.Component);v.defaultProps=a;var j=v,w=j,P=r(3),L={placeholder:{alignItems:"center",backgroundColor:P.colours.functional.backgroundSecondary,bottom:0,justifyContent:"center",left:0,position:"absolute",right:0,top:0,zIndex:0}};var x=function(){return o.a.createElement("svg",{height:"auto",version:"1.1",viewBox:"145 50 108 120",width:"100%",style:{maxWidth:"25%",maxHeight:"50%"}},o.a.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},o.a.createElement("path",{d:"M211.26076,54 L211.231367,54 L147.67512,54 L145,85.7081465 L146.922096,86.4489102 C146.922096,86.4489102 164.867589,68.1355181 168.301115,65.0001546 C171.728017,61.8689133 174.237132,61.0885763 176.436179,60.3527593 C180.998206,59.169681 185.977937,59.2150255 185.977937,59.2150255 L186.109581,59.2150255 L186.109581,156.560932 L169.259886,164.473953 L169.259886,166 L228.735147,166 L228.735147,164.473953 L211.889177,156.560932 L211.889177,59.2150255 L212.01751,59.2150255 C212.01751,59.2150255 216.992272,59.169681 221.558854,60.3527593 C223.757072,61.0885763 226.266601,61.8689133 229.691848,65.0001546 C233.130341,68.1355181 251.071695,86.4489102 251.071695,86.4489102 L253,85.7081465 L250.317842,54 L211.270695,54 L211.242545,54",fill:P.colours.functional.contrast})))};function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){I(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var E=function(e){var t=e.borderRadius,r=void 0===t?0:t,n=R(R({},L.placeholder),{},{borderRadius:r});return o.a.createElement(i.TcView,{height:"100%",style:n,width:"100%"},o.a.createElement(x,null))};r.d(t,"ModalImage",(function(){return w})),r.d(t,"Placeholder",(function(){return E}));t.default=j}]); | ||
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@times-components/utils/rnw")},function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t,r){"use strict";r.r(t);var n=r(1),o=r.n(n),i=r(2),c=r(0),u=r.n(c),a=(u.a.object,u.a.string,u.a.number,u.a.number,u.a.bool,u.a.bool,u.a.number,u.a.func,u.a.bool,u.a.string,u.a.bool,{aspectRatio:void 0,disablePlaceholder:!1,fadeImageIn:!1,highResSize:null,rounded:!1,uri:null,isLcpItem:!1}),l=r(4),f=r.n(l).a.img.withConfig({displayName:"responsive",componentId:"sc-1nnon4d-0"})(["display:block;position:absolute;width:100%;z-index:",";"],(function(e){return e.zIndex}));function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O(e);if(t){var o=O(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return h(this,r)}}function h(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(u,e);var t,r,n,c=g(u);function u(){return d(this,u),c.apply(this,arguments)}return t=u,(r=[{key:"highResImage",value:function(e){var t=e.highResSize,r=void 0===t?300:t,n=e.url,c=this.props.accessibilityLabel,u=Object(i.appendToImageURL)(n,"resize",r);return o.a.createElement(f,{alt:c,loading:"lazy",src:u,zIndex:2})}},{key:"render",value:function(){var e=this.props,t=e.aspectRatio,r=e.highResSize,n=e.style,c=e.uri,u=e.onLayout,a=e.rounded,l=e.isLcpItem,f=Object(i.addMissingProtocol)(c),s=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},n);return Object.assign(s,{backgroundColor:"#efefef"}),a&&Object.assign(s,{borderRadius:"50%",overflow:"hidden"}),o.a.createElement(i.TcView,{onLayout:u,style:s,testID:"Image",className:l?"lcpItem":""},o.a.createElement("div",{style:{paddingBottom:"".concat(100/t,"%"),position:"relative",overflow:"hidden"}},this.highResImage({highResSize:r,url:f})))}}])&&y(t.prototype,r),n&&y(t,n),u}(n.Component);v.defaultProps=a;var j=v,w=j,P=r(3),L={placeholder:{alignItems:"center",backgroundColor:P.colours.functional.backgroundSecondary,bottom:0,justifyContent:"center",left:0,position:"absolute",right:0,top:0,zIndex:0}};var x=function(){return o.a.createElement("svg",{height:"auto",version:"1.1",viewBox:"145 50 108 120",width:"100%",style:{maxWidth:"25%",maxHeight:"50%"}},o.a.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},o.a.createElement("path",{d:"M211.26076,54 L211.231367,54 L147.67512,54 L145,85.7081465 L146.922096,86.4489102 C146.922096,86.4489102 164.867589,68.1355181 168.301115,65.0001546 C171.728017,61.8689133 174.237132,61.0885763 176.436179,60.3527593 C180.998206,59.169681 185.977937,59.2150255 185.977937,59.2150255 L186.109581,59.2150255 L186.109581,156.560932 L169.259886,164.473953 L169.259886,166 L228.735147,166 L228.735147,164.473953 L211.889177,156.560932 L211.889177,59.2150255 L212.01751,59.2150255 C212.01751,59.2150255 216.992272,59.169681 221.558854,60.3527593 C223.757072,61.0885763 226.266601,61.8689133 229.691848,65.0001546 C233.130341,68.1355181 251.071695,86.4489102 251.071695,86.4489102 L253,85.7081465 L250.317842,54 L211.270695,54 L211.242545,54",fill:P.colours.functional.contrast})))};function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){I(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var E=function(e){var t=e.borderRadius,r=void 0===t?0:t,n=R(R({},L.placeholder),{},{borderRadius:r});return o.a.createElement(i.TcView,{height:"100%",style:n,width:"100%"},o.a.createElement(x,null))};r.d(t,"ModalImage",(function(){return w})),r.d(t,"Placeholder",(function(){return E}));t.default=j}]); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
211071
316
2
1