pdf-tsx 0.17.3 → 0.17.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 (127) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +512 -512
  3. package/dist/cjs/components/PDFSidebar.cjs +1 -1
  4. package/dist/cjs/components/PDFViewer.cjs +1 -1
  5. package/dist/cjs/components/PDFViewer.module.cjs +1 -1
  6. package/dist/cjs/components/features/PDFAnnotations.cjs +1 -1
  7. package/dist/cjs/components/features/PDFAttachments.cjs +1 -1
  8. package/dist/cjs/components/features/PDFChangeFile.cjs +1 -1
  9. package/dist/cjs/components/features/PDFDownloadButton.cjs +1 -1
  10. package/dist/cjs/components/features/PDFNavigation.cjs +1 -1
  11. package/dist/cjs/components/features/PDFOutline.cjs +1 -1
  12. package/dist/cjs/components/features/PDFPageFit.cjs +1 -1
  13. package/dist/cjs/components/features/PDFPrintButton.cjs +1 -1
  14. package/dist/cjs/components/features/PDFRotationControl.cjs +1 -1
  15. package/dist/cjs/components/features/PDFSearch.cjs +1 -1
  16. package/dist/cjs/components/features/PDFSidebarToggle.cjs +1 -1
  17. package/dist/cjs/components/features/PDFSignatures.cjs +1 -1
  18. package/dist/cjs/components/features/PDFThemeToggle.cjs +1 -1
  19. package/dist/cjs/components/features/PDFThumbnails.cjs +1 -1
  20. package/dist/cjs/components/features/PDFZoomControls.cjs +1 -1
  21. package/dist/cjs/components/ui/PDFToolbar.cjs +1 -1
  22. package/dist/cjs/components/ui/PDFToolbarDropdownContext.cjs +1 -1
  23. package/dist/cjs/components/ui/PDFToolbarItem.cjs +1 -1
  24. package/dist/cjs/components/ui/PDFToolbarSeparator.cjs +1 -1
  25. package/dist/cjs/components/ui/ToolbarButton.cjs +1 -1
  26. package/dist/cjs/components/ui/icons.cjs +1 -1
  27. package/dist/cjs/context/LabelsContext.cjs +1 -1
  28. package/dist/cjs/context/PDFViewerContext.cjs +1 -1
  29. package/dist/cjs/context/ThemeContext.cjs +1 -1
  30. package/dist/cjs/context/labelsContextValue.cjs +1 -1
  31. package/dist/cjs/context/themeContextValue.cjs +1 -1
  32. package/dist/cjs/hooks/useAnnotationLayer.cjs +1 -1
  33. package/dist/cjs/hooks/useAnnotations.cjs +1 -1
  34. package/dist/cjs/hooks/useAttachments.cjs +1 -1
  35. package/dist/cjs/hooks/useKeyboardShortcuts.cjs +1 -1
  36. package/dist/cjs/hooks/useLabels.cjs +1 -1
  37. package/dist/cjs/hooks/useOutline.cjs +1 -1
  38. package/dist/cjs/hooks/useOverlayRects.cjs +1 -1
  39. package/dist/cjs/hooks/usePDFLoader.cjs +1 -1
  40. package/dist/cjs/hooks/usePDFRenderer.cjs +1 -1
  41. package/dist/cjs/hooks/usePinchZoom.cjs +1 -1
  42. package/dist/cjs/hooks/useScrollTracking.cjs +1 -1
  43. package/dist/cjs/hooks/useSignatures.cjs +1 -1
  44. package/dist/cjs/hooks/useTextLayer.cjs +1 -1
  45. package/dist/cjs/hooks/useTextSearch.cjs +1 -1
  46. package/dist/cjs/hooks/useTheme.cjs +1 -1
  47. package/dist/cjs/hooks/useThumbnails.cjs +1 -1
  48. package/dist/cjs/index.cjs +1 -1
  49. package/dist/cjs/pdf-tsx.css +1 -1
  50. package/dist/cjs/utils/pdfFit.cjs +1 -1
  51. package/dist/components/PDFViewer.d.ts +1 -2
  52. package/dist/es/components/PDFViewer.module.js +23 -23
  53. package/dist/es/components/features/PDFPrintButton.js +22 -8
  54. package/dist/es/pdf-tsx.css +1 -1
  55. package/dist/hooks/usePDFLoader.d.ts +1 -1
  56. package/dist/utils/polyfills.d.ts +1 -0
  57. package/package.json +64 -64
  58. package/dist/components/features/PDFSignButton.d.ts +0 -10
  59. package/dist/components/features/SignaturePad.d.ts +0 -10
  60. package/dist/pdf-tsx.cjs.js +0 -5
  61. package/dist/pdf-tsx.css +0 -2
  62. package/dist/pdf-tsx.es.js +0 -2637
  63. package/dist/src/components/PDFSidebar.d.ts +0 -11
  64. package/dist/src/components/PDFViewer.d.ts +0 -22
  65. package/dist/src/components/features/PDFAnnotations.d.ts +0 -5
  66. package/dist/src/components/features/PDFAttachments.d.ts +0 -5
  67. package/dist/src/components/features/PDFChangeFile.d.ts +0 -9
  68. package/dist/src/components/features/PDFDownloadButton.d.ts +0 -9
  69. package/dist/src/components/features/PDFNavigation.d.ts +0 -10
  70. package/dist/src/components/features/PDFOutline.d.ts +0 -1
  71. package/dist/src/components/features/PDFPageFit.d.ts +0 -10
  72. package/dist/src/components/features/PDFPrintButton.d.ts +0 -9
  73. package/dist/src/components/features/PDFRotationControl.d.ts +0 -9
  74. package/dist/src/components/features/PDFSearch.d.ts +0 -13
  75. package/dist/src/components/features/PDFSidebarToggle.d.ts +0 -10
  76. package/dist/src/components/features/PDFSignatures.d.ts +0 -5
  77. package/dist/src/components/features/PDFThemeToggle.d.ts +0 -10
  78. package/dist/src/components/features/PDFThumbnails.d.ts +0 -1
  79. package/dist/src/components/features/PDFZoomControls.d.ts +0 -10
  80. package/dist/src/components/ui/PDFToolbar.d.ts +0 -8
  81. package/dist/src/components/ui/PDFToolbarDropdownContext.d.ts +0 -1
  82. package/dist/src/components/ui/PDFToolbarItem.d.ts +0 -7
  83. package/dist/src/components/ui/PDFToolbarSeparator.d.ts +0 -4
  84. package/dist/src/components/ui/ToolbarButton.d.ts +0 -6
  85. package/dist/src/components/ui/icons.d.ts +0 -7
  86. package/dist/src/context/LabelsContext.d.ts +0 -7
  87. package/dist/src/context/PDFViewerContext.d.ts +0 -30
  88. package/dist/src/context/ThemeContext.d.ts +0 -12
  89. package/dist/src/context/labelsContextValue.d.ts +0 -2
  90. package/dist/src/context/themeContextValue.d.ts +0 -7
  91. package/dist/src/hooks/useAnnotationLayer.d.ts +0 -34
  92. package/dist/src/hooks/useAnnotations.d.ts +0 -15
  93. package/dist/src/hooks/useAttachments.d.ts +0 -11
  94. package/dist/src/hooks/useKeyboardShortcuts.d.ts +0 -9
  95. package/dist/src/hooks/useLabels.d.ts +0 -2
  96. package/dist/src/hooks/useOutline.d.ts +0 -14
  97. package/dist/src/hooks/useOverlayRects.d.ts +0 -21
  98. package/dist/src/hooks/usePDFLoader.d.ts +0 -5
  99. package/dist/src/hooks/usePDFRenderer.d.ts +0 -16
  100. package/dist/src/hooks/useScrollTracking.d.ts +0 -10
  101. package/dist/src/hooks/useSignatures.d.ts +0 -17
  102. package/dist/src/hooks/useTextLayer.d.ts +0 -10
  103. package/dist/src/hooks/useTextSearch.d.ts +0 -12
  104. package/dist/src/hooks/useTheme.d.ts +0 -2
  105. package/dist/src/hooks/useThumbnails.d.ts +0 -10
  106. package/dist/src/index.d.ts +0 -24
  107. package/dist/src/labels.d.ts +0 -53
  108. package/dist/src/theme.d.ts +0 -27
  109. package/dist/src/utils/pdfFit.d.ts +0 -2
  110. package/dist/src/utils/url.d.ts +0 -1
  111. package/dist/utils/addSignatureToPdf.d.ts +0 -9
  112. package/dist/vite.svg +0 -1
  113. package/dist/wasm/LICENSE_JBIG2 +0 -196
  114. package/dist/wasm/LICENSE_OPENJPEG +0 -39
  115. package/dist/wasm/LICENSE_PDFJS_JBIG2 +0 -13
  116. package/dist/wasm/LICENSE_PDFJS_OPENJPEG +0 -22
  117. package/dist/wasm/LICENSE_PDFJS_QCMS +0 -22
  118. package/dist/wasm/LICENSE_QCMS +0 -21
  119. package/dist/wasm/jbig2.wasm +0 -0
  120. package/dist/wasm/jbig2_nowasm_fallback.js +0 -15
  121. package/dist/wasm/openjpeg.wasm +0 -0
  122. package/dist/wasm/openjpeg_nowasm_fallback.js +0 -17
  123. package/dist/wasm/qcms_bg.wasm +0 -0
  124. package/dist/wasm/quickjs-eval.js +0 -16
  125. package/dist/wasm/quickjs-eval.wasm +0 -0
  126. /package/dist/{src/hooks → hooks}/usePinchZoom.d.ts +0 -0
  127. /package/dist/{src/utils → utils}/zoom.d.ts +0 -0
@@ -1,11 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface SidebarPanel {
3
- icon: ReactNode;
4
- label: string;
5
- content: ReactNode;
6
- }
7
- interface PDFSidebarProps {
8
- panels: SidebarPanel[];
9
- }
10
- export declare function PDFSidebar({ panels }: Readonly<PDFSidebarProps>): import("react").JSX.Element | null;
11
- export {};
@@ -1,22 +0,0 @@
1
- import { default as React } from 'react';
2
- import { Theme } from '../theme';
3
- interface PDFViewerProps {
4
- file: File;
5
- workerSrc: string;
6
- sidebar?: React.ReactNode;
7
- toolbar?: React.ReactNode;
8
- onChangeFile?: (file: File) => void;
9
- themeOverrides?: {
10
- light?: Partial<Theme>;
11
- dark?: Partial<Theme>;
12
- };
13
- defaultTheme?: "light" | "dark";
14
- defaultFit?: "width" | "page";
15
- language?: "it" | "en";
16
- className?: string;
17
- style?: React.CSSProperties;
18
- requireRead?: boolean;
19
- onDocumentRead?: () => void;
20
- }
21
- declare const PDFViewer: React.FC<PDFViewerProps>;
22
- export default PDFViewer;
@@ -1,5 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export declare function PDFAnnotationsIcon({ icon }: {
3
- icon: ReactNode;
4
- }): import("react").JSX.Element;
5
- export declare function PDFAnnotations(): import("react").JSX.Element;
@@ -1,5 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export declare function PDFAttachmentsIcon({ icon }: {
3
- icon: ReactNode;
4
- }): import("react").JSX.Element;
5
- export declare function PDFAttachments(): import("react").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { default as React } from 'react';
2
- interface PDFChangeFileProps {
3
- icon: React.ReactNode;
4
- }
5
- export declare function PDFChangeFile({ icon }: PDFChangeFileProps): React.JSX.Element;
6
- export declare namespace PDFChangeFile {
7
- var toolbarLabelKey: "changeFileToolbarLabel";
8
- }
9
- export {};
@@ -1,9 +0,0 @@
1
- import { default as React } from 'react';
2
- interface PDFDownloadButtonProps {
3
- icon: React.ReactNode;
4
- }
5
- export declare function PDFDownloadButton({ icon }: PDFDownloadButtonProps): React.JSX.Element;
6
- export declare namespace PDFDownloadButton {
7
- var toolbarLabelKey: "downloadToolbarLabel";
8
- }
9
- export {};
@@ -1,10 +0,0 @@
1
- import { default as React } from 'react';
2
- interface PDFNavigationProps {
3
- prevIcon: React.ReactNode;
4
- nextIcon: React.ReactNode;
5
- }
6
- export declare function PDFNavigation({ prevIcon, nextIcon }: PDFNavigationProps): React.JSX.Element;
7
- export declare namespace PDFNavigation {
8
- var toolbarLabelKey: "navigationToolbarLabel";
9
- }
10
- export {};
@@ -1 +0,0 @@
1
- export declare function PDFOutline(): import("react").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { default as React } from 'react';
2
- interface PDFPageFitProps {
3
- fitWidthIcon: React.ReactNode;
4
- fitPageIcon: React.ReactNode;
5
- }
6
- export declare function PDFPageFit({ fitWidthIcon, fitPageIcon }: PDFPageFitProps): React.JSX.Element;
7
- export declare namespace PDFPageFit {
8
- var toolbarLabelKey: "fitToolbarLabel";
9
- }
10
- export {};
@@ -1,9 +0,0 @@
1
- import { default as React } from 'react';
2
- interface PDFPrintButtonProps {
3
- icon: React.ReactNode;
4
- }
5
- export declare function PDFPrintButton({ icon }: PDFPrintButtonProps): React.JSX.Element;
6
- export declare namespace PDFPrintButton {
7
- var toolbarLabelKey: "printToolbarLabel";
8
- }
9
- export {};
@@ -1,9 +0,0 @@
1
- import { default as React } from 'react';
2
- interface PDFRotationControlProps {
3
- icon: React.ReactNode;
4
- }
5
- export declare function PDFRotationControl({ icon }: PDFRotationControlProps): React.JSX.Element;
6
- export declare namespace PDFRotationControl {
7
- var toolbarLabelKey: "rotateToolbarLabel";
8
- }
9
- export {};
@@ -1,13 +0,0 @@
1
- import { default as React } from 'react';
2
- interface PDFSearchProps {
3
- searchIcon: React.ReactNode;
4
- prevIcon: React.ReactNode;
5
- nextIcon: React.ReactNode;
6
- clearIcon: React.ReactNode;
7
- initialSearch?: string;
8
- }
9
- export declare function PDFSearch({ searchIcon, prevIcon, nextIcon, clearIcon, initialSearch, }: PDFSearchProps): React.JSX.Element;
10
- export declare namespace PDFSearch {
11
- var toolbarLabelKey: "searchToolbarLabel";
12
- }
13
- export {};
@@ -1,10 +0,0 @@
1
- import { ReactNode } from 'react';
2
- interface PDFSidebarToggleProps {
3
- collapseIcon: ReactNode;
4
- expandIcon: ReactNode;
5
- }
6
- export declare function PDFSidebarToggle({ collapseIcon, expandIcon, }: PDFSidebarToggleProps): import("react").JSX.Element;
7
- export declare namespace PDFSidebarToggle {
8
- var toolbarLabelKey: "sidebarToolbarLabel";
9
- }
10
- export {};
@@ -1,5 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export declare function PDFSignaturesIcon({ icon }: {
3
- icon: ReactNode;
4
- }): import("react").JSX.Element;
5
- export declare function PDFSignatures(): import("react").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { default as React } from 'react';
2
- interface PDFThemeToggleProps {
3
- lightIcon: React.ReactNode;
4
- darkIcon: React.ReactNode;
5
- }
6
- export declare function PDFThemeToggle({ lightIcon, darkIcon }: PDFThemeToggleProps): React.JSX.Element;
7
- export declare namespace PDFThemeToggle {
8
- var toolbarLabelKey: "themeToolbarLabel";
9
- }
10
- export {};
@@ -1 +0,0 @@
1
- export declare function PDFThumbnails(): import("react").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { default as React } from 'react';
2
- interface PDFZoomControlsProps {
3
- zoomOutIcon: React.ReactNode;
4
- zoomInIcon: React.ReactNode;
5
- }
6
- export declare function PDFZoomControls({ zoomOutIcon, zoomInIcon, }: PDFZoomControlsProps): React.JSX.Element;
7
- export declare namespace PDFZoomControls {
8
- var toolbarLabelKey: "zoomToolbarLabel";
9
- }
10
- export {};
@@ -1,8 +0,0 @@
1
- import { default as React } from 'react';
2
- import { PDFToolbarDropdownContext } from './PDFToolbarDropdownContext';
3
- export { PDFToolbarDropdownContext };
4
- interface Props {
5
- children: React.ReactNode;
6
- overflowIcon?: React.ReactNode;
7
- }
8
- export declare function PDFToolbar({ children, overflowIcon }: Props): React.JSX.Element;
@@ -1 +0,0 @@
1
- export declare const PDFToolbarDropdownContext: import('react').Context<boolean>;
@@ -1,7 +0,0 @@
1
- import { default as React } from 'react';
2
- interface Props {
3
- children: React.ReactNode;
4
- label?: string;
5
- }
6
- export declare function PDFToolbarItem({ children, label }: Props): React.JSX.Element;
7
- export {};
@@ -1,4 +0,0 @@
1
- export declare function PDFToolbarSeparator(): import("react").JSX.Element;
2
- export declare namespace PDFToolbarSeparator {
3
- var isSeparator: true;
4
- }
@@ -1,6 +0,0 @@
1
- import { ButtonHTMLAttributes } from 'react';
2
- interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
3
- $primary?: boolean;
4
- }
5
- export declare function ToolbarButton({ $primary, className, ...props }: Props): import("react").JSX.Element;
6
- export {};
@@ -1,7 +0,0 @@
1
- import { default as React } from 'react';
2
- interface IconProps {
3
- size?: number;
4
- }
5
- export declare const IconChevronRight: ({ size }: IconProps) => React.JSX.Element;
6
- export declare const IconChevronDown: ({ size }: IconProps) => React.JSX.Element;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { ReactNode } from 'react';
2
- interface LabelsProviderProps {
3
- children: ReactNode;
4
- language?: "it" | "en";
5
- }
6
- export declare function LabelsProvider({ children, language }: LabelsProviderProps): import("react").JSX.Element;
7
- export {};
@@ -1,30 +0,0 @@
1
- import * as pdfjsLib from "pdfjs-dist";
2
- export interface HighlightRect {
3
- page: number;
4
- pdfRect: [number, number, number, number];
5
- }
6
- export interface PDFViewerContextValue {
7
- pdf: pdfjsLib.PDFDocumentProxy | null;
8
- numPages: number;
9
- zoom: number;
10
- setZoom: React.Dispatch<React.SetStateAction<number>>;
11
- rotation: number;
12
- setRotation: React.Dispatch<React.SetStateAction<number>>;
13
- currentPage: number;
14
- goToPage: (page: number, yOffset?: number) => void;
15
- containerRef: React.RefObject<HTMLDivElement | null>;
16
- canvasRefs: React.RefObject<(HTMLCanvasElement | null)[]>;
17
- file: File;
18
- highlight: HighlightRect | null;
19
- setHighlight: (h: HighlightRect | null) => void;
20
- searchMatches: HighlightRect[];
21
- setSearchMatches: (matches: HighlightRect[]) => void;
22
- onChangeFile?: (file: File) => void;
23
- sidebarCollapsed: boolean;
24
- setSidebarCollapsed: React.Dispatch<React.SetStateAction<boolean>>;
25
- fitMode: "width" | "page" | null;
26
- setFitMode: React.Dispatch<React.SetStateAction<"width" | "page" | null>>;
27
- navigationLocked: boolean;
28
- }
29
- export declare const PDFViewerContext: import('react').Context<PDFViewerContextValue | null>;
30
- export declare function usePDFViewer(): PDFViewerContextValue;
@@ -1,12 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { Theme } from '../theme';
3
- interface ThemeProviderProps {
4
- children: ReactNode;
5
- themeOverrides?: {
6
- light?: Partial<Theme>;
7
- dark?: Partial<Theme>;
8
- };
9
- defaultTheme?: "light" | "dark";
10
- }
11
- export declare function ThemeProvider({ children, themeOverrides, defaultTheme, }: ThemeProviderProps): import("react").JSX.Element;
12
- export {};
@@ -1,2 +0,0 @@
1
- import { Labels } from '../labels';
2
- export declare const LabelsContext: import('react').Context<Labels | null>;
@@ -1,7 +0,0 @@
1
- import { Theme } from '../theme';
2
- export interface ThemeContextValue {
3
- isDark: boolean;
4
- toggleTheme: () => void;
5
- theme: Theme;
6
- }
7
- export declare const ThemeContext: import('react').Context<ThemeContextValue | null>;
@@ -1,34 +0,0 @@
1
- import * as pdfjsLib from "pdfjs-dist";
2
- export interface LinkOverlay {
3
- page: number;
4
- x: number;
5
- y: number;
6
- width: number;
7
- height: number;
8
- url?: string;
9
- dest?: string | unknown[];
10
- newWindow?: boolean;
11
- }
12
- export interface NoteOverlay {
13
- page: number;
14
- x: number;
15
- y: number;
16
- width: number;
17
- height: number;
18
- contents: string;
19
- title?: string;
20
- subtype: string;
21
- pdfRect: [number, number, number, number];
22
- }
23
- interface UseAnnotationLayerOptions {
24
- pdf: pdfjsLib.PDFDocumentProxy | null;
25
- zoom: number;
26
- rotation: number;
27
- mountedPages: number[];
28
- goToPage: (page: number) => void;
29
- }
30
- export declare function useAnnotationLayer({ pdf, zoom, rotation, mountedPages, goToPage, }: UseAnnotationLayerOptions): {
31
- linkOverlays: LinkOverlay[];
32
- noteOverlays: NoteOverlay[];
33
- };
34
- export {};
@@ -1,15 +0,0 @@
1
- import * as pdfjsLib from "pdfjs-dist";
2
- export interface PDFAnnotation {
3
- id: string;
4
- page: number;
5
- subtype: string;
6
- contents?: string;
7
- title?: string;
8
- rect?: [number, number, number, number];
9
- }
10
- export declare function useAnnotations({ pdf, }: {
11
- pdf: pdfjsLib.PDFDocumentProxy | null;
12
- }): {
13
- annotations: PDFAnnotation[];
14
- loading: boolean;
15
- };
@@ -1,11 +0,0 @@
1
- import * as pdfjsLib from "pdfjs-dist";
2
- export interface PDFAttachment {
3
- filename: string;
4
- content: Uint8Array;
5
- }
6
- export declare function useAttachments({ pdf, }: {
7
- pdf: pdfjsLib.PDFDocumentProxy | null;
8
- }): {
9
- attachments: PDFAttachment[];
10
- loading: boolean;
11
- };
@@ -1,9 +0,0 @@
1
- import * as pdfjsLib from "pdfjs-dist";
2
- interface UseKeyboardShortcutsOptions {
3
- pdf: pdfjsLib.PDFDocumentProxy | null;
4
- currentPage: number;
5
- goToPage: (page: number) => void;
6
- setRotation: React.Dispatch<React.SetStateAction<number>>;
7
- }
8
- export declare function useKeyboardShortcuts({ pdf, currentPage, goToPage, setRotation, }: UseKeyboardShortcutsOptions): void;
9
- export {};
@@ -1,2 +0,0 @@
1
- import { Labels } from '../labels';
2
- export declare function useLabels(): Labels;
@@ -1,14 +0,0 @@
1
- import * as pdfjsLib from "pdfjs-dist";
2
- export interface OutlineNode {
3
- title: string;
4
- dest: string | unknown[] | null;
5
- items: OutlineNode[];
6
- bold: boolean;
7
- italic: boolean;
8
- }
9
- export declare function useOutline({ pdf, }: {
10
- pdf: pdfjsLib.PDFDocumentProxy | null;
11
- }): {
12
- outline: OutlineNode[];
13
- loading: boolean;
14
- };
@@ -1,21 +0,0 @@
1
- import { HighlightRect } from '../context/PDFViewerContext';
2
- import * as pdfjsLib from "pdfjs-dist";
3
- export interface OverlayRect {
4
- page: number;
5
- x: number;
6
- y: number;
7
- width: number;
8
- height: number;
9
- }
10
- interface Params {
11
- pdf: pdfjsLib.PDFDocumentProxy | null;
12
- highlight: HighlightRect | null;
13
- searchMatches: HighlightRect[];
14
- zoom: number;
15
- rotation: number;
16
- }
17
- export declare function useOverlayRects({ pdf, highlight, searchMatches, zoom, rotation, }: Params): {
18
- overlayRect: OverlayRect | null;
19
- searchOverlays: OverlayRect[];
20
- };
21
- export {};
@@ -1,5 +0,0 @@
1
- export declare function usePDFLoader(file: File): {
2
- pdf: import('pdfjs-dist/types/src/display/api').PDFDocumentProxy | null;
3
- numPages: number;
4
- loading: boolean;
5
- };
@@ -1,16 +0,0 @@
1
- import * as pdfjsLib from "pdfjs-dist";
2
- interface Params {
3
- pdf: pdfjsLib.PDFDocumentProxy | null;
4
- zoom: number;
5
- rotation: number;
6
- visiblePages: number[];
7
- canvasRefs: React.RefObject<(HTMLCanvasElement | null)[]>;
8
- }
9
- export declare function usePDFRenderer({ pdf, zoom, rotation, visiblePages, canvasRefs, }: Params): {
10
- pageSizes: {
11
- width: number;
12
- height: number;
13
- }[];
14
- renderedPages: Set<number>;
15
- };
16
- export {};
@@ -1,10 +0,0 @@
1
- interface UseScrollTrackingOptions {
2
- numPages: number;
3
- containerRef: React.RefObject<HTMLDivElement | null>;
4
- pageRefs: React.RefObject<(HTMLDivElement | null)[]>;
5
- }
6
- export declare function useScrollTracking({ numPages, containerRef, pageRefs, }: UseScrollTrackingOptions): {
7
- currentPage: number;
8
- goToPage: (pageNum: number, yOffset?: number) => void;
9
- };
10
- export {};
@@ -1,17 +0,0 @@
1
- import * as pdfjsLib from "pdfjs-dist";
2
- export interface PDFSignature {
3
- fieldName: string;
4
- page: number;
5
- signed: boolean;
6
- signerName?: string;
7
- signDate?: string;
8
- reason?: string;
9
- location?: string;
10
- rect?: [number, number, number, number];
11
- }
12
- export declare function useSignatures({ pdf, }: {
13
- pdf: pdfjsLib.PDFDocumentProxy | null;
14
- }): {
15
- signatures: PDFSignature[];
16
- loading: boolean;
17
- };
@@ -1,10 +0,0 @@
1
- import * as pdfjsLib from "pdfjs-dist";
2
- interface UseTextLayerOptions {
3
- pdf: pdfjsLib.PDFDocumentProxy | null;
4
- zoom: number;
5
- rotation: number;
6
- mountedPages: number[];
7
- canvasRefs: React.RefObject<(HTMLCanvasElement | null)[]>;
8
- }
9
- export declare function useTextLayer({ pdf, zoom, rotation, mountedPages, canvasRefs, }: UseTextLayerOptions): React.RefObject<(HTMLDivElement | null)[]>;
10
- export {};
@@ -1,12 +0,0 @@
1
- import * as pdfjsLib from "pdfjs-dist";
2
- export interface SearchMatch {
3
- page: number;
4
- pdfRect: [number, number, number, number];
5
- }
6
- export declare function useTextSearch({ pdf, query, }: {
7
- pdf: pdfjsLib.PDFDocumentProxy | null;
8
- query: string;
9
- }): {
10
- matches: SearchMatch[];
11
- searching: boolean;
12
- };
@@ -1,2 +0,0 @@
1
- import { ThemeContextValue } from '../context/themeContextValue';
2
- export declare function useTheme(): ThemeContextValue;
@@ -1,10 +0,0 @@
1
- import * as pdfjsLib from "pdfjs-dist";
2
- interface UseThumbnailsOptions {
3
- pdf: pdfjsLib.PDFDocumentProxy | null;
4
- rotation: number;
5
- visiblePages: number[];
6
- }
7
- export declare function useThumbnails({ pdf, rotation, visiblePages, }: UseThumbnailsOptions): {
8
- thumbnails: (string | null)[];
9
- };
10
- export {};
@@ -1,24 +0,0 @@
1
- export { default as PDFViewer } from './components/PDFViewer';
2
- export type { Theme } from './theme';
3
- export { darkTheme, lightTheme } from './theme';
4
- export type { Labels } from './labels';
5
- export { italianLabels, englishLabels } from './labels';
6
- export { PDFSidebar } from './components/PDFSidebar';
7
- export { PDFAttachments, PDFAttachmentsIcon, } from './components/features/PDFAttachments';
8
- export { PDFAnnotations, PDFAnnotationsIcon, } from './components/features/PDFAnnotations';
9
- export { PDFChangeFile } from './components/features/PDFChangeFile';
10
- export { PDFDownloadButton } from './components/features/PDFDownloadButton';
11
- export { PDFNavigation } from './components/features/PDFNavigation';
12
- export { PDFOutline } from './components/features/PDFOutline';
13
- export { PDFPageFit } from './components/features/PDFPageFit';
14
- export { PDFRotationControl } from './components/features/PDFRotationControl';
15
- export { PDFSearch } from './components/features/PDFSearch';
16
- export { PDFSignatures, PDFSignaturesIcon, } from './components/features/PDFSignatures';
17
- export { PDFThumbnails } from './components/features/PDFThumbnails';
18
- export { PDFZoomControls } from './components/features/PDFZoomControls';
19
- export { PDFThemeToggle } from './components/features/PDFThemeToggle';
20
- export { PDFPrintButton } from './components/features/PDFPrintButton';
21
- export { PDFSidebarToggle } from './components/features/PDFSidebarToggle';
22
- export { PDFToolbar } from './components/ui/PDFToolbar';
23
- export { PDFToolbarItem } from './components/ui/PDFToolbarItem';
24
- export { PDFToolbarSeparator } from './components/ui/PDFToolbarSeparator';
@@ -1,53 +0,0 @@
1
- export interface Labels {
2
- searchPlaceholder: string;
3
- searchToolbarLabel: string;
4
- prevPageTitle: string;
5
- pageInputTitle: string;
6
- nextPageTitle: string;
7
- navigationToolbarLabel: string;
8
- downloadTitle: string;
9
- downloadText: string;
10
- downloadToolbarLabel: string;
11
- downloadFallbackFilename: string;
12
- printTitle: string;
13
- printToolbarLabel: string;
14
- rotateTitle: string;
15
- rotateToolbarLabel: string;
16
- zoomOutTitle: string;
17
- zoomInTitle: string;
18
- zoomToolbarLabel: string;
19
- changeFileTitle: string;
20
- changeFileToolbarLabel: string;
21
- fitWidthTitle: string;
22
- fitPageTitle: string;
23
- fitToolbarLabel: string;
24
- switchToLightTitle: string;
25
- switchToDarkTitle: string;
26
- themeToolbarLabel: string;
27
- expandSidebarTitle: string;
28
- collapseSidebarTitle: string;
29
- sidebarToolbarLabel: string;
30
- attachmentsLoading: string;
31
- attachmentsEmpty: string;
32
- downloadAttachmentTitle: string;
33
- outlineLoading: string;
34
- outlineEmpty: string;
35
- thumbnailAlt: string;
36
- annotationTypes: Record<string, string>;
37
- annotationsLoading: string;
38
- annotationsEmpty: string;
39
- annotationsPageHeader: string;
40
- signatureSigned: string;
41
- signatureUnsigned: string;
42
- signatureSignerLabel: string;
43
- signatureDateLabel: string;
44
- signatureReasonLabel: string;
45
- signatureLocationLabel: string;
46
- signaturesLoading: string;
47
- signaturesEmpty: string;
48
- toolbarMoreOptions: string;
49
- requireReadPending: string;
50
- requireReadDone: string;
51
- }
52
- export declare const italianLabels: Labels;
53
- export declare const englishLabels: Labels;
@@ -1,27 +0,0 @@
1
- export interface Theme {
2
- fontFamily: string;
3
- bg: string;
4
- surface: string;
5
- surfaceHover: string;
6
- border: string;
7
- borderLight: string;
8
- scrollArea: string;
9
- textPrimary: string;
10
- textSecondary: string;
11
- textMuted: string;
12
- textPlaceholder: string;
13
- accent: string;
14
- accentHover: string;
15
- accentDark: string;
16
- accentLight: string;
17
- accentSubtle: string;
18
- panelBg: string;
19
- panelBorder: string;
20
- panelHeaderBg: string;
21
- shadowPage: string;
22
- badgeBg: string;
23
- toolbarSeparator: string;
24
- }
25
- export declare const darkTheme: Theme;
26
- export declare const lightTheme: Theme;
27
- export declare function themeToCssVars(theme: Theme): Record<string, string>;
@@ -1,2 +0,0 @@
1
- import type * as pdfjsLib from "pdfjs-dist";
2
- export declare function computeFit(mode: "width" | "page", pdf: pdfjsLib.PDFDocumentProxy, container: HTMLDivElement, rotation: number): Promise<number>;
@@ -1 +0,0 @@
1
- export declare function isSafeUrl(url: string): boolean;
@@ -1,9 +0,0 @@
1
- export interface AddSignatureOptions {
2
- page: number;
3
- x: number;
4
- y: number;
5
- width: number;
6
- height: number;
7
- image: string | Uint8Array;
8
- }
9
- export declare function addSignatureToPdf(pdfBytes: Uint8Array, opts: AddSignatureOptions): Promise<Uint8Array>;
package/dist/vite.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>