Repository navigation
Conversation
Lets hosts build pagination controls and page thumbnails without relying on internal DOM structure. Signed-off-by: Luis Amorim <principal@felps.zip>
Adds showThumbnails/thumbnailWidth props. Thumbnails render lazily, highlight the current page and navigate via goToPage. Signed-off-by: Luis Amorim <principal@felps.zip>
…n view Signed-off-by: Luis Amorim <principal@felps.zip>
5 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs: LibreSign/libresign#1863
Stacked on #176 (
feat/page-navigation). Until it is merged this PR also shows its commit; the thumbnails change is the last two commits only. Marked as draft for that reason.What does this change?
Adds an optional left sidebar with page thumbnails, built on the navigation API from #176.
showThumbnailsprop (defaultfalse): renders a sticky thumbnail sidebar. The existing layout is unchanged when off.thumbnailWidthprop (default120): thumbnail width in px.PDFThumbnails: lazy-rendered thumbnails (IntersectionObserver). It highlights the current page, keeps the active thumbnail in view, resets when the documents change, and emitsselect.Clicking a thumbnail calls
goToPage; the highlighted page followspdf-elements:page-change. Documented indocs/API.md.How was it tested?
All pass (123 tests). For a manual check, set
:show-thumbnails="true"in the demo and click thumbnails while scrolling.Checklist
npm run lint,npm run typecheck,npm run testandnpm run buildpass when applicable.