teamsync-pdf-viewer 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +4 -4
- package/dist/src/components/DocumentViewer.d.ts +3 -1
- package/dist/src/components/TeamSyncViewer.d.ts +5 -1
- package/dist/src/core/ViewerInstance.d.ts +2 -0
- package/dist/src/core/types.d.ts +10 -0
- package/dist/teamsync-pdf-viewer.js +1569 -1553
- package/dist/teamsync-pdf-viewer.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `teamsync-pdf-viewer` are documented here.
|
|
4
4
|
|
|
5
|
+
## [1.5.1] — 2026-09-06
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **`redactionsApplied` & `redactionsChanged` Events**: Added typed `redactionsApplied: { redactions: Redaction[] }` and `redactionsChanged: { redactions: Redaction[] }` events to `ViewerEventMap` available via `instance.on()`.
|
|
9
|
+
- **Public Redaction Callbacks**: Added `onRedactionsApplied?: (redactions: Redaction[]) => void` and `onRedactionsChange?: (redactions: Redaction[]) => void` props to `<TeamSyncViewer>` and `WebViewerOptions`.
|
|
10
|
+
- **Apply Confirmation Hook**: Threaded `onRedactionsApplied` through `DocumentViewerProps`, firing once per user click of Apply in the confirmation modal with the full combined list of applied redactions.
|
|
11
|
+
- **Public `getRedactions()` API**: Added `instance.getRedactions(): Redaction[]` to `WebViewerInstance` mirroring `getAnnotations()`, returning the live combined redaction list.
|
|
12
|
+
|
|
5
13
|
## [1.5.0] — 2026-09-05
|
|
6
14
|
|
|
7
15
|
### Added
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
### **100% Open Source. 100% Client-Side. Enterprise
|
|
7
|
+
### **100% Open Source. 100% Client-Side. Enterprise SDK.**
|
|
8
8
|
|
|
9
9
|
[](LICENSE)
|
|
10
10
|
[](https://pdfviewer.teamsync.com/)
|
|
@@ -25,7 +25,7 @@ Try the **[Interactive Live Demo](https://pdfviewer.teamsync.com/)** or integrat
|
|
|
25
25
|
Traditional commercial PDF viewers force developers into expensive per-domain licenses, opaque sales calls, and heavy server-side processing dependencies. **TeamSync PDF Viewer** is built from the ground up to solve these pain points.
|
|
26
26
|
|
|
27
27
|
- 💰 **Zero-Cost, Transparent Licensing**: Uncapped usage, no per-server fees, and no commercial paywalls. 100% free and open-source under CPAL 1.0.
|
|
28
|
-
- ⚡ **100% Client-Side WebAssembly**: Documents never leave the browser sandbox. Process, redact, and render PDFs entirely on the client
|
|
28
|
+
- ⚡ **100% Client-Side WebAssembly**: Documents never leave the browser sandbox. Process, redact, and render PDFs entirely on the client.
|
|
29
29
|
- 🔌 **Universal WebViewer API**: Clean, intuitive `WebViewer({...})` API interface that makes integrating into your web applications effortless.
|
|
30
30
|
- 🎨 **Headless & Customizable**: Built for modern React 19 SPA lifecycles. No bloated iFrames to fight—customize toolbars, sidebars, context menus, and controls natively.
|
|
31
31
|
|
|
@@ -84,10 +84,10 @@ Everything you need to build collaborative, secure document workflows.
|
|
|
84
84
|
- **Notes & Callouts**: Sticky notes, callout text boxes with directional arrows, and text annotations.
|
|
85
85
|
- **Interactive Hyperlinks**: Create internal page-jump links (`#page=N`) or external web URL links directly on document selections.
|
|
86
86
|
|
|
87
|
-
### 🛡️
|
|
87
|
+
### 🛡️ Secure Redaction
|
|
88
88
|
- **Binary-Level Data Obliteration**: We don't just place black boxes over text—redactions are permanently rasterized and burned into the underlying PDF vector structure.
|
|
89
89
|
- **Text Layer Sanitization**: Redacted text is automatically stripped from the DOM `textLayer` and PDF content streams, preventing copy/paste extraction and search indexing.
|
|
90
|
-
- **Automatic Regex Redactions**: Programmatically locate and redact sensitive PII
|
|
90
|
+
- **Automatic Regex Redactions**: Programmatically locate and redact sensitive PII in a single click.
|
|
91
91
|
- **Discard Unapplied Redactions**: Easily discard individual pending redactions or bulk-discard all unapplied redaction marks before committing.
|
|
92
92
|
|
|
93
93
|
### 📐 Dynamic Layout & Viewport Controls
|
|
@@ -31,6 +31,8 @@ interface DocumentViewerProps {
|
|
|
31
31
|
onAnnotationsChange?: (annotations: Annotation[]) => void;
|
|
32
32
|
/** Reports the combined (prop + regex + manual) redaction list whenever it changes. */
|
|
33
33
|
onRedactionsChange?: (redactions: Redaction[]) => void;
|
|
34
|
+
/** Fires once per user click of Apply in the confirmation modal with all applied redactions. */
|
|
35
|
+
onRedactionsApplied?: (redactions: Redaction[]) => void;
|
|
34
36
|
onDocumentLoaded?: (doc: pdfjsLib.PDFDocumentProxy, url: string) => void;
|
|
35
37
|
onLoadError?: (error: Error, info: DocumentLoadErrorInfo) => void;
|
|
36
38
|
/** Fires once per loaded document, after the first page canvas has been painted. */
|
|
@@ -55,5 +57,5 @@ interface DocumentViewerProps {
|
|
|
55
57
|
defaultTool?: 'select' | 'pan';
|
|
56
58
|
showSelectionTooltip?: boolean;
|
|
57
59
|
}
|
|
58
|
-
export default function DocumentViewer({ leftSidebarOpen, rightSidebarOpen, activeTab, annotationManager, initialDoc, loadNonce, withCredentials, assets, sidebars, redactions, regexRedactions, scale, setScale, sidebarTab, setSidebarTab, onAnnotationsChange, onRedactionsChange, onDocumentLoaded, onLoadError, onFirstPageRendered, onPageRendered, onPageChange, pageTransition, pageLayout, rotation, setRotation, watermark, watermarkText, enableAnnotations: _enableAnnotations, initialPage, page, transientHighlights, permissions, hideAnnotationsUntilPageRendered, enableTextSelection, defaultTool, showSelectionTooltip }: DocumentViewerProps): React.JSX.Element;
|
|
60
|
+
export default function DocumentViewer({ leftSidebarOpen, rightSidebarOpen, activeTab, annotationManager, initialDoc, loadNonce, withCredentials, assets, sidebars, redactions, regexRedactions, scale, setScale, sidebarTab, setSidebarTab, onAnnotationsChange, onRedactionsChange, onRedactionsApplied, onDocumentLoaded, onLoadError, onFirstPageRendered, onPageRendered, onPageChange, pageTransition, pageLayout, rotation, setRotation, watermark, watermarkText, enableAnnotations: _enableAnnotations, initialPage, page, transientHighlights, permissions, hideAnnotationsUntilPageRendered, enableTextSelection, defaultTool, showSelectionTooltip }: DocumentViewerProps): React.JSX.Element;
|
|
59
61
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { DocumentLoadErrorInfo } from './DocumentViewer';
|
|
3
3
|
import { WebViewerInstance } from '../core/ViewerInstance';
|
|
4
|
-
import { WebViewerOptions, TransientHighlight } from '../core/types';
|
|
4
|
+
import { WebViewerOptions, Redaction, TransientHighlight } from '../core/types';
|
|
5
5
|
import { Annotation } from '../annotations/types';
|
|
6
6
|
export interface TeamSyncViewerProps extends Omit<WebViewerOptions, 'path'> {
|
|
7
7
|
/** URL of the PDF to display. Alias of `initialDoc`; `fileUrl` wins when both are set. */
|
|
@@ -33,6 +33,10 @@ export interface TeamSyncViewerProps extends Omit<WebViewerOptions, 'path'> {
|
|
|
33
33
|
}) => void;
|
|
34
34
|
onPageChange?: (pageNumber: number, numPages: number) => void;
|
|
35
35
|
onAnnotationsChange?: (annotations: Annotation[]) => void;
|
|
36
|
+
/** Fires whenever pending or applied redactions change in the viewer. */
|
|
37
|
+
onRedactionsChange?: (redactions: Redaction[]) => void;
|
|
38
|
+
/** Fires once per user click of Apply in the confirmation modal with all applied redactions. */
|
|
39
|
+
onRedactionsApplied?: (redactions: Redaction[]) => void;
|
|
36
40
|
/** Fires whenever transient highlights change. */
|
|
37
41
|
onTransientHighlightsChange?: (highlights: TransientHighlight[]) => void;
|
|
38
42
|
/** Fires whenever the user selects text within the document. */
|
|
@@ -96,6 +96,8 @@ export declare class WebViewerInstance {
|
|
|
96
96
|
tooltip?: string;
|
|
97
97
|
}): Promise<SearchResult | null>;
|
|
98
98
|
getAnnotations(): Annotation[];
|
|
99
|
+
/** Get the current list of redactions (pending and applied). */
|
|
100
|
+
getRedactions(): Redaction[];
|
|
99
101
|
/** Print the exported document (annotations, redactions and watermark baked in). */
|
|
100
102
|
print(): void;
|
|
101
103
|
/**
|
package/dist/src/core/types.d.ts
CHANGED
|
@@ -113,6 +113,10 @@ export interface WebViewerOptions {
|
|
|
113
113
|
defaultTool?: 'select' | 'pan';
|
|
114
114
|
/** Show floating quick-action copy badge above selected text (default true). */
|
|
115
115
|
showSelectionTooltip?: boolean;
|
|
116
|
+
/** Fires whenever pending or applied redactions change in the viewer. */
|
|
117
|
+
onRedactionsChange?: (redactions: Redaction[]) => void;
|
|
118
|
+
/** Fires once per user click of Apply in the confirmation modal with all applied redactions. */
|
|
119
|
+
onRedactionsApplied?: (redactions: Redaction[]) => void;
|
|
116
120
|
}
|
|
117
121
|
/** Events available through `instance.on(type, listener)`. */
|
|
118
122
|
export interface ViewerEventMap {
|
|
@@ -142,6 +146,12 @@ export interface ViewerEventMap {
|
|
|
142
146
|
};
|
|
143
147
|
/** Granular add / modify / delete (with the `imported` flag) from the AnnotationManager. */
|
|
144
148
|
annotationChanged: AnnotationChangedEvent;
|
|
149
|
+
redactionsChanged: {
|
|
150
|
+
redactions: Redaction[];
|
|
151
|
+
};
|
|
152
|
+
redactionsApplied: {
|
|
153
|
+
redactions: Redaction[];
|
|
154
|
+
};
|
|
145
155
|
transientHighlightsChanged: {
|
|
146
156
|
highlights: TransientHighlight[];
|
|
147
157
|
};
|