Socket
Socket
Sign inDemoInstall

react-pdf

Package Overview
Dependencies
84
Maintainers
1
Versions
143
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.3.3 to 7.4.0

33

dist/cjs/Document.d.ts

@@ -51,3 +51,34 @@ /**

onSourceSuccess?: OnSourceSuccess | undefined;
options?: Options | undefined;
options?: {
length?: number | null | undefined;
worker?: import("pdfjs-dist").PDFWorker | null | undefined;
ownerDocument?: HTMLDocument | null | undefined;
password?: string | null | undefined;
verbosity?: number | null | undefined;
isOffscreenCanvasSupported?: boolean | null | undefined;
httpHeaders?: Object | null | undefined;
withCredentials?: boolean | null | undefined;
rangeChunkSize?: number | null | undefined;
docBaseUrl?: string | null | undefined;
cMapUrl?: string | null | undefined;
cMapPacked?: boolean | null | undefined;
CMapReaderFactory?: Object | null | undefined;
useSystemFonts?: boolean | null | undefined;
standardFontDataUrl?: string | null | undefined;
StandardFontDataFactory?: Object | null | undefined;
useWorkerFetch?: boolean | null | undefined;
stopAtErrors?: boolean | null | undefined;
maxImageSize?: number | null | undefined;
isEvalSupported?: boolean | null | undefined;
canvasMaxAreaInBytes?: number | null | undefined;
disableFontFace?: boolean | null | undefined;
fontExtraProperties?: boolean | null | undefined;
enableXfa?: boolean | null | undefined;
disableRange?: boolean | null | undefined;
disableStream?: boolean | null | undefined;
disableAutoFetch?: boolean | null | undefined;
pdfBug?: boolean | null | undefined;
canvasFactory?: Object | null | undefined;
filterFactory?: Object | null | undefined;
} | undefined;
renderMode?: RenderMode | undefined;

@@ -54,0 +85,0 @@ rotate?: number | null | undefined;

2

dist/cjs/index.test.d.ts

@@ -13,3 +13,3 @@ import pdfjs from './pdfjs.js';

export type { ThumbnailProps } from './Thumbnail.js';
import './pdf.worker.entry';
import './pdf.worker.entry.js';
export { pdfjs, Document, Outline, Page, Thumbnail, useDocumentContext, useOutlineContext, usePageContext, };

@@ -23,2 +23,2 @@ "use strict";

exports.usePageContext = usePageContext_js_1.default;
require("./pdf.worker.entry");
require("./pdf.worker.entry.js");

@@ -127,6 +127,15 @@ "use strict";

const clonedViewport = viewport.clone({ dontFlip: true });
const parameters = {
const annotationLayerParameters = {
accessibilityManager: null,
annotationCanvasMap: null,
div: layer,
l10n: null,
page,
viewport: clonedViewport,
};
const renderParameters = {
annotations,
annotationStorage: pdf.annotationStorage,
div: layer,
// See https://github.com/mozilla/pdf.js/issues/17029
downloadManager: null,

@@ -141,3 +150,3 @@ imageResourcesPath,

try {
pdfjs_js_1.default.AnnotationLayer.render(parameters);
new pdfjs_js_1.default.AnnotationLayer(annotationLayerParameters).render(renderParameters);
// Intentional immediate callback

@@ -144,0 +153,0 @@ onRenderSuccess();

@@ -88,2 +88,6 @@ "use strict";

.then((nextSvg) => {
// See https://github.com/mozilla/pdf.js/issues/16745
if (!(nextSvg instanceof SVGElement)) {
throw new Error('getSVG returned unexpected result.');
}
svgDispatch({ type: 'RESOLVE', value: nextSvg });

@@ -90,0 +94,0 @@ })

@@ -76,5 +76,3 @@ /// <reference types="react" />

export type PasswordResponse = (typeof PasswordResponses)[keyof typeof PasswordResponses];
export type Options = NullableObject<Omit<DocumentInitParameters, KeyOfUnion<Source> | 'canvasMaxAreaInBytes'>> & {
canvasMaxAreaInBytes?: number | null;
};
export type Options = NullableObject<Omit<DocumentInitParameters, KeyOfUnion<Source>>>;
export type DocumentContextType = {

@@ -81,0 +79,0 @@ imageResourcesPath?: ImageResourcesPath;

@@ -51,3 +51,34 @@ /**

onSourceSuccess?: OnSourceSuccess | undefined;
options?: Options | undefined;
options?: {
length?: number | null | undefined;
worker?: import("pdfjs-dist").PDFWorker | null | undefined;
ownerDocument?: HTMLDocument | null | undefined;
password?: string | null | undefined;
verbosity?: number | null | undefined;
isOffscreenCanvasSupported?: boolean | null | undefined;
httpHeaders?: Object | null | undefined;
withCredentials?: boolean | null | undefined;
rangeChunkSize?: number | null | undefined;
docBaseUrl?: string | null | undefined;
cMapUrl?: string | null | undefined;
cMapPacked?: boolean | null | undefined;
CMapReaderFactory?: Object | null | undefined;
useSystemFonts?: boolean | null | undefined;
standardFontDataUrl?: string | null | undefined;
StandardFontDataFactory?: Object | null | undefined;
useWorkerFetch?: boolean | null | undefined;
stopAtErrors?: boolean | null | undefined;
maxImageSize?: number | null | undefined;
isEvalSupported?: boolean | null | undefined;
canvasMaxAreaInBytes?: number | null | undefined;
disableFontFace?: boolean | null | undefined;
fontExtraProperties?: boolean | null | undefined;
enableXfa?: boolean | null | undefined;
disableRange?: boolean | null | undefined;
disableStream?: boolean | null | undefined;
disableAutoFetch?: boolean | null | undefined;
pdfBug?: boolean | null | undefined;
canvasFactory?: Object | null | undefined;
filterFactory?: Object | null | undefined;
} | undefined;
renderMode?: RenderMode | undefined;

@@ -54,0 +85,0 @@ rotate?: number | null | undefined;

@@ -13,3 +13,3 @@ import pdfjs from './pdfjs.js';

export type { ThumbnailProps } from './Thumbnail.js';
import './pdf.worker.entry';
import './pdf.worker.entry.js';
export { pdfjs, Document, Outline, Page, Thumbnail, useDocumentContext, useOutlineContext, usePageContext, };

@@ -9,3 +9,3 @@ import pdfjs from './pdfjs.js';

import usePageContext from './shared/hooks/usePageContext.js';
import './pdf.worker.entry';
import './pdf.worker.entry.js';
export { pdfjs, Document, Outline, Page, Thumbnail, useDocumentContext, useOutlineContext, usePageContext, };

@@ -99,6 +99,15 @@ 'use client';

const clonedViewport = viewport.clone({ dontFlip: true });
const parameters = {
const annotationLayerParameters = {
accessibilityManager: null,
annotationCanvasMap: null,
div: layer,
l10n: null,
page,
viewport: clonedViewport,
};
const renderParameters = {
annotations,
annotationStorage: pdf.annotationStorage,
div: layer,
// See https://github.com/mozilla/pdf.js/issues/17029
downloadManager: null,

@@ -113,3 +122,3 @@ imageResourcesPath,

try {
pdfjs.AnnotationLayer.render(parameters);
new pdfjs.AnnotationLayer(annotationLayerParameters).render(renderParameters);
// Intentional immediate callback

@@ -116,0 +125,0 @@ onRenderSuccess();

@@ -60,2 +60,6 @@ import React, { useEffect, useMemo } from 'react';

.then((nextSvg) => {
// See https://github.com/mozilla/pdf.js/issues/16745
if (!(nextSvg instanceof SVGElement)) {
throw new Error('getSVG returned unexpected result.');
}
svgDispatch({ type: 'RESOLVE', value: nextSvg });

@@ -62,0 +66,0 @@ })

@@ -76,5 +76,3 @@ /// <reference types="react" />

export type PasswordResponse = (typeof PasswordResponses)[keyof typeof PasswordResponses];
export type Options = NullableObject<Omit<DocumentInitParameters, KeyOfUnion<Source> | 'canvasMaxAreaInBytes'>> & {
canvasMaxAreaInBytes?: number | null;
};
export type Options = NullableObject<Omit<DocumentInitParameters, KeyOfUnion<Source>>>;
export type DocumentContextType = {

@@ -81,0 +79,0 @@ imageResourcesPath?: ImageResourcesPath;

{
"name": "react-pdf",
"version": "7.3.3",
"version": "7.4.0",
"description": "Display PDFs in your React app as easily as if they were images.",

@@ -45,3 +45,3 @@ "type": "module",

"unit": "vitest",
"watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & yarn build-js-cjs-package & nodemon --watch src --ext css --exec \"yarn copy-styles\""
"watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & nodemon --watch src --ext css --exec \"yarn copy-styles\""
},

@@ -63,3 +63,3 @@ "keywords": [

"merge-refs": "^1.2.1",
"pdfjs-dist": "3.6.172",
"pdfjs-dist": "3.11.174",
"prop-types": "^15.6.2",

@@ -73,3 +73,2 @@ "tiny-invariant": "^1.0.0",

"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.0",
"@types/node": "*",

@@ -80,7 +79,5 @@ "@types/react": "*",

"eslint-config-wojtekmaj": "^0.9.0",
"husky": "^8.0.0",
"jsdom": "^21.1.0",
"nodemon": "^3.0.0",
"prettier": "^2.7.0",
"pretty-quick": "^3.1.0",
"prettier": "^3.0.0",
"react": "^18.2.0",

@@ -90,3 +87,3 @@ "react-dom": "^18.2.0",

"typescript": "^5.0.0",
"vitest": "^0.30.1",
"vitest": "^0.34.0",
"vitest-canvas-mock": "^0.2.2"

@@ -114,6 +111,6 @@ },

"type": "git",
"url": "https://github.com/wojtekmaj/react-pdf.git"
"url": "https://github.com/wojtekmaj/react-pdf.git",
"directory": "packages/react-pdf"
},
"funding": "https://github.com/wojtekmaj/react-pdf?sponsor=1",
"packageManager": "yarn@3.1.0"
"funding": "https://github.com/wojtekmaj/react-pdf?sponsor=1"
}

@@ -17,3 +17,3 @@ import pdfjs from './pdfjs.js';

import './pdf.worker.entry';
import './pdf.worker.entry.js';

@@ -20,0 +20,0 @@ export {

@@ -125,8 +125,3 @@ import type {

export type Options = NullableObject<
Omit<DocumentInitParameters, KeyOfUnion<Source> | 'canvasMaxAreaInBytes'>
> & {
// See https://github.com/mozilla/pdf.js/issues/16503
canvasMaxAreaInBytes?: number | null;
};
export type Options = NullableObject<Omit<DocumentInitParameters, KeyOfUnion<Source>>>;

@@ -133,0 +128,0 @@ /* Context types */

Sorry, the diff of this file is too big to display

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

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

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

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc