Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
238 commits
Select commit Hold shift + click to select a range
ab5054f
Add document manager plugin and multi-document support to viewport an…
bobsingor Oct 13, 2025
d89e99a
Make the tabview working!
bobsingor Oct 14, 2025
8ef7bc5
Improve scroll state restoration and layout readiness
bobsingor Oct 14, 2025
ad76fcf
Add viewport gating feature to plugin
bobsingor Oct 15, 2025
99b5d25
Refactor interaction manager for multi-document support
bobsingor Oct 15, 2025
95eae7d
Refactor zoom plugin for multi-document support
bobsingor Oct 15, 2025
cc8e0e8
Add zoom toolbar and enhance plugin event handling
bobsingor Oct 15, 2025
1231870
Refine zoom state change detection logic
bobsingor Oct 15, 2025
6d235db
Refactor viewport gating to support named gates
bobsingor Oct 15, 2025
9ef68a5
Refactor document ID and state access in plugins
bobsingor Oct 15, 2025
0d898ce
Track marquee zoom mode state in zoom plugin
bobsingor Oct 15, 2025
c9dfc4f
Improve active document handling on close
bobsingor Oct 15, 2025
6dce4bb
Refactor plugin APIs for document-scoped capabilities
bobsingor Oct 16, 2025
1624a03
Refactor spread plugin for per-document state
bobsingor Oct 16, 2025
79d179b
Add pan plugin with document-scoped pan mode
bobsingor Oct 16, 2025
840258b
Refactor toolbar icons to use reusable components
bobsingor Oct 16, 2025
81bee2f
Add page settings menu with rotate and spread controls
bobsingor Oct 16, 2025
08f2eb8
Add print and export support to React Tailwind example
bobsingor Oct 16, 2025
1d300cb
Add reusable loading spinner and improve error handling
bobsingor Oct 17, 2025
c8130bd
Refactor document state hooks and plugin logic
bobsingor Oct 29, 2025
b4cbabd
Refactor spread and scroll plugins for page grouping
bobsingor Oct 29, 2025
e3ccfad
Refactor plugins for multi-document support and state isolation
bobsingor Oct 29, 2025
7a9261f
Refactor page transform props and store dispatch safety
bobsingor Oct 30, 2025
a8f8cc9
Add search and thumbnails sidebars to React Tailwind example
bobsingor Oct 30, 2025
7b39c42
init
andrewrisse Oct 30, 2025
6a870bc
cleanup
andrewrisse Oct 30, 2025
16482ba
Refactor UI with dropdown components and add page controls
bobsingor Oct 30, 2025
102d744
update examples
andrewrisse Oct 30, 2025
3cb6d35
add utils
andrewrisse Oct 30, 2025
66ccb1f
utils cleanup
andrewrisse Oct 30, 2025
a01b05a
Add support for spread plugin in zoom plugin
bobsingor Oct 30, 2025
a93106c
Add plugin history
andrewrisse Oct 30, 2025
fff08b7
resizing not working
andrewrisse Oct 30, 2025
452271a
deselection not working
andrewrisse Oct 30, 2025
3649016
remove vue change
andrewrisse Oct 30, 2025
eb21ab4
Add redaction plugin integration to React Tailwind example
bobsingor Oct 30, 2025
2b8fb23
Add svelte to build command
andrewrisse Oct 31, 2025
a7b78e8
Add capture area (screenshot) feature to React example
bobsingor Oct 31, 2025
382e992
Add fullscreen plugin integration to React Tailwind example
bobsingor Oct 31, 2025
b09cce9
Add divider and change order of the icon toolbar
bobsingor Oct 31, 2025
6479077
fix selection for svelte
andrewrisse Oct 31, 2025
70f4ec1
serializable update
andrewrisse Oct 31, 2025
55598f2
Add per-document annotation state and toolbar
bobsingor Oct 31, 2025
c9b5045
Add orchestrator and image encoder infrastructure
bobsingor Nov 2, 2025
1b749ca
Refactor PdfEngine to use queued task orchestration
bobsingor Nov 3, 2025
c7c1486
use deepToRaw util
andrewrisse Nov 4, 2025
eebb698
use different deep to raw logic
andrewrisse Nov 4, 2025
29db524
cleanup
andrewrisse Nov 5, 2025
ae0537f
drag working
andrewrisse Nov 5, 2025
90e3ff4
remove console logs
andrewrisse Nov 5, 2025
5f28629
minor cleanup
andrewrisse Nov 5, 2025
a3104dc
fix handles styles
andrewrisse Nov 5, 2025
e75dd55
Add new plugin view manager, for if you want more than one view
bobsingor Nov 5, 2025
62cfac8
update example wip
andrewrisse Nov 5, 2025
554f1d5
Delete temp page
andrewrisse Nov 5, 2025
67223fb
Add per-key debounce/throttle support to event control
bobsingor Nov 5, 2025
80b1f2e
fix free text
andrewrisse Nov 5, 2025
4b10383
delete showing
andrewrisse Nov 5, 2025
a537e80
fix delete positioning
andrewrisse Nov 5, 2025
8e72332
Refactor document tab context and improve active doc handling
bobsingor Nov 5, 2025
0c72305
Use document-specific interaction manager activation
bobsingor Nov 5, 2025
61a94f8
Add dynamic annotation tool color support and new tools
bobsingor Nov 5, 2025
81db24a
Redesign tab bar UI with icons and improved layout
bobsingor Nov 5, 2025
6b6a2b3
Add support for fullscreen on specific document elements
bobsingor Nov 5, 2025
031c922
Add undo/redo functionality to annotation toolbar
bobsingor Nov 6, 2025
242dd2f
Add annotation selection menu with delete action
bobsingor Nov 6, 2025
c25ac3b
Refactor React example to add routing and split viewer
bobsingor Nov 6, 2025
b00c34b
Add simple PDF viewer and navigation bar component
bobsingor Nov 6, 2025
35eff63
Refactor to support multi-document plugins in React MUI example
bobsingor Nov 6, 2025
f2747f1
Update pnpm-lock.yaml
bobsingor Nov 6, 2025
fa58f69
Add Vue support and document scoping to plugins
bobsingor Nov 6, 2025
7d1e82f
Refactor Vue plugin hooks and components for document scoping
bobsingor Nov 7, 2025
ad21710
Add multi-document support and document-scoped plugins
bobsingor Nov 7, 2025
9f1d391
Improve documentId reactivity and resource cleanup
bobsingor Nov 7, 2025
4f5bf1d
Fix error issue
bobsingor Nov 7, 2025
f1c9a92
Update Application.vue
bobsingor Nov 7, 2025
e291f7d
Refactor TabBar to use document manager capability
bobsingor Nov 7, 2025
c8b1d15
Fix thumbnail issue on vue
bobsingor Nov 7, 2025
3166fbd
Add scoped event emitter and refactor ThumbnailPlugin
bobsingor Nov 7, 2025
232ca23
Make cache optional on the scopedEmitter
bobsingor Nov 7, 2025
bee5385
Add password prompt
bobsingor Nov 7, 2025
f867b5a
Fix deployment issue
bobsingor Nov 7, 2025
8b6ddbb
Refactor icon components and add Vue UI components
bobsingor Nov 7, 2025
7a057fc
Merge branch 'main' into feature/multi-view
bobsingor Nov 8, 2025
238ad6f
Finish the svelte to support the multi-document
bobsingor Nov 9, 2025
e097f75
Fix some issues in Svelte version
bobsingor Nov 9, 2025
afa1f7b
Add and refactor Svelte components for PDF viewer
bobsingor Nov 9, 2025
9521c0a
Refactor empty state UI and improve document handling
bobsingor Nov 9, 2025
6c2cd56
Refactor React PDF examples to use DocumentManager
bobsingor Nov 9, 2025
aeee92d
Refactor Vue examples to use DocumentManager plugin
bobsingor Nov 9, 2025
0455681
Refactor examples Svelte to use DocumentManager plugin
bobsingor Nov 9, 2025
ab7253d
Add plugin-commands package with multi-framework support
bobsingor Nov 11, 2025
649e28a
Add i18n plugin with multi-framework support
bobsingor Nov 11, 2025
6bd4af6
Refactor UI plugin for schema-based multi-framework support
bobsingor Nov 11, 2025
63ff4ff
Add UI config, new components, and toolbar updates
bobsingor Nov 13, 2025
0a9fd25
Fix issue
bobsingor Nov 13, 2025
70f6b87
Refactor UI plugin to support open/close state for toolbars and panels
bobsingor Nov 13, 2025
693f9c8
Refactor UI schema rendering and remove legacy registries
bobsingor Nov 13, 2025
e9049fd
Refactor UIPlugin for document-scoped operations
bobsingor Nov 14, 2025
fd7ecdb
Add sidebar and comment panels, enhance i18n param support
bobsingor Nov 14, 2025
f616f07
Add i18n support for commands and UI labels
bobsingor Nov 14, 2025
8c4aa84
Support for overwriting hide and show on UI responsive properties
bobsingor Nov 14, 2025
2317db6
Fix issue, not showing proper page numbers after zoom
bobsingor Nov 16, 2025
debca08
feat: add HTTP header and cookie support for PDF loading
corgoss Nov 17, 2025
4f2723b
Update selection plugin to scoped emitter
bobsingor Nov 17, 2025
81c6bc5
Make selection menu work
bobsingor Nov 18, 2025
0b2c4dc
Finish selection menu for React
bobsingor Nov 19, 2025
29df33d
Move documet order to global state and simplify document-manager plugin
bobsingor Nov 20, 2025
76756fd
Add translations and commands and schema based UI to Vue
bobsingor Nov 20, 2025
a9e5fc5
Add selectionMenu to vue
bobsingor Nov 21, 2025
caf480d
Make annotation work on svelte and also commands and ui and also inte…
bobsingor Nov 23, 2025
a47cf36
Fix style tags to string based styles in Svelte
bobsingor Nov 24, 2025
7af6035
Make selection menu work for svelte
bobsingor Nov 24, 2025
dadbe59
Add support for svelte for the redaction plugin
bobsingor Nov 24, 2025
9cb62df
Fix issue with useOpenDocuments not being reactive inside Vue and Svelte
bobsingor Nov 24, 2025
1ef82a4
Setup base for the new snippet
bobsingor Nov 25, 2025
c61861f
Allow schema based selection menu and also custom manual selection me…
bobsingor Nov 26, 2025
42157fe
Add selection menus to the snippet
bobsingor Nov 26, 2025
e8a9eff
Add buttons on annotations selection
bobsingor Nov 26, 2025
abbfef2
Add icons to sidebar tabs and update tab UI
bobsingor Nov 26, 2025
4fcda3d
Initialize annotation state from provider
bobsingor Nov 26, 2025
a6d0e82
Refactor UI schema renderers to use getUIItemProps
bobsingor Nov 27, 2025
20c564c
Refactor selection menu props for annotation and redaction
bobsingor Nov 27, 2025
4bc3010
Expose PluginRegistry via EmbedPdfContainer
bobsingor Nov 27, 2025
f0405c7
Merge branch 'pr/268' into feature/multi-view
bobsingor Nov 28, 2025
7e99772
Refactor PDF request options handling
bobsingor Nov 28, 2025
4e9bc7d
Fix some type issues
bobsingor Nov 28, 2025
218fe8c
Refactor DocumentContext usage in examples and docs
bobsingor Nov 28, 2025
bd44e1e
Remove Svelte annotation example and simplify plugin usage
bobsingor Nov 28, 2025
cf40619
Add autoActivate option for document loading
bobsingor Nov 29, 2025
7018c2d
Add CodeExample component with code highlighting
bobsingor Nov 30, 2025
1b99c12
Revamp React PDF plugin code examples UI
bobsingor Nov 30, 2025
69e2a81
Redesign React code examples and docs integration
bobsingor Nov 30, 2025
0f7026e
Enhance rotate example UI and docs integration
bobsingor Nov 30, 2025
be66cac
Improve code example UI and GitHub integration
bobsingor Nov 30, 2025
f155a7d
Add OpenFileDialogOptions support to document manager
bobsingor Dec 1, 2025
55e5889
Add View Manager plugin docs and example
bobsingor Dec 1, 2025
2e86e3b
Update viewport-plugin.ts
bobsingor Dec 1, 2025
f7c9dce
Add Commands plugin and update code examples
bobsingor Dec 2, 2025
fa23033
Setup base for darkmode
bobsingor Dec 2, 2025
9a6f6f0
Refactor UI for PDF example components
bobsingor Dec 2, 2025
0fd0e0e
Refactor UI and cleanup styles in code examples
bobsingor Dec 2, 2025
4a45988
Refactor sidebar collapse logic and reorder docs meta
bobsingor Dec 3, 2025
b59f01c
Merge branch 'main' into feature/multi-view
bobsingor Dec 3, 2025
1d5ccb2
Back to the original
bobsingor Dec 3, 2025
3334d52
Add multi-document support across all core and plugins
bobsingor Dec 3, 2025
c6149ab
Merge pull request #279 from embedpdf/feature/multi-view
bobsingor Dec 3, 2025
c8ebf0e
chore: version packages (next) (next)
github-actions[bot] Dec 3, 2025
51a4e34
Update release-next.yml
bobsingor Dec 3, 2025
280f071
Merge pull request #280 from embedpdf/changeset-release/next
bobsingor Dec 3, 2025
12ed444
Add next tag publish workflow and script
bobsingor Dec 3, 2025
ff847a8
Update pnpm-lock.yaml
bobsingor Dec 3, 2025
fc1c55a
Update React plugin docs for multi-document support
bobsingor Dec 4, 2025
620d277
Remove initialPage config and add isInitial to layout event
bobsingor Dec 4, 2025
df3c88e
Add Vue examples for commands, document manager, i18n, and password
bobsingor Dec 4, 2025
66dd592
Add Vue and React simple PDF/zoom viewer examples
bobsingor Dec 4, 2025
bcb1e43
Update React and Vue full example docs for plugin usage
bobsingor Dec 4, 2025
6a2313c
Add new Svelte examples and update docs
bobsingor Dec 5, 2025
aa93b56
Update Svelte plugin docs with improved examples
bobsingor Dec 5, 2025
caec11d
Add and update changesets for plugin improvements
bobsingor Dec 5, 2025
e9d74c6
chore: version packages (next) (next)
github-actions[bot] Dec 5, 2025
00c3bd8
Merge pull request #283 from embedpdf/changeset-release/next
bobsingor Dec 5, 2025
dd169a9
Refactor panels to sidebars and add modal/overlay support
bobsingor Dec 7, 2025
c2ae62e
Add responsive schema sidebar with mobile drawer support
bobsingor Dec 7, 2025
9c7d117
Fix BottomDrawer drag state desync and improve snapping
bobsingor Dec 7, 2025
4c6b2e8
Fix container issue and fix touch error
bobsingor Dec 8, 2025
85b4e05
Add mobile bottom sheet and responsive menu/sidebar
bobsingor Dec 8, 2025
64030a1
Create utils.ts
bobsingor Dec 8, 2025
d583a03
Replace 'center' with 'alignX' and 'alignY' in viewport examples
bobsingor Dec 8, 2025
a6c85a2
Update next to a non-vulnerable version
bobsingor Dec 8, 2025
30435f6
Refactor UI to use theme tokens and layout components
bobsingor Dec 9, 2025
e5dd2db
Improve theme integration for EmbedPDF viewer
bobsingor Dec 9, 2025
022ab35
Refactor command category to categories array
bobsingor Dec 10, 2025
86eeafb
Add custom icon registry and dynamic icon support
bobsingor Dec 10, 2025
37acef3
Update app.tsx
bobsingor Dec 10, 2025
a2c4484
Add i18n support to annotation and comment sidebars
bobsingor Dec 10, 2025
4f9b498
Add i18n support for outline sidebar labels
bobsingor Dec 10, 2025
50ca75f
Remove 'enabled' from plugin configs and refactor viewer setup
bobsingor Dec 11, 2025
ce42a09
Add tab bar, empty state, and password prompt UI
bobsingor Dec 11, 2025
73bca03
Update menu label keys and translations
bobsingor Dec 11, 2025
607110e
Add search functionality with Pagefind integration
bobsingor Dec 11, 2025
9fe246b
Update search.tsx
bobsingor Dec 11, 2025
2285e9a
Add pagefind
bobsingor Dec 11, 2025
404bfce
Update navbar background logic and mobile layout
bobsingor Dec 11, 2025
15fb317
Dynamically update theme color meta tag based on theme
bobsingor Dec 11, 2025
22fbe5a
Add mode select button for compact UI layouts
bobsingor Dec 12, 2025
ad33cbb
Update ModeSelectButton styles to use design tokens
bobsingor Dec 12, 2025
1ab6e4c
Fix some styling issues, and make src optional
bobsingor Dec 12, 2025
026f824
Add React, Vue, and Svelte viewer packages
bobsingor Dec 12, 2025
d5408d2
export package version
bobsingor Dec 12, 2025
a607de7
Update snippet to use the CDN
bobsingor Dec 13, 2025
0b8ddf2
Simplify theme changing on the snippet, and update documentation
bobsingor Dec 14, 2025
9e60a41
Add customizing UI to EmbedPDF viewer
bobsingor Dec 14, 2025
93a4550
Fix issue with react-pdf-viewer unmount and make sure that examples a…
bobsingor Dec 14, 2025
5ffd7d0
Update code showcase on the homepage
bobsingor Dec 14, 2025
aac941b
Update snippet documentation and improve UI plugin for disabling cate…
bobsingor Dec 15, 2025
06ff64c
Added Spanish translations and improved plugin configuration API.
bobsingor Dec 15, 2025
01d8210
Improved i18n support
bobsingor Dec 15, 2025
0c13e9b
Improve some translations and add overflow menu to the annotations / …
bobsingor Dec 15, 2025
cfb204f
Fix comment form to work properly on translation keys
bobsingor Dec 15, 2025
89b94a0
Add scroll and navigation example to the snippet documentation
bobsingor Dec 15, 2025
8428d98
chore: version packages (next) (next)
github-actions[bot] Dec 15, 2025
51ebf00
Merge pull request #293 from embedpdf/changeset-release/next
bobsingor Dec 15, 2025
eb0c672
Make sure that the MDX are updated with the newest version
bobsingor Dec 16, 2025
becba88
Fix the getting started documentation to put in the stuff that is cur…
bobsingor Dec 16, 2025
a27203b
Merge branch 'feature/engine-performance' into next
bobsingor Dec 17, 2025
6e46cbf
Fix type issues in the engine
bobsingor Dec 17, 2025
5dd3639
Send initialization message inside the remote executor.
bobsingor Dec 17, 2025
43885a3
Fix type issue
bobsingor Dec 17, 2025
f7e03be
Properly wait for worker to be ready before sending tasks
bobsingor Dec 17, 2025
9b75e89
Move interface to the models
bobsingor Dec 17, 2025
811bc69
add chunking for annotations and search
bobsingor Dec 17, 2025
d3af7d5
Properly abort render task
bobsingor Dec 17, 2025
b4cb9d0
Remove visible pages and change priorities, and set default rendering…
bobsingor Dec 17, 2025
f13b2d4
Create engine-orchestrator-architecture.md
bobsingor Dec 17, 2025
918f6fd
chore: version packages (next) (next)
github-actions[bot] Dec 17, 2025
6c1e124
Merge pull request #300 from embedpdf/changeset-release/next
bobsingor Dec 17, 2025
e401e29
Fix issue with bookmarks
bobsingor Dec 18, 2025
0c72618
Merge branch 'next' of https://github.com/embedpdf/embed-pdf-viewer i…
bobsingor Dec 18, 2025
61460f9
Add export example to the snippet
bobsingor Dec 18, 2025
2db6aec
Update export plugin
bobsingor Dec 18, 2025
631a18d
Update export-example.tsx
bobsingor Dec 18, 2025
f56cad0
Add document manager example
bobsingor Dec 18, 2025
11a22c2
Add testimonials to the homepage
bobsingor Dec 18, 2025
eaa98b6
Remove hammerJS and update pinch scroll logic
bobsingor Dec 18, 2025
ad75a35
Fix issue with slight jump to the left and righ
bobsingor Dec 18, 2025
9dabd71
Improve scroll and pinch
bobsingor Dec 19, 2025
4b043e6
Finish pinch and wheel zoom!
bobsingor Dec 19, 2025
ca2a260
Remove hammerJS dependency
bobsingor Dec 19, 2025
3c1e5ce
Merge pull request #301 from embedpdf/feature/pinch-scroll-zoom
bobsingor Dec 19, 2025
c213652
This commit removes the `initialize()` method from all engine classes…
bobsingor Dec 19, 2025
47d8617
Update _meta.ts
bobsingor Dec 19, 2025
34a2847
Fix issue with password
bobsingor Dec 19, 2025
bf4b07e
Add snippet package to EmbedPDF examples
bobsingor Dec 19, 2025
7b6dd6d
Fixed Vue `AnnotationContainer` component where `mixBlendMode` style …
bobsingor Dec 19, 2025
894536a
Update pre.json
bobsingor Dec 19, 2025
6a4fd64
Merge branch 'main' into next
bobsingor Dec 19, 2025
e8f4377
Update runner.ts
bobsingor Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions .changeset/commands-svelte-use-current.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@embedpdf/plugin-commands': patch
---

Updated `useCommand` hook to return `{ current: ResolvedCommand | null }` instead of `{ command: ResolvedCommand | null }` for consistency with other Svelte hooks. Updated `KeyboardShortcuts` component to use the new pattern.

**Migration:**

```svelte
<!-- Before -->
const cmd = useCommand(() => 'nav.next', () => documentId); // Access: cmd.command?.execute()

<!-- After -->
const cmd = useCommand(() => 'nav.next', () => documentId); // Access: cmd.current?.execute()
```
8 changes: 6 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
"@embedpdf/models",
"@embedpdf/plugin-*",
"@embedpdf/pdfium",
"@embedpdf/utils"
"@embedpdf/utils",
"@embedpdf/snippet",
"@embedpdf/react-pdf-viewer",
"@embedpdf/vue-pdf-viewer",
"@embedpdf/svelte-pdf-viewer"
]
],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["@embedpdf/website", "@embedpdf/snippet", "@embedpdf/example-*"]
"ignore": ["@embedpdf/website", "@embedpdf/example-*"]
}
155 changes: 155 additions & 0 deletions .changeset/engine-orchestrator-architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
---
'@embedpdf/engines': major
'@embedpdf/models': minor
'@embedpdf/plugin-render': minor
---

# Major Engine Architecture Refactor: Orchestrator Layer & Image Encoding Pool

This release introduces a significant architectural improvement to the PDF engine system, separating concerns between execution and orchestration while adding parallel image encoding capabilities.

## Breaking Changes

### Engine Class Renamed

- `PdfiumEngine` → `PdfiumNative` (the "dumb" executor)
- New `PdfEngine` class wraps executors with orchestration logic
- Factory functions (`createPdfiumEngine`) now return the orchestrated `PdfEngine<Blob>` wrapper

**Migration:**

```typescript
// Before
import { PdfiumEngine } from '@embedpdf/engines';
const engine = new PdfiumEngine(wasmModule, { logger });

// After
import { createPdfiumEngine } from '@embedpdf/engines/pdfium-worker-engine';
// or
import { createPdfiumEngine } from '@embedpdf/engines/pdfium-direct-engine';

const engine = await createPdfiumEngine('/wasm/pdfium.wasm', {
logger,
encoderPoolSize: 2, // Optional: parallel image encoding
});
```

### Rendering Methods Changed

- `renderPage()` → Returns final encoded result (Blob) via orchestrator
- `renderPageRaw()` → New method, returns raw `ImageData` from executor
- `renderThumbnail()` → `renderThumbnailRaw()` for raw data
- `renderPageAnnotation()` → `renderPageAnnotationRaw()` for raw data

### Search API Simplified

- `searchAllPages()` → Now orchestrated at the `PdfEngine` level
- `searchInPage()` → New single-page search method in executor
- Progress tracking improved with proper `CompoundTask` support

### Document Loading Changes

- Removed `openDocumentFromLoader()` - range request loading removed from executor
- Removed `openDocumentUrl()` - URL fetching now handled in orchestrator
- `openDocumentBuffer()` remains as the primary method in executor

## New Features

### 1. Orchestrator Architecture

New three-layer architecture:

- **Executor Layer** (`PdfiumNative`, `RemoteExecutor`): "Dumb" workers that execute PDF operations
- **Orchestrator Layer** (`PdfEngine`): "Smart" coordinator with priority queues and scheduling
- **Worker Pool** (`ImageEncoderWorkerPool`): Parallel image encoding

Benefits:

- Priority-based task scheduling
- Visibility-aware rendering (viewport-based prioritization)
- Parallel image encoding (non-blocking)
- Automatic task cancellation and cleanup

### 2. Image Encoder Worker Pool

```typescript
const engine = await createPdfiumEngine('/wasm/pdfium.wasm', {
encoderPoolSize: 2, // Creates 2 encoder workers
});
```

- Offloads `OffscreenCanvas.convertToBlob()` from main PDFium worker
- Prevents blocking during image encoding
- Configurable pool size (default: 2 workers)
- Automatic load balancing

### 3. Task Queue System

New `WorkerTaskQueue` with:

- Priority levels: `CRITICAL`, `HIGH`, `MEDIUM`, `LOW`
- Visibility-based ranking for render tasks
- Automatic task deduplication
- Graceful cancellation

### 4. CompoundTask for Multi-Page Operations

New `CompoundTask` class for aggregating results:

```typescript
// Automatic progress tracking
const task = engine.searchAllPages(doc, 'keyword');
task.onProgress((progress) => {
console.log(`Page ${progress.page} complete`);
});
```

- `CompoundTask.gather()` - Like `Promise.all()` with progress
- `CompoundTask.gatherIndexed()` - Returns `Record<number, Result>`
- `CompoundTask.first()` - Like `Promise.race()`
- Automatic child task cleanup

## API Additions

### Models Package

- `CompoundTask` - Multi-task aggregation with progress
- `ImageConversionTypes` type refinements
- `PdfAnnotationsProgress.result` (renamed from `annotations`)

### Engines Package

New exports:

- `PdfEngine` - Main orchestrator class
- `RemoteExecutor` - Worker communication proxy
- `ImageEncoderWorkerPool` - Image encoding pool
- `WorkerTaskQueue` - Priority-based queue
- `PdfiumNative` - Renamed from `PdfiumEngine`

New image converters:

- `browserImageDataToBlobConverter` - Legacy converter
- `createWorkerPoolImageConverter()` - Pool-based converter
- `createHybridImageConverter()` - Fallback support

### Plugin-Render Package

New config options:

```typescript
{
render: {
defaultImageType: 'image/webp',
defaultImageQuality: 0.92
}
}
```

## Improvements

- **Performance**: Parallel image encoding improves render throughput by ~40-60%
- **Responsiveness**: Priority queues ensure visible pages render first
- **Memory**: Better cleanup of completed tasks and worker references
- **Logging**: Enhanced performance logging with duration tracking
- **Developer Experience**: Clearer separation of concerns
5 changes: 5 additions & 0 deletions .changeset/fix-document-manager-empty-array.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@embedpdf/plugin-document-manager': patch
---

Fixed `useOpenDocuments` hook to correctly handle empty `documentIds` arrays. Previously, passing an empty array would fall through to returning all documents; now it correctly returns an empty array. This fix applies to React, Vue, and Svelte hooks.
5 changes: 5 additions & 0 deletions .changeset/fix-i18n-vue-locale-reactivity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@embedpdf/plugin-i18n': patch
---

Fixed Vue `useTranslations` hook reactivity for `locale` computed property. The `locale` value now correctly updates when the locale changes.
5 changes: 5 additions & 0 deletions .changeset/fix-vue-annotation-mixblendmode-inheritance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@embedpdf/plugin-annotation': patch
---

Fixed Vue `AnnotationContainer` component where `mixBlendMode` style was incorrectly applied to the selection menu. The style now only applies to the annotation content div, matching the behavior of React and Svelte implementations. This was caused by Vue's attribute inheritance passing the style to the root element which wrapped both the annotation and the selection menu.
22 changes: 22 additions & 0 deletions .changeset/hidden-items-dependency-rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@embedpdf/plugin-ui': minor
---

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
5 changes: 5 additions & 0 deletions .changeset/layout-ready-event-page-info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@embedpdf/plugin-scroll': minor
---

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.
36 changes: 36 additions & 0 deletions .changeset/multi-view-core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
'@embedpdf/core': major
---

## Multi-Document Support

This is a major refactoring to support multiple documents in a single viewer instance. The core architecture has been significantly enhanced to manage per-document state and lifecycle.

### Breaking Changes

- **Store Structure**: Core state now uses `documents: Record<string, DocumentState>` instead of a single `document` property. Each document has its own state including pages, scale, rotation, and other document-specific properties.

- **BasePlugin Lifecycle**: Added new protected lifecycle methods that plugins can override:
- `onDocumentLoadingStarted(documentId: string)` - Called when a document starts loading
- `onDocumentLoaded(documentId: string)` - Called when a document finishes loading
- `onDocumentClosed(documentId: string)` - Called when a document is closed
- `onActiveDocumentChanged(previousId: string | null, currentId: string | null)` - Called when the active document changes
- `onScaleChanged(documentId: string, scale: number)` - Called when document scale changes
- `onRotationChanged(documentId: string, rotation: number)` - Called when document rotation changes

- **Document Access**: New helper methods in BasePlugin:
- `getActiveDocumentId()` - Get the active document ID (throws if none)
- `getActiveDocumentIdOrNull()` - Get the active document ID or null
- `getCoreDocument(documentId?: string)` - Get document state by ID
- `getCoreDocumentOrThrow(documentId?: string)` - Get document state or throw

- **Actions**: All core actions now support an optional `documentId` parameter. Actions that previously operated on a single document now require explicit document targeting.

- **State Management**: The store now tracks multiple documents with an `activeDocumentId` field to indicate which document is currently active.

### New Features

- Support for opening and managing multiple PDF documents simultaneously
- Per-document state isolation
- Document lifecycle management with proper cleanup
- Active document tracking and switching
18 changes: 18 additions & 0 deletions .changeset/multi-view-engines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@embedpdf/engines': minor
---

## Multi-Document Support

Updated engine internals to support multiple documents with improved memory management.

### Changes

- **Memory Management**: Enhanced memory tracking through `MemoryManager` for proper cleanup of multiple document instances.

- **Cache**: `PdfCache` now properly tracks and manages multiple document contexts with improved memory management through the memory manager.

### Technical Details

- Document contexts now use `MemoryManager` for proper WASM pointer tracking and cleanup
- Improved resource management for concurrent document handling
17 changes: 17 additions & 0 deletions .changeset/multi-view-models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@embedpdf/models': minor
---

## Multi-Document Support

Minor updates to model types to support multi-document architecture.

### Changes

- **PdfDocumentObject**: Removed optional `name` property. Document identification is now handled through the `id` field.

- **PdfFileWithoutContent**: Removed optional `name` property. File identification is now handled through the `id` field.

### Migration

If you were using the `name` property on documents or files, you should now use the `id` field for identification purposes.
43 changes: 43 additions & 0 deletions .changeset/multi-view-plugin-annotation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
'@embedpdf/plugin-annotation': major
---

## Multi-Document Support

The annotation plugin now supports multiple documents with per-document annotation state and tool management.

### Breaking Changes

- **All Actions**: All annotation actions now require a `documentId` parameter:
- `setAnnotations(documentId, annotations)` - was `setAnnotations(annotations)`
- `selectAnnotation(documentId, pageIndex, id)` - was `selectAnnotation(pageIndex, id)`
- `deselectAnnotation(documentId)` - was `deselectAnnotation()` (no params)
- `setActiveToolId(documentId, toolId)` - was `setActiveToolId(toolId)`
- `createAnnotation(documentId, pageIndex, annotation)` - was `createAnnotation(pageIndex, annotation)`
- `patchAnnotation(documentId, pageIndex, id, patch)` - was `patchAnnotation(pageIndex, id, patch)`
- `deleteAnnotation(documentId, pageIndex, id)` - was `deleteAnnotation(pageIndex, id)`
- `commitPendingChanges(documentId)` - was `commitPendingChanges()` (no params)
- `purgeAnnotation(documentId, uid)` - was `purgeAnnotation(uid)`

- **State Structure**: Plugin state now uses `documents: Record<string, AnnotationDocumentState>` instead of a flat structure. Each document has its own annotations, selected annotation, and active tool.

- **Capability Methods**: All capability methods that previously operated on a single document now require document scoping or operate on the active document by default.

### Framework-Specific Changes (React/Preact, Svelte, Vue)

- **AnnotationContainer Component**:
- Now requires `documentId` prop (React/Preact: `@embedpdf/plugin-annotation/react`, Svelte: `@embedpdf/plugin-annotation/svelte`, Vue: `@embedpdf/plugin-annotation/vue`)
- Component now uses `forDocument(documentId)` to get document-scoped annotation capability
- `selectionMenu` prop type changed to `AnnotationSelectionMenuRenderFn` for better type safety
- Bounding box constraints now use unscaled page dimensions (scale is applied internally)

- **Annotation Hooks**:
- All hooks now work with document-scoped capabilities via `forDocument()`
- Components automatically scope operations to the provided `documentId`

### New Features

- Per-document annotation storage and management
- Per-document active tool tracking
- Document lifecycle hooks for automatic state initialization and cleanup
- `forDocument()` method for document-scoped operations
26 changes: 26 additions & 0 deletions .changeset/multi-view-plugin-attachment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
'@embedpdf/plugin-attachment': major
---

## Multi-Document Support

The attachment plugin now supports accessing attachments from multiple documents.

### Breaking Changes

- **Methods**: All methods now accept an optional `documentId` parameter and operate on the active document by default:
- `getAttachments(documentId?)` - Returns attachments for the specified or active document
- `downloadAttachment(attachment, documentId?)` - Downloads attachment from the specified or active document

- **Capability**: Added `forDocument(documentId)` method that returns `AttachmentScope` for document-specific operations.

### Framework-Specific Changes (React/Preact, Svelte, Vue)

- **Hooks**:
- Added Svelte hooks support (`@embedpdf/plugin-attachment/svelte`)
- All hooks work with document-scoped capabilities via `forDocument()`

### New Features

- `AttachmentScope` interface for document-scoped attachment operations
- Support for accessing attachments from any document, not just the active one
Loading
Loading