@tiptap-pro/extension-pages Changelog

Changelog for @tiptap-pro/extension-pages

0.22.1

Patch Changes

  • d43e16d: Match Microsoft Word for differentFirstPage and differentOddEven:

    • Empty type-specific header/footer slots (first / odd / even) now render empty in the editor instead of silently falling back to the default.
    • setDifferentOddEven(true) copies the default content into the odd slot so pages 1, 3, 5... keep showing the existing header/footer (Word continuity). Even pages start empty. setDifferentFirstPage does not copy (Word: first slot is a separate blank slot).
    • Toggling either different* flag while a header/footer overlay is open now refreshes the overlay so it shows the new variant right away.
    • setHeader / setFooter and the six typed setters (setHeader{FirstPage,Odd,Even} / setFooter{FirstPage,Odd,Even}) no longer corrupt storage to <p></p> when called while an overlay is open.

0.22.0

Minor Changes

  • e9cd180: Add resetHeaderTopMargin and resetFooterBottomMargin commands to clear the stored margin override and fall back to the active format's default. setHeaderTopMargin and setFooterBottomMargin now reject NaN inputs alongside negative values.

Patch Changes

  • c1e3695: Fix issues with pagination, header/footer sizing, and scrolling when the editor uses CSS zoom on mobile. The code now gets the correct scale directly from the element using getBoundingClientRect, instead of relying on storage.zoom, so page counts stay accurate even when the screen changes.

    It also recalculates the page count right away on first load, so long documents show the correct number without needing any interaction. The pagination wrapper’s min-height is rounded to whole pixels to prevent tiny layout changes from triggering unnecessary updates. Lastly, it uses the browser’s built-in scrollIntoView while zoomed, so typing no longer causes the view to jump across pages.

0.21.1

Patch Changes

  • a18577d: Fix header and footer editor overlays overflowing the page width when zoom is not 100%. Removed the width: ${100/zoom}% compensation on .tiptap-header-editor-container / .tiptap-footer-editor-container. The zoom property already scales the inner layout coordinate space by 1/zoom, so width: 100% (from the stylesheet) resolves correctly

0.21.0

Minor Changes

  • 53979aa: Expose header and footer inner editor event subscriptions through Pages storage and keep active header/footer state in sync on focus.

    New storage APIs:

    • editor.storage.pages.headerEditorOn / editor.storage.pages.headerEditorOff for subscribing to and unsubscribing from header inner editor events.
    • editor.storage.pages.footerEditorOn / editor.storage.pages.footerEditorOff for subscribing to and unsubscribing from footer inner editor events.

    Header/footer focus handling:

    • Header and footer focus now update activeEditor, activeEditorType, and activePageNumber immediately, so toolbars can react when an inner editor receives focus without waiting for a document update.
    • Header and footer overlays now scope their DOM lookups to the editor instance that opened them, preventing multiple mounted Pages editors from targeting the wrong header or footer element.

Patch Changes

  • 221c1fd: Fix the dynamic header and footer margin reset behavior so that setting headerTopMargin or footerBottomMargin to 0 restores the default positioning used on the initial render. Also fix the header and footer height on the initial render, as their heights are currently incorrect when these margins are set during initialization.
  • fcf94d7: Fix header and footer editor overlays to calculate dynamic heights correctly when zoomed.

0.20.1

Patch Changes

  • 830279c: PagesTableKit — table row grid and height refinements:

    • TableRow grid columns now use minmax(0, Nfr) when every cell has a colwidth — this preserves relative column proportions while guaranteeing the row fits the page content area. Fixes DOCX imports where the author drew tables wider than the printable area and the column-width sum overflowed the page.
    • Mixed rows (some cells carry colwidth, others do not) fall back to fixed px for sized cells and 1fr for unsized cells.
    • TableRow height now branches on the heightRule attribute — exact emits height + the --tr-height custom property (hard clipping preserved), atLeast and unset values emit min-height so narrower columns can push the row taller instead of clipping content. Mirrors the ConvertKit renderHTML behaviour inside the NodeView.

    Pages — table row overflow containment:

    • The Pages stylesheet now applies max-width: 100%, min-width: 0, and overflow-x: hidden to <tr> elements, plus min-width: 0 on cells. Contains DOCX-imported tables whose declared widths exceed the page content area so they no longer spill past the page edge.

0.20.0

Minor Changes

  • e3f8cd4: Add zoom support to the Pages extension for visual scaling of the editor content.

    New option:

    • zoom — Set an initial zoom level when configuring the extension (e.g. Pages.configure({ zoom: 0.75 })). Accepts values from 0.25 (25%) to 4 (400%). Defaults to 1 (100%).

    New command:

    • editor.commands.setZoom(value) — Dynamically change the zoom level at any time. The value is clamped to the [0.25, 4] range.

    New storage properties:

    • editor.storage.pages.zoom — Read the current zoom level.
    • editor.storage.pages.getZoom?.() — Get the current zoom level (function form for symmetry with other storage getters).

    New callback:

    • onZoomChange — Option callback invoked whenever the zoom level changes, useful for keeping UI controls in sync (e.g. a zoom dropdown or slider).

    Zoom behavior:

    • Applies visual scaling to the entire editor including page content, headers, footers, and page breaks.
    • Header and footer editors automatically match the current zoom level, including when zoom changes while an editor is open.
    • Pagination calculations remain accurate at all zoom levels.
    • Does not affect document structure or print output — zoom is purely visual.

0.19.1

Patch Changes

  • 990f322: Remove unused @tiptap-pro/extension-pagebreak peer dependency

0.19.0

Minor Changes

  • 4f38179: Add Pages-aware PageBreak behavior and integrate PageBreak into PageKit

    @tiptap-pro/extension-pagebreak

    • Add Pages-aware node view that fills remaining page space to push content to the next page, mirroring MS Word's page break behavior
    • Register measurement callbacks with the Pages extension's layout refresh cycle for synchronized height updates
    • Implement multi-pass layout stabilization so consecutive page breaks converge correctly
    • Add insertPageBreak command with Mod-Enter keyboard shortcut
    • Support standard mode (visual dashed rule with label) and Pages mode (invisible space filler)
    • Include drag-and-drop support and DOCX import compatibility

    @tiptap-pro/extension-pages

    • Add onAfterPageLayoutCallbacks storage map for cooperating extensions to hook into the page layout refresh cycle
    • Extend refreshPage with multi-pass stabilization that re-runs callbacks until layout converges or the max pass limit is reached
    • Add getDistanceToNextPagebreak and getDistanceToPrevPagebreak storage APIs for querying pixel distances to page boundaries
    • Schedule post-render recalculations via requestAnimationFrame when document changes affect page count
    • Add BFC loop detector reset on legitimate page-count recalculations to prevent false-positive oscillation detection
    • Include @tiptap-pro/extension-pagebreak as a peer dependency
    • Bundle PageBreak into PageKit by default (disable with pagebreak: false)
    • BREAKING: Rename pageBreakBackground option to pageGapBackground, setPageBreakBackground command to setPageGapBackground, to avoid confusion with the new PageBreak extension
    • BREAKING: Pages extension no longer exports PageKit or TableKit; they have been moved to separate @tiptap-pro/extension-pages-pagekit and @tiptap-pro/extension-pages-tablekit extensions.

Patch Changes

  • Updated dependencies [4f38179]
    • @tiptap-pro/extension-pagebreak@0.3.0

0.18.0

Minor Changes

  • fcd13d5: Initial beta point for export and pages packages