Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clever-cloudinary-react

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clever-cloudinary-react - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

lib/index.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("cloudinary-react"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["cloudinary-react","react","react-dom"],t):"object"==typeof exports?exports.CleverCloudinaryReact=t(require("cloudinary-react"),require("react"),require("react-dom")):e.CleverCloudinaryReact=t(e["cloudinary-react"],e.react,e["react-dom"])}(this,function(e,t,r){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Transformation=t.CleverCloudinaryReact=void 0;var u=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(1),c=n(s),l=r(2),p=(n(l),r(0)),f=function(e){function t(e){o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.state={progressive:!0,width:!1,quality:!1},r.progressiveThreshold=200,r.defaultQuality="auto",r.unitConvert={em:16,rem:16,px:1},r}return a(t,e),u(t,[{key:"componentWillMount",value:function(){var e=this.maxWidth();if(this.setState({progressive:this.props.progressive||e>this.progressiveThreshold}),this.props.width){var t=this.props.width.match(/([0-9]+)/g),r=this.props.width.match(/([^0-9]+)/g);if("%"!=r){for(var n in this.unitConvert)n==r&&(t=parseInt(t)*parseInt(this.unitConvert[n]));(t<e||0==e)&&this.setState({width:t})}}this.qualityAssigned()&&this.setState({quality:this.defaultQuality})}},{key:"componentDidUpdate",value:function(e,t){}},{key:"maxWidth",value:function(){var e=c.default.Children.map(this.props.children,function(e){return parseInt(e.props.width)?parseInt(e.props.width):0});return e?e[e.length-1]:0}},{key:"qualityAssigned",value:function(){var e=c.default.Children.map(this.props.children,function(e){return e.props.quality?1:0});return!!e&&e.indexOf(1)>=0}},{key:"render",value:function(){var e=this.state.progressive?c.default.createElement(p.Transformation,{flags:"progressive"}):c.default.createElement(p.Transformation,null),t=this.props.children?this.props.children:c.default.createElement(p.Transformation,null),r=this.state.width?c.default.createElement(p.Transformation,{width:this.state.width,crop:"scale"}):c.default.createElement(p.Transformation,null),n=this.state.quality?c.default.createElement(p.Transformation,{quality:this.state.quality}):c.default.createElement(p.Transformation,null);return c.default.createElement(p.CloudinaryContext,{cloudName:this.props.cloudName,privateCdn:this.props.privateCdn,secureDistribution:this.props.secureDistribution,cname:this.props.cname,cdnSubdomain:this.props.cdnSubdomain},c.default.createElement(p.Image,{publicId:this.props.publicId},c.default.createElement(p.Transformation,{dpr:"auto"}),t,e,r,n))}}],[{key:"defaultProps",get:function(){return{cloudName:"demo",publicId:"",progressive:!1,privateCdn:"",secureDistribution:"",cname:"",cdnSubdomain:""}}}]),t}(c.default.Component);t.CleverCloudinaryReact=f,t.Transformation=p.Transformation}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("cloudinary-react"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["cloudinary-react","react","react-dom"],t):"object"==typeof exports?exports.CleverCloudinaryReact=t(require("cloudinary-react"),require("react"),require("react-dom")):e.CleverCloudinaryReact=t(e["cloudinary-react"],e.react,e["react-dom"])}(this,function(e,t,r){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Transformation=t.CleverCloudinaryReact=void 0;var u=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(1),c=n(s),l=r(2),p=(n(l),r(0)),f=function(e){function t(e){o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.state={progressive:!0,width:!1,quality:!1},r.progressiveThreshold=200,r.defaultQuality="auto",r.unitConvert={em:16,rem:16,px:1},r}return a(t,e),u(t,[{key:"componentWillMount",value:function(){var e=this.maxWidth();if(this.setState({progressive:this.props.progressive||e>this.progressiveThreshold}),this.props.width){var t=this.props.width.match(/([0-9]+)/g),r=this.props.width.match(/([^0-9]+)/g);if("%"!=r){for(var n in this.unitConvert)n==r&&(t=parseInt(t)*parseInt(this.unitConvert[n]));(t<e||0==e)&&this.setState({width:t})}}this.qualityAssigned()&&this.setState({quality:this.defaultQuality})}},{key:"componentDidUpdate",value:function(e,t){}},{key:"maxWidth",value:function(){var e=c.default.Children.map(this.props.children,function(e){return parseInt(e.props.width)?parseInt(e.props.width):0});return e?e[e.length-1]:0}},{key:"qualityAssigned",value:function(){var e=c.default.Children.map(this.props.children,function(e){return e.props.quality?1:0});return!!e&&e.indexOf(1)>=0}},{key:"render",value:function(){var e=this.state.progressive?c.default.createElement(p.Transformation,{flags:"progressive"}):c.default.createElement(p.Transformation,null),t=this.props.children?this.props.children:c.default.createElement(p.Transformation,null),r=this.state.width?c.default.createElement(p.Transformation,{width:this.state.width,crop:"scale"}):c.default.createElement(p.Transformation,null),n=this.state.quality?c.default.createElement(p.Transformation,{quality:this.state.quality}):c.default.createElement(p.Transformation,null);return c.default.createElement(p.CloudinaryContext,{cloudName:this.props.cloudName,privateCdn:this.props.privateCdn,secureDistribution:this.props.secureDistribution,cname:this.props.cname,cdnSubdomain:this.props.cdnSubdomain},c.default.createElement(p.Image,{publicId:this.props.publicId,width:this.props.width},c.default.createElement(p.Transformation,{dpr:"auto"}),t,e,r,n))}}],[{key:"defaultProps",get:function(){return{cloudName:"demo",publicId:"",progressive:!1,privateCdn:"",secureDistribution:"",cname:"",cdnSubdomain:""}}}]),t}(c.default.Component);t.CleverCloudinaryReact=f,t.Transformation=p.Transformation}])});
{
"name": "clever-cloudinary-react",
"version": "0.1.1",
"version": "0.1.2",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc