yarn @react-pdf-viewer/core 3.7.0
Improve Bookmark plugin

latest releases: 3.12.0, 3.11.0, 3.10.0...
2 years ago

New features

  • You can customize the bookmarks by using the renderBookmarkItem properly:
<Bookmark renderBookmarkItem={renderBookmarkItem} />
  • The default layout plugin provides new toggleTab function to toggle a given tab in the sidebar:
const defaultLayoutPluginInstance = defaultLayoutPlugin();
const { toggleTab } = defaultLayoutPluginInstance;

// Toggle the second tab
toggleTab(1);

Improvement

  • Clicking Command + ArrowUp (on macOS) or Ctrl + ArrowUp (on Windows) will bring users to the previous clicked link annotation.
    You can disable that shortcuts via the enableShortcuts option:
// Use the standalone page navigation plugin
const pageNavigationPluginInstance = pageNavigationPlugin({
    enableShortcuts: false,
});

// Use the default layout plugin
const defaultLayoutPluginInstance = defaultLayoutPlugin({
    toolbarPlugin: {
        pageNavigationPlugin: {
            enableShortcuts: false,
        },
    },
});

Bug fixes

  • Clicking a particular bookmark might not go to the destination
  • Targets of link annotations are sanitized to avoid secutiry issues
  • The CharacterMap type isn't available
  • The onPageChange callback does not trigger if the current page equals to the initial page
  • The page navigation options are missing when creating a toolbar plugin
  • The search popover always shows up after pressing shortcuts
  • The viewer always navigates to previous, next pages after users press shortcuts even the document isn't focused

Don't miss a new core release

NewReleases is sending notifications on new releases.