- Added safety check to
onProgresshook inPdfLoaderto prevent potential races and resets to loading state after a PDF has been loaded in. #1 Thank you @orausch ❤. - Removed
MouseSelectionRendererand moved any necessary logic intoMouseSelection. - Removed
TipRendererand moved any necessary logic intoTipContainer. - Removed
PdfLoaderContextin favour of callback style child components, much like the original branch. - Removed
SelectionContextandTipContext, moving all functionality into a newPdfHighlighterContext. 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
Commentand added generic types toViewportHighlight. This allows the user to create their own Highlight types and typehint them inside theirHighlightContext. - Added
highlightTiptoMonitoredHighlightContainerdirectly, so users can simply specify the component they want to display above a hovered highlight. - Added
onCreateGhostHighlightandonRemoveGhostHighlightevents - Renamed
MonitoredHighlightContainerevents - 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.
- 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, anduseSelectionUtilshooks. - Removed callbacks for rendering highlights in PdfHighlighter and instead replaced it with expecting a user-defined HighlightContainer which will be supplied
useHighlightUtils - Expoed
viewerandtipViewerUtilsas 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 addedonProgressParametersas a variable tobeforeLoad - Added option to specify bounds for AreaHighlight, defaulted to the page in the example app.
- Added documentation to almost all components
- Lots of refactoring.
- Support for React 18 (agentcooper#232)
- Fix for
usePdfCoordinates(agentcooper#244)
- Added support of multi-page highlights, thanks to @jonathanbyrne!
- Update PDF.js dependency to 2.2.228.
- Enabled hyperlinks inside the PDF document (thanks @steevn).
- Renamed
PdfAnnotatortoPdfHighlighterall over the code for naming consistency.