react-pdf-highlighter-plus 1.0.2 → 1.0.4

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.
Files changed (88) hide show
  1. package/dist/esm/index.css +1221 -0
  2. package/dist/esm/index.css.map +1 -0
  3. package/dist/esm/index.d.ts +1348 -19
  4. package/dist/esm/index.js +3558 -18
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/esm/style/style.css +13 -0
  7. package/package.json +3 -2
  8. package/dist/esm/components/AreaHighlight.d.ts +0 -82
  9. package/dist/esm/components/AreaHighlight.js +0 -109
  10. package/dist/esm/components/AreaHighlight.js.map +0 -1
  11. package/dist/esm/components/DrawingCanvas.d.ts +0 -48
  12. package/dist/esm/components/DrawingCanvas.js +0 -277
  13. package/dist/esm/components/DrawingCanvas.js.map +0 -1
  14. package/dist/esm/components/DrawingHighlight.d.ts +0 -70
  15. package/dist/esm/components/DrawingHighlight.js +0 -164
  16. package/dist/esm/components/DrawingHighlight.js.map +0 -1
  17. package/dist/esm/components/FreetextHighlight.d.ts +0 -112
  18. package/dist/esm/components/FreetextHighlight.js +0 -193
  19. package/dist/esm/components/FreetextHighlight.js.map +0 -1
  20. package/dist/esm/components/HighlightLayer.d.ts +0 -49
  21. package/dist/esm/components/HighlightLayer.js +0 -37
  22. package/dist/esm/components/HighlightLayer.js.map +0 -1
  23. package/dist/esm/components/ImageHighlight.d.ts +0 -63
  24. package/dist/esm/components/ImageHighlight.js +0 -65
  25. package/dist/esm/components/ImageHighlight.js.map +0 -1
  26. package/dist/esm/components/MonitoredHighlightContainer.d.ts +0 -37
  27. package/dist/esm/components/MonitoredHighlightContainer.js +0 -42
  28. package/dist/esm/components/MonitoredHighlightContainer.js.map +0 -1
  29. package/dist/esm/components/MouseMonitor.d.ts +0 -34
  30. package/dist/esm/components/MouseMonitor.js +0 -30
  31. package/dist/esm/components/MouseMonitor.js.map +0 -1
  32. package/dist/esm/components/MouseSelection.d.ts +0 -66
  33. package/dist/esm/components/MouseSelection.js +0 -122
  34. package/dist/esm/components/MouseSelection.js.map +0 -1
  35. package/dist/esm/components/PdfHighlighter.d.ts +0 -184
  36. package/dist/esm/components/PdfHighlighter.js +0 -410
  37. package/dist/esm/components/PdfHighlighter.js.map +0 -1
  38. package/dist/esm/components/PdfLoader.d.ts +0 -55
  39. package/dist/esm/components/PdfLoader.js +0 -57
  40. package/dist/esm/components/PdfLoader.js.map +0 -1
  41. package/dist/esm/components/ShapeCanvas.d.ts +0 -51
  42. package/dist/esm/components/ShapeCanvas.js +0 -205
  43. package/dist/esm/components/ShapeCanvas.js.map +0 -1
  44. package/dist/esm/components/ShapeHighlight.d.ts +0 -107
  45. package/dist/esm/components/ShapeHighlight.js +0 -140
  46. package/dist/esm/components/ShapeHighlight.js.map +0 -1
  47. package/dist/esm/components/SignaturePad.d.ts +0 -40
  48. package/dist/esm/components/SignaturePad.js +0 -138
  49. package/dist/esm/components/SignaturePad.js.map +0 -1
  50. package/dist/esm/components/TextHighlight.d.ts +0 -93
  51. package/dist/esm/components/TextHighlight.js +0 -115
  52. package/dist/esm/components/TextHighlight.js.map +0 -1
  53. package/dist/esm/components/TipContainer.d.ts +0 -27
  54. package/dist/esm/components/TipContainer.js +0 -58
  55. package/dist/esm/components/TipContainer.js.map +0 -1
  56. package/dist/esm/contexts/HighlightContext.d.ts +0 -44
  57. package/dist/esm/contexts/HighlightContext.js +0 -16
  58. package/dist/esm/contexts/HighlightContext.js.map +0 -1
  59. package/dist/esm/contexts/PdfHighlighterContext.d.ts +0 -89
  60. package/dist/esm/contexts/PdfHighlighterContext.js +0 -16
  61. package/dist/esm/contexts/PdfHighlighterContext.js.map +0 -1
  62. package/dist/esm/lib/coordinates.d.ts +0 -16
  63. package/dist/esm/lib/coordinates.js +0 -69
  64. package/dist/esm/lib/coordinates.js.map +0 -1
  65. package/dist/esm/lib/export-pdf.d.ts +0 -81
  66. package/dist/esm/lib/export-pdf.js +0 -511
  67. package/dist/esm/lib/export-pdf.js.map +0 -1
  68. package/dist/esm/lib/get-bounding-rect.d.ts +0 -3
  69. package/dist/esm/lib/get-bounding-rect.js +0 -35
  70. package/dist/esm/lib/get-bounding-rect.js.map +0 -1
  71. package/dist/esm/lib/get-client-rects.d.ts +0 -3
  72. package/dist/esm/lib/get-client-rects.js +0 -43
  73. package/dist/esm/lib/get-client-rects.js.map +0 -1
  74. package/dist/esm/lib/group-highlights-by-page.d.ts +0 -6
  75. package/dist/esm/lib/group-highlights-by-page.js +0 -23
  76. package/dist/esm/lib/group-highlights-by-page.js.map +0 -1
  77. package/dist/esm/lib/optimize-client-rects.d.ts +0 -3
  78. package/dist/esm/lib/optimize-client-rects.js +0 -65
  79. package/dist/esm/lib/optimize-client-rects.js.map +0 -1
  80. package/dist/esm/lib/pdfjs-dom.d.ts +0 -9
  81. package/dist/esm/lib/pdfjs-dom.js +0 -55
  82. package/dist/esm/lib/pdfjs-dom.js.map +0 -1
  83. package/dist/esm/lib/screenshot.d.ts +0 -4
  84. package/dist/esm/lib/screenshot.js +0 -24
  85. package/dist/esm/lib/screenshot.js.map +0 -1
  86. package/dist/esm/types.d.ts +0 -213
  87. package/dist/esm/types.js +0 -2
  88. package/dist/esm/types.js.map +0 -1
@@ -1,89 +0,0 @@
1
- /// <reference types="react" />
2
- import { GhostHighlight, Highlight, PdfSelection, Tip } from "../types";
3
- import { PDFViewer } from "pdfjs-dist/types/web/pdf_viewer";
4
- /**
5
- * A set of utilities for to control the behaviour of {@link PdfHighlighter}.
6
- *
7
- * @category Context
8
- */
9
- export type PdfHighlighterUtils = {
10
- /**
11
- * Checks whether a selection is progress, a ghost highlight, or an edit.
12
- *
13
- * @returns - `true` if editing, ghost highlighting, or selecting.
14
- */
15
- isEditingOrHighlighting(): boolean;
16
- /**
17
- * Get currently selected area or text selection.
18
- *
19
- * @returns - current selection or `null` if no selection is being made.
20
- */
21
- getCurrentSelection(): PdfSelection | null;
22
- /**
23
- * Get the currently present ghost highlight.
24
- *
25
- * @return - currently present ghost highlight or `null` if non-existent.
26
- */
27
- getGhostHighlight(): GhostHighlight | null;
28
- /**
29
- * Cancel any ghost highlight.
30
- * The selected area will stay selected until the user clicks away.
31
- */
32
- removeGhostHighlight(): void;
33
- /**
34
- * If enabled, automatic tips/popups inside of a PdfHighlighter will be disabled.
35
- * Additional niceties will also be provided to prevent new highlights being made.
36
- */
37
- toggleEditInProgress(flag?: boolean): void;
38
- /**
39
- * Whether an AreaHighlight is being moved/resized, or a manual highlight edit has
40
- * been toggled.
41
- *
42
- * @returns - `true` if AreaHighlight is being edited or edit mode was set.
43
- */
44
- isEditInProgress(): boolean;
45
- /**
46
- * Whether a mouse selection or text selection is currently being performed.
47
- *
48
- * @returns - `true` if mouse selection or text selection is being performed.
49
- */
50
- isSelectionInProgress(): boolean;
51
- /**
52
- * Scroll to a highlight in this viewer.
53
- *
54
- * @param highlight - A highlight provided to the {@link PdfHighlighter} to
55
- * scroll to.
56
- */
57
- scrollToHighlight(highlight: Highlight): void;
58
- /**
59
- * Get a reference to the currently used instance of a PDF Viewer.
60
- *
61
- * @returns - The currently active PDF Viewer.
62
- */
63
- getViewer(): PDFViewer | null;
64
- /**
65
- * Get the currently active tip, if any.
66
- *
67
- * @returns - the currently active tip or `null` if inactive.
68
- */
69
- getTip(): Tip | null;
70
- /**
71
- * Set a tip to be displayed in the current PDF Viewer.
72
- *
73
- * @param tip - tip to be displayed, or `null` to hide any tip.
74
- */
75
- setTip(tip: Tip | null): void;
76
- /**
77
- * Callback to update any currently active tip's position. This will make sure
78
- * the tip is visible above/below its highlight.
79
- */
80
- updateTipPosition(): void;
81
- };
82
- export declare const PdfHighlighterContext: import("react").Context<PdfHighlighterUtils | undefined>;
83
- /**
84
- * Custom hook for providing {@link PdfHighlighterUtils}. Must be used
85
- * within a child of {@link PdfHighlighter}.
86
- *
87
- * @category Context
88
- */
89
- export declare const usePdfHighlighterContext: () => PdfHighlighterUtils;
@@ -1,16 +0,0 @@
1
- import { createContext, useContext } from "react";
2
- export const PdfHighlighterContext = createContext(undefined);
3
- /**
4
- * Custom hook for providing {@link PdfHighlighterUtils}. Must be used
5
- * within a child of {@link PdfHighlighter}.
6
- *
7
- * @category Context
8
- */
9
- export const usePdfHighlighterContext = () => {
10
- const pdfHighlighterUtils = useContext(PdfHighlighterContext);
11
- if (pdfHighlighterUtils === undefined) {
12
- throw new Error("usePdfHighlighterContext must be used within PdfHighlighter!");
13
- }
14
- return pdfHighlighterUtils;
15
- };
16
- //# sourceMappingURL=PdfHighlighterContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PdfHighlighterContext.js","sourceRoot":"","sources":["../../../src/contexts/PdfHighlighterContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AA6FlD,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAEhD,SAAS,CAAC,CAAC;AAEb;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,MAAM,mBAAmB,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAE9D,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CACb,8DAA8D,CAC/D,CAAC;IACJ,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC"}
@@ -1,16 +0,0 @@
1
- import { PDFViewer } from "pdfjs-dist/types/web/pdf_viewer";
2
- import type { LTWHP, ViewportPosition, Scaled, ScaledPosition } from "../types";
3
- import { PageViewport } from "pdfjs-dist";
4
- interface WIDTH_HEIGHT {
5
- width: number;
6
- height: number;
7
- }
8
- /** @category Utilities */
9
- export declare const viewportToScaled: (rect: LTWHP, { width, height }: WIDTH_HEIGHT) => Scaled;
10
- /** @category Utilities */
11
- export declare const viewportPositionToScaled: ({ boundingRect, rects }: ViewportPosition, viewer: PDFViewer) => ScaledPosition;
12
- /** @category Utilities */
13
- export declare const scaledToViewport: (scaled: Scaled, viewport: PageViewport, usePdfCoordinates?: boolean) => LTWHP;
14
- /** @category Utilities */
15
- export declare const scaledPositionToViewport: ({ boundingRect, rects, usePdfCoordinates }: ScaledPosition, viewer: PDFViewer) => ViewportPosition;
16
- export {};
@@ -1,69 +0,0 @@
1
- /** @category Utilities */
2
- export const viewportToScaled = (rect, { width, height }) => {
3
- return {
4
- x1: rect.left,
5
- y1: rect.top,
6
- x2: rect.left + rect.width,
7
- y2: rect.top + rect.height,
8
- width,
9
- height,
10
- pageNumber: rect.pageNumber,
11
- };
12
- };
13
- /** @category Utilities */
14
- export const viewportPositionToScaled = ({ boundingRect, rects }, viewer) => {
15
- const pageNumber = boundingRect.pageNumber;
16
- const viewport = viewer.getPageView(pageNumber - 1).viewport; // Account for 1 indexing of PDF documents
17
- const scale = (obj) => viewportToScaled(obj, viewport);
18
- return {
19
- boundingRect: scale(boundingRect),
20
- rects: (rects || []).map(scale),
21
- };
22
- };
23
- const pdfToViewport = (pdf, viewport) => {
24
- const [x1, y1, x2, y2] = viewport.convertToViewportRectangle([
25
- pdf.x1,
26
- pdf.y1,
27
- pdf.x2,
28
- pdf.y2,
29
- ]);
30
- return {
31
- left: Math.min(x1, x2),
32
- top: Math.min(y1, y2),
33
- width: Math.abs(x2 - x1),
34
- height: Math.abs(y1 - y2),
35
- pageNumber: pdf.pageNumber,
36
- };
37
- };
38
- /** @category Utilities */
39
- export const scaledToViewport = (scaled, viewport, usePdfCoordinates = false) => {
40
- const { width, height } = viewport;
41
- if (usePdfCoordinates) {
42
- return pdfToViewport(scaled, viewport);
43
- }
44
- if (scaled.x1 === undefined) {
45
- throw new Error("You are using old position format, please update");
46
- }
47
- const x1 = (width * scaled.x1) / scaled.width;
48
- const y1 = (height * scaled.y1) / scaled.height;
49
- const x2 = (width * scaled.x2) / scaled.width;
50
- const y2 = (height * scaled.y2) / scaled.height;
51
- return {
52
- left: x1,
53
- top: y1,
54
- width: x2 - x1,
55
- height: y2 - y1,
56
- pageNumber: scaled.pageNumber,
57
- };
58
- };
59
- /** @category Utilities */
60
- export const scaledPositionToViewport = ({ boundingRect, rects, usePdfCoordinates }, viewer) => {
61
- const pageNumber = boundingRect.pageNumber;
62
- const viewport = viewer.getPageView(pageNumber - 1).viewport; // Account for 1 indexing of PDF documents
63
- const scale = (obj) => scaledToViewport(obj, viewport, usePdfCoordinates);
64
- return {
65
- boundingRect: scale(boundingRect),
66
- rects: (rects || []).map(scale),
67
- };
68
- };
69
- //# sourceMappingURL=coordinates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coordinates.js","sourceRoot":"","sources":["../../../src/lib/coordinates.ts"],"names":[],"mappings":"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"}
@@ -1,81 +0,0 @@
1
- import type { ScaledPosition, ShapeData } from "../types";
2
- /**
3
- * Options for the PDF export function.
4
- *
5
- * @category Type
6
- */
7
- export interface ExportPdfOptions {
8
- /** Default color for text highlights. Default: "rgba(255, 226, 143, 0.5)" */
9
- textHighlightColor?: string;
10
- /** Default color for area highlights. Default: "rgba(255, 226, 143, 0.5)" */
11
- areaHighlightColor?: string;
12
- /** Default text color for freetext. Default: "#333333" */
13
- defaultFreetextColor?: string;
14
- /** Default background for freetext. Default: "#ffffc8" */
15
- defaultFreetextBgColor?: string;
16
- /** Default font size for freetext. Default: 14 */
17
- defaultFreetextFontSize?: number;
18
- /** Progress callback for large PDFs */
19
- onProgress?: (current: number, total: number) => void;
20
- }
21
- /**
22
- * A highlight that can be exported to PDF.
23
- *
24
- * @category Type
25
- */
26
- export interface ExportableHighlight {
27
- id: string;
28
- type?: "text" | "area" | "freetext" | "image" | "drawing" | "shape";
29
- content?: {
30
- text?: string;
31
- image?: string;
32
- shape?: ShapeData;
33
- };
34
- position: ScaledPosition;
35
- /** Per-highlight color override (for text/area highlights) */
36
- highlightColor?: string;
37
- /** Style mode for text highlights: "highlight" (default), "underline", or "strikethrough" */
38
- highlightStyle?: "highlight" | "underline" | "strikethrough";
39
- /** Text color for freetext highlights */
40
- color?: string;
41
- /** Background color for freetext highlights */
42
- backgroundColor?: string;
43
- /** Font size for freetext highlights */
44
- fontSize?: string;
45
- /** Font family for freetext highlights (not used in export, Helvetica is always used) */
46
- fontFamily?: string;
47
- /** Shape type for shape highlights */
48
- shapeType?: "rectangle" | "circle" | "arrow";
49
- /** Stroke color for shape highlights */
50
- strokeColor?: string;
51
- /** Stroke width for shape highlights */
52
- strokeWidth?: number;
53
- }
54
- /**
55
- * Export a PDF with annotations embedded.
56
- *
57
- * @param pdfSource - The source PDF as a URL string, Uint8Array, or ArrayBuffer
58
- * @param highlights - Array of highlights to embed in the PDF
59
- * @param options - Export options for customizing colors and behavior
60
- * @returns Promise<Uint8Array> - The modified PDF as bytes
61
- *
62
- * @example
63
- * ```typescript
64
- * const pdfBytes = await exportPdf(pdfUrl, highlights, {
65
- * textHighlightColor: "rgba(255, 255, 0, 0.4)",
66
- * onProgress: (current, total) => console.log(`${current}/${total} pages`)
67
- * });
68
- *
69
- * // Download the file
70
- * const blob = new Blob([pdfBytes], { type: "application/pdf" });
71
- * const url = URL.createObjectURL(blob);
72
- * const a = document.createElement("a");
73
- * a.href = url;
74
- * a.download = "annotated.pdf";
75
- * a.click();
76
- * URL.revokeObjectURL(url);
77
- * ```
78
- *
79
- * @category Function
80
- */
81
- export declare function exportPdf(pdfSource: string | Uint8Array | ArrayBuffer, highlights: ExportableHighlight[], options?: ExportPdfOptions): Promise<Uint8Array>;