Skip to content

[lexical-playground] Feature: Add PagesExtension#8322

Merged
etrepum merged 33 commits intofacebook:mainfrom
ibastawisi:pages
Apr 12, 2026
Merged

[lexical-playground] Feature: Add PagesExtension#8322
etrepum merged 33 commits intofacebook:mainfrom
ibastawisi:pages

Conversation

@ibastawisi
Copy link
Copy Markdown
Contributor

Description

This pull request introduces a comprehensive "Pages" feature to the Lexical Playground, adding support for document pagination, page setup, and print-friendly styling. The main changes include new node types for representing pages and their content, a page setup node for configuring size and margins, and significant CSS updates for print output and UI enhancements.

Pages feature and node architecture:

  • Added new node types: PageNode, PageContentNode, and PageSetupNode, along with supporting types and constants, to represent document pages, their content, and page setup (size, orientation, margins). These nodes manage pagination logic, page measurement, overflow/underflow handling, and serialization. [1] [2] [3] [4] [5] [6]
  • Integrated the PagesExtension into the main playground app, enabling the new pages functionality in the editor. [1] [2]

Print and UI enhancements:

  • Added print-specific CSS rules to ensure correct page rendering, hide non-editor elements, and optimize color and layout for printing. [1] [2]
  • Updated editor and dropdown styling, including new icons for page setup and improved submenu chevrons, and slightly increased the editor shell's maximum width. [1] [2] [3]

These changes lay the foundation for multi-page document editing and WYSIWYG print output in the Lexical Playground.

image

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Apr 12, 2026 4:11pm
lexical-playground Ready Ready Preview, Comment Apr 12, 2026 4:11pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 9, 2026
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Apr 9, 2026
Copy link
Copy Markdown
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

This is probably one of the most requested features and generally the trickiest to build! I haven't had time to do a close inspection yet, but here are some general notes on the architecture. Basically it could be made a lot less react-dependent (everything but the dropdown UI itself I think) and follow newer lexical conventions more closely to reduce boilerplate required for clone/serialization/etc.

Comment thread packages/lexical-playground/src/plugins/PagesExtension/PageNode.ts
Comment thread packages/lexical-playground/src/nodes/PageNode/PageNode.ts Outdated
Comment thread packages/lexical-playground/src/nodes/PageNode/PageSetupNode.tsx Outdated
Comment thread packages/lexical-playground/src/plugins/PagesExtension/PageSetupDropdown.tsx Outdated
Comment thread packages/lexical-playground/src/plugins/PagesExtension/PagesPlugin.tsx Outdated
…roving page navigation logic. Removed unnecessary dataset checks and refined selection handling for page breaks and previous siblings.
Comment thread packages/lexical-playground/src/plugins/PagesExtension/PagesExtension.ts Outdated
dependabot Bot and others added 3 commits April 12, 2026 08:47
…ith 42 updates (facebook#8347)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bob Ippolito <bob@redivi.com>
Copy link
Copy Markdown
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

I think we're good to merge this and any improvements to the TextNode splitting or anything else can be addressed in follow-ups!

@etrepum etrepum added this pull request to the merge queue Apr 12, 2026
Merged via the queue into facebook:main with commit 56e975b Apr 12, 2026
37 checks passed
@etrepum etrepum mentioned this pull request Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants