feat(paginate): repeat flag and stepwise createPaginator API - #3497
Merged
Conversation
…eights paginate(root, height) becomes the constant-height loop over the sealed iterator, keeping its MAX_PAGES backstop. Iterator callers pass a height per next() call, own their termination, and cannot mutate in-flight state. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Names what comes back — fresh Fragments of the completed repeat items — instead of where the caller happens to put them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…how real page sizes Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
index.ts becomes pure re-exports, matching the one-unit-per-file layout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 3a91e3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Summary
Engine-only changes to
@react-pdf/paginate, split out of the pagination-rewrite branch so they can merge independently (the package has no released consumer yet).repeatflagItems flagged
repeat: true(leaf, column, row, lazy — not spacer/penalty) re-emit as fresh fragments at the head of every continuation of their parent column — thead-style repeating table headers.MAX_PAGESstays as backstop).repeatlazy re-materializes on every page it lands on with that page's number, via anorigintag on materialized fragments.fit/columnandfit/row's column children).createPaginatorSealed stepwise pagination:
next(height)fills exactly one page (a different height per call — the hook for page templates whose chrome varies per page),donesignals exhaustion.paginate(root, height)is now the constant-height loop over it, keeping itsMAX_PAGEScap. Internal state is deliberately unreachable from callers.Tests
19 new tests, every one ending in a visual snapshot per repo convention; the snapshot renderer now accepts per-page regions so varying-height pages render at their true sizes. 90/90 total, typecheck clean.
🤖 Generated with Claude Code