Skip to content

Add layout pagination package and demos - #54

Open
frouaix wants to merge 4 commits into
mainfrom
feature/layout-pagination
Open

frouaix wants to merge 4 commits into
mainfrom
feature/layout-pagination

Conversation

@frouaix

@frouaix frouaix commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a new vitrine-layout-pagination package with document/page models, measurement contracts, and an initial flow/presentation engine foundation
  • add standalone presentation and flow-document demo pages plus gallery demos for the two target scenarios
  • normalize the demo navigation ring and consolidate the regular text-selection demo path

Testing

  • pnpm lint
  • pnpm --filter vitrine-layout-pagination test
  • pnpm --filter vitrine-demo build

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 19:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new renderer-agnostic layout pagination package (vitrine-layout-pagination) and integrates standalone + gallery demos in vitrine-demo to showcase both presentation-style (explicit slides) and flow-style (paginated document) scenarios.

Changes:

  • Introduce packages/layout-pagination with document/page models, measurement delegate contracts, and an initial pagination engine (+ vitest tests).
  • Add demo scenarios + preview renderer and two standalone demo pages (presentation + flow), plus gallery demos.
  • Normalize demo navigation flow by redirecting the legacy “regular text selection debug” page and updating nav links.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
README.md Documents the new vitrine-layout-pagination workspace package.
pnpm-lock.yaml Adds the new package as a workspace importer with existing dev tool deps.
packages/layout-pagination/tsconfig.json TypeScript build output configuration for the new package.
packages/layout-pagination/package.json New publishable package metadata and scripts.
packages/layout-pagination/src/model.ts Document/page/node model types + page spec resolution helpers.
packages/layout-pagination/src/measure.ts Measurement delegate contract and null delegate implementation.
packages/layout-pagination/src/engine.ts Initial pagination engine implementation (flow + presentation).
packages/layout-pagination/src/index.ts Public exports for the new package.
packages/layout-pagination/test/page-spec.test.ts Unit tests covering page spec resolution + basic pagination behaviors.
packages/demo/package.json Adds workspace dependency on vitrine-layout-pagination.
packages/demo/vite.config.ts Adds standalone HTML entries and an alias for vitrine-layout-pagination.
packages/demo/layout-pagination-scenarios.ts Defines presentation + flow scenario documents and runs pagination.
packages/demo/layout-pagination-preview.ts Renders paginated results as Vitrine blocks for demos.
packages/demo/layout-pagination-presentation.html Standalone presentation preview page.
packages/demo/layout-pagination-presentation-setup.js Mounts the presentation preview component and cycles slides.
packages/demo/layout-pagination-flow.html Standalone flow document preview page.
packages/demo/layout-pagination-flow-setup.js Mounts the flow preview component.
packages/demo/demos/layout-pagination-presentation.ts Adds the presentation demo to the gallery registry.
packages/demo/demos/layout-pagination-flow.ts Adds the flow demo to the gallery registry.
packages/demo/gallery.ts Registers the new demos and adds a “Documents & Layout” category.
packages/demo/gallery.html Updates nav linkage to include the new flow demo in the ring.
packages/demo/component-demo.html Updates nav linkage to point to the consolidated text selection page.
packages/demo/text-selection.html Updates nav linkage to align with the new navigation ring.
packages/demo/text-selection-debug-texta.html Updates nav linkage to point into the new layout-pagination standalone demo.
packages/demo/text-selection-debug.html Redirects legacy debug page to the consolidated text selection page.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment on lines +1 to +5
import type { LayoutDocument } from 'vitrine-layout-pagination';
import { createPaginatedLayoutEngine } from 'vitrine-layout-pagination';

function paragraph(id: string, text: string): LayoutDocument['body'] {
return {
Comment on lines +236 to +240
case 'pageBreak':
return 0;
default:
return measureLeafNode(node, availableWidth, page, delegate, diagnostics).height;
}
}
}

if (node.kind === 'stack') {
Comment on lines +55 to +57
if (node.kind === 'fixed' && role !== 'body') {
throw new Error(`Nested fixed nodes are not allowed in ${role}.`);
}
frouaix and others added 3 commits July 21, 2026 14:54
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants