Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-pdf-highlighter

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-pdf-highlighter - npm Package Compare versions

Comparing version 6.0.0 to 6.1.0

7

dist/cjs/components/PdfHighlighter.d.ts

@@ -55,4 +55,7 @@ import "pdfjs-dist/web/pdf_viewer.css";

containerNodeRef: RefObject<HTMLDivElement>;
highlightReactRoots: {
[page: number]: Root;
highlightRoots: {
[page: number]: {
reactRoot: Root;
container: Element;
};
};

@@ -59,0 +62,0 @@ unsubscribe: () => void;

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

this.containerNode = null;
this.highlightReactRoots = {};
this.highlightRoots = {};
this.unsubscribe = () => { };

@@ -398,5 +398,6 @@ this.attachRef = () => {

for (let pageNumber = 1; pageNumber <= pdfDocument.numPages; pageNumber++) {
const root = this.highlightReactRoots[pageNumber];
if (root != null) {
this.renderHighlightLayer(root, pageNumber);
const highlightRoot = this.highlightRoots[pageNumber];
/** Need to check if container is still attached to the DOM as PDF.js can unload pages. */
if (highlightRoot && highlightRoot.container.isConnected) {
this.renderHighlightLayer(highlightRoot.reactRoot, pageNumber);
}

@@ -406,5 +407,8 @@ else {

if (highlightLayer) {
const root = (0, client_1.createRoot)(highlightLayer);
this.highlightReactRoots[pageNumber] = root;
this.renderHighlightLayer(root, pageNumber);
const reactRoot = (0, client_1.createRoot)(highlightLayer);
this.highlightRoots[pageNumber] = {
reactRoot,
container: highlightLayer,
};
this.renderHighlightLayer(reactRoot, pageNumber);
}

@@ -411,0 +415,0 @@ }

@@ -55,4 +55,7 @@ import "pdfjs-dist/web/pdf_viewer.css";

containerNodeRef: RefObject<HTMLDivElement>;
highlightReactRoots: {
[page: number]: Root;
highlightRoots: {
[page: number]: {
reactRoot: Root;
container: Element;
};
};

@@ -59,0 +62,0 @@ unsubscribe: () => void;

@@ -37,3 +37,3 @@ import "pdfjs-dist/web/pdf_viewer.css";

this.containerNode = null;
this.highlightReactRoots = {};
this.highlightRoots = {};
this.unsubscribe = () => { };

@@ -369,5 +369,6 @@ this.attachRef = () => {

for (let pageNumber = 1; pageNumber <= pdfDocument.numPages; pageNumber++) {
const root = this.highlightReactRoots[pageNumber];
if (root != null) {
this.renderHighlightLayer(root, pageNumber);
const highlightRoot = this.highlightRoots[pageNumber];
/** Need to check if container is still attached to the DOM as PDF.js can unload pages. */
if (highlightRoot && highlightRoot.container.isConnected) {
this.renderHighlightLayer(highlightRoot.reactRoot, pageNumber);
}

@@ -377,5 +378,8 @@ else {

if (highlightLayer) {
const root = createRoot(highlightLayer);
this.highlightReactRoots[pageNumber] = root;
this.renderHighlightLayer(root, pageNumber);
const reactRoot = createRoot(highlightLayer);
this.highlightRoots[pageNumber] = {
reactRoot,
container: highlightLayer,
};
this.renderHighlightLayer(reactRoot, pageNumber);
}

@@ -382,0 +386,0 @@ }

{
"name": "react-pdf-highlighter",
"version": "6.0.0",
"version": "6.1.0",
"description": "Set of React components for PDF annotation",

@@ -5,0 +5,0 @@ "author": "Artem Tyurin <artem.tyurin@gmail.com>",

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