-
-
Notifications
You must be signed in to change notification settings - Fork 132
Feature/multi view #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bobsingor
wants to merge
68
commits into
main
Choose a base branch
from
feature/multi-view
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/multi view #252
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…d core Introduces the new plugin-document-manager package, enabling multi-document management with tab ordering, open/close/retry actions, and event hooks. Refactors core store to support multiple documents, updates actions, reducer, selectors, and plugin base to handle document lifecycle events. Adds support for custom fetch headers in Pdfium engine and updates related types and interfaces.
Refactors scroll plugin to guard against premature scrollOffset updates before layout is ready, ensuring persisted state is protected. Adds useLayoutEffect to adapters, updates Scroller to clear layout state on unmount, and removes direct scroll restoration from viewport hooks to centralize scroll position management in the scroll plugin.
Introduces gating logic to the viewport plugin, allowing viewports to be gated and released per document. Updates state, actions, reducer, and plugin API to support gating, and adds hooks and component logic for both React and Vue to conditionally render children based on gated state.
Refactors the interaction manager plugin to support per-document state and operations. Updates actions, reducer, types, and all React/Vue components and hooks to handle document scoping, enabling multiple documents to be managed independently within the same plugin instance.
This update refactors the zoom plugin to support per-document zoom state and actions, enabling simultaneous handling of multiple documents. It introduces document-scoped actions, reducers, and capability interfaces, updates hooks and components to accept documentId, and ensures all zoom operations are properly scoped. Pinch and marquee zoom logic, as well as event handling, are updated to work with the new multi-document architecture.
Introduces a ZoomToolbar component to the React Tailwind example for document zoom controls. Integrates interaction and zoom plugins, and updates BasePlugin to handle scale and rotation change events, with corresponding overrides in ScrollPlugin and ZoomPlugin for layout refresh and auto mode recalculation.
Removes the onScaleChanged override and updates the state emission logic to only trigger when zoom levels actually change, improving efficiency and reducing unnecessary state updates.
Replaces boolean gating with a Set of named gates in viewport state. Updates actions, reducer, types, and plugin API to support adding and removing gates by key. Gate change events now provide details on all active gates and which gate was added or removed. Zoom plugin updated to use named 'zoom' gate for document loading.
Centralizes active document ID and document state retrieval logic in BasePlugin, replacing duplicated helper methods in plugin classes. Updates ScrollPlugin to use core document scale directly, removing scale from ScrollDocumentState. Improves maintainability and consistency across plugins.
Adds isMarqueeZoomActive to ZoomDocumentState and updates the zoom plugin to track marquee zoom mode activation per document. The reducer, actions, and UI are updated to reflect and respond to changes in marquee zoom mode, improving state synchronization between interaction manager and zoom plugin.
Refactors how the active document is updated when closing a document. The next active document is now determined in the document manager plugin and passed to the reducer, which validates and sets it. Removes redundant subscription logic from BasePlugin and updates scroll plugin lifecycle hooks for better initialization.
Refactored rotate, zoom, scroll, and interaction manager plugins to provide document-scoped capabilities via computed refs in both React and Vue hooks. Added Redux actions and reducer for rotate plugin, updated rotate plugin implementation for per-document state, and updated shared components and hooks to use the new API. This improves multi-document support and state isolation for plugin features.
Refactored the spread plugin to support per-document spread state, including new actions, reducer logic, and capability API. Updated hooks for React and Vue to work with document-scoped spread state. This enables managing spread mode independently for multiple documents and improves plugin lifecycle handling.
Introduces a pan plugin with Redux-style state management, document-scoped pan mode, and React/Vue hooks for pan state. Refactors the React example to use new TabBar and ViewerToolbar components, and adds a PanToggleButton for toggling pan mode per document. Implements pan reducer, actions, and capability API for per-document pan handling.
Introduced a new icons component with reusable SVG icon components and replaced inline SVGs in pan-toggle, tab-bar, and zoom-toolbar with these components. Improved tab-bar and toolbar styling for better UI consistency and maintainability.
Introduces a PageSettingsMenu component to the viewer toolbar, allowing users to rotate pages and change spread mode (single, odd, even) via UI. Adds new icons for rotate and spread actions. Integrates Rotate and Spread plugins into the application, updates plugin manifests to remove unnecessary dependencies, and improves plugin interaction with the viewport. Also fixes dropdown menu alignment in the zoom toolbar.
Integrates @embedpdf/plugin-print and @embedpdf/plugin-export into the React Tailwind example. Adds document-scoped hooks for print/export, a document menu with print/download actions, and a print dialog component. Refactors plugin-export and plugin-print for document-scoped operations and updates related hooks and types for both React and Vue frameworks.
Introduces a LoadingSpinner component for consistent loading UI in the React Tailwind example, replacing inline spinner markup. Adds logger support to PDF engine and viewer. Improves document manager plugin by dispatching document order on loading start, and updates React/Vue hooks to handle document error events and ensure proper cleanup of subscriptions.
Introduces a new useDocumentState hook in core for accessing document state reactively. Refactors DocumentManagerPlugin to extract and centralize logic for document loading, error handling, and retry validation. Updates adapters to export useMemo, and updates useOpenDocuments to use core state and document order for improved reactivity and correctness. Cleans up and simplifies related code in plugin and hooks.
Removes the 'pages' property and related logic from core state and selectors, shifting page grouping and spread logic into the spread plugin. The spread plugin now manages page grouping indices and exposes grouped pages via its capability, while the scroll plugin consumes this grouping for layout and navigation. This decouples spread logic from the core, improves plugin modularity, and updates types and dependencies accordingly.
This commit updates the render, selection, and tiling plugins to support per-document state and operations, enabling multiple documents to be handled in parallel. Selection plugin actions, reducers, and selectors are refactored to namespace all state and actions by documentId, and plugin capabilities now provide document-scoped APIs. The render plugin now uses core state for page refresh tracking, and the React example is updated to use the new plugin APIs and layers. This improves modularity, enables true multi-document support, and prepares the codebase for more robust plugin interactions.
Refactors page-level components to derive scale and rotation from document state instead of passing them as props, simplifying their interfaces. Updates the Rotate plugin and types to clarify matrix calculation and remove unused methods. Enhances the Store implementation to prevent re-entrant dispatches and unsafe state access during reducer execution, improving reliability and aligning with Redux-like safety guarantees.
Introduces search and thumbnails sidebars with toggles in the viewer toolbar for the React Tailwind example. Refactors toolbar buttons for consistency, adds new icons, and updates plugin-search to support per-document state and actions. Also improves plugin-search reducer and actions for multi-document support, and updates the UI to allow toggling and displaying search results and thumbnails per document.
Introduces reusable dropdown menu components under a new ui/ directory and refactors existing menus (document, page settings, zoom) to use them. Adds a floating page controls component for page navigation in the viewer. Updates imports to use the new UI components and moves ToolbarButton to the ui/ directory. Also ensures totalPages is set on document load in the scroll plugin.
Integrated @embedpdf/plugin-spread as an optional dependency in the zoom plugin. Updated manifest and plugin implementation to subscribe to spread changes and trigger zoom recalculation. Adjusted package.json dependencies accordingly.
Integrates the @embedpdf/plugin-redaction package into the React Tailwind example, including UI support for redaction mode, a new redaction toolbar, and per-document redaction state management. Refactors the redaction plugin for per-document state, updates actions and reducers for document scoping, and improves event handling and capability APIs. Also adds new icons and updates toolbars to support switching between view and redact modes.
Introduces a new capture area (screenshot) feature to the React Tailwind example using @embedpdf/plugin-capture. Adds UI components for capture dialogs, integrates the plugin into the application, updates the document menu with a 'Capture Area' option, and implements plugin state management and reducer logic. Also refactors dialog and button UI components for reuse, updates icon set, and synchronizes plugin-capture API and state handling across React and Vue implementations.
Integrates the @embedpdf/plugin-fullscreen package into the React Tailwind example, allowing users to toggle fullscreen mode for the document content area. Adds fullscreen and exit fullscreen icons, updates the document menu to include a fullscreen toggle, and enhances the fullscreen plugin to support targeting a specific element via a CSS selector. Updates the FullscreenProvider to use the configured target element for fullscreen requests.
Replaces LoaderPlugin usage with DocumentManagerPlugin across all example components. Updates child components to accept and use documentId prop, ensuring all plugin instances are document-aware. Refactors initialization logic to open documents via DocumentManager and updates plugin usage to pass documentId where required. This improves multi-document support and consistency in plugin API usage.
Replaces LoaderPlugin usage with DocumentManagerPlugin across all Svelte example files. Updates all example content components to accept and use a documentId prop, passing it to plugin hooks and components. Refactors page rendering snippets and plugin usage to be document-aware, and wraps EmbedPDF usage with DocumentContext and DocumentContent for proper document lifecycle management. This improves multi-document support and aligns with the latest plugin architecture.
Introduces the @embedpdf/plugin-commands package, providing a cross-framework (React, Preact, Vue, Svelte) commands plugin for the EmbedPDF platform. Includes core plugin logic, state management, keyboard shortcut handling, framework adapters, shared hooks/utilities, and configuration files for building and type safety.
Introduces the @embedpdf/plugin-i18n package, providing internationalization capabilities for React, Preact, Vue, and Svelte. Includes core plugin logic, translation hooks, shared components, locale definitions (English and Spanish), and integration into the example app. Updates dependencies and lockfile to register the new plugin.
Major refactor of the UI plugin to support schema-driven configuration and multi-framework (React, Preact, Vue, Svelte) builds. Removes legacy menu manager and component code, introduces unified UI state management, new schema types, and updates package exports and build scripts. Adds Vue and Svelte entry points and configuration, and updates peer dependencies.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.