@iamjariwala/react-doc-viewer 0.2.1 → 1.0.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.
Files changed (105) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/dist/DocViewer.d.ts +0 -21
  4. package/dist/components/DocumentNav.d.ts +0 -3
  5. package/dist/components/FileName.d.ts +0 -3
  6. package/dist/components/HeaderBar.d.ts +0 -3
  7. package/dist/components/LoadingTimout.d.ts +0 -3
  8. package/dist/components/ProxyRenderer.d.ts +0 -3
  9. package/dist/components/common/Button.d.ts +0 -16
  10. package/dist/components/common/index.d.ts +0 -1
  11. package/dist/components/icons/index.d.ts +0 -8
  12. package/dist/cssStyles.d.ts +0 -1
  13. package/dist/defaultTheme.d.ts +0 -3
  14. package/dist/empty-DBAFSQIv.cjs +0 -1
  15. package/dist/empty-GlqisfcO.js +0 -4
  16. package/dist/features/annotations/components/AnnotationLayer.d.ts +0 -10
  17. package/dist/features/annotations/components/AnnotationToolbar.d.ts +0 -3
  18. package/dist/features/annotations/components/ColorPicker.d.ts +0 -3
  19. package/dist/features/annotations/components/CommentMarker.d.ts +0 -8
  20. package/dist/features/annotations/components/CommentPopover.d.ts +0 -9
  21. package/dist/features/annotations/components/TextHighlight.d.ts +0 -8
  22. package/dist/features/annotations/components/icons/index.d.ts +0 -13
  23. package/dist/features/annotations/hooks/useAnnotationExport.d.ts +0 -9
  24. package/dist/features/annotations/hooks/useDrawingCanvas.d.ts +0 -15
  25. package/dist/features/annotations/hooks/useTextSelection.d.ts +0 -10
  26. package/dist/features/annotations/index.d.ts +0 -13
  27. package/dist/features/annotations/state/actions.d.ts +0 -52
  28. package/dist/features/annotations/state/index.d.ts +0 -17
  29. package/dist/features/annotations/state/reducer.d.ts +0 -17
  30. package/dist/features/annotations/types/index.d.ts +0 -44
  31. package/dist/features/drag-drop/components/DropZoneOverlay.d.ts +0 -9
  32. package/dist/features/drag-drop/hooks/useDragDrop.d.ts +0 -11
  33. package/dist/features/drag-drop/hooks/useFileProcessor.d.ts +0 -13
  34. package/dist/features/drag-drop/index.d.ts +0 -4
  35. package/dist/features/drag-drop/types/index.d.ts +0 -19
  36. package/dist/features/thumbnail-sidebar/components/ThumbnailItem.d.ts +0 -11
  37. package/dist/features/thumbnail-sidebar/components/ThumbnailSidebar.d.ts +0 -8
  38. package/dist/features/thumbnail-sidebar/components/ThumbnailToggle.d.ts +0 -7
  39. package/dist/features/thumbnail-sidebar/hooks/useThumbnailGenerator.d.ts +0 -13
  40. package/dist/features/thumbnail-sidebar/index.d.ts +0 -6
  41. package/dist/features/thumbnail-sidebar/state/actions.d.ts +0 -31
  42. package/dist/features/thumbnail-sidebar/state/index.d.ts +0 -15
  43. package/dist/features/thumbnail-sidebar/state/reducer.d.ts +0 -11
  44. package/dist/hooks/useDocumentLoader.d.ts +0 -13
  45. package/dist/hooks/useRendererSelector.d.ts +0 -5
  46. package/dist/hooks/useTranslation.d.ts +0 -3
  47. package/dist/hooks/useWindowSize.d.ts +0 -4
  48. package/dist/i18n.d.ts +0 -158
  49. package/dist/index-BW6EMUiE.cjs +0 -797
  50. package/dist/index-CYjVmFQ0.cjs +0 -10
  51. package/dist/index-DHMTXjv6.cjs +0 -1
  52. package/dist/index-Dg8HfAtq.js +0 -21246
  53. package/dist/index-dGGNa2HA.js +0 -3350
  54. package/dist/index-nyGAOsVK.js +0 -42
  55. package/dist/index.css +0 -1
  56. package/dist/index.d.ts +0 -8
  57. package/dist/locales/ar.json.d.ts +0 -13
  58. package/dist/locales/de.json.d.ts +0 -13
  59. package/dist/locales/en.json.d.ts +0 -26
  60. package/dist/locales/es.json.d.ts +0 -13
  61. package/dist/locales/fr.json.d.ts +0 -13
  62. package/dist/locales/it.json.d.ts +0 -13
  63. package/dist/locales/ja.json.d.ts +0 -13
  64. package/dist/locales/pl.json.d.ts +0 -13
  65. package/dist/locales/pt.json.d.ts +0 -13
  66. package/dist/locales/ru.json.d.ts +0 -13
  67. package/dist/locales/se.json.d.ts +0 -13
  68. package/dist/locales/sr.json.d.ts +0 -13
  69. package/dist/locales/sr_cyr.json.d.ts +0 -13
  70. package/dist/locales/tr.json.d.ts +0 -13
  71. package/dist/models.d.ts +0 -122
  72. package/dist/react-doc-viewer.cjs +0 -1
  73. package/dist/react-doc-viewer.js +0 -23
  74. package/dist/renderers/bmp/index.d.ts +0 -4
  75. package/dist/renderers/csv/index.d.ts +0 -4
  76. package/dist/renderers/gif/index.d.ts +0 -4
  77. package/dist/renderers/html/index.d.ts +0 -4
  78. package/dist/renderers/image/index.d.ts +0 -4
  79. package/dist/renderers/index.d.ts +0 -15
  80. package/dist/renderers/jpg/index.d.ts +0 -4
  81. package/dist/renderers/msdoc/index.d.ts +0 -4
  82. package/dist/renderers/pdf/components/PDFControls.d.ts +0 -4
  83. package/dist/renderers/pdf/components/PDFPagination.d.ts +0 -4
  84. package/dist/renderers/pdf/components/PDFThumbnailGenerator.d.ts +0 -3
  85. package/dist/renderers/pdf/components/icons/index.d.ts +0 -9
  86. package/dist/renderers/pdf/components/pages/PDFAllPages.d.ts +0 -7
  87. package/dist/renderers/pdf/components/pages/PDFPages.d.ts +0 -4
  88. package/dist/renderers/pdf/components/pages/PDFSinglePage.d.ts +0 -7
  89. package/dist/renderers/pdf/index.d.ts +0 -4
  90. package/dist/renderers/pdf/state/actions.d.ts +0 -32
  91. package/dist/renderers/pdf/state/index.d.ts +0 -13
  92. package/dist/renderers/pdf/state/reducer.d.ts +0 -15
  93. package/dist/renderers/png/index.d.ts +0 -4
  94. package/dist/renderers/tiff/index.d.ts +0 -4
  95. package/dist/renderers/tiff/tiffToCanvas.d.ts +0 -1
  96. package/dist/renderers/txt/index.d.ts +0 -4
  97. package/dist/renderers/video/index.d.ts +0 -4
  98. package/dist/renderers/webp/index.d.ts +0 -4
  99. package/dist/store/DocViewerProvider.d.ts +0 -22
  100. package/dist/store/actions.d.ts +0 -63
  101. package/dist/store/mainStateReducer.d.ts +0 -23
  102. package/dist/url-BH2U_nez.cjs +0 -3
  103. package/dist/url-Dk8Xia2J.js +0 -560
  104. package/dist/utils/fileLoaders.d.ts +0 -13
  105. package/dist/utils/getFileName.d.ts +0 -3
package/README.md CHANGED
@@ -61,8 +61,8 @@ Most React document viewers only handle PDFs or require expensive commercial lic
61
61
 
62
62
  <!-- START doctoc generated TOC please keep comment here to allow auto update -->
63
63
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
64
+ ## Table of Contents
64
65
 
65
- - [Why @iamjariwala/react-doc-viewer?](#why-iamjariwalareact-doc-viewer)
66
66
  - [Supported File Types](#supported-file-types)
67
67
  - [Live Demo](#live-demo)
68
68
  - [Installation](#installation)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamjariwala/react-doc-viewer",
3
- "version": "0.2.1",
3
+ "version": "1.0.0",
4
4
  "description": "React document viewer and PDF viewer component — render PDF, Word, Excel, PowerPoint, images, video, CSV and 20+ file types with drag-and-drop, annotations, thumbnails and i18n.",
5
5
  "author": "Mehul Jariwala",
6
6
  "type": "module",
@@ -1,21 +0,0 @@
1
- import { default as React, CSSProperties } from 'react';
2
- import { AvailableLanguages } from './i18n';
3
- import { DocRenderer, DocViewerRef, IConfig, IDocument, ITheme } from './models';
4
-
5
- export interface DocViewerProps {
6
- documents: IDocument[];
7
- className?: string;
8
- style?: CSSProperties;
9
- config?: IConfig;
10
- theme?: ITheme;
11
- pluginRenderers?: DocRenderer[];
12
- prefetchMethod?: string;
13
- requestHeaders?: Record<string, string>;
14
- initialActiveDocument?: IDocument;
15
- language?: AvailableLanguages;
16
- activeDocument?: IDocument;
17
- onDocumentChange?: (document: IDocument) => void;
18
- jumpToPage?: number;
19
- }
20
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<DocViewerProps & React.RefAttributes<DocViewerRef>>>;
21
- export default _default;
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- export declare const DocumentNav: FC;
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- export declare const FileName: FC;
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- export declare const HeaderBar: FC;
@@ -1,3 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
-
3
- export declare const LoadingTimeout: FC<PropsWithChildren>;
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- export declare const ProxyRenderer: FC;
@@ -1,16 +0,0 @@
1
- import { IStyledProps } from '../..';
2
-
3
- interface ButtonProps extends IStyledProps {
4
- disabled?: boolean;
5
- }
6
- export declare const ButtonPrimaryStyle: import('styled-components').RuleSet<object>;
7
- export declare const ButtonSecondaryStyle: import('styled-components').RuleSet<object>;
8
- export declare const Button: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ButtonProps>> & string;
9
- export declare const LinkButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
10
- export declare const ButtonPrimary: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof ButtonProps> & ButtonProps, "ref"> & {
11
- ref?: ((instance: HTMLButtonElement | null) => void) | import('react').RefObject<HTMLButtonElement> | null | undefined;
12
- }, never>> & string;
13
- export declare const ButtonSecondary: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof ButtonProps> & ButtonProps, "ref"> & {
14
- ref?: ((instance: HTMLButtonElement | null) => void) | import('react').RefObject<HTMLButtonElement> | null | undefined;
15
- }, never>> & string;
16
- export {};
@@ -1 +0,0 @@
1
- export * from './Button';
@@ -1,8 +0,0 @@
1
- export interface IIconProps {
2
- color?: string;
3
- size?: string | number | string | undefined;
4
- reverse?: boolean;
5
- }
6
- export declare const PrevDocIcon: (props: IIconProps) => import("react/jsx-runtime").JSX.Element;
7
- export declare const NextDocIcon: (props: IIconProps) => import("react/jsx-runtime").JSX.Element;
8
- export declare const LoadingIcon: (props: IIconProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
-
@@ -1,3 +0,0 @@
1
- import { ITheme } from '.';
2
-
3
- export declare const defaultTheme: ITheme;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=null;exports.default=e;
@@ -1,4 +0,0 @@
1
- var a = null;
2
- export {
3
- a as default
4
- };
@@ -1,10 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- interface AnnotationLayerProps {
4
- pageNumber: number;
5
- documentUri: string;
6
- width: number;
7
- height: number;
8
- }
9
- export declare const AnnotationLayer: FC<AnnotationLayerProps>;
10
- export {};
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- export declare const AnnotationToolbar: FC;
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- export declare const ColorPicker: FC;
@@ -1,8 +0,0 @@
1
- import { FC } from 'react';
2
- import { IAnnotation } from '../types';
3
-
4
- interface CommentMarkerProps {
5
- annotation: IAnnotation;
6
- }
7
- export declare const CommentMarker: FC<CommentMarkerProps>;
8
- export {};
@@ -1,9 +0,0 @@
1
- import { FC } from 'react';
2
- import { IAnnotation } from '../types';
3
-
4
- interface CommentPopoverProps {
5
- annotation: IAnnotation;
6
- onClose: () => void;
7
- }
8
- export declare const CommentPopover: FC<CommentPopoverProps>;
9
- export {};
@@ -1,8 +0,0 @@
1
- import { FC } from 'react';
2
- import { IAnnotation } from '../types';
3
-
4
- interface TextHighlightProps {
5
- annotation: IAnnotation;
6
- }
7
- export declare const TextHighlight: FC<TextHighlightProps>;
8
- export {};
@@ -1,13 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- export interface IIconProps {
4
- color?: string;
5
- size?: string | number;
6
- isActive?: boolean;
7
- }
8
- export declare const SelectIcon: FC<IIconProps>;
9
- export declare const HighlightIcon: FC<IIconProps>;
10
- export declare const PenIcon: FC<IIconProps>;
11
- export declare const CommentIcon: FC<IIconProps>;
12
- export declare const EraserIcon: FC<IIconProps>;
13
- export declare const DeleteIcon: FC<IIconProps>;
@@ -1,9 +0,0 @@
1
- import { IAnnotation } from '../types';
2
-
3
- export declare const useAnnotationExport: () => {
4
- exportAnnotations: () => IAnnotation[];
5
- exportAsJSON: () => string;
6
- downloadAnnotations: (filename?: string) => void;
7
- getAnnotationsForPage: (pageNumber: number, documentUri: string) => IAnnotation[];
8
- annotationCount: number;
9
- };
@@ -1,15 +0,0 @@
1
- import { IAnnotation } from '../types';
2
-
3
- interface UseDrawingCanvasProps {
4
- canvasRef: React.RefObject<HTMLCanvasElement>;
5
- pageNumber: number;
6
- documentUri: string;
7
- }
8
- export declare const useDrawingCanvas: ({ canvasRef, pageNumber, documentUri, }: UseDrawingCanvasProps) => {
9
- startDrawing: (e: React.MouseEvent<HTMLCanvasElement>) => void;
10
- draw: (e: React.MouseEvent<HTMLCanvasElement>) => void;
11
- stopDrawing: () => void;
12
- redrawAnnotations: (annotations: IAnnotation[]) => void;
13
- isDrawing: boolean;
14
- };
15
- export {};
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- interface UseTextSelectionProps {
3
- pageNumber: number;
4
- documentUri: string;
5
- containerRef: React.RefObject<HTMLDivElement>;
6
- }
7
- export declare const useTextSelection: ({ pageNumber, documentUri, containerRef, }: UseTextSelectionProps) => {
8
- handleTextSelection: () => void;
9
- };
10
- export {};
@@ -1,13 +0,0 @@
1
- export { AnnotationLayer } from './components/AnnotationLayer';
2
- export { AnnotationToolbar } from './components/AnnotationToolbar';
3
- export { TextHighlight } from './components/TextHighlight';
4
- export { CommentMarker } from './components/CommentMarker';
5
- export { CommentPopover } from './components/CommentPopover';
6
- export { ColorPicker } from './components/ColorPicker';
7
- export * from './components/icons';
8
- export { AnnotationProvider, AnnotationContext } from './state';
9
- export { useDrawingCanvas } from './hooks/useDrawingCanvas';
10
- export { useTextSelection } from './hooks/useTextSelection';
11
- export { useAnnotationExport } from './hooks/useAnnotationExport';
12
- export * from './state/actions';
13
- export * from './types';
@@ -1,52 +0,0 @@
1
- import { AnnotationTool, IAnnotation } from '../types';
2
-
3
- export declare const SET_ACTIVE_TOOL = "SET_ACTIVE_TOOL";
4
- export declare const SET_CURRENT_COLOR = "SET_CURRENT_COLOR";
5
- export declare const ADD_ANNOTATION = "ADD_ANNOTATION";
6
- export declare const UPDATE_ANNOTATION = "UPDATE_ANNOTATION";
7
- export declare const DELETE_ANNOTATION = "DELETE_ANNOTATION";
8
- export declare const SET_ANNOTATIONS = "SET_ANNOTATIONS";
9
- export declare const SET_SELECTED_ANNOTATION = "SET_SELECTED_ANNOTATION";
10
- export declare const SET_IS_DRAWING = "SET_IS_DRAWING";
11
- export interface SetActiveTool {
12
- type: typeof SET_ACTIVE_TOOL;
13
- tool: AnnotationTool;
14
- }
15
- export declare const setActiveTool: (tool: AnnotationTool) => SetActiveTool;
16
- export interface SetCurrentColor {
17
- type: typeof SET_CURRENT_COLOR;
18
- color: string;
19
- }
20
- export declare const setCurrentColor: (color: string) => SetCurrentColor;
21
- export interface AddAnnotation {
22
- type: typeof ADD_ANNOTATION;
23
- annotation: IAnnotation;
24
- }
25
- export declare const addAnnotation: (annotation: IAnnotation) => AddAnnotation;
26
- export interface UpdateAnnotation {
27
- type: typeof UPDATE_ANNOTATION;
28
- id: string;
29
- updates: Partial<IAnnotation>;
30
- }
31
- export declare const updateAnnotation: (id: string, updates: Partial<IAnnotation>) => UpdateAnnotation;
32
- export interface DeleteAnnotation {
33
- type: typeof DELETE_ANNOTATION;
34
- id: string;
35
- }
36
- export declare const deleteAnnotation: (id: string) => DeleteAnnotation;
37
- export interface SetAnnotations {
38
- type: typeof SET_ANNOTATIONS;
39
- annotations: IAnnotation[];
40
- }
41
- export declare const setAnnotations: (annotations: IAnnotation[]) => SetAnnotations;
42
- export interface SetSelectedAnnotation {
43
- type: typeof SET_SELECTED_ANNOTATION;
44
- id: string | null;
45
- }
46
- export declare const setSelectedAnnotation: (id: string | null) => SetSelectedAnnotation;
47
- export interface SetIsDrawing {
48
- type: typeof SET_IS_DRAWING;
49
- isDrawing: boolean;
50
- }
51
- export declare const setIsDrawing: (isDrawing: boolean) => SetIsDrawing;
52
- export type AnnotationActions = SetActiveTool | SetCurrentColor | AddAnnotation | UpdateAnnotation | DeleteAnnotation | SetAnnotations | SetSelectedAnnotation | SetIsDrawing;
@@ -1,17 +0,0 @@
1
- import { default as React, Dispatch, FC, PropsWithChildren } from 'react';
2
- import { IAnnotationConfig } from '../../../models';
3
- import { AnnotationActions } from './actions';
4
- import { IAnnotationState } from './reducer';
5
-
6
- interface AnnotationContextValue {
7
- state: IAnnotationState;
8
- dispatch: Dispatch<AnnotationActions>;
9
- config?: IAnnotationConfig;
10
- }
11
- export declare const AnnotationContext: React.Context<AnnotationContextValue>;
12
- interface AnnotationProviderProps {
13
- config?: IAnnotationConfig;
14
- documentUri?: string;
15
- }
16
- export declare const AnnotationProvider: FC<PropsWithChildren<AnnotationProviderProps>>;
17
- export {};
@@ -1,17 +0,0 @@
1
- import { AnnotationTool, IAnnotation } from '../types';
2
- import { AnnotationActions } from './actions';
3
-
4
- export interface IAnnotationState {
5
- activeTool: AnnotationTool;
6
- currentColor: string;
7
- annotations: IAnnotation[];
8
- selectedAnnotationId: string | null;
9
- isDrawing: boolean;
10
- availableColors: string[];
11
- availableTools: AnnotationTool[];
12
- }
13
- export declare const DEFAULT_COLORS: string[];
14
- export declare const DEFAULT_TOOLS: AnnotationTool[];
15
- export declare const initialAnnotationState: IAnnotationState;
16
- export type AnnotationStateReducer = (state: IAnnotationState, action: AnnotationActions) => IAnnotationState;
17
- export declare const annotationReducer: AnnotationStateReducer;
@@ -1,44 +0,0 @@
1
- export type AnnotationTool = "select" | "highlight" | "pen" | "comment" | "eraser";
2
- export interface IAnnotation {
3
- id: string;
4
- type: "highlight" | "drawing" | "comment";
5
- documentUri: string;
6
- pageNumber: number;
7
- color: string;
8
- data?: IHighlightData | IDrawingData | ICommentData;
9
- }
10
- export interface IHighlightData {
11
- rects: Array<{
12
- x: number;
13
- y: number;
14
- width: number;
15
- height: number;
16
- }>;
17
- text?: string;
18
- }
19
- export interface IDrawingData {
20
- paths: Array<{
21
- x: number;
22
- y: number;
23
- }[]>;
24
- strokeWidth: number;
25
- }
26
- export interface ICommentData {
27
- x: number;
28
- y: number;
29
- text: string;
30
- author?: string;
31
- timestamp?: number;
32
- }
33
- export interface IAnnotationConfig {
34
- enableAnnotations?: boolean;
35
- defaultColor?: string;
36
- colors?: string[];
37
- tools?: AnnotationTool[];
38
- onAnnotationChange?: (annotations: IAnnotation[]) => void;
39
- initialAnnotations?: IAnnotation[];
40
- }
41
- export interface IPoint {
42
- x: number;
43
- y: number;
44
- }
@@ -1,9 +0,0 @@
1
- import { FC } from 'react';
2
- import { IDragState } from '../types';
3
-
4
- interface DropZoneOverlayProps {
5
- dragState: IDragState;
6
- dropMessage?: string;
7
- }
8
- export declare const DropZoneOverlay: FC<DropZoneOverlayProps>;
9
- export {};
@@ -1,11 +0,0 @@
1
- import { DragEvent } from 'react';
2
- import { IDragState } from '../types';
3
-
4
- export declare const useDragDrop: () => {
5
- dragState: IDragState;
6
- handleDragEnter: (e: DragEvent<HTMLDivElement>) => void;
7
- handleDragLeave: (e: DragEvent<HTMLDivElement>) => void;
8
- handleDragOver: (e: DragEvent<HTMLDivElement>) => void;
9
- handleDrop: (e: DragEvent<HTMLDivElement>, onFilesDropped: (files: File[]) => void) => void;
10
- resetDragState: () => void;
11
- };
@@ -1,13 +0,0 @@
1
- import { IDocument } from '../../../models';
2
- import { IDragDropConfig } from '../types';
3
-
4
- export declare const useFileProcessor: (config?: IDragDropConfig) => {
5
- processFiles: (files: File[]) => Promise<IDocument[]>;
6
- validateFiles: (files: File[]) => {
7
- valid: File[];
8
- invalidType: File[];
9
- invalidSize: File[];
10
- };
11
- isFileTypeAccepted: (file: File) => boolean;
12
- isFileSizeValid: (file: File) => boolean;
13
- };
@@ -1,4 +0,0 @@
1
- export { DropZoneOverlay } from './components/DropZoneOverlay';
2
- export { useDragDrop } from './hooks/useDragDrop';
3
- export { useFileProcessor } from './hooks/useFileProcessor';
4
- export * from './types';
@@ -1,19 +0,0 @@
1
- export interface IDragDropConfig {
2
- enableDragDrop?: boolean;
3
- acceptedFileTypes?: string[];
4
- maxFileSize?: number;
5
- dropBehavior?: "append" | "replace";
6
- onDrop?: (files: File[]) => void;
7
- onDropRejected?: (files: File[], reason: DropRejectionReason) => void;
8
- }
9
- export type DropRejectionReason = "file-type" | "file-size" | "unknown";
10
- export interface IDragState {
11
- isDragging: boolean;
12
- isOverDropZone: boolean;
13
- }
14
- export interface IProcessedFile {
15
- uri: string;
16
- fileType: string;
17
- fileName: string;
18
- fileData: string;
19
- }
@@ -1,11 +0,0 @@
1
- import { FC } from 'react';
2
- import { IThumbnail } from '../state/actions';
3
-
4
- interface ThumbnailItemProps {
5
- thumbnail: IThumbnail;
6
- isSelected: boolean;
7
- width: number;
8
- onClick: () => void;
9
- }
10
- export declare const ThumbnailItem: FC<ThumbnailItemProps>;
11
- export {};
@@ -1,8 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- interface ThumbnailSidebarProps {
4
- onPageSelect: (pageNumber: number) => void;
5
- currentPage: number;
6
- }
7
- export declare const ThumbnailSidebar: FC<ThumbnailSidebarProps>;
8
- export {};
@@ -1,7 +0,0 @@
1
- import { FC } from 'react';
2
-
3
- interface ThumbnailToggleProps {
4
- title?: string;
5
- }
6
- export declare const ThumbnailToggle: FC<ThumbnailToggleProps>;
7
- export {};
@@ -1,13 +0,0 @@
1
- import { IThumbnail } from '../state/actions';
2
-
3
- interface UseThumbnailGeneratorProps {
4
- numPages: number;
5
- documentUri?: string;
6
- scale?: number;
7
- }
8
- export declare const useThumbnailGenerator: ({ numPages, documentUri, scale, }: UseThumbnailGeneratorProps) => {
9
- thumbnails: IThumbnail[];
10
- generateThumbnailFromCanvas: (canvas: HTMLCanvasElement, pageNumber: number) => void;
11
- scale: number;
12
- };
13
- export {};
@@ -1,6 +0,0 @@
1
- export { ThumbnailSidebar } from './components/ThumbnailSidebar';
2
- export { ThumbnailItem } from './components/ThumbnailItem';
3
- export { ThumbnailToggle } from './components/ThumbnailToggle';
4
- export { ThumbnailProvider, ThumbnailContext } from './state';
5
- export { useThumbnailGenerator } from './hooks/useThumbnailGenerator';
6
- export * from './state/actions';
@@ -1,31 +0,0 @@
1
- export declare const SET_SIDEBAR_OPEN = "SET_SIDEBAR_OPEN";
2
- export declare const SET_THUMBNAILS = "SET_THUMBNAILS";
3
- export declare const SET_SELECTED_PAGE = "SET_SELECTED_PAGE";
4
- export declare const UPDATE_SINGLE_THUMBNAIL = "UPDATE_SINGLE_THUMBNAIL";
5
- export interface SetSidebarOpen {
6
- type: typeof SET_SIDEBAR_OPEN;
7
- isOpen: boolean;
8
- }
9
- export declare const setSidebarOpen: (isOpen: boolean) => SetSidebarOpen;
10
- export interface IThumbnail {
11
- pageNumber: number;
12
- dataUrl?: string;
13
- isLoading: boolean;
14
- }
15
- export interface SetThumbnails {
16
- type: typeof SET_THUMBNAILS;
17
- thumbnails: IThumbnail[];
18
- }
19
- export declare const setThumbnails: (thumbnails: IThumbnail[]) => SetThumbnails;
20
- export interface SetSelectedPage {
21
- type: typeof SET_SELECTED_PAGE;
22
- pageNumber: number;
23
- }
24
- export declare const setSelectedPage: (pageNumber: number) => SetSelectedPage;
25
- export interface UpdateSingleThumbnail {
26
- type: typeof UPDATE_SINGLE_THUMBNAIL;
27
- pageNumber: number;
28
- dataUrl: string;
29
- }
30
- export declare const updateSingleThumbnail: (pageNumber: number, dataUrl: string) => UpdateSingleThumbnail;
31
- export type ThumbnailActions = SetSidebarOpen | SetThumbnails | SetSelectedPage | UpdateSingleThumbnail;
@@ -1,15 +0,0 @@
1
- import { default as React, Dispatch, FC, PropsWithChildren } from 'react';
2
- import { IThumbnailConfig } from '../../../models';
3
- import { ThumbnailActions } from './actions';
4
- import { IThumbnailState } from './reducer';
5
-
6
- interface ThumbnailContextValue {
7
- state: IThumbnailState;
8
- dispatch: Dispatch<ThumbnailActions>;
9
- }
10
- export declare const ThumbnailContext: React.Context<ThumbnailContextValue>;
11
- interface ThumbnailProviderProps {
12
- config?: IThumbnailConfig;
13
- }
14
- export declare const ThumbnailProvider: FC<PropsWithChildren<ThumbnailProviderProps>>;
15
- export {};
@@ -1,11 +0,0 @@
1
- import { ThumbnailActions, IThumbnail } from './actions';
2
-
3
- export interface IThumbnailState {
4
- isOpen: boolean;
5
- thumbnails: IThumbnail[];
6
- selectedPage: number;
7
- thumbnailWidth: number;
8
- }
9
- export declare const initialThumbnailState: IThumbnailState;
10
- export type ThumbnailStateReducer = (state: IThumbnailState, action: ThumbnailActions) => IThumbnailState;
11
- export declare const thumbnailReducer: ThumbnailStateReducer;
@@ -1,13 +0,0 @@
1
- import { Dispatch } from 'react';
2
- import { MainStateActions } from '../store/actions';
3
- import { IMainState } from '../store/mainStateReducer';
4
- import { DocRenderer } from '..';
5
-
6
- /**
7
- * Custom Hook for loading the current document into context
8
- */
9
- export declare const useDocumentLoader: () => {
10
- state: IMainState;
11
- dispatch: Dispatch<MainStateActions>;
12
- CurrentRenderer: DocRenderer | null | undefined;
13
- };
@@ -1,5 +0,0 @@
1
- import { DocRenderer } from '..';
2
-
3
- export declare const useRendererSelector: () => {
4
- CurrentRenderer: DocRenderer | null | undefined;
5
- };
@@ -1,3 +0,0 @@
1
- export declare const useTranslation: () => {
2
- t: (key: "documentNavInfo" | "noRendererMessage" | "downloadButtonLabel" | "brokenFile" | "msgPluginRecipients" | "msgPluginSender" | "pdfPluginLoading" | "pdfPluginPageNumber", variables?: Record<string, string | number>) => string;
3
- };
@@ -1,4 +0,0 @@
1
- export declare const useWindowSize: () => {
2
- width: number | undefined;
3
- height: number | undefined;
4
- };