@mikecousins/react-pdf
Advanced tools
Comparing version 5.5.0 to 5.5.1
@@ -0,25 +1,18 @@ | ||
import pdfjs from '@bundled-es-modules/pdfjs-dist'; | ||
import React from 'react'; | ||
declare type ComponentProps = { | ||
file: string; | ||
onDocumentComplete: (numPages: number) => void; | ||
onPageLoaded: () => void; | ||
page?: number; | ||
scale?: number; | ||
rotate?: number; | ||
cMapUrl?: string; | ||
cMapPacked?: boolean; | ||
workerSrc?: string; | ||
withCredentials?: boolean; | ||
declare type ComponentRenderProps = HookReturnValues & { | ||
canvas: React.ReactElement; | ||
}; | ||
declare const Pdf: { | ||
({ file, onDocumentComplete, onPageLoaded, page, scale, rotate, cMapUrl, cMapPacked, workerSrc, withCredentials, }: ComponentProps): JSX.Element; | ||
defaultProps: { | ||
onDocumentComplete: () => void; | ||
onPageLoaded: () => void; | ||
}; | ||
}; | ||
declare const Pdf: React.ForwardRefExoticComponent<Pick<HookProps, "file" | "onDocumentLoadSuccess" | "onDocumentLoadFail" | "onPageLoadSuccess" | "onPageLoadFail" | "onPageRenderSuccess" | "onPageRenderFail" | "scale" | "rotate" | "page" | "cMapUrl" | "cMapPacked" | "workerSrc" | "withCredentials"> & React.CanvasHTMLAttributes<HTMLCanvasElement> & { | ||
children?: ((renderProps: ComponentRenderProps) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>) | undefined; | ||
} & React.RefAttributes<HTMLCanvasElement | null>>; | ||
declare type HookProps = { | ||
canvasEl: React.RefObject<HTMLCanvasElement>; | ||
canvasRef: React.RefObject<HTMLCanvasElement | null>; | ||
file: string; | ||
onPageLoaded: () => void; | ||
onDocumentLoadSuccess?: (document: pdfjs.PDFDocumentProxy) => void; | ||
onDocumentLoadFail?: () => void; | ||
onPageLoadSuccess?: (page: pdfjs.PDFPageProxy) => void; | ||
onPageLoadFail?: () => void; | ||
onPageRenderSuccess?: (page: pdfjs.PDFPageProxy) => void; | ||
onPageRenderFail?: () => void; | ||
scale?: number; | ||
@@ -33,3 +26,7 @@ rotate?: number; | ||
}; | ||
export declare const usePdf: ({ canvasEl, file, onPageLoaded, scale, rotate, page, cMapUrl, cMapPacked, workerSrc, withCredentials, }: HookProps) => any[]; | ||
declare type HookReturnValues = { | ||
pdfDocument: pdfjs.PDFDocumentProxy | undefined; | ||
pdfPage: pdfjs.PDFPageProxy | undefined; | ||
}; | ||
export declare const usePdf: ({ canvasRef, file, onDocumentLoadSuccess, onDocumentLoadFail, onPageLoadSuccess, onPageLoadFail, onPageRenderSuccess, onPageRenderFail, scale, rotate, page, cMapUrl, cMapPacked, workerSrc, withCredentials, }: HookProps) => HookReturnValues; | ||
export default Pdf; |
@@ -7,10 +7,53 @@ 'use strict'; | ||
var pdfjs = _interopDefault(require('pdfjs-dist')); | ||
var pdfjs = _interopDefault(require('@bundled-es-modules/pdfjs-dist')); | ||
var React = require('react'); | ||
var React__default = _interopDefault(React); | ||
var Pdf = function Pdf(_ref) { | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function isFunction(value) { | ||
return typeof value === 'function'; | ||
} | ||
var Pdf = | ||
/*#__PURE__*/ | ||
React__default.forwardRef(function (_ref, ref) { | ||
var file = _ref.file, | ||
onDocumentComplete = _ref.onDocumentComplete, | ||
onPageLoaded = _ref.onPageLoaded, | ||
onDocumentLoadSuccess = _ref.onDocumentLoadSuccess, | ||
onDocumentLoadFail = _ref.onDocumentLoadFail, | ||
onPageLoadSuccess = _ref.onPageLoadSuccess, | ||
onPageLoadFail = _ref.onPageLoadFail, | ||
onPageRenderSuccess = _ref.onPageRenderSuccess, | ||
onPageRenderFail = _ref.onPageRenderFail, | ||
page = _ref.page, | ||
@@ -22,8 +65,19 @@ scale = _ref.scale, | ||
workerSrc = _ref.workerSrc, | ||
withCredentials = _ref.withCredentials; | ||
var canvasEl = React.useRef(null); | ||
withCredentials = _ref.withCredentials, | ||
children = _ref.children, | ||
canvasProps = _objectWithoutPropertiesLoose(_ref, ["file", "onDocumentLoadSuccess", "onDocumentLoadFail", "onPageLoadSuccess", "onPageLoadFail", "onPageRenderSuccess", "onPageRenderFail", "page", "scale", "rotate", "cMapUrl", "cMapPacked", "workerSrc", "withCredentials", "children"]); | ||
var _usePdf = usePdf({ | ||
canvasEl: canvasEl, | ||
var canvasRef = React.useRef(null); | ||
React.useImperativeHandle(ref, function () { | ||
return canvasRef.current; | ||
}); | ||
var pdfData = usePdf({ | ||
canvasRef: canvasRef, | ||
file: file, | ||
onDocumentLoadSuccess: onDocumentLoadSuccess, | ||
onDocumentLoadFail: onDocumentLoadFail, | ||
onPageLoadSuccess: onPageLoadSuccess, | ||
onPageLoadFail: onPageLoadFail, | ||
onPageRenderSuccess: onPageRenderSuccess, | ||
onPageRenderFail: onPageRenderFail, | ||
page: page, | ||
@@ -35,23 +89,25 @@ scale: scale, | ||
workerSrc: workerSrc, | ||
withCredentials: withCredentials, | ||
onPageLoaded: onPageLoaded | ||
}), | ||
numPages = _usePdf[1]; | ||
React.useEffect(function () { | ||
onDocumentComplete(numPages); | ||
}, [numPages, onDocumentComplete]); | ||
return React__default.createElement("canvas", { | ||
ref: canvasEl | ||
withCredentials: withCredentials | ||
}); | ||
}; | ||
var canvas = React__default.createElement("canvas", Object.assign({}, canvasProps, { | ||
ref: canvasRef | ||
})); | ||
Pdf.defaultProps = { | ||
onDocumentComplete: function onDocumentComplete() {}, | ||
onPageLoaded: function onPageLoaded() {} | ||
}; | ||
if (isFunction(children)) { | ||
return children(_extends({ | ||
canvas: canvas | ||
}, pdfData)); | ||
} | ||
return canvas; | ||
}); | ||
var usePdf = function usePdf(_ref2) { | ||
var canvasEl = _ref2.canvasEl, | ||
var canvasRef = _ref2.canvasRef, | ||
file = _ref2.file, | ||
onPageLoaded = _ref2.onPageLoaded, | ||
onDocumentLoadSuccess = _ref2.onDocumentLoadSuccess, | ||
onDocumentLoadFail = _ref2.onDocumentLoadFail, | ||
onPageLoadSuccess = _ref2.onPageLoadSuccess, | ||
onPageLoadFail = _ref2.onPageLoadFail, | ||
onPageRenderSuccess = _ref2.onPageRenderSuccess, | ||
onPageRenderFail = _ref2.onPageRenderFail, | ||
_ref2$scale = _ref2.scale, | ||
@@ -71,8 +127,38 @@ scale = _ref2$scale === void 0 ? 1 : _ref2$scale, | ||
var _useState = React.useState(), | ||
pdf = _useState[0], | ||
setPdf = _useState[1]; | ||
pdfDocument = _useState[0], | ||
setPdfDocument = _useState[1]; | ||
var _useState2 = React.useState(), | ||
pdfPage = _useState2[0], | ||
setPdfPage = _useState2[1]; | ||
var renderTask = React.useRef(null); | ||
var onDocumentLoadSuccessRef = React.useRef(onDocumentLoadSuccess); | ||
var onDocumentLoadFailRef = React.useRef(onDocumentLoadFail); | ||
var onPageLoadSuccessRef = React.useRef(onPageLoadSuccess); | ||
var onPageLoadFailRef = React.useRef(onPageLoadFail); | ||
var onPageRenderSuccessRef = React.useRef(onPageRenderSuccess); | ||
var onPageRenderFailRef = React.useRef(onPageRenderFail); // assign callbacks to refs to avoid redrawing | ||
React.useEffect(function () { | ||
onDocumentLoadSuccessRef.current = onDocumentLoadSuccess; | ||
}, [onDocumentLoadSuccess]); | ||
React.useEffect(function () { | ||
onDocumentLoadFailRef.current = onDocumentLoadFail; | ||
}, [onDocumentLoadFail]); | ||
React.useEffect(function () { | ||
onPageLoadSuccessRef.current = onPageLoadSuccess; | ||
}, [onPageLoadSuccess]); | ||
React.useEffect(function () { | ||
onPageLoadFailRef.current = onPageLoadFail; | ||
}, [onPageLoadFail]); | ||
React.useEffect(function () { | ||
onPageRenderSuccessRef.current = onPageRenderSuccess; | ||
}, [onPageRenderSuccess]); | ||
React.useEffect(function () { | ||
onPageRenderFailRef.current = onPageRenderFail; | ||
}, [onPageRenderFail]); | ||
React.useEffect(function () { | ||
pdfjs.GlobalWorkerOptions.workerSrc = workerSrc; | ||
}, []); | ||
}, [workerSrc]); | ||
React.useEffect(function () { | ||
@@ -89,49 +175,89 @@ var config = { | ||
pdfjs.getDocument(config).promise.then(setPdf); | ||
}, [file, withCredentials, cMapUrl, cMapPacked]); // handle changes | ||
pdfjs.getDocument(config).promise.then(function (loadedPdfDocument) { | ||
setPdfDocument(loadedPdfDocument); | ||
if (isFunction(onDocumentLoadSuccessRef.current)) { | ||
onDocumentLoadSuccessRef.current(loadedPdfDocument); | ||
} | ||
}, function () { | ||
if (isFunction(onDocumentLoadFailRef.current)) { | ||
onDocumentLoadFailRef.current(); | ||
} | ||
}); | ||
}, [file, withCredentials, cMapUrl, cMapPacked]); | ||
React.useEffect(function () { | ||
if (pdf) { | ||
pdf.getPage(page).then(function (p) { | ||
return drawPDF(p); | ||
// draw a page of the pdf | ||
var drawPDF = function drawPDF(page) { | ||
// Because this page's rotation option overwrites pdf default rotation value, | ||
// calculating page rotation option value from pdf default and this component prop rotate. | ||
var rotation = rotate === 0 ? page.rotate : page.rotate + rotate; | ||
var dpRatio = window.devicePixelRatio; | ||
var adjustedScale = scale * dpRatio; | ||
var viewport = page.getViewport({ | ||
scale: adjustedScale, | ||
rotation: rotation | ||
}); | ||
} | ||
}, [pdf, page, scale, rotate, canvasEl]); // draw a page of the pdf | ||
var canvasEl = canvasRef.current; | ||
var drawPDF = function drawPDF(page) { | ||
// Because this page's rotation option overwrites pdf default rotation value, | ||
// calculating page rotation option value from pdf default and this component prop rotate. | ||
var rotation = rotate === 0 ? page.rotate : page.rotate + rotate; | ||
var dpRatio = 1; | ||
dpRatio = window.devicePixelRatio; | ||
var adjustedScale = scale * dpRatio; | ||
var viewport = page.getViewport({ | ||
scale: adjustedScale, | ||
rotation: rotation | ||
}); | ||
var canvas = canvasEl.current; | ||
if (!canvasEl) { | ||
return; | ||
} | ||
if (!canvas) { | ||
return; | ||
} | ||
var canvasContext = canvasEl.getContext('2d'); | ||
var canvasContext = canvas.getContext('2d'); | ||
canvas.style.width = viewport.width / dpRatio + "px"; | ||
canvas.style.height = viewport.height / dpRatio + "px"; | ||
canvas.height = viewport.height; | ||
canvas.width = viewport.width; | ||
var renderContext = { | ||
canvasContext: canvasContext, | ||
viewport: viewport | ||
if (!canvasContext) { | ||
return; | ||
} | ||
canvasEl.style.width = viewport.width / dpRatio + "px"; | ||
canvasEl.style.height = viewport.height / dpRatio + "px"; | ||
canvasEl.height = viewport.height; | ||
canvasEl.width = viewport.width; // if previous render isn't done yet, we cancel it | ||
if (renderTask.current) { | ||
renderTask.current.cancel(); | ||
return; | ||
} | ||
renderTask.current = page.render({ | ||
canvasContext: canvasContext, | ||
viewport: viewport | ||
}); | ||
return renderTask.current.promise.then(function () { | ||
renderTask.current = null; | ||
if (isFunction(onPageRenderSuccessRef.current)) { | ||
onPageRenderSuccessRef.current(page); | ||
} | ||
}, function (err) { | ||
renderTask.current = null; // @ts-ignore typings are outdated | ||
if (err && err.name === 'RenderingCancelledException') { | ||
drawPDF(page); | ||
} else if (isFunction(onPageRenderFailRef.current)) { | ||
onPageRenderFailRef.current(); | ||
} | ||
}); | ||
}; | ||
page.render(renderContext).promise.then(onPageLoaded); | ||
if (pdfDocument) { | ||
pdfDocument.getPage(page).then(function (loadedPdfPage) { | ||
setPdfPage(loadedPdfPage); | ||
if (isFunction(onPageLoadSuccessRef.current)) { | ||
onPageLoadSuccessRef.current(loadedPdfPage); | ||
} | ||
drawPDF(loadedPdfPage); | ||
}, function () { | ||
if (isFunction(onPageLoadFailRef.current)) { | ||
onPageLoadFailRef.current(); | ||
} | ||
}); | ||
} | ||
}, [canvasRef, page, pdfDocument, rotate, scale]); | ||
return { | ||
pdfDocument: pdfDocument, | ||
pdfPage: pdfPage | ||
}; | ||
var loading = React.useMemo(function () { | ||
return !pdf; | ||
}, [pdf]); | ||
var numPages = React.useMemo(function () { | ||
return pdf ? pdf._pdfInfo.numPages : null; | ||
}, [pdf]); | ||
return [loading, numPages]; | ||
}; | ||
@@ -138,0 +264,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("pdfjs-dist")),r=require("react"),o=e(r),a=function(e){var t=e.file,a=e.onDocumentComplete,i=e.onPageLoaded,c=e.page,u=e.scale,d=e.rotate,s=e.cMapUrl,f=e.cMapPacked,l=e.workerSrc,p=e.withCredentials,v=r.useRef(null),h=n({canvasEl:v,file:t,page:c,scale:u,rotate:d,cMapUrl:s,cMapPacked:f,workerSrc:l,withCredentials:p,onPageLoaded:i})[1];return r.useEffect((function(){a(h)}),[h,a]),o.createElement("canvas",{ref:v})};a.defaultProps={onDocumentComplete:function(){},onPageLoaded:function(){}};var n=function(e){var o=e.canvasEl,a=e.file,n=e.onPageLoaded,i=e.scale,c=void 0===i?1:i,u=e.rotate,d=void 0===u?0:u,s=e.page,f=void 0===s?1:s,l=e.cMapUrl,p=e.cMapPacked,v=e.workerSrc,h=void 0===v?"//cdnjs.cloudflare.com/ajax/libs/pdf.js/"+t.version+"/pdf.worker.js":v,g=e.withCredentials,w=void 0!==g&&g,P=r.useState(),m=P[0],M=P[1];r.useEffect((function(){t.GlobalWorkerOptions.workerSrc=h}),[]),r.useEffect((function(){var e={url:a,withCredentials:w};l&&(e.cMapUrl=l,e.cMapPacked=p),t.getDocument(e).promise.then(M)}),[a,w,l,p]),r.useEffect((function(){m&&m.getPage(f).then((function(e){return k(e)}))}),[m,f,c,d,o]);var k=function(e){var t;t=window.devicePixelRatio;var r=e.getViewport({scale:c*t,rotation:0===d?e.rotate:e.rotate+d}),a=o.current;if(a){var i=a.getContext("2d");a.style.width=r.width/t+"px",a.style.height=r.height/t+"px",a.height=r.height,a.width=r.width,e.render({canvasContext:i,viewport:r}).promise.then(n)}};return[r.useMemo((function(){return!m}),[m]),r.useMemo((function(){return m?m._pdfInfo.numPages:null}),[m])]};exports.default=a,exports.usePdf=n; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("@bundled-es-modules/pdfjs-dist")),r=require("react"),t=e(r);function c(){return(c=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}function a(e){return"function"==typeof e}var o=t.forwardRef((function(e,n){var o=e.file,i=e.onDocumentLoadSuccess,s=e.onDocumentLoadFail,f=e.onPageLoadSuccess,d=e.onPageLoadFail,l=e.onPageRenderSuccess,p=e.onPageRenderFail,g=e.page,v=e.scale,P=e.rotate,h=e.cMapUrl,w=e.cMapPacked,R=e.workerSrc,S=e.withCredentials,m=e.children,L=function(e,n){if(null==e)return{};var r,t,c={},a=Object.keys(e);for(t=0;t<a.length;t++)n.indexOf(r=a[t])>=0||(c[r]=e[r]);return c}(e,["file","onDocumentLoadSuccess","onDocumentLoadFail","onPageLoadSuccess","onPageLoadFail","onPageRenderSuccess","onPageRenderFail","page","scale","rotate","cMapUrl","cMapPacked","workerSrc","withCredentials","children"]),k=r.useRef(null);r.useImperativeHandle(n,(function(){return k.current}));var F=u({canvasRef:k,file:o,onDocumentLoadSuccess:i,onDocumentLoadFail:s,onPageLoadSuccess:f,onPageLoadFail:d,onPageRenderSuccess:l,onPageRenderFail:p,page:g,scale:v,rotate:P,cMapUrl:h,cMapPacked:w,workerSrc:R,withCredentials:S}),j=t.createElement("canvas",Object.assign({},L,{ref:k}));return a(m)?m(c({canvas:j},F)):j})),u=function(e){var t=e.canvasRef,c=e.file,o=e.onDocumentLoadSuccess,u=e.onDocumentLoadFail,i=e.onPageLoadSuccess,s=e.onPageLoadFail,f=e.onPageRenderSuccess,d=e.onPageRenderFail,l=e.scale,p=void 0===l?1:l,g=e.rotate,v=void 0===g?0:g,P=e.page,h=void 0===P?1:P,w=e.cMapUrl,R=e.cMapPacked,S=e.workerSrc,m=void 0===S?"//cdnjs.cloudflare.com/ajax/libs/pdf.js/"+n.version+"/pdf.worker.js":S,L=e.withCredentials,k=void 0!==L&&L,F=r.useState(),j=F[0],x=F[1],E=r.useState(),M=E[0],D=E[1],b=r.useRef(null),y=r.useRef(o),C=r.useRef(u),O=r.useRef(i),U=r.useRef(s),q=r.useRef(f),_=r.useRef(d);return r.useEffect((function(){y.current=o}),[o]),r.useEffect((function(){C.current=u}),[u]),r.useEffect((function(){O.current=i}),[i]),r.useEffect((function(){U.current=s}),[s]),r.useEffect((function(){q.current=f}),[f]),r.useEffect((function(){_.current=d}),[d]),r.useEffect((function(){n.GlobalWorkerOptions.workerSrc=m}),[m]),r.useEffect((function(){var e={url:c,withCredentials:k};w&&(e.cMapUrl=w,e.cMapPacked=R),n.getDocument(e).promise.then((function(e){x(e),a(y.current)&&y.current(e)}),(function(){a(C.current)&&C.current()}))}),[c,k,w,R]),r.useEffect((function(){j&&j.getPage(h).then((function(e){D(e),a(O.current)&&O.current(e),function e(n){var r=window.devicePixelRatio,c=n.getViewport({scale:p*r,rotation:0===v?n.rotate:n.rotate+v}),o=t.current;if(o){var u=o.getContext("2d");if(u){if(o.style.width=c.width/r+"px",o.style.height=c.height/r+"px",o.height=c.height,o.width=c.width,!b.current)return b.current=n.render({canvasContext:u,viewport:c}),b.current.promise.then((function(){b.current=null,a(q.current)&&q.current(n)}),(function(r){b.current=null,r&&"RenderingCancelledException"===r.name?e(n):a(_.current)&&_.current()}));b.current.cancel()}}}(e)}),(function(){a(U.current)&&U.current()}))}),[t,h,j,v,p]),{pdfDocument:j,pdfPage:M}};exports.default=o,exports.usePdf=u; | ||
//# sourceMappingURL=react-pdf.cjs.production.min.js.map |
@@ -1,8 +0,51 @@ | ||
import pdfjs from 'pdfjs-dist'; | ||
import React, { useRef, useEffect, useState, useMemo } from 'react'; | ||
import pdfjs from '@bundled-es-modules/pdfjs-dist'; | ||
import React, { useRef, useImperativeHandle, useState, useEffect } from 'react'; | ||
var Pdf = function Pdf(_ref) { | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function isFunction(value) { | ||
return typeof value === 'function'; | ||
} | ||
var Pdf = | ||
/*#__PURE__*/ | ||
React.forwardRef(function (_ref, ref) { | ||
var file = _ref.file, | ||
onDocumentComplete = _ref.onDocumentComplete, | ||
onPageLoaded = _ref.onPageLoaded, | ||
onDocumentLoadSuccess = _ref.onDocumentLoadSuccess, | ||
onDocumentLoadFail = _ref.onDocumentLoadFail, | ||
onPageLoadSuccess = _ref.onPageLoadSuccess, | ||
onPageLoadFail = _ref.onPageLoadFail, | ||
onPageRenderSuccess = _ref.onPageRenderSuccess, | ||
onPageRenderFail = _ref.onPageRenderFail, | ||
page = _ref.page, | ||
@@ -14,8 +57,19 @@ scale = _ref.scale, | ||
workerSrc = _ref.workerSrc, | ||
withCredentials = _ref.withCredentials; | ||
var canvasEl = useRef(null); | ||
withCredentials = _ref.withCredentials, | ||
children = _ref.children, | ||
canvasProps = _objectWithoutPropertiesLoose(_ref, ["file", "onDocumentLoadSuccess", "onDocumentLoadFail", "onPageLoadSuccess", "onPageLoadFail", "onPageRenderSuccess", "onPageRenderFail", "page", "scale", "rotate", "cMapUrl", "cMapPacked", "workerSrc", "withCredentials", "children"]); | ||
var _usePdf = usePdf({ | ||
canvasEl: canvasEl, | ||
var canvasRef = useRef(null); | ||
useImperativeHandle(ref, function () { | ||
return canvasRef.current; | ||
}); | ||
var pdfData = usePdf({ | ||
canvasRef: canvasRef, | ||
file: file, | ||
onDocumentLoadSuccess: onDocumentLoadSuccess, | ||
onDocumentLoadFail: onDocumentLoadFail, | ||
onPageLoadSuccess: onPageLoadSuccess, | ||
onPageLoadFail: onPageLoadFail, | ||
onPageRenderSuccess: onPageRenderSuccess, | ||
onPageRenderFail: onPageRenderFail, | ||
page: page, | ||
@@ -27,23 +81,25 @@ scale: scale, | ||
workerSrc: workerSrc, | ||
withCredentials: withCredentials, | ||
onPageLoaded: onPageLoaded | ||
}), | ||
numPages = _usePdf[1]; | ||
useEffect(function () { | ||
onDocumentComplete(numPages); | ||
}, [numPages, onDocumentComplete]); | ||
return React.createElement("canvas", { | ||
ref: canvasEl | ||
withCredentials: withCredentials | ||
}); | ||
}; | ||
var canvas = React.createElement("canvas", Object.assign({}, canvasProps, { | ||
ref: canvasRef | ||
})); | ||
Pdf.defaultProps = { | ||
onDocumentComplete: function onDocumentComplete() {}, | ||
onPageLoaded: function onPageLoaded() {} | ||
}; | ||
if (isFunction(children)) { | ||
return children(_extends({ | ||
canvas: canvas | ||
}, pdfData)); | ||
} | ||
return canvas; | ||
}); | ||
var usePdf = function usePdf(_ref2) { | ||
var canvasEl = _ref2.canvasEl, | ||
var canvasRef = _ref2.canvasRef, | ||
file = _ref2.file, | ||
onPageLoaded = _ref2.onPageLoaded, | ||
onDocumentLoadSuccess = _ref2.onDocumentLoadSuccess, | ||
onDocumentLoadFail = _ref2.onDocumentLoadFail, | ||
onPageLoadSuccess = _ref2.onPageLoadSuccess, | ||
onPageLoadFail = _ref2.onPageLoadFail, | ||
onPageRenderSuccess = _ref2.onPageRenderSuccess, | ||
onPageRenderFail = _ref2.onPageRenderFail, | ||
_ref2$scale = _ref2.scale, | ||
@@ -63,8 +119,38 @@ scale = _ref2$scale === void 0 ? 1 : _ref2$scale, | ||
var _useState = useState(), | ||
pdf = _useState[0], | ||
setPdf = _useState[1]; | ||
pdfDocument = _useState[0], | ||
setPdfDocument = _useState[1]; | ||
var _useState2 = useState(), | ||
pdfPage = _useState2[0], | ||
setPdfPage = _useState2[1]; | ||
var renderTask = useRef(null); | ||
var onDocumentLoadSuccessRef = useRef(onDocumentLoadSuccess); | ||
var onDocumentLoadFailRef = useRef(onDocumentLoadFail); | ||
var onPageLoadSuccessRef = useRef(onPageLoadSuccess); | ||
var onPageLoadFailRef = useRef(onPageLoadFail); | ||
var onPageRenderSuccessRef = useRef(onPageRenderSuccess); | ||
var onPageRenderFailRef = useRef(onPageRenderFail); // assign callbacks to refs to avoid redrawing | ||
useEffect(function () { | ||
onDocumentLoadSuccessRef.current = onDocumentLoadSuccess; | ||
}, [onDocumentLoadSuccess]); | ||
useEffect(function () { | ||
onDocumentLoadFailRef.current = onDocumentLoadFail; | ||
}, [onDocumentLoadFail]); | ||
useEffect(function () { | ||
onPageLoadSuccessRef.current = onPageLoadSuccess; | ||
}, [onPageLoadSuccess]); | ||
useEffect(function () { | ||
onPageLoadFailRef.current = onPageLoadFail; | ||
}, [onPageLoadFail]); | ||
useEffect(function () { | ||
onPageRenderSuccessRef.current = onPageRenderSuccess; | ||
}, [onPageRenderSuccess]); | ||
useEffect(function () { | ||
onPageRenderFailRef.current = onPageRenderFail; | ||
}, [onPageRenderFail]); | ||
useEffect(function () { | ||
pdfjs.GlobalWorkerOptions.workerSrc = workerSrc; | ||
}, []); | ||
}, [workerSrc]); | ||
useEffect(function () { | ||
@@ -81,49 +167,89 @@ var config = { | ||
pdfjs.getDocument(config).promise.then(setPdf); | ||
}, [file, withCredentials, cMapUrl, cMapPacked]); // handle changes | ||
pdfjs.getDocument(config).promise.then(function (loadedPdfDocument) { | ||
setPdfDocument(loadedPdfDocument); | ||
if (isFunction(onDocumentLoadSuccessRef.current)) { | ||
onDocumentLoadSuccessRef.current(loadedPdfDocument); | ||
} | ||
}, function () { | ||
if (isFunction(onDocumentLoadFailRef.current)) { | ||
onDocumentLoadFailRef.current(); | ||
} | ||
}); | ||
}, [file, withCredentials, cMapUrl, cMapPacked]); | ||
useEffect(function () { | ||
if (pdf) { | ||
pdf.getPage(page).then(function (p) { | ||
return drawPDF(p); | ||
// draw a page of the pdf | ||
var drawPDF = function drawPDF(page) { | ||
// Because this page's rotation option overwrites pdf default rotation value, | ||
// calculating page rotation option value from pdf default and this component prop rotate. | ||
var rotation = rotate === 0 ? page.rotate : page.rotate + rotate; | ||
var dpRatio = window.devicePixelRatio; | ||
var adjustedScale = scale * dpRatio; | ||
var viewport = page.getViewport({ | ||
scale: adjustedScale, | ||
rotation: rotation | ||
}); | ||
} | ||
}, [pdf, page, scale, rotate, canvasEl]); // draw a page of the pdf | ||
var canvasEl = canvasRef.current; | ||
var drawPDF = function drawPDF(page) { | ||
// Because this page's rotation option overwrites pdf default rotation value, | ||
// calculating page rotation option value from pdf default and this component prop rotate. | ||
var rotation = rotate === 0 ? page.rotate : page.rotate + rotate; | ||
var dpRatio = 1; | ||
dpRatio = window.devicePixelRatio; | ||
var adjustedScale = scale * dpRatio; | ||
var viewport = page.getViewport({ | ||
scale: adjustedScale, | ||
rotation: rotation | ||
}); | ||
var canvas = canvasEl.current; | ||
if (!canvasEl) { | ||
return; | ||
} | ||
if (!canvas) { | ||
return; | ||
} | ||
var canvasContext = canvasEl.getContext('2d'); | ||
var canvasContext = canvas.getContext('2d'); | ||
canvas.style.width = viewport.width / dpRatio + "px"; | ||
canvas.style.height = viewport.height / dpRatio + "px"; | ||
canvas.height = viewport.height; | ||
canvas.width = viewport.width; | ||
var renderContext = { | ||
canvasContext: canvasContext, | ||
viewport: viewport | ||
if (!canvasContext) { | ||
return; | ||
} | ||
canvasEl.style.width = viewport.width / dpRatio + "px"; | ||
canvasEl.style.height = viewport.height / dpRatio + "px"; | ||
canvasEl.height = viewport.height; | ||
canvasEl.width = viewport.width; // if previous render isn't done yet, we cancel it | ||
if (renderTask.current) { | ||
renderTask.current.cancel(); | ||
return; | ||
} | ||
renderTask.current = page.render({ | ||
canvasContext: canvasContext, | ||
viewport: viewport | ||
}); | ||
return renderTask.current.promise.then(function () { | ||
renderTask.current = null; | ||
if (isFunction(onPageRenderSuccessRef.current)) { | ||
onPageRenderSuccessRef.current(page); | ||
} | ||
}, function (err) { | ||
renderTask.current = null; // @ts-ignore typings are outdated | ||
if (err && err.name === 'RenderingCancelledException') { | ||
drawPDF(page); | ||
} else if (isFunction(onPageRenderFailRef.current)) { | ||
onPageRenderFailRef.current(); | ||
} | ||
}); | ||
}; | ||
page.render(renderContext).promise.then(onPageLoaded); | ||
if (pdfDocument) { | ||
pdfDocument.getPage(page).then(function (loadedPdfPage) { | ||
setPdfPage(loadedPdfPage); | ||
if (isFunction(onPageLoadSuccessRef.current)) { | ||
onPageLoadSuccessRef.current(loadedPdfPage); | ||
} | ||
drawPDF(loadedPdfPage); | ||
}, function () { | ||
if (isFunction(onPageLoadFailRef.current)) { | ||
onPageLoadFailRef.current(); | ||
} | ||
}); | ||
} | ||
}, [canvasRef, page, pdfDocument, rotate, scale]); | ||
return { | ||
pdfDocument: pdfDocument, | ||
pdfPage: pdfPage | ||
}; | ||
var loading = useMemo(function () { | ||
return !pdf; | ||
}, [pdf]); | ||
var numPages = useMemo(function () { | ||
return pdf ? pdf._pdfInfo.numPages : null; | ||
}, [pdf]); | ||
return [loading, numPages]; | ||
}; | ||
@@ -130,0 +256,0 @@ |
{ | ||
"name": "@mikecousins/react-pdf", | ||
"version": "5.5.0", | ||
"version": "5.5.1", | ||
"description": "Simple React component to wrap up PDF.js. The easiest way to render PDFs in your React app.", | ||
@@ -43,7 +43,7 @@ "author": "mikecousins", | ||
"@testing-library/react": "9.4.0", | ||
"@types/jest": "24.9.0", | ||
"@types/jest": "25.1.2", | ||
"@types/pdfjs-dist": "2.1.3", | ||
"@types/react": "16.9.17", | ||
"@types/react-dom": "16.9.4", | ||
"husky": "4.0.10", | ||
"@types/react": "16.9.19", | ||
"@types/react-dom": "16.9.5", | ||
"husky": "4.2.3", | ||
"jest-canvas-mock": "^2.2.0", | ||
@@ -57,4 +57,4 @@ "react": "16.12.0", | ||
"dependencies": { | ||
"pdfjs-dist": "2.2.228" | ||
"@bundled-es-modules/pdfjs-dist": "^2.2.228-alpha1" | ||
} | ||
} |
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
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
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
70852
507
1
+ Added@bundled-es-modules/pdfjs-dist@2.16.106(transitive)
- Removedpdfjs-dist@2.2.228
- Removed@webassemblyjs/ast@1.9.0(transitive)
- Removed@webassemblyjs/floating-point-hex-parser@1.9.0(transitive)
- Removed@webassemblyjs/helper-api-error@1.9.0(transitive)
- Removed@webassemblyjs/helper-buffer@1.9.0(transitive)
- Removed@webassemblyjs/helper-code-frame@1.9.0(transitive)
- Removed@webassemblyjs/helper-fsm@1.9.0(transitive)
- Removed@webassemblyjs/helper-module-context@1.9.0(transitive)
- Removed@webassemblyjs/helper-wasm-bytecode@1.9.0(transitive)
- Removed@webassemblyjs/helper-wasm-section@1.9.0(transitive)
- Removed@webassemblyjs/ieee754@1.9.0(transitive)
- Removed@webassemblyjs/leb128@1.9.0(transitive)
- Removed@webassemblyjs/utf8@1.9.0(transitive)
- Removed@webassemblyjs/wasm-edit@1.9.0(transitive)
- Removed@webassemblyjs/wasm-gen@1.9.0(transitive)
- Removed@webassemblyjs/wasm-opt@1.9.0(transitive)
- Removed@webassemblyjs/wasm-parser@1.9.0(transitive)
- Removed@webassemblyjs/wast-parser@1.9.0(transitive)
- Removed@webassemblyjs/wast-printer@1.9.0(transitive)
- Removed@xtuc/ieee754@1.2.0(transitive)
- Removed@xtuc/long@4.2.2(transitive)
- Removedacorn@6.4.2(transitive)
- Removedajv@6.12.6(transitive)
- Removedajv-errors@1.0.1(transitive)
- Removedajv-keywords@3.5.2(transitive)
- Removedanymatch@2.0.03.1.3(transitive)
- Removedaproba@1.2.0(transitive)
- Removedarr-diff@4.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-unique@0.3.2(transitive)
- Removedasn1.js@4.10.1(transitive)
- Removedassert@1.5.1(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedasync-each@1.0.6(transitive)
- Removedatob@2.1.2(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase@0.11.2(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbig.js@5.2.2(transitive)
- Removedbinary-extensions@1.13.12.3.0(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbluebird@3.7.2(transitive)
- Removedbn.js@4.12.15.2.1(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@2.3.23.0.3(transitive)
- Removedbrorand@1.1.0(transitive)
- Removedbrowserify-aes@1.2.0(transitive)
- Removedbrowserify-cipher@1.0.1(transitive)
- Removedbrowserify-des@1.0.2(transitive)
- Removedbrowserify-rsa@4.1.1(transitive)
- Removedbrowserify-sign@4.2.3(transitive)
- Removedbrowserify-zlib@0.2.0(transitive)
- Removedbuffer@4.9.2(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedbuffer-xor@1.0.3(transitive)
- Removedbuiltin-status-codes@3.0.0(transitive)
- Removedcacache@12.0.4(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedcall-bind@1.0.8(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removedchokidar@2.1.83.6.0(transitive)
- Removedchownr@1.1.4(transitive)
- Removedchrome-trace-event@1.0.4(transitive)
- Removedcipher-base@1.0.6(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcommondir@1.0.1(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconcat-stream@1.6.2(transitive)
- Removedconsole-browserify@1.2.0(transitive)
- Removedconstants-browserify@1.0.0(transitive)
- Removedcopy-concurrently@1.0.5(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcreate-ecdh@4.0.4(transitive)
- Removedcreate-hash@1.2.0(transitive)
- Removedcreate-hmac@1.1.7(transitive)
- Removedcrypto-browserify@3.12.1(transitive)
- Removedcyclist@1.0.2(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removeddes.js@1.1.0(transitive)
- Removeddiffie-hellman@5.0.3(transitive)
- Removeddomain-browser@1.2.0(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedduplexify@3.7.1(transitive)
- Removedelliptic@6.6.1(transitive)
- Removedemojis-list@3.0.0(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedenhanced-resolve@4.5.0(transitive)
- Removederrno@0.1.8(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedeslint-scope@4.0.3(transitive)
- Removedesrecurse@4.3.0(transitive)
- Removedestraverse@4.3.05.3.0(transitive)
- Removedevents@3.3.0(transitive)
- Removedevp_bytestokey@1.0.3(transitive)
- Removedexpand-brackets@2.1.4(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@2.0.4(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedfiggy-pudding@3.5.2(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedfill-range@4.0.07.1.1(transitive)
- Removedfind-cache-dir@2.1.0(transitive)
- Removedfind-up@3.0.0(transitive)
- Removedflush-write-stream@1.1.1(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfrom2@2.3.0(transitive)
- Removedfs-write-stream-atomic@1.0.10(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfsevents@1.2.132.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.6(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@3.1.05.1.2(transitive)
- Removedgopd@1.2.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhash-base@3.0.5(transitive)
- Removedhash.js@1.1.7(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedhttps-browserify@1.0.0(transitive)
- Removedieee754@1.2.1(transitive)
- Removediferr@0.1.5(transitive)
- Removedimurmurhash@0.1.4(transitive)
- Removedinfer-owner@1.0.4(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.32.0.4(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-binary-path@1.0.12.1.0(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-glob@3.1.04.0.3(transitive)
- Removedis-number@3.0.07.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedis-wsl@1.1.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisobject@2.1.03.0.1(transitive)
- Removedjson-parse-better-errors@1.0.2(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson5@1.0.2(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedloader-runner@2.4.0(transitive)
- Removedloader-utils@1.4.2(transitive)
- Removedlocate-path@3.0.0(transitive)
- Removedlru-cache@5.1.1(transitive)
- Removedmake-dir@2.1.0(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedmd5.js@1.3.5(transitive)
- Removedmemory-fs@0.4.10.5.0(transitive)
- Removedmicromatch@3.1.10(transitive)
- Removedmiller-rabin@4.0.1(transitive)
- Removedminimalistic-assert@1.0.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmississippi@3.0.0(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedmove-concurrently@1.0.1(transitive)
- Removedms@2.0.0(transitive)
- Removednan@2.22.0(transitive)
- Removednanomatch@1.2.13(transitive)
- Removedneo-async@2.6.2(transitive)
- Removednode-ensure@0.0.0(transitive)
- Removednode-libs-browser@2.2.1(transitive)
- Removednormalize-path@2.1.13.0.0(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.assign@4.1.7(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-browserify@0.3.0(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@3.0.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedpako@1.0.11(transitive)
- Removedparallel-transform@1.2.0(transitive)
- Removedparse-asn1@5.1.7(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-browserify@0.0.1(transitive)
- Removedpath-dirname@1.0.2(transitive)
- Removedpath-exists@3.0.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpbkdf2@3.1.2(transitive)
- Removedpdfjs-dist@2.2.228(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedpify@4.0.1(transitive)
- Removedpkg-dir@3.0.0(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedprocess@0.11.10(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedpromise-inflight@1.0.1(transitive)
- Removedprr@1.0.1(transitive)
- Removedpublic-encrypt@4.0.3(transitive)
- Removedpump@2.0.13.0.2(transitive)
- Removedpumpify@1.5.1(transitive)
- Removedpunycode@1.4.12.3.1(transitive)
- Removedqs@6.13.1(transitive)
- Removedquerystring-es3@0.2.1(transitive)
- Removedrandombytes@2.1.0(transitive)
- Removedrandomfill@1.0.4(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedreaddirp@2.2.13.6.0(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedripemd160@2.0.2(transitive)
- Removedrun-queue@1.0.3(transitive)
- Removedsafe-buffer@5.1.25.2.1(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedschema-utils@0.4.71.0.0(transitive)
- Removedsemver@5.7.2(transitive)
- Removedserialize-javascript@4.0.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-value@2.0.1(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedsha.js@2.4.11(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-list-map@2.0.1(transitive)
- Removedsource-map@0.5.70.6.1(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-support@0.5.21(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedssri@6.0.2(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedstream-browserify@2.0.2(transitive)
- Removedstream-each@1.2.3(transitive)
- Removedstream-http@2.8.3(transitive)
- Removedstream-shift@1.0.3(transitive)
- Removedstring_decoder@1.1.11.3.0(transitive)
- Removedtapable@1.1.3(transitive)
- Removedterser@4.8.1(transitive)
- Removedterser-webpack-plugin@1.4.6(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedtimers-browserify@2.0.12(transitive)
- Removedto-arraybuffer@1.0.1(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.15.0.1(transitive)
- Removedtty-browserify@0.0.0(transitive)
- Removedtypedarray@0.0.6(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunique-filename@1.1.1(transitive)
- Removedunique-slug@2.0.2(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedupath@1.2.0(transitive)
- Removeduri-js@4.4.1(transitive)
- Removedurix@0.1.0(transitive)
- Removedurl@0.11.4(transitive)
- Removeduse@3.1.1(transitive)
- Removedutil@0.10.40.11.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedvm-browserify@1.1.2(transitive)
- Removedwatchpack@1.7.5(transitive)
- Removedwatchpack-chokidar2@2.0.1(transitive)
- Removedwebpack@4.47.0(transitive)
- Removedwebpack-sources@1.4.3(transitive)
- Removedworker-farm@1.7.0(transitive)
- Removedworker-loader@2.0.0(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedxtend@4.0.2(transitive)
- Removedy18n@4.0.3(transitive)
- Removedyallist@3.1.1(transitive)