teamsync-pdf-viewer 1.4.0 → 1.5.0
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 +9 -0
- package/dist/src/annotations/types.d.ts +1 -1
- package/dist/src/components/PageRenderer.d.ts +4 -1
- package/dist/src/components/TextSelectionTooltip.d.ts +1 -0
- package/dist/src/core/types.d.ts +1 -1
- package/dist/teamsync-pdf-viewer.js +2138 -1468
- package/dist/teamsync-pdf-viewer.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `teamsync-pdf-viewer` are documented here.
|
|
4
4
|
|
|
5
|
+
## [1.5.0] — 2026-09-05
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Undo & Redo Annotation Actions**: Added dedicated Undo and Redo buttons to the Annotate toolbar with live state reflection bound to history, alongside existing keyboard shortcuts (`Cmd+Z`/`Ctrl+Z` and `Cmd+Shift+Z`/`Ctrl+Y`).
|
|
9
|
+
- **Underline, Strikeout & Squiggly Tools**: Added first-class text markup annotations with toolbar tools, stroke width and color controls, drag creation, selection tooltip quick actions, SVG rendering (straight lines and sinusoidal waves), full XFDF export/import roundtrip, and PDF export baking via `pdf-lib`.
|
|
10
|
+
- **Text Annotation Automatic Word-Wrapping**: Text annotations now automatically wrap multi-line text cleanly inside SVG `<foreignObject>` containers (`word-break: break-word`, `overflow-wrap: break-word`, `white-space: pre-wrap`) and in baked PDF exports via dynamic text wrapping.
|
|
11
|
+
- **Interactive 8-Handle Text Resizing**: Text annotations now feature an interactive selection bounding box with 8 resize handles (`nw`, `n`, `ne`, `e`, `se`, `s`, `sw`, `w`) with directional cursors, real-time live text reflow during drag, and single-step undo history.
|
|
12
|
+
- **Quick-Markup Selection Tooltip**: Extended the floating selection tooltip with `[Highlight]`, `[Underline]`, `[Strikeout]`, and `[Squiggly]` quick actions.
|
|
13
|
+
|
|
5
14
|
## [1.4.0] — 2026-09-04
|
|
6
15
|
|
|
7
16
|
### Added
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* /Rotate applied (top-left origin, PDF points). UI rotation applied by the viewer is composed on
|
|
7
7
|
* top of this space at render time, so stored annotations are independent of the current view.
|
|
8
8
|
*/
|
|
9
|
-
export type AnnotationType = 'rectangle' | 'ellipse' | 'line' | 'arrow' | 'freehand' | 'text' | 'note' | 'callout' | 'signature' | 'highlight' | 'digital_signature_placeholder' | 'link'
|
|
9
|
+
export type AnnotationType = 'rectangle' | 'ellipse' | 'line' | 'arrow' | 'freehand' | 'text' | 'note' | 'callout' | 'signature' | 'highlight' | 'underline' | 'strikeout' | 'squiggly' | 'digital_signature_placeholder' | 'link'
|
|
10
10
|
/**
|
|
11
11
|
* An annotation imported from XFDF that this viewer cannot edit or render natively (e.g.
|
|
12
12
|
* underline, squiggly, polygon, redaction). It is drawn as a read-only outline at its bounding
|
|
@@ -27,6 +27,9 @@ interface PageRendererProps {
|
|
|
27
27
|
onMouseMove: (e: React.MouseEvent<Element>, pageNum: number) => void;
|
|
28
28
|
onMouseUp: (e: React.MouseEvent<Element>, pageNum: number) => void;
|
|
29
29
|
onAnnotationClick: (id: string, e: React.MouseEvent) => void;
|
|
30
|
+
onAnnotationDoubleClick?: (id: string, e: React.MouseEvent) => void;
|
|
31
|
+
onStartResize?: (id: string, handle: string, e: React.MouseEvent, pageNum: number) => void;
|
|
32
|
+
onStartMove?: (id: string, e: React.MouseEvent, pageNum: number) => void;
|
|
30
33
|
onAnnotationMouseEnter: (id: string) => void;
|
|
31
34
|
onClearSelection: () => void;
|
|
32
35
|
watermark?: WatermarkOptions;
|
|
@@ -38,6 +41,6 @@ interface PageRendererProps {
|
|
|
38
41
|
/** Whether to hide annotations and transient highlights until the page canvas has finished rendering. Default: true. */
|
|
39
42
|
hideAnnotationsUntilPageRendered?: boolean;
|
|
40
43
|
}
|
|
41
|
-
declare function PageRendererComponent({ pageNum, pdfDoc, scale, rotation, containerWidth: _containerWidth, containerHeight: _containerHeight, scrollTop: _scrollTop, scrollLeft: _scrollLeft, pageTop, pageLeft, basePageWidth, basePageHeight, activeTab, activeTool, annotations, selectedAnnotationId, activeSearchResult, transientHighlights, onMouseDown, onMouseMove, onMouseUp, onAnnotationClick, onAnnotationMouseEnter, onClearSelection, watermark, watermarkText, redactions, onDiscardRedaction, onRendered, hideAnnotationsUntilPageRendered }: PageRendererProps): React.JSX.Element;
|
|
44
|
+
declare function PageRendererComponent({ pageNum, pdfDoc, scale, rotation, containerWidth: _containerWidth, containerHeight: _containerHeight, scrollTop: _scrollTop, scrollLeft: _scrollLeft, pageTop, pageLeft, basePageWidth, basePageHeight, activeTab, activeTool, annotations, selectedAnnotationId, activeSearchResult, transientHighlights, onMouseDown, onMouseMove, onMouseUp, onAnnotationClick, onAnnotationDoubleClick, onStartResize, onStartMove, onAnnotationMouseEnter, onClearSelection, watermark, watermarkText, redactions, onDiscardRedaction, onRendered, hideAnnotationsUntilPageRendered }: PageRendererProps): React.JSX.Element;
|
|
42
45
|
declare const PageRenderer: React.MemoExoticComponent<typeof PageRendererComponent>;
|
|
43
46
|
export default PageRenderer;
|
|
@@ -2,6 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
interface TextSelectionTooltipProps {
|
|
3
3
|
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
4
4
|
onCopy?: (text: string) => void;
|
|
5
|
+
onAnnotateSelection?: (type: 'highlight' | 'underline' | 'strikeout' | 'squiggly') => void;
|
|
5
6
|
}
|
|
6
7
|
export declare const TextSelectionTooltip: React.FC<TextSelectionTooltipProps>;
|
|
7
8
|
export default TextSelectionTooltip;
|
package/dist/src/core/types.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export interface ViewerUser {
|
|
|
54
54
|
name: string;
|
|
55
55
|
}
|
|
56
56
|
export type InitialScale = number | 'fit-width' | 'fit-page';
|
|
57
|
-
export type ToolMode = 'select' | 'pan' | 'rectangle' | 'ellipse' | 'line' | 'arrow' | 'freehand' | 'highlight' | 'text' | 'eraser' | 'note' | 'callout' | 'signature' | 'digital_signature' | 'link' | 'redaction' | null;
|
|
57
|
+
export type ToolMode = 'select' | 'pan' | 'rectangle' | 'ellipse' | 'line' | 'arrow' | 'freehand' | 'highlight' | 'underline' | 'strikeout' | 'squiggly' | 'text' | 'eraser' | 'note' | 'callout' | 'signature' | 'digital_signature' | 'link' | 'redaction' | null;
|
|
58
58
|
/**
|
|
59
59
|
* Options accepted by `createWebViewer()` (and the deprecated `WebViewer()` alias).
|
|
60
60
|
* Every option is also available as a prop on `<TeamSyncViewer>`.
|