Skip to content

Releases: DanielArnould/react-pdf-highlighter-extended

v8.1.0

Choose a tag to compare

@DanielArnould DanielArnould released this 05 Jul 10:11
d80742c

This is a minor upgrade from 8.0.0 mostly focussed on patching the security vulnerabilities of the older PDF.js version 2. Some behaviour enhancements have been made to selection as well.

Changes

  • Upgraded to PDF.js version 4.4.168. This fixes the high severity vulnerability from eval in older versions. #13
  • onSelection events are now registered by PointerUp events, rather than debounced selection changes. This simplifies the underlying behaviour quite a bit and makes it so selection tips are only displayed after the user lifts their mouse, like most other PDF viewers. Example app now includes a demonstration of how this could be applied to adding a highlight mode. #15
  • Added HighlightType property to Highlight in order to distinguish area and text highlights without needing content. #16

Full Changelog: v7.1.0...v8.1.0

v8.0.0

Choose a tag to compare

@DanielArnould DanielArnould released this 28 Feb 10:56

This is a substantial upgrade from 7.0.0 with numerous bugfixes and quality of life improvements. Efforts have been made to bring the syntax of this fork closer to the original and, where not possible, simplicity has been an upmost priority.

Changes

  • Added safety check to onProgress hook in PdfLoader to prevent potential races and resets to loading state after a PDF has been loaded in. #1 Thank you @orausch ❤.
  • Removed MouseSelectionRenderer and moved any necessary logic into MouseSelection.
  • Removed TipRenderer and moved any necessary logic into TipContainer.
  • Removed PdfLoaderContext in favour of callback style child components, much like the original branch.
  • Removed SelectionContext and TipContext, moving all functionality into a new PdfHighlighterContext. This streamlines the library massively and makes tasks like getting the current tip, setting a tip, getting the current selection, making a ghost highlight, etc. much simpler and accessible across an entire application.
  • Added strict mode to example app for better testing.
  • Fixed PDF document stacking by debouncing PDF Loading #2 .
  • Removed Comment and added generic types to ViewportHighlight. This allows the user to create their own Highlight types and typehint them inside their HighlightContext.
  • Added highlightTip to MonitoredHighlightContainer directly, so users can simply specify the component they want to display above a hovered highlight.
  • Added onCreateGhostHighlight and onRemoveGhostHighlight events
  • Renamed MonitoredHighlightContainer events
  • Added tip position clipping on the left of the screen.
  • Rolled back to PDF.js v2.16.05 for a better selection experience. This may change in future. #3 .
  • Added TypeDocs.
  • Updated example app.
  • Updated usage examples
  • Updated dependencies.

NOTE: This was labelled 7.1.0 originally, but since backward compatibility is broken, the version number is being updated to be semantically corect.

7.0.0

Choose a tag to compare

@DanielArnould DanielArnould released this 28 Nov 10:12

7.0.0

Here are some brief notes on what has been changed in this fork of react-pdf-highlighter. Note: this list is certainly not exhaustive, but efforts will be made to ensure future releases have clearer changelogs.

  • Exposed pdfScaleValue as a stateful prop
  • Made all components functional based
  • Updated PDF.js dependency to 3.8.162
  • Added onContextMenu event listeners to Highlight components
  • Fixed clamping bug / tips not being displayed correctly on ultrawide monitors
  • Exposed styling on all componenets
  • Added default dark grey background to PdfHighlighter
  • Removed generic types for Highlight and added GhostHighlight as a public type.
  • Exposed selection color styling and changed default color to blue.
  • Replaced callbacks for afterSelection with selectionTip prop and onSelectionFinished events.
  • Created useHighlightUtils, useTipContainerUtils, useTipViewerUtils, and useSelectionUtils hooks.
  • Removed callbacks for rendering highlights in PdfHighlighter and instead replaced it with expecting a user-defined HighlightContainer which will be supplied useHighlightUtils
  • Expoed viewer and tipViewerUtils as optionl reference callbacks in the PdfHighlighter. This allows more customisable control of displaying tips or accessing PDF.js settings
  • Changed PdfLoader props to accept document parameters inside of document. Also added onProgressParameters as a variable to beforeLoad
  • Added option to specify bounds for AreaHighlight, defaulted to the page in the example app.
  • Added documentation to almost all components
  • Lots of refactoring.