pdfjs-annotation-extension-for-react 0.1.5 → 0.2.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 +33 -30
- package/dist/{exceljs.min-B7fHvxww.cjs → exceljs.min-B5c5PPGJ.cjs} +1 -1
- package/dist/{exceljs.min-B403urw7.js → exceljs.min-DbvGAX2r.js} +1 -1
- package/dist/{index-Bog6up9g.js → index-CzUW2GJH.js} +19291 -18970
- package/dist/index-D3SubjD7.cjs +397 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +36 -12
- package/dist/index.es.js +1 -1
- package/dist/pdfjs-annotation-extension-for-react.css +1 -1
- package/package.json +1 -1
- package/dist/index-Cnht7wRN.cjs +0 -397
package/README.md
CHANGED
|
@@ -136,6 +136,7 @@ An advanced PDF viewer with annotation capabilities.
|
|
|
136
136
|
| --------------------------- | ------------------------------------------------------------------- | ----------------------------------- | -------------------------------------------------------------------- |
|
|
137
137
|
| `user` | `User` | `{ id: 'null', name: 'unknown' }` | Current user information<br />used to identify the annotation author |
|
|
138
138
|
| `enableNativeAnnotations` | `boolean` | `false` | Native annotations embedded in the PDF file |
|
|
139
|
+
| `defaultShowAnnotationsSidebar` | `boolean` | `false` | Show Annotations Sidebar |
|
|
139
140
|
| `defaultOptions` | `DeepPartial` | — | Default configuration for the annotator; |
|
|
140
141
|
| `initialAnnotations` | `IAnnotationStore[]` | — | Existing annotations to be rendered during initialization |
|
|
141
142
|
| `actions` | `React.ReactNode \| React.ComponentType` | — | Custom actions area |
|
|
@@ -271,10 +272,10 @@ A lightweight PDF viewer with toolbar, sidebar, actions and extensible UI slots.
|
|
|
271
272
|
| Name | Type | Default | Description |
|
|
272
273
|
| ---------------------- | ------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------ |
|
|
273
274
|
| `actions` | `React.ReactNode \| (context: PdfViewerContextValue) => React.ReactNode` | — | Custom actions area in the toolbar |
|
|
274
|
-
| `sidebar` | `
|
|
275
|
+
| `sidebar` | `SidebarPanel[]` | — | Custom sidebar component |
|
|
275
276
|
| `toolbar` | `React.ReactNode \| (context: PdfViewerContextValue) => React.ReactNode` | — | Custom toolbar component |
|
|
276
|
-
| `showSidebarTrigger` | `boolean` | `false` | Whether to display a button to toggle the sidebar visibility |
|
|
277
277
|
| `showTextLayer` | `boolean` | `true` | Whether to render the text layer |
|
|
278
|
+
| `defaultActiveSidebarKey` | `string` | null | Default Active Sidebar Key |
|
|
278
279
|
| `onDocumentLoaded` | `(pdfViewer: PDFViewer \| null) => void` | — | Callback invoked when the PDF <br />document is fully loaded and the viewer is initialized |
|
|
279
280
|
| `onEventBusReady` | `(eventBus: EventBus \| null) => void` | — | Callback invoked when the pdf.js EventBus is ready |
|
|
280
281
|
|
|
@@ -309,34 +310,36 @@ A lightweight PDF viewer with toolbar, sidebar, actions and extensible UI slots.
|
|
|
309
310
|
```jsx
|
|
310
311
|
<PdfViewer
|
|
311
312
|
url={pdfUrl}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
313
|
+
sidebar={[{
|
|
314
|
+
key: 'sidebar-1',
|
|
315
|
+
title: 'Sidebar 1',
|
|
316
|
+
icon: <BsLayoutTextSidebar />,
|
|
317
|
+
render: (context) => (
|
|
318
|
+
<div style={{ display: 'flex', gap: 10, flexDirection: 'column' }}>
|
|
319
|
+
Sidebar 1
|
|
320
|
+
<button onClick={context.toggleSidebar}>
|
|
321
|
+
toggleSidebar
|
|
322
|
+
</button>
|
|
323
|
+
<button onClick={() => console.log(context.pdfViewer)}>
|
|
324
|
+
Get PDF Viewer
|
|
325
|
+
</button>
|
|
326
|
+
<button onClick={() => {
|
|
327
|
+
context.pdfViewer?.scrollPageIntoView({
|
|
328
|
+
pageNumber: 1
|
|
329
|
+
})
|
|
330
|
+
}}>
|
|
331
|
+
goto page1
|
|
332
|
+
</button>
|
|
333
|
+
<button onClick={() => {
|
|
334
|
+
context.pdfViewer?.scrollPageIntoView({
|
|
335
|
+
pageNumber: 10
|
|
336
|
+
})
|
|
337
|
+
}}>
|
|
338
|
+
goto page 10
|
|
339
|
+
</button>
|
|
340
|
+
</div>
|
|
341
|
+
)
|
|
342
|
+
}]}
|
|
340
343
|
/>
|
|
341
344
|
```
|
|
342
345
|
|