react-pdf-js
Advanced tools
Comparing version 1.0.16 to 1.0.17
@@ -82,3 +82,7 @@ 'use strict'; | ||
if (newProps.file && newProps.file !== this.props.file || newProps.content && newProps.content !== this.props.content) { | ||
var newDocInit = newProps.documentInitParameters; | ||
var docInit = this.props.documentInitParameters; | ||
if (newProps.file && newProps.file !== this.props.file || newProps.content && newProps.content !== this.props.content || newDocInit && newDocInit !== docInit || newDocInit && docInit && newDocInit.url !== docInit.url) { | ||
this.loadPDFDocument(newProps); | ||
@@ -148,2 +152,4 @@ } | ||
this.loadByteArray(byteArray); | ||
} else if (!!props.documentInitParameters) { | ||
return window.PDFJS.getDocument(props.documentInitParameters).then(this.onDocumentComplete); | ||
} else { | ||
@@ -190,2 +196,3 @@ throw new Error('react-pdf-js works with a file(URL) or (base64)content. At least one needs to be provided!'); | ||
file: _react2.default.PropTypes.string, | ||
documentInitParameters: _react2.default.PropTypes.object, | ||
loading: _react2.default.PropTypes.any, | ||
@@ -192,0 +199,0 @@ page: _react2.default.PropTypes.number, |
{ | ||
"name": "react-pdf-js", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "A React component to wrap PDF.js", | ||
@@ -33,6 +33,6 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"pdfjs-dist": "1.5.292" | ||
"pdfjs-dist": "1.5.294" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "6.9.0", | ||
"babel-cli": "6.10.1", | ||
"babel-core": "6.9.1", | ||
@@ -51,3 +51,3 @@ "babel-eslint": "6.0.4", | ||
"eslint-plugin-react": "5.1.1", | ||
"eslint-plugin-jsx-a11y": "1.4.0", | ||
"eslint-plugin-jsx-a11y": "1.4.2", | ||
"react": "15.1.0", | ||
@@ -54,0 +54,0 @@ "rifraf": "2.0.2", |
@@ -19,4 +19,10 @@ import React from 'react'; | ||
const { pdf } = this.state; | ||
const newDocInit = newProps.documentInitParameters; | ||
const docInit = this.props.documentInitParameters; | ||
if ((newProps.file && newProps.file !== this.props.file) || | ||
(newProps.content && newProps.content !== this.props.content)) { | ||
(newProps.content && newProps.content !== this.props.content) || | ||
(newDocInit && newDocInit !== docInit) || | ||
(newDocInit && docInit && newDocInit.url !== docInit.url)) { | ||
this.loadPDFDocument(newProps); | ||
@@ -73,2 +79,5 @@ } | ||
this.loadByteArray(byteArray); | ||
} else if (!!props.documentInitParameters) { | ||
return window.PDFJS.getDocument(props.documentInitParameters) | ||
.then(this.onDocumentComplete); | ||
} else { | ||
@@ -102,2 +111,3 @@ throw new Error('react-pdf-js works with a file(URL) or (base64)content. At least one needs to be provided!'); | ||
file: React.PropTypes.string, | ||
documentInitParameters: React.PropTypes.object, | ||
loading: React.PropTypes.any, | ||
@@ -104,0 +114,0 @@ page: React.PropTypes.number, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2561136
52496
4
+ Addedpdfjs-dist@1.5.294(transitive)
- Removedpdfjs-dist@1.5.292(transitive)
Updatedpdfjs-dist@1.5.294