react-pdf-highlighter-plus 1.1.4 → 1.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 +152 -20
- package/dist/esm/index.d.ts +104 -9
- package/dist/esm/index.js +1031 -137
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/style/PdfHighlighter.css +53 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,8 +46,13 @@
|
|
|
46
46
|
| **PDF Search** | Search through all PDF text with next/previous navigation |
|
|
47
47
|
| **PDF Export** | Export annotated PDF with all highlights embedded |
|
|
48
48
|
| **Local PDF Worker** | Uses the packaged PDF.js worker by default |
|
|
49
|
-
| **Light/Dark Theme** |
|
|
50
|
-
| **Zoom Support** |
|
|
49
|
+
| **Light/Dark Theme** | Hue-preserving dark mode (OKLab recolor) — photos & colors stay readable |
|
|
50
|
+
| **Zoom Support** | Buttons, **pinch / ctrl+wheel zoom**, position-independent data |
|
|
51
|
+
| **Smooth Scroll** | Animated scroll-to-highlight (respects reduced-motion) |
|
|
52
|
+
| **Deep Linking** | `initialPage` + `onPageChange` for `?page=N` style navigation |
|
|
53
|
+
| **Locate Text** | `getTextPosition` — turn any quote into a precise highlight (citations) |
|
|
54
|
+
| **Read Aloud** | Text-to-speech that highlights & follows each sentence (recipe) |
|
|
55
|
+
| **Fast Loading** | Progressive range loading, auth headers, document caching |
|
|
51
56
|
| **Fully Customizable** | Exposed styling on all components |
|
|
52
57
|
|
|
53
58
|
## Quick Links
|
|
@@ -299,10 +304,13 @@ highlighterUtilsRef.current?.clearSearch();
|
|
|
299
304
|
|
|
300
305
|
## Light/Dark Theme
|
|
301
306
|
|
|
302
|
-
|
|
307
|
+
Dark mode recolors each page **at render time** using a hue-preserving OKLab map —
|
|
308
|
+
white paper maps to a dark background and black text to a light foreground, while
|
|
309
|
+
**colors keep their hue and embedded photos keep their pixels** (unlike a CSS
|
|
310
|
+
`invert()` filter). Highlights, the text selection, and the left panel all adapt.
|
|
303
311
|
|
|
304
312
|
```tsx
|
|
305
|
-
// Enable dark mode
|
|
313
|
+
// Enable dark mode (warm-gray default palette)
|
|
306
314
|
<PdfHighlighter
|
|
307
315
|
pdfDocument={pdfDocument}
|
|
308
316
|
theme={{ mode: "dark" }}
|
|
@@ -311,12 +319,15 @@ Toggle between light and dark modes with customizable styling for comfortable re
|
|
|
311
319
|
<HighlightContainer />
|
|
312
320
|
</PdfHighlighter>
|
|
313
321
|
|
|
314
|
-
// Customize dark
|
|
322
|
+
// Customize the dark palette
|
|
315
323
|
<PdfHighlighter
|
|
316
324
|
pdfDocument={pdfDocument}
|
|
317
325
|
theme={{
|
|
318
326
|
mode: "dark",
|
|
319
|
-
|
|
327
|
+
darkModeColors: {
|
|
328
|
+
background: "#141210", // replaces white paper
|
|
329
|
+
foreground: "#eae6e0", // replaces black text / line-art
|
|
330
|
+
},
|
|
320
331
|
containerBackgroundColor: "#3a3a3a",
|
|
321
332
|
scrollbarThumbColor: "#6b6b6b",
|
|
322
333
|
scrollbarTrackColor: "#2c2c2c",
|
|
@@ -327,25 +338,146 @@ Toggle between light and dark modes with customizable styling for comfortable re
|
|
|
327
338
|
</PdfHighlighter>
|
|
328
339
|
```
|
|
329
340
|
|
|
330
|
-
**
|
|
331
|
-
-
|
|
332
|
-
-
|
|
333
|
-
-
|
|
334
|
-
-
|
|
335
|
-
-
|
|
336
|
-
|
|
337
|
-
**
|
|
338
|
-
|
|
339
|
-
|-------|--------|----------|
|
|
340
|
-
| `1.0` | Pure black | High contrast |
|
|
341
|
-
| `0.9` | Dark gray (~#1a1a1a) | **Recommended** |
|
|
342
|
-
| `0.85` | Softer gray (~#262626) | Long reading sessions |
|
|
343
|
-
| `0.8` | Medium gray (~#333333) | Maximum comfort |
|
|
341
|
+
**Highlights:**
|
|
342
|
+
- Hue-preserving recolor (red stays red, blue links stay blue); photos untouched.
|
|
343
|
+
- Highlights stay readable: translucent fill + a border, with no `mix-blend` wash-out.
|
|
344
|
+
- Scroll **and** zoom are preserved when toggling the theme.
|
|
345
|
+
- `LeftPanel` accepts `mode="dark"` so the outline/thumbnails panel matches.
|
|
346
|
+
- Drawing/shape default ink becomes white in dark mode.
|
|
347
|
+
|
|
348
|
+
> **Deprecated:** `theme.darkModeInvertIntensity` is ignored — dark mode no longer
|
|
349
|
+
> uses a CSS `invert()` filter. Use `theme.darkModeColors` instead.
|
|
344
350
|
|
|
345
351
|
[Full Documentation →](docs/theming.md)
|
|
346
352
|
|
|
347
353
|
---
|
|
348
354
|
|
|
355
|
+
## Loading & Performance
|
|
356
|
+
|
|
357
|
+
`PdfLoader` loads documents progressively and caches them.
|
|
358
|
+
|
|
359
|
+
```tsx
|
|
360
|
+
<PdfLoader
|
|
361
|
+
document="https://api.example.com/files/report.pdf"
|
|
362
|
+
// Fetch only the pages needed to render first (needs server HTTP range support)
|
|
363
|
+
disableAutoFetch={true}
|
|
364
|
+
// Auth / cross-origin
|
|
365
|
+
httpHeaders={{ Authorization: `Bearer ${token}` }}
|
|
366
|
+
withCredentials={false}
|
|
367
|
+
// Reuse the same URL instantly on remount / re-open (default true)
|
|
368
|
+
enableCache={true}
|
|
369
|
+
>
|
|
370
|
+
{(pdfDocument) => <PdfHighlighter pdfDocument={pdfDocument} /* … */ />}
|
|
371
|
+
</PdfLoader>
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
| Prop | Default | Description |
|
|
375
|
+
|------|---------|-------------|
|
|
376
|
+
| `disableAutoFetch` | `true` | Fetch pages on demand instead of the whole file (first page shows fast on range-capable servers) |
|
|
377
|
+
| `disableStream` | `false` | Disable progressive streaming |
|
|
378
|
+
| `rangeChunkSize` | pdf.js | Size of each range request in bytes |
|
|
379
|
+
| `httpHeaders` | – | Extra request headers (e.g. an auth token) |
|
|
380
|
+
| `withCredentials` | `false` | Send cookies with the request |
|
|
381
|
+
| `enableCache` | `true` | Cache the loaded document by URL (also dedupes StrictMode double-mount) |
|
|
382
|
+
| `beforeLoad` | spinner | Render while loading; receives progress or `null` |
|
|
383
|
+
|
|
384
|
+
> Progressive loading requires the server to support HTTP range requests
|
|
385
|
+
> (`Accept-Ranges: bytes`) **and** expose `Content-Range` via CORS.
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## Navigation, Zoom & Smooth Scroll
|
|
390
|
+
|
|
391
|
+
```tsx
|
|
392
|
+
<PdfHighlighter
|
|
393
|
+
pdfDocument={pdfDocument}
|
|
394
|
+
initialPage={12} // jump here on first load (deep-link)
|
|
395
|
+
onPageChange={(page) => syncUrl(page)} // current page changed
|
|
396
|
+
onZoomChange={(scale) => setZoom(scale)} // pinch / ctrl+wheel zoom changed
|
|
397
|
+
highlights={highlights}
|
|
398
|
+
>
|
|
399
|
+
<HighlightContainer />
|
|
400
|
+
</PdfHighlighter>
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
- **Pinch / ctrl(⌘)+wheel zoom** is built in — smooth (GPU transform during the
|
|
404
|
+
gesture, one crisp re-render on settle), anchored to the cursor.
|
|
405
|
+
- **`scrollToHighlight(highlight)`** (from `usePdfHighlighterContext`) now scrolls
|
|
406
|
+
**smoothly** and respects `prefers-reduced-motion`.
|
|
407
|
+
- `initialPage` is applied once on load; `onPageChange` fires as the visible page
|
|
408
|
+
changes — wire them to a `?page=N` URL for deep links.
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## Locating Text (Citations)
|
|
413
|
+
|
|
414
|
+
`getTextPosition` finds a piece of text in the PDF and returns a precise
|
|
415
|
+
`ScaledPosition` — turn an external quote (e.g. an AI citation) into a highlight
|
|
416
|
+
you can render or scroll to. Matching ignores whitespace/line-wraps and falls
|
|
417
|
+
back to fuzzy matching.
|
|
418
|
+
|
|
419
|
+
```tsx
|
|
420
|
+
import { getTextPosition } from "react-pdf-highlighter-plus";
|
|
421
|
+
|
|
422
|
+
const match = await getTextPosition(pdfDocument, "the exact or near-exact quote");
|
|
423
|
+
if (match) {
|
|
424
|
+
const citation = {
|
|
425
|
+
id: "cite-1",
|
|
426
|
+
type: "text",
|
|
427
|
+
content: { text: match.matchedText },
|
|
428
|
+
position: match.position, // precise rects, page-independent
|
|
429
|
+
};
|
|
430
|
+
setHighlights((prev) => [citation, ...prev]);
|
|
431
|
+
utils.scrollToHighlight(citation); // smooth scroll + flash
|
|
432
|
+
}
|
|
433
|
+
// match: { position, pageNumber, matchedText, confidence: "exact" | "fuzzy" }
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## Read Aloud (Text-to-Speech)
|
|
439
|
+
|
|
440
|
+
Build a read-aloud / "PDF to audio" experience: speak the document and
|
|
441
|
+
highlight + auto-scroll to each sentence as it's read. The pieces are already
|
|
442
|
+
here — `extractSentences` gives the ordered script (text + position) and
|
|
443
|
+
`scrollToHighlight` follows along. The TTS engine is yours to choose (the
|
|
444
|
+
browser `speechSynthesis`, or a cloud voice).
|
|
445
|
+
|
|
446
|
+
```tsx
|
|
447
|
+
import { extractSentences } from "react-pdf-highlighter-plus";
|
|
448
|
+
|
|
449
|
+
// 1. Build the ordered script once.
|
|
450
|
+
const sentences = (
|
|
451
|
+
await extractSentences(pdfDocument, { includePositions: true })
|
|
452
|
+
).filter((s) => s.position);
|
|
453
|
+
|
|
454
|
+
// 2. Speak each sentence; highlight + scroll as it starts.
|
|
455
|
+
function readFrom(index: number) {
|
|
456
|
+
const s = sentences[index];
|
|
457
|
+
if (!s) return;
|
|
458
|
+
|
|
459
|
+
const reading = {
|
|
460
|
+
id: "reading",
|
|
461
|
+
type: "text",
|
|
462
|
+
content: { text: s.text },
|
|
463
|
+
position: s.position!,
|
|
464
|
+
};
|
|
465
|
+
setHighlights((prev) => [reading, ...prev.filter((h) => h.id !== "reading")]);
|
|
466
|
+
utils.scrollToHighlight(reading); // smooth follow
|
|
467
|
+
|
|
468
|
+
const utter = new SpeechSynthesisUtterance(s.text);
|
|
469
|
+
utter.onend = () => readFrom(index + 1); // advance
|
|
470
|
+
speechSynthesis.speak(utter);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
readFrom(0);
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
Swap `speechSynthesis` for any engine — sentence-level sync needs no word
|
|
477
|
+
timing. See the example app for a full transport (play/pause/seek/speed/voice).
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
349
481
|
## PDF Export
|
|
350
482
|
|
|
351
483
|
Export your annotated PDF with all highlights embedded.
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -476,8 +476,8 @@ declare const usePdfHighlighterContext: () => PdfHighlighterUtils;
|
|
|
476
476
|
*/
|
|
477
477
|
interface PdfHighlighterTheme {
|
|
478
478
|
/**
|
|
479
|
-
* Theme mode
|
|
480
|
-
*
|
|
479
|
+
* Theme mode. In dark mode, pages are recolored at draw time (hue-preserving,
|
|
480
|
+
* photos kept) using {@link PdfHighlighterTheme.darkModeColors}.
|
|
481
481
|
* @default "light"
|
|
482
482
|
*/
|
|
483
483
|
mode?: "light" | "dark";
|
|
@@ -504,8 +504,24 @@ interface PdfHighlighterTheme {
|
|
|
504
504
|
* - 0.85 = Softer gray ~#262626 (very comfortable)
|
|
505
505
|
* - 0.8 = Medium gray ~#333333 (maximum softness)
|
|
506
506
|
* @default 0.9
|
|
507
|
+
* @deprecated Dark mode now recolors at draw time (OKLab, hue-preserving,
|
|
508
|
+
* photos untouched) instead of a CSS `invert()` filter. This value is
|
|
509
|
+
* ignored. Use {@link PdfHighlighterTheme.darkModeColors} instead.
|
|
507
510
|
*/
|
|
508
511
|
darkModeInvertIntensity?: number;
|
|
512
|
+
/**
|
|
513
|
+
* Dark-mode recolor palette. White paper maps to `background` and black
|
|
514
|
+
* text/line-art to `foreground`, recolored per-color at draw time (OKLab
|
|
515
|
+
* ramp) so hues are preserved and embedded photos keep their pixels.
|
|
516
|
+
* Only used when `mode === "dark"`.
|
|
517
|
+
* @default { background: "#141210", foreground: "#eae6e0" }
|
|
518
|
+
*/
|
|
519
|
+
darkModeColors?: {
|
|
520
|
+
/** Replaces the white paper background. */
|
|
521
|
+
background: string;
|
|
522
|
+
/** Replaces black text and line art. */
|
|
523
|
+
foreground: string;
|
|
524
|
+
};
|
|
509
525
|
}
|
|
510
526
|
/**
|
|
511
527
|
* The props type for {@link PdfHighlighter}.
|
|
@@ -527,6 +543,27 @@ interface PdfHighlighterProps {
|
|
|
527
543
|
* What scale to render the PDF at inside the viewer.
|
|
528
544
|
*/
|
|
529
545
|
pdfScaleValue?: PdfScaleValue;
|
|
546
|
+
/**
|
|
547
|
+
* Fired when the user changes zoom by pinch / ctrl+wheel gesture, with the new
|
|
548
|
+
* numeric scale. Use it to keep an external zoom indicator / `pdfScaleValue`
|
|
549
|
+
* state in sync.
|
|
550
|
+
*
|
|
551
|
+
* @param scale - The new numeric scale (e.g. 1.25).
|
|
552
|
+
*/
|
|
553
|
+
onZoomChange?(scale: number): void;
|
|
554
|
+
/**
|
|
555
|
+
* Page to scroll to once the document first finishes loading (1-indexed).
|
|
556
|
+
* Use for deep-linking (e.g. `?page=12`) or restoring a saved position.
|
|
557
|
+
* Applied only on initial load, not on subsequent re-renders.
|
|
558
|
+
*/
|
|
559
|
+
initialPage?: number;
|
|
560
|
+
/**
|
|
561
|
+
* Callback fired whenever the current (most visible) page changes, including
|
|
562
|
+
* the initial page. Use to sync the page into a URL/localStorage.
|
|
563
|
+
*
|
|
564
|
+
* @param pageNumber - The new current page (1-indexed).
|
|
565
|
+
*/
|
|
566
|
+
onPageChange?(pageNumber: number): void;
|
|
530
567
|
/**
|
|
531
568
|
* Callback triggered whenever a user finishes making a mouse selection or has
|
|
532
569
|
* selected text.
|
|
@@ -690,7 +727,7 @@ interface PdfHighlighterProps {
|
|
|
690
727
|
*
|
|
691
728
|
* @category Component
|
|
692
729
|
*/
|
|
693
|
-
declare const PdfHighlighter: ({ highlights, onScrollAway, pdfScaleValue, onSelection: onSelectionFinished, onCreateGhostHighlight, onRemoveGhostHighlight, selectionTip, enableAreaSelection, areaSelectionMode, mouseSelectionStyle, pdfDocument, children, textSelectionColor, utilsRef, style, enableFreetextCreation, onFreetextClick, enableImageCreation, onImageClick, enableDrawingMode, onDrawingComplete, onDrawingCancel, drawingStrokeColor, drawingStrokeWidth, enableShapeMode, onShapeComplete, onShapeCancel, shapeStrokeColor, shapeStrokeWidth, theme: userTheme, }: PdfHighlighterProps) => React.JSX.Element;
|
|
730
|
+
declare const PdfHighlighter: ({ highlights, onScrollAway, pdfScaleValue, onZoomChange, initialPage, onPageChange, onSelection: onSelectionFinished, onCreateGhostHighlight, onRemoveGhostHighlight, selectionTip, enableAreaSelection, areaSelectionMode, mouseSelectionStyle, pdfDocument, children, textSelectionColor, utilsRef, style, enableFreetextCreation, onFreetextClick, enableImageCreation, onImageClick, enableDrawingMode, onDrawingComplete, onDrawingCancel, drawingStrokeColor: drawingStrokeColorProp, drawingStrokeWidth, enableShapeMode, onShapeComplete, onShapeCancel, shapeStrokeColor: shapeStrokeColorProp, shapeStrokeWidth, theme: userTheme, }: PdfHighlighterProps) => React.JSX.Element;
|
|
694
731
|
|
|
695
732
|
/**
|
|
696
733
|
* Style options for text highlight appearance.
|
|
@@ -1408,12 +1445,13 @@ interface PdfLoaderProps {
|
|
|
1408
1445
|
*/
|
|
1409
1446
|
document: string | URL | TypedArray | DocumentInitParameters;
|
|
1410
1447
|
/**
|
|
1411
|
-
* Callback to render content before the PDF document is loaded.
|
|
1448
|
+
* Callback to render content before the PDF document is loaded. Receives the
|
|
1449
|
+
* PDF.js progress, or `null` before any progress is known (e.g. a cache hit).
|
|
1412
1450
|
*
|
|
1413
|
-
* @param progress - PDF.js progress status.
|
|
1451
|
+
* @param progress - PDF.js progress status, or null.
|
|
1414
1452
|
* @returns - Component to be rendered in space of the PDF document while loading.
|
|
1415
1453
|
*/
|
|
1416
|
-
beforeLoad?(progress: OnProgressParameters): ReactNode;
|
|
1454
|
+
beforeLoad?(progress: OnProgressParameters | null): ReactNode;
|
|
1417
1455
|
/**
|
|
1418
1456
|
* Component to render in the case of any PDF loading errors.
|
|
1419
1457
|
*
|
|
@@ -1440,13 +1478,36 @@ interface PdfLoaderProps {
|
|
|
1440
1478
|
* worker from the installed pdfjs-dist package so bundlers can emit it locally.
|
|
1441
1479
|
*/
|
|
1442
1480
|
workerSrc?: string;
|
|
1481
|
+
/**
|
|
1482
|
+
* Only fetch the pages needed to render, instead of background-downloading the
|
|
1483
|
+
* whole file. Makes the first page appear fast for large PDFs served over an
|
|
1484
|
+
* API — provided the server supports HTTP range requests (`Accept-Ranges:
|
|
1485
|
+
* bytes`). Has no effect for servers without range support or for raw bytes.
|
|
1486
|
+
* @default true
|
|
1487
|
+
*/
|
|
1488
|
+
disableAutoFetch?: boolean;
|
|
1489
|
+
/** Disable progressive streaming of the response. @default false */
|
|
1490
|
+
disableStream?: boolean;
|
|
1491
|
+
/** Size (bytes) of each range request when streaming. PDF.js default ~64KB. */
|
|
1492
|
+
rangeChunkSize?: number;
|
|
1493
|
+
/** Send credentials (cookies) with the document request. */
|
|
1494
|
+
withCredentials?: boolean;
|
|
1495
|
+
/** Extra HTTP headers for the document request (e.g. an auth token). */
|
|
1496
|
+
httpHeaders?: Record<string, string>;
|
|
1497
|
+
/**
|
|
1498
|
+
* Cache the loaded document so re-opening the same URL (or a StrictMode/
|
|
1499
|
+
* remount) reuses it instead of re-downloading. Only URL-based documents are
|
|
1500
|
+
* cached. Disable if the same URL can return different content.
|
|
1501
|
+
* @default true
|
|
1502
|
+
*/
|
|
1503
|
+
enableCache?: boolean;
|
|
1443
1504
|
}
|
|
1444
1505
|
/**
|
|
1445
1506
|
* A component for loading a PDF document and passing it to a child.
|
|
1446
1507
|
*
|
|
1447
1508
|
* @category Component
|
|
1448
1509
|
*/
|
|
1449
|
-
declare const PdfLoader: ({ document, beforeLoad, errorMessage, children, onError, workerSrc, }: PdfLoaderProps) => React.ReactNode;
|
|
1510
|
+
declare const PdfLoader: ({ document, beforeLoad, errorMessage, children, onError, workerSrc, disableAutoFetch, disableStream, rangeChunkSize, withCredentials, httpHeaders, enableCache, }: PdfLoaderProps) => React.ReactNode;
|
|
1450
1511
|
|
|
1451
1512
|
/**
|
|
1452
1513
|
* A set of utilities for rendering highlights. Designed to be used within a
|
|
@@ -1566,6 +1627,37 @@ declare const extractSentences: (pdfDocument: PDFDocumentProxy, options?: Extrac
|
|
|
1566
1627
|
declare const sentenceToHighlight: (sentence: PdfSentence, options?: {
|
|
1567
1628
|
id?: string;
|
|
1568
1629
|
}) => Highlight;
|
|
1630
|
+
/**
|
|
1631
|
+
* The result of {@link getTextPosition}.
|
|
1632
|
+
*
|
|
1633
|
+
* @category Type
|
|
1634
|
+
*/
|
|
1635
|
+
interface TextPositionMatch {
|
|
1636
|
+
/** Scaled position of the matched text, ready to use as a highlight position. */
|
|
1637
|
+
position: ScaledPosition;
|
|
1638
|
+
/** 1-indexed page the match was found on. */
|
|
1639
|
+
pageNumber: number;
|
|
1640
|
+
/** The exact document text that was matched. */
|
|
1641
|
+
matchedText: string;
|
|
1642
|
+
/** "exact" = whitespace-insensitive verbatim, "fuzzy" = approximate match. */
|
|
1643
|
+
confidence: "exact" | "fuzzy";
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* Locate a piece of text in the PDF and return its precise position — the rects
|
|
1647
|
+
* of the exact phrase (sub-item, per-line), not a whole sentence. Use it to turn
|
|
1648
|
+
* an external quote / citation into a highlight you can render or scroll to.
|
|
1649
|
+
*
|
|
1650
|
+
* Robust to PDF quirks: matching ignores whitespace (so line-wraps and spacing
|
|
1651
|
+
* differences don't matter) and falls back to bounded fuzzy matching for minor
|
|
1652
|
+
* differences (hyphenation, OCR, slight paraphrase). Returns the first match
|
|
1653
|
+
* (optionally restrict the page range), or null.
|
|
1654
|
+
*
|
|
1655
|
+
* @category Utility
|
|
1656
|
+
*/
|
|
1657
|
+
declare const getTextPosition: (pdfDocument: PDFDocumentProxy, query: string, options?: {
|
|
1658
|
+
pages?: "all" | number[];
|
|
1659
|
+
fuzzy?: boolean;
|
|
1660
|
+
}) => Promise<TextPositionMatch | null>;
|
|
1569
1661
|
|
|
1570
1662
|
/** Style configuration for outline items */
|
|
1571
1663
|
interface OutlineItemStyles {
|
|
@@ -1846,7 +1938,10 @@ interface LeftPanelProps {
|
|
|
1846
1938
|
thumbnailWidth?: number;
|
|
1847
1939
|
/** Children for custom content */
|
|
1848
1940
|
children?: React.ReactNode;
|
|
1849
|
-
/**
|
|
1941
|
+
/** Color scheme. "dark" swaps in a dark default palette; `theme` overrides
|
|
1942
|
+
* individual colors on top of whichever preset is chosen. @default "light" */
|
|
1943
|
+
mode?: "light" | "dark";
|
|
1944
|
+
/** Theme customization (merged over the mode preset) */
|
|
1850
1945
|
theme?: LeftPanelTheme;
|
|
1851
1946
|
/** Show page count in footer */
|
|
1852
1947
|
showFooter?: boolean;
|
|
@@ -2030,4 +2125,4 @@ declare function usePageNavigation(options: UsePageNavigationOptions): UsePageNa
|
|
|
2030
2125
|
|
|
2031
2126
|
declare const exportPdf: typeof exportPdf$1;
|
|
2032
2127
|
|
|
2033
|
-
export { AreaHighlight, type AreaHighlightProps, type AreaHighlightStyle, type Content, DocumentOutline, type DocumentOutlineClassNames, type DocumentOutlineProps, type DocumentOutlineStyles, DrawingCanvas, type DrawingCanvasProps, DrawingHighlight, type DrawingHighlightProps, type DrawingPoint, type DrawingStroke, type ExportPdfOptions, type ExportableHighlight, type ExtractSentencesOptions, type FooterClassNames, type FooterStyles, FreetextHighlight, type FreetextHighlightProps, type FreetextStyle, type GhostHighlight, type Highlight, type HighlightBindings, type HighlightContainerUtils, type HighlightType, ImageHighlight, type ImageHighlightProps, type LTWH, type LTWHP, LeftPanel, type LeftPanelProps, type LeftPanelTab, type LeftPanelTheme, type LeftPanelUtils, MonitoredHighlightContainer, type MonitoredHighlightContainerProps, OutlineItem, type OutlineItemClassNames, type OutlineItemProps, type OutlineItemRenderProps, type OutlineItemStyles, type Page, type PdfColumnDetection, type PdfExtractedPage, PdfHighlighter, type PdfHighlighterProps, type PdfHighlighterTheme, type PdfHighlighterUtils, PdfLoader, type PdfLoaderProps, type PdfReadingOrder, type PdfScaleValue, type PdfSearchOptions, type PdfSelection, type PdfSentence, type PdfSentenceSource, type PdfTextColumn, type PdfTextItem, type PdfTextUnit, type PdfTextUnitType, type ProcessedOutlineItem, type Scaled, type ScaledPosition, ShapeCanvas, type ShapeCanvasProps, type ShapeData, ShapeHighlight, type ShapeHighlightProps, type ShapeStyle, type ShapeType, SignaturePad, type SignaturePadProps, type TabClassNames, type TabStyles, TextHighlight, type TextHighlightProps, type TextHighlightStyle, type ThumbnailData, ThumbnailItem, type ThumbnailItemProps, ThumbnailPanel, type ThumbnailPanelProps, type Tip, type ToggleButtonClassNames, type ToggleButtonStyles, type ViewportHighlight, type ViewportPosition, exportPdf, extractPageTextItems, extractSentences, extractTextUnits, scaledPositionToViewport, sentenceToHighlight, useDocumentOutline, useHighlightContainerContext, useLeftPanelContext, usePageNavigation, usePdfHighlighterContext, useThumbnails, viewportPositionToScaled };
|
|
2128
|
+
export { AreaHighlight, type AreaHighlightProps, type AreaHighlightStyle, type Content, DocumentOutline, type DocumentOutlineClassNames, type DocumentOutlineProps, type DocumentOutlineStyles, DrawingCanvas, type DrawingCanvasProps, DrawingHighlight, type DrawingHighlightProps, type DrawingPoint, type DrawingStroke, type ExportPdfOptions, type ExportableHighlight, type ExtractSentencesOptions, type FooterClassNames, type FooterStyles, FreetextHighlight, type FreetextHighlightProps, type FreetextStyle, type GhostHighlight, type Highlight, type HighlightBindings, type HighlightContainerUtils, type HighlightType, ImageHighlight, type ImageHighlightProps, type LTWH, type LTWHP, LeftPanel, type LeftPanelProps, type LeftPanelTab, type LeftPanelTheme, type LeftPanelUtils, MonitoredHighlightContainer, type MonitoredHighlightContainerProps, OutlineItem, type OutlineItemClassNames, type OutlineItemProps, type OutlineItemRenderProps, type OutlineItemStyles, type Page, type PdfColumnDetection, type PdfExtractedPage, PdfHighlighter, type PdfHighlighterProps, type PdfHighlighterTheme, type PdfHighlighterUtils, PdfLoader, type PdfLoaderProps, type PdfReadingOrder, type PdfScaleValue, type PdfSearchOptions, type PdfSelection, type PdfSentence, type PdfSentenceSource, type PdfTextColumn, type PdfTextItem, type PdfTextUnit, type PdfTextUnitType, type ProcessedOutlineItem, type Scaled, type ScaledPosition, ShapeCanvas, type ShapeCanvasProps, type ShapeData, ShapeHighlight, type ShapeHighlightProps, type ShapeStyle, type ShapeType, SignaturePad, type SignaturePadProps, type TabClassNames, type TabStyles, TextHighlight, type TextHighlightProps, type TextHighlightStyle, type TextPositionMatch, type ThumbnailData, ThumbnailItem, type ThumbnailItemProps, ThumbnailPanel, type ThumbnailPanelProps, type Tip, type ToggleButtonClassNames, type ToggleButtonStyles, type ViewportHighlight, type ViewportPosition, exportPdf, extractPageTextItems, extractSentences, extractTextUnits, getTextPosition, scaledPositionToViewport, sentenceToHighlight, useDocumentOutline, useHighlightContainerContext, useLeftPanelContext, usePageNavigation, usePdfHighlighterContext, useThumbnails, viewportPositionToScaled };
|