@iamjariwala/react-doc-viewer 1.5.0 → 1.6.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/README.md +24 -7
- package/dist/components/CommonToolbar.d.ts +14 -0
- package/dist/{index-BDy_G-6x.js → index--dJZvZe8.js} +2 -2
- package/dist/{index-Ba7-TkGo.js → index-CIbou6J_.js} +7716 -7326
- package/dist/{index-DN_5oCsl.cjs → index-DodZ2MFt.cjs} +1 -1
- package/dist/{index-BMTSVg1c.cjs → index-DuxxqB5A.cjs} +1 -1
- package/dist/{index-MuffK10n.js → index-Gxy84XUC.js} +2 -2
- package/dist/index-Wjgevdpq.cjs +77 -0
- package/dist/index.css +1 -1
- package/dist/react-doc-viewer.cjs +1 -1
- package/dist/react-doc-viewer.js +1 -1
- package/dist/renderers/pdf/components/pages/PDFAllPages.d.ts +1 -5
- package/dist/renderers/pdf/state/actions.d.ts +7 -1
- package/dist/renderers/pdf/state/reducer.d.ts +1 -0
- package/dist/{url-CBUIAJr7.js → url-C8IT7FoP.js} +1 -1
- package/dist/{url-BKzIFWJ6.cjs → url-Cm3u07j7.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-CnEWg8Vs.cjs +0 -77
package/README.md
CHANGED
|
@@ -85,9 +85,11 @@ Looking for the best React document viewer? Here's how `@iamjariwala/react-doc-v
|
|
|
85
85
|
| Office docs (Word, Excel, PPT) | Yes | -- | Yes | Partial |
|
|
86
86
|
| Images (PNG, JPG, GIF, WebP, TIFF, BMP) | Yes | -- | Yes | Partial |
|
|
87
87
|
| Video (MP4) | Yes | -- | Yes | Yes |
|
|
88
|
+
| Markdown / RTF | Yes | -- | -- | -- |
|
|
88
89
|
| CSV / TXT / HTML | Yes | -- | Yes | Partial |
|
|
90
|
+
| Toolbar for all file types | Yes | -- | -- | -- |
|
|
89
91
|
| Dark Mode (light / dark / auto) | Yes | -- | -- | -- |
|
|
90
|
-
| Text Search
|
|
92
|
+
| Text Search with highlighting | Yes | -- | -- | -- |
|
|
91
93
|
| Annotations (highlight, draw, comment) | Yes | -- | -- | -- |
|
|
92
94
|
| Keyboard Shortcuts | Yes | -- | -- | -- |
|
|
93
95
|
| Watermark Overlay | Yes | -- | -- | -- |
|
|
@@ -108,7 +110,7 @@ Looking for the best React document viewer? Here's how `@iamjariwala/react-doc-v
|
|
|
108
110
|
| Tree-shakeable | Yes | Yes | -- | -- |
|
|
109
111
|
| No external services | Yes | Yes | -- | -- |
|
|
110
112
|
| Zero styled-components | Yes | Yes | -- | -- |
|
|
111
|
-
| Actively maintained (
|
|
113
|
+
| Actively maintained (2026) | Yes | Yes | -- | -- |
|
|
112
114
|
| License | Apache-2.0 | MIT | MIT | MIT |
|
|
113
115
|
|
|
114
116
|
> **TL;DR** -- If you only render PDFs, `react-pdf` is lighter. If you need multi-format support with a professional-grade feature set (search, annotations, dark mode, keyboard shortcuts, watermarks, bookmarks, split view, and more), this library covers all of it in a single package.
|
|
@@ -127,6 +129,19 @@ Looking for the best React document viewer? Here's how `@iamjariwala/react-doc-v
|
|
|
127
129
|
|
|
128
130
|
---
|
|
129
131
|
|
|
132
|
+
### What's New in v1.6.0
|
|
133
|
+
|
|
134
|
+
- **Common Toolbar for All File Types** -- Non-PDF renderers (DOCX, images, text, markdown, RTF, CSV) now have a toolbar with download, print, and zoom controls
|
|
135
|
+
- **DOCX Inline Rendering** -- Word documents render inline with full formatting using `docx-preview` instead of download cards
|
|
136
|
+
- **DOCX Page Navigation** -- Multi-page DOCX documents show page controls (prev/next, page input, jump-to-page) with automatic page detection
|
|
137
|
+
- **Markdown Renderer** -- Native markdown rendering with headings, lists, links, code blocks, and formatting
|
|
138
|
+
- **RTF Renderer** -- Rich Text Format file support
|
|
139
|
+
- **Search Highlighting** -- Text search now highlights matched text with yellow background directly in the PDF
|
|
140
|
+
- **Search Page Navigation** -- Clicking next/prev match automatically navigates to the page containing the match
|
|
141
|
+
- **PDF Scroll Mode Navigation** -- Page prev/next buttons now scroll to the correct page in scroll (continuous) mode
|
|
142
|
+
- **Sticky Header** -- Header bar stays fixed at the top when scrolling through documents
|
|
143
|
+
- **Improved Storybook Organization** -- Stories reorganized into categorized navigation (Core, Features, File Types, Upload)
|
|
144
|
+
|
|
130
145
|
### What's New in v1.3.0
|
|
131
146
|
|
|
132
147
|
**11 new features** that bring the viewer to professional-grade quality:
|
|
@@ -223,8 +238,10 @@ Looking for the best React document viewer? Here's how `@iamjariwala/react-doc-v
|
|
|
223
238
|
| txt | `text/plain` | Monospace text viewer |
|
|
224
239
|
| htm / html | `text/htm`, `text/html` | Sandboxed iframe with DOMPurify sanitization |
|
|
225
240
|
| mp4 | `video/mp4` | Native video player with controls |
|
|
241
|
+
| md | `text/markdown` | Parsed markdown with headings, lists, code, links |
|
|
242
|
+
| rtf | `application/rtf` | Rich text viewer |
|
|
226
243
|
| doc | `application/msword` | Download card |
|
|
227
|
-
| docx | `application/vnd.openxmlformats-officedocument.wordprocessingml.document` |
|
|
244
|
+
| docx | `application/vnd.openxmlformats-officedocument.wordprocessingml.document` | Inline rendered with page navigation and formatting |
|
|
228
245
|
| xls | `application/vnd.ms-excel` | Download card |
|
|
229
246
|
| xlsx | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` | Download card |
|
|
230
247
|
| ppt | `application/vnd.ms-powerpoint` | Download card |
|
|
@@ -232,7 +249,7 @@ Looking for the best React document viewer? Here's how `@iamjariwala/react-doc-v
|
|
|
232
249
|
| odt | `application/vnd.oasis.opendocument.text` | Download card |
|
|
233
250
|
|
|
234
251
|
> [!NOTE]
|
|
235
|
-
> MS Office
|
|
252
|
+
> DOCX files render inline with full formatting (headings, tables, lists, styles) using `docx-preview`. Multi-page DOCX documents include page navigation controls. Other MS Office formats (doc, xls, xlsx, ppt, pptx) render as download cards. No external service or public URL is required.
|
|
236
253
|
|
|
237
254
|
## Live Demo
|
|
238
255
|
|
|
@@ -440,7 +457,7 @@ import DocViewer, { PDFRenderer, PNGRenderer } from "@iamjariwala/react-doc-view
|
|
|
440
457
|
<DocViewer pluginRenderers={[PDFRenderer, PNGRenderer]} documents={docs} />;
|
|
441
458
|
```
|
|
442
459
|
|
|
443
|
-
**Available renderers:** `BMPRenderer`, `CSVRenderer`, `GIFRenderer`, `HTMLRenderer`, `JPGRenderer`, `MSDocRenderer`, `PDFRenderer`, `PNGRenderer`, `TIFFRenderer`, `TXTRenderer`, `VideoRenderer`, `WebPRenderer`
|
|
460
|
+
**Available renderers:** `BMPRenderer`, `CSVRenderer`, `DocxRenderer`, `GIFRenderer`, `HTMLRenderer`, `JPGRenderer`, `MarkdownRenderer`, `MSDocRenderer`, `PDFRenderer`, `PNGRenderer`, `RTFRenderer`, `TIFFRenderer`, `TXTRenderer`, `VideoRenderer`, `WebPRenderer`
|
|
444
461
|
|
|
445
462
|
### Custom Renderer
|
|
446
463
|
|
|
@@ -502,7 +519,7 @@ The `"auto"` mode listens for system theme changes in real-time. All dark mode s
|
|
|
502
519
|
|
|
503
520
|
### Text Search in PDF
|
|
504
521
|
|
|
505
|
-
Full-text search across all pages using the pdfjs text extraction API. Displays match count with prev/next navigation.
|
|
522
|
+
Full-text search across all pages using the pdfjs text extraction API. Matched text is highlighted with a yellow background directly in the PDF. Displays match count with prev/next navigation that automatically jumps to the page containing the match.
|
|
506
523
|
|
|
507
524
|
```tsx
|
|
508
525
|
<DocViewer
|
|
@@ -519,7 +536,7 @@ Full-text search across all pages using the pdfjs text extraction API. Displays
|
|
|
519
536
|
| ------ | ---- | ------- | ----------- |
|
|
520
537
|
| `enableSearch` | `boolean` | `false` | Show search icon in toolbar and enable Ctrl+F shortcut |
|
|
521
538
|
|
|
522
|
-
When enabled, a search icon appears in the toolbar. Click it or press **Ctrl+F** to open the search bar. Press **Enter** to go to the next match, **Shift+Enter** for the previous match, and **Escape** to close.
|
|
539
|
+
When enabled, a search icon appears in the toolbar. Click it or press **Ctrl+F** to open the search bar. Type to search -- matched text is highlighted in yellow directly on the PDF pages. Press **Enter** to go to the next match (auto-navigates to the correct page), **Shift+Enter** for the previous match, and **Escape** to close.
|
|
523
540
|
|
|
524
541
|
### Keyboard Shortcuts
|
|
525
542
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
interface CommonToolbarProps {
|
|
4
|
+
zoomLevel: number;
|
|
5
|
+
onZoomIn: () => void;
|
|
6
|
+
onZoomOut: () => void;
|
|
7
|
+
onZoomReset: () => void;
|
|
8
|
+
numPages: number;
|
|
9
|
+
currentPage: number;
|
|
10
|
+
onPageChange: (page: number) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const DEFAULT_ZOOM = 1;
|
|
13
|
+
export declare const CommonToolbar: FC<CommonToolbarProps>;
|
|
14
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as u } from "./index-
|
|
2
|
-
import { s as l, r as g } from "./index-
|
|
1
|
+
import { g as u } from "./index-CIbou6J_.js";
|
|
2
|
+
import { s as l, r as g } from "./index-Gxy84XUC.js";
|
|
3
3
|
function h(i, o) {
|
|
4
4
|
for (var f = 0; f < o.length; f++) {
|
|
5
5
|
const r = o[f];
|