Comparing version 0.0.8 to 0.0.9
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("viewerjs"),require("viewerjs/dist/viewer.min.css")):"function"==typeof define&&define.amd?define(["react","viewerjs","viewerjs/dist/viewer.min.css"],t):e.RcViewer=t(e.React,e.Viewer)}(this,function(e,t){"use strict";var n="default"in e?e.default:e;t=t&&t.hasOwnProperty("default")?t.default:t;var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(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};return function(u){function c(e){r(this,c);var t=a(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,e));return t.container=null,t.viewer=null,t}return function(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)}(c,e.Component),i(c,[{key:"componentDidMount",value:function(){this.viewerInit()}},{key:"getViewer",value:function(){return{viewer:this.viewer,container:this.container}}},{key:"componentDidUpdate",value:function(){this.viewer&&!this.isIdentical()&&this.viewerInit()}},{key:"componentWillUnmount",value:function(){this.viewer&&this.viewer.destroy()}},{key:"isIdentical",value:function(){var e=this.viewer.images||[];this.viewer.update();var t=this.viewer.images||[];return!e.length&&!t.length||e.length===t.length&&t.every(function(t,n){return e[n]===t})}},{key:"viewerInit",value:function(){this.viewer&&this.viewer.destroy();var e=this.props,n=e.options,r=void 0===n?{}:n,i=e.children;this.viewer=new t(this.container,o({navbar:!(!Array.isArray(i)||!i.length)},r))}},{key:"render",value:function(){var e=this,t=this.props,r=(t.options,t.children),i=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["options","children"]);return n.createElement("div",o({ref:function(t){e.container=t}},i),r)}}]),c}()}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("viewerjs"),require("viewerjs/dist/viewer.min.css")):"function"==typeof define&&define.amd?define(["react","viewerjs","viewerjs/dist/viewer.min.css"],t):e.RcViewer=t(e.React,e.Viewer)}(this,function(e,t){"use strict";var n="default"in e?e.default:e;t=t&&t.hasOwnProperty("default")?t.default:t;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();return function(o){function a(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var t=function(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}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,e));return t.container=null,t.viewer=null,t}return function(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)}(a,e.Component),i(a,[{key:"componentDidMount",value:function(){this.viewerInit()}},{key:"getViewer",value:function(){return{viewer:this.viewer,container:this.container}}},{key:"componentDidUpdate",value:function(){this.viewer&&!this.isIdentical()&&this.viewerInit()}},{key:"componentWillUnmount",value:function(){this.viewer&&this.viewer.destroy()}},{key:"isIdentical",value:function(){var e=this.viewer.images||[];this.viewer.update();var t=this.viewer.images||[];return!e.length&&!t.length||e.length===t.length&&t.every(function(t,n){return e[n]===t&&t.src===e[n].src})}},{key:"viewerInit",value:function(){this.viewer&&this.viewer.destroy();var e=this.props,n=e.options,i=void 0===n?{}:n,o=e.children;this.viewer=new t(this.container,r({navbar:!(!Array.isArray(o)||!o.length)},i))}},{key:"render",value:function(){var e=this,t=this.props,i=(t.options,t.children),o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["options","children"]);return n.createElement("div",r({ref:function(t){e.container=t}},o),i)}}]),a}()}); |
{ | ||
"name": "rc-viewer", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Image viewer component for react, supports rotation, scale, zoom and so on, based on viewer.js", | ||
@@ -8,2 +8,3 @@ "main": "dist/rc-viewer.js", | ||
"build": "rollup -c", | ||
"buildw": "webpack --progress --hide-modules --config ./webpack.config.js ", | ||
"release": "npm run build && npm publish" | ||
@@ -38,2 +39,4 @@ }, | ||
"babel-core": "^6.26.3", | ||
"babel-loader": "^7.1.4", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-external-helpers": "^6.22.0", | ||
@@ -46,4 +49,6 @@ "babel-preset-env": "^1.7.0", | ||
"rollup-plugin-commonjs": "^9.1.3", | ||
"rollup-plugin-uglify": "^3.0.0" | ||
"rollup-plugin-uglify": "^3.0.0", | ||
"webpack": "^4.8.3", | ||
"webpack-cli": "^2.1.4" | ||
} | ||
} |
@@ -34,3 +34,3 @@ import React, { Component } from 'react' | ||
if (imgarr.length !== imgarr2.length) return false | ||
return imgarr2.every((img,index) => imgarr[index] === img) | ||
return imgarr2.every((img,index) => imgarr[index] === img && img.src === imgarr[index].src) | ||
} | ||
@@ -37,0 +37,0 @@ viewerInit () { |
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
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
22637
61
13