New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rax-image

Package Overview
Dependencies
Maintainers
4
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rax-image - npm Package Compare versions

Comparing version 0.6.6 to 0.6.7

2

dist/image.factory.js

@@ -249,3 +249,3 @@ module.exports = function(require, exports, module) {

var source = this.isError ? nativeProps.source : this.state.source; // Source must a object
var source = this.isError ? this.state.source : nativeProps.source; // Source must a object

@@ -252,0 +252,0 @@ if (source && source.uri) {

@@ -271,3 +271,3 @@

var source = this.isError ? nativeProps.source : this.state.source; // Source must a object
var source = this.isError ? this.state.source : nativeProps.source; // Source must a object

@@ -274,0 +274,0 @@ if (source && source.uri) {

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

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define)define("rax-image",function(t,r,n){n.exports=e()});else{("undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:this).RaxImage=e()}}(function(){return 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=2)}([function(e,t){e.exports=function(){var e;if(!e)try{e=require("rax")}catch(e){}return e}()},function(e,t,r){"use strict";function n(e){return(n="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 o(e){return(o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.isReactNative=t.isWeex=t.isNode=t.isWeb=void 0;var i="object"===("undefined"==typeof navigator?"undefined":o(navigator))&&("Mozilla"===navigator.appCodeName||"Gecko"===navigator.product);t.isWeb=i;var u="undefined"!=typeof process&&!(!process.versions||!process.versions.node);t.isNode=u;var c="function"==typeof callNative||"object"===("undefined"==typeof WXEnvironment?"undefined":o(WXEnvironment))&&"Web"!==WXEnvironment.platform;t.isWeex=c;var f="undefined"!=typeof __fbBatchedBridgeConfig;t.isReactNative=f,t.default=e.exports;var l=e.exports;t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(0),o=r(1),i=function(e){return e&&e.__esModule?e:{default:e}}(r(3));function u(e){return(u="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 c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){y(e,t,r[t])})}return e}function l(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 a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=function(e){function t(){var e,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return y(p(p(r=function(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?p(e):t}(this,(e=a(t)).call.apply(e,[this].concat(o))))),"state",{source:r.props.source}),y(p(p(r)),"onLoad",function(e){var t=p(p(r)).onError,n=r.props.onLoad;void 0!==e.success?e.success?n(e):t(e):void 0!==e.currentTarget&&(e.currentTarget.naturalWidth>1&&e.currentTarget.naturalHeight>1?n(e):t(e))}),y(p(p(r)),"onError",function(e){var t=r.props,n=t.fallbackSource,o=t.onError,i=r.state.source;n.uri&&i.uri!==n.uri&&(r.isError=!0,r.setState({source:n})),o(e)}),y(p(p(r)),"save",function(e){r.refs.nativeImg.save(function(t){e(t)})}),r}return 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&&s(e,t)}(t,n.PureComponent),function(e,t,r){t&&l(e.prototype,t),r&&l(e,r)}(t,[{key:"render",value:function(){var e=f({},this.props),t=this.isError?e.source:this.state.source;if(t&&t.uri){var r,u=e.style,l=t.width,a=t.height,s=t.uri;null==l&&null==a&&null==u.height&&null==u.width&&(l=0,a=0),e.style=f({},f({},!this.context.isInAParentText&&{display:"flex"},{width:l,height:a}),u),e.src=s,e.onLoad=this.onLoad,e.onError=this.onError,delete e.source,r=o.isWeex?"image":"img";var p=e.resizeMode||e.style.resizeMode;return p&&(o.isWeex?(e.resize=p,e.style.resizeMode=p):e.style.objectFit=p),this.props.children?(e.children=null,(0,n.createElement)(i.default,{style:e.style},(0,n.createElement)(r,c({ref:"nativeImg"},e)),(0,n.createElement)(i.default,{style:d.absoluteImage},this.props.children))):(0,n.createElement)(r,c({ref:"nativeImg"},e))}return null}}]),t}();y(b,"propTypes",{}),y(b,"resizeMode",{contain:"contain",cover:"cover",stretch:"stretch",center:"center",repeat:"repeat"}),y(b,"contextTypes",{isInAParentText:n.PropTypes.bool}),y(b,"defaultProps",{onLoad:function(){},onError:function(){},fallbackSource:{}});var d={absoluteImage:{left:0,top:0,position:"absolute"}},v=b;t.default=v,e.exports=t.default},function(e,t,r){"use strict";function n(e){return(n="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)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(0),i=r(1);function u(e){return(u="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function f(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 l(e,t){return!t||"object"!==u(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 a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,a(t).apply(this,arguments))}return 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&&s(e,t)}(t,o.Component),function(e,t,r){t&&f(e.prototype,t),r&&f(e,r)}(t,[{key:"render",value:function(){var e=this.props;if(i.isWeex)return(0,o.createElement)("div",e);var t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){p(e,t,r[t])})}return e}({},b.initial,e.style);return(0,o.createElement)("div",c({},e,{style:t}))}}]),t}();p(y,"propTypes",{});var b={initial:{border:"0 solid black",position:"relative",boxSizing:"border-box",display:"flex",flexDirection:"column",alignContent:"flex-start",flexShrink:0}},d=y;t.default=d,e.exports=t.default}])});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define)define("rax-image",function(t,r,n){n.exports=e()});else{("undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:this).RaxImage=e()}}(function(){return 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=2)}([function(e,t){e.exports=function(){var e;if(!e)try{e=require("rax")}catch(e){}return e}()},function(e,t,r){"use strict";function n(e){return(n="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 o(e){return(o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.isReactNative=t.isWeex=t.isNode=t.isWeb=void 0;var i="object"===("undefined"==typeof navigator?"undefined":o(navigator))&&("Mozilla"===navigator.appCodeName||"Gecko"===navigator.product);t.isWeb=i;var u="undefined"!=typeof process&&!(!process.versions||!process.versions.node);t.isNode=u;var c="function"==typeof callNative||"object"===("undefined"==typeof WXEnvironment?"undefined":o(WXEnvironment))&&"Web"!==WXEnvironment.platform;t.isWeex=c;var f="undefined"!=typeof __fbBatchedBridgeConfig;t.isReactNative=f,t.default=e.exports;var l=e.exports;t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(0),o=r(1),i=function(e){return e&&e.__esModule?e:{default:e}}(r(3));function u(e){return(u="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 c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){y(e,t,r[t])})}return e}function l(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 a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=function(e){function t(){var e,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return y(p(p(r=function(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?p(e):t}(this,(e=a(t)).call.apply(e,[this].concat(o))))),"state",{source:r.props.source}),y(p(p(r)),"onLoad",function(e){var t=p(p(r)).onError,n=r.props.onLoad;void 0!==e.success?e.success?n(e):t(e):void 0!==e.currentTarget&&(e.currentTarget.naturalWidth>1&&e.currentTarget.naturalHeight>1?n(e):t(e))}),y(p(p(r)),"onError",function(e){var t=r.props,n=t.fallbackSource,o=t.onError,i=r.state.source;n.uri&&i.uri!==n.uri&&(r.isError=!0,r.setState({source:n})),o(e)}),y(p(p(r)),"save",function(e){r.refs.nativeImg.save(function(t){e(t)})}),r}return 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&&s(e,t)}(t,n.PureComponent),function(e,t,r){t&&l(e.prototype,t),r&&l(e,r)}(t,[{key:"render",value:function(){var e=f({},this.props),t=this.isError?this.state.source:e.source;if(t&&t.uri){var r,u=e.style,l=t.width,a=t.height,s=t.uri;null==l&&null==a&&null==u.height&&null==u.width&&(l=0,a=0),e.style=f({},f({},!this.context.isInAParentText&&{display:"flex"},{width:l,height:a}),u),e.src=s,e.onLoad=this.onLoad,e.onError=this.onError,delete e.source,r=o.isWeex?"image":"img";var p=e.resizeMode||e.style.resizeMode;return p&&(o.isWeex?(e.resize=p,e.style.resizeMode=p):e.style.objectFit=p),this.props.children?(e.children=null,(0,n.createElement)(i.default,{style:e.style},(0,n.createElement)(r,c({ref:"nativeImg"},e)),(0,n.createElement)(i.default,{style:d.absoluteImage},this.props.children))):(0,n.createElement)(r,c({ref:"nativeImg"},e))}return null}}]),t}();y(b,"propTypes",{}),y(b,"resizeMode",{contain:"contain",cover:"cover",stretch:"stretch",center:"center",repeat:"repeat"}),y(b,"contextTypes",{isInAParentText:n.PropTypes.bool}),y(b,"defaultProps",{onLoad:function(){},onError:function(){},fallbackSource:{}});var d={absoluteImage:{left:0,top:0,position:"absolute"}},v=b;t.default=v,e.exports=t.default},function(e,t,r){"use strict";function n(e){return(n="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)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(0),i=r(1);function u(e){return(u="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function f(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 l(e,t){return!t||"object"!==u(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 a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,a(t).apply(this,arguments))}return 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&&s(e,t)}(t,o.Component),function(e,t,r){t&&f(e.prototype,t),r&&f(e,r)}(t,[{key:"render",value:function(){var e=this.props;if(i.isWeex)return(0,o.createElement)("div",e);var t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){p(e,t,r[t])})}return e}({},b.initial,e.style);return(0,o.createElement)("div",c({},e,{style:t}))}}]),t}();p(y,"propTypes",{});var b={initial:{border:"0 solid black",position:"relative",boxSizing:"border-box",display:"flex",flexDirection:"column",alignContent:"flex-start",flexShrink:0}},d=y;t.default=d,e.exports=t.default}])});
//# sourceMappingURL=image.min.map

@@ -222,3 +222,3 @@ service.register(options.serviceName, {

var source = this.isError ? nativeProps.source : this.state.source; // Source must a object
var source = this.isError ? this.state.source : nativeProps.source; // Source must a object

@@ -225,0 +225,0 @@ if (source && source.uri) {

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

service.register(options.serviceName,{create:function(id,env,config){return{rax_image_0_6_6:function(weex){return{init:function(define,defineName,window){for(var key in window)eval("var "+key+" = window."+key+";");!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define)define("rax-image",[],function(t,r,n){n.exports=e()});else{(void 0!==window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:this).rax_image_0_6_6=e()}}(function(){return 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=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(1),o=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r(3));function u(e){return(u="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 c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){y(e,t,r[t])})}return e}function f(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 l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var d=function(e){function t(){var e,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return y(p(p(r=function(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?p(e):t}(this,(e=l(t)).call.apply(e,[this].concat(o))))),"state",{source:r.props.source}),y(p(p(r)),"onLoad",function(e){var t=p(p(r)).onError,n=r.props.onLoad;void 0!==e.success?e.success?n(e):t(e):void 0!==e.currentTarget&&(e.currentTarget.naturalWidth>1&&e.currentTarget.naturalHeight>1?n(e):t(e))}),y(p(p(r)),"onError",function(e){var t=r.props,n=t.fallbackSource,o=t.onError,i=r.state.source;n.uri&&i.uri!==n.uri&&(r.isError=!0,r.setState({source:n})),o(e)}),y(p(p(r)),"save",function(e){r.refs.nativeImg.save(function(t){e(t)})}),r}return 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&&s(e,t)}(t,n.PureComponent),function(e,t,r){t&&f(e.prototype,t),r&&f(e,r)}(t,[{key:"render",value:function(){var e=a({},this.props),t=this.isError?e.source:this.state.source;if(t&&t.uri){var r,u=e.style,f=t.width,l=t.height,s=t.uri;null==f&&null==l&&null==u.height&&null==u.width&&(f=0,l=0),e.style=a({},a({},!this.context.isInAParentText&&{display:"flex"},{width:f,height:l}),u),e.src=s,e.onLoad=this.onLoad,e.onError=this.onError,delete e.source,r=o.isWeex?"image":"img";var p=e.resizeMode||e.style.resizeMode;return p&&(o.isWeex?(e.resize=p,e.style.resizeMode=p):e.style.objectFit=p),this.props.children?(e.children=null,(0,n.createElement)(i.default,{style:e.style},(0,n.createElement)(r,c({ref:"nativeImg"},e)),(0,n.createElement)(i.default,{style:b.absoluteImage},this.props.children))):(0,n.createElement)(r,c({ref:"nativeImg"},e))}return null}}]),t}();y(d,"propTypes",{}),y(d,"resizeMode",{contain:"contain",cover:"cover",stretch:"stretch",center:"center",repeat:"repeat"}),y(d,"contextTypes",{isInAParentText:n.PropTypes.bool}),y(d,"defaultProps",{onLoad:function(){},onError:function(){},fallbackSource:{}});var b={absoluteImage:{left:0,top:0,position:"absolute"}},v=d;t.default=v,e.exports=t.default},function(e,t){e.exports=require("rax")},function(e,t){e.exports=require("universal-env")},function(e,t){e.exports=require("rax-view")}])})}}}}}});
service.register(options.serviceName,{create:function(id,env,config){return{rax_image_0_6_6:function(weex){return{init:function(define,defineName,window){for(var key in window)eval("var "+key+" = window."+key+";");!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define)define("rax-image",[],function(t,r,n){n.exports=e()});else{(void 0!==window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:this).rax_image_0_6_6=e()}}(function(){return 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=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(1),o=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r(3));function u(e){return(u="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 c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){y(e,t,r[t])})}return e}function f(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 l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var d=function(e){function t(){var e,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return y(p(p(r=function(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?p(e):t}(this,(e=l(t)).call.apply(e,[this].concat(o))))),"state",{source:r.props.source}),y(p(p(r)),"onLoad",function(e){var t=p(p(r)).onError,n=r.props.onLoad;void 0!==e.success?e.success?n(e):t(e):void 0!==e.currentTarget&&(e.currentTarget.naturalWidth>1&&e.currentTarget.naturalHeight>1?n(e):t(e))}),y(p(p(r)),"onError",function(e){var t=r.props,n=t.fallbackSource,o=t.onError,i=r.state.source;n.uri&&i.uri!==n.uri&&(r.isError=!0,r.setState({source:n})),o(e)}),y(p(p(r)),"save",function(e){r.refs.nativeImg.save(function(t){e(t)})}),r}return 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&&s(e,t)}(t,n.PureComponent),function(e,t,r){t&&f(e.prototype,t),r&&f(e,r)}(t,[{key:"render",value:function(){var e=a({},this.props),t=this.isError?this.state.source:e.source;if(t&&t.uri){var r,u=e.style,f=t.width,l=t.height,s=t.uri;null==f&&null==l&&null==u.height&&null==u.width&&(f=0,l=0),e.style=a({},a({},!this.context.isInAParentText&&{display:"flex"},{width:f,height:l}),u),e.src=s,e.onLoad=this.onLoad,e.onError=this.onError,delete e.source,r=o.isWeex?"image":"img";var p=e.resizeMode||e.style.resizeMode;return p&&(o.isWeex?(e.resize=p,e.style.resizeMode=p):e.style.objectFit=p),this.props.children?(e.children=null,(0,n.createElement)(i.default,{style:e.style},(0,n.createElement)(r,c({ref:"nativeImg"},e)),(0,n.createElement)(i.default,{style:b.absoluteImage},this.props.children))):(0,n.createElement)(r,c({ref:"nativeImg"},e))}return null}}]),t}();y(d,"propTypes",{}),y(d,"resizeMode",{contain:"contain",cover:"cover",stretch:"stretch",center:"center",repeat:"repeat"}),y(d,"contextTypes",{isInAParentText:n.PropTypes.bool}),y(d,"defaultProps",{onLoad:function(){},onError:function(){},fallbackSource:{}});var b={absoluteImage:{left:0,top:0,position:"absolute"}},v=d;t.default=v,e.exports=t.default},function(e,t){e.exports=require("rax")},function(e,t){e.exports=require("universal-env")},function(e,t){e.exports=require("rax-view")}])})}}}}}});

@@ -110,3 +110,3 @@ "use strict";

var source = this.isError ? nativeProps.source : this.state.source; // Source must a object
var source = this.isError ? this.state.source : nativeProps.source; // Source must a object

@@ -113,0 +113,0 @@ if (source && source.uri) {

{
"name": "rax-image",
"version": "0.6.6",
"version": "0.6.7",
"description": "Image component for Rax.",

@@ -5,0 +5,0 @@ "license": "BSD-3-Clause",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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