@shahajimbhosle/local-doc-viewer 1.0.0 → 1.0.2
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 +19 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29943 -29926
- package/dist/index.umd.cjs +113 -113
- package/dist/pdf.worker.min.mjs +21 -0
- package/dist/renderers/PdfRenderer.d.ts +1 -0
- package/dist/renderers/PdfRenderer.d.ts.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ By default, the viewer:
|
|
|
63
63
|
- Uses local `Blob` URLs for preview/download/print flows
|
|
64
64
|
- Sanitizes generated HTML and removes remote resource references from rendered HTML
|
|
65
65
|
- Removes external PPTX relationships before rendering so linked resources are not fetched
|
|
66
|
-
- Uses a
|
|
66
|
+
- Uses a packaged PDF.js worker instead of a CDN worker
|
|
67
67
|
|
|
68
68
|
If your app serves confidential documents from its own trusted private endpoint, opt in explicitly:
|
|
69
69
|
|
|
@@ -81,6 +81,24 @@ If your app serves confidential documents from its own trusted private endpoint,
|
|
|
81
81
|
|
|
82
82
|
For highly sensitive deployments, pair this with a strict Content Security Policy that blocks outbound connections except your own origin.
|
|
83
83
|
|
|
84
|
+
### PDF Worker
|
|
85
|
+
|
|
86
|
+
The PDF.js worker is published as a separate package asset at:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
@shahajimbhosle/local-doc-viewer/pdf.worker.min.mjs
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The viewer tries to resolve that worker automatically from the package bundle. If your build system serves package assets from a different location, copy `pdf.worker.min.mjs` to your public assets and configure it once before rendering PDFs:
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
import { configurePdfWorker } from '@shahajimbhosle/local-doc-viewer';
|
|
96
|
+
|
|
97
|
+
configurePdfWorker('/pdf.worker.min.mjs');
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The worker is intentionally not embedded as an inline base64 JavaScript data URL in the library bundle, because large inline executable payloads can trigger package malware scanners even when the code comes from PDF.js.
|
|
101
|
+
|
|
84
102
|
## Controls
|
|
85
103
|
|
|
86
104
|
The default control surface includes:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { DocumentViewer } from './DocumentViewer';
|
|
2
2
|
export { builtInRenderers } from './renderers';
|
|
3
|
+
export { configurePdfWorker } from './renderers/PdfRenderer';
|
|
3
4
|
export type { BinaryDocumentData, DocumentInfo, DocumentRenderer, DocumentRendererProps, DocumentSource, DocumentViewerControls, DocumentViewerLabels, DocumentViewerProps, FitMode, RendererActions, ResolvedDocument, ResolvedDocumentViewerControls, SearchStats, ViewerRuntimeState, } from './types';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,8BAA8B,EAC9B,WAAW,EACX,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,8BAA8B,EAC9B,WAAW,EACX,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
|