Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Dec 15, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

next is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on next.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

@embedpdf/[email protected]

Minor Changes

  • 89b94a0 by @bobsingor – Added pageNumber and totalPages properties to LayoutReadyEvent. This allows consumers to get the current page information immediately when the layout becomes ready, without needing to subscribe to a separate onPageChange event.

@embedpdf/[email protected]

Minor Changes

  • #293 by @github-actions – Added data-hidden-items attribute for efficient CSS dependency rules.

    Problem: Visibility dependency rules (e.g., hiding overflow buttons when all menu items are hidden) required exponential CSS rules when using category-based logic, causing stylesheet bloat.

    Solution:

    • Added hiddenItems state that tracks which item IDs are hidden based on disabled categories
    • Dependency rules now use data-epdf-hid attribute to check item IDs directly
    • CSS rules are now O(n) per breakpoint instead of O(m^n)

    New APIs:

    • getHiddenItems() - returns array of hidden item IDs
    • onCategoryChanged event now includes hiddenItems in payload
    • extractItemCategories(schema) - extracts item→categories mapping
    • computeHiddenItems(itemCategories, disabledCategories) - computes hidden items

    Breaking Changes: None - existing disabledCategories API unchanged

@embedpdf/[email protected]

Minor Changes

  • 89b94a0 by @bobsingor – Added comprehensive type exports for all plugin Capabilities and Scopes, enabling proper TypeScript support when using plugin APIs.

    New Type Exports

    All plugins now export their *Capability and *Scope types, allowing developers to properly type variables when using plugin.provides() and forDocument():

    • Viewport: ViewportCapability, ViewportScope, ViewportMetrics
    • Scroll: ScrollCapability, ScrollScope, ScrollMetrics, PageChangeEvent, ScrollEvent, LayoutChangeEvent
    • Spread: SpreadCapability, SpreadScope
    • Zoom: ZoomCapability, ZoomScope, ZoomLevel, ZoomChangeEvent
    • Rotate: RotateCapability, RotateScope
    • Tiling: TilingCapability, TilingScope
    • Thumbnail: ThumbnailCapability, ThumbnailScope
    • Annotation: AnnotationCapability, AnnotationScope, AnnotationEvent
    • Search: SearchCapability, SearchScope
    • Selection: SelectionCapability, SelectionScope
    • Capture: CaptureCapability, CaptureScope
    • Redaction: RedactionCapability, RedactionScope, RedactionMode, RedactionItem
    • UI: UIScope (UICapability was already exported)
    • I18n: I18nCapability, I18nScope, Locale, LocaleChangeEvent
    • Commands: CommandScope (CommandsCapability was already exported)
    • DocumentManager: DocumentManagerCapability, DocumentChangeEvent, LoadDocumentUrlOptions, LoadDocumentBufferOptions
    • Print: PrintCapability, PrintScope
    • Fullscreen: FullscreenCapability
    • Bookmark: BookmarkCapability, BookmarkScope
    • Export: ExportCapability, ExportScope
    • Pan: PanCapability, PanScope
    • History: HistoryCapability, HistoryScope
    • Attachment: AttachmentCapability, AttachmentScope
    • Render: RenderCapability, RenderScope
    • InteractionManager: InteractionManagerCapability, InteractionManagerScope

    Usage Example

    import {
      ScrollPlugin,
      type ScrollCapability,
      type ScrollScope,
      type PageChangeEvent,
    } from '@embedpdf/snippet';
    
    // Type the capability returned by provides()
    const scroll: ScrollCapability = registry
      .getPlugin<ScrollPlugin>('scroll')
      ?.provides();
    
    // Type the scoped API for a specific document
    const doc: ScrollScope = scroll.forDocument('my-document');
    
    // Type event callbacks
    scroll.onPageChange((event: PageChangeEvent) => {
      console.log(`Page ${event.pageNumber} of ${event.totalPages}`);
    });
  • #293 by @github-actions – Added global disabledCategories config and hierarchical categories for fine-grained feature control.

    Global disabledCategories Configuration

    Added disabledCategories to the root PDFViewerConfig that applies to both UI and Commands plugins:

    const config: PDFViewerConfig = {
      src: 'document.pdf',
      // Disable all annotation and redaction features globally
      disabledCategories: ['annotation', 'redaction'],
    };

    Plugin-specific settings can override the global setting:

    const config: PDFViewerConfig = {
      disabledCategories: ['annotation'], // Global default
      ui: {
        disabledCategories: ['redaction'], // Overrides for UI only
      },
      commands: {
        disabledCategories: [], // Re-enables all for commands
      },
    };

    Hierarchical Categories

    All commands and UI schema items now have hierarchical categories for granular control:

    • annotation - all annotation features
      • annotation-markup - highlight, underline, strikeout, squiggly
        • annotation-highlight, annotation-underline, etc.
      • annotation-shape - rectangle, circle, line, arrow, polygon, polyline
        • annotation-rectangle, annotation-circle, etc.
      • annotation-ink, annotation-text, annotation-stamp
    • redaction - all redaction features
      • redaction-text, redaction-area, redaction-apply, redaction-clear
    • zoom - all zoom features
      • zoom-in, zoom-out, zoom-fit-page, zoom-fit-width, zoom-marquee
      • zoom-level - all zoom level presets
    • document - document operations
      • document-open, document-close, document-print, document-export, document-fullscreen
    • panel - sidebar panels
      • panel-sidebar, panel-search, panel-comment, panel-annotation-style
    • page - page settings
      • spread, scroll, rotate
    • history - undo/redo
      • history-undo, history-redo
    • mode - viewer modes
      • mode-view, mode-annotate, mode-shapes, mode-redact
    • tools - tool buttons
      • pan, pointer, capture

    Example: Disable only print functionality while keeping export:

    disabledCategories: ['document-print'];
  • #293 by @github-actions – Added Spanish translations, improved i18n support, and enhanced plugin configuration API.

    New Features

    • Spanish Translations: Added Spanish (es) locale support with complete translations for all UI elements and commands.
    • Annotation Sidebar Translations: Sidebar titles are now properly translated using i18n keys. Added missing translation keys (annotation.freeText, annotation.square, annotation.styles, annotation.defaults) to all 5 languages.

    Improvements

    • Partial Plugin Configs: All plugin configuration options in PDFViewerConfig now use Partial<> types, making it easier to override only the settings you need without specifying all required fields.
    • Reactive Blend Mode Labels: Blend mode dropdown labels in the annotation sidebar now update reactively when the language changes.
    • Search Sidebar Layout: Changed search options checkboxes from horizontal to vertical layout for better compatibility with longer translated labels.
    // Override just specific settings
    <PDFViewer
      config={{
        src: '/document.pdf',
        zoom: { defaultZoomLevel: ZoomMode.FitWidth },
        i18n: { defaultLocale: 'es' }, // Use Spanish translations
      }}
    />

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@embedpdf/[email protected]

@vercel
Copy link

vercel bot commented Dec 15, 2025

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

Project Deployment Review Updated (UTC)
embed-pdf-snippet Ready Ready Preview, Comment Dec 15, 2025 10:01pm
embed-pdf-viewer-react-mui Ready Ready Preview, Comment Dec 15, 2025 10:01pm
embed-pdf-viewer-svelte-tailwind Ready Ready Preview, Comment Dec 15, 2025 10:01pm
embed-pdf-viewer-vue-vuetify Ready Ready Preview, Comment Dec 15, 2025 10:01pm
embed-pdf-website Ready Ready Preview, Comment Dec 15, 2025 10:01pm

@github-actions github-actions bot force-pushed the changeset-release/next branch from 3bea350 to 716cc9b Compare December 15, 2025 15:06
@github-actions github-actions bot force-pushed the changeset-release/next branch from 716cc9b to 0158b12 Compare December 15, 2025 15:29
@github-actions github-actions bot force-pushed the changeset-release/next branch from 0158b12 to ed823f9 Compare December 15, 2025 16:42
@github-actions github-actions bot force-pushed the changeset-release/next branch from ed823f9 to a9ee083 Compare December 15, 2025 17:10
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