@iamjariwala/react-doc-viewer 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +568 -0
- package/dist/DocViewer.d.ts +21 -0
- package/dist/components/DocumentNav.d.ts +3 -0
- package/dist/components/FileName.d.ts +3 -0
- package/dist/components/HeaderBar.d.ts +3 -0
- package/dist/components/LoadingTimout.d.ts +3 -0
- package/dist/components/ProxyRenderer.d.ts +3 -0
- package/dist/components/common/Button.d.ts +16 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/icons/index.d.ts +8 -0
- package/dist/cssStyles.d.ts +1 -0
- package/dist/defaultTheme.d.ts +3 -0
- package/dist/empty-DBAFSQIv.cjs +1 -0
- package/dist/empty-GlqisfcO.js +4 -0
- package/dist/features/annotations/components/AnnotationLayer.d.ts +10 -0
- package/dist/features/annotations/components/AnnotationToolbar.d.ts +3 -0
- package/dist/features/annotations/components/ColorPicker.d.ts +3 -0
- package/dist/features/annotations/components/CommentMarker.d.ts +8 -0
- package/dist/features/annotations/components/CommentPopover.d.ts +9 -0
- package/dist/features/annotations/components/TextHighlight.d.ts +8 -0
- package/dist/features/annotations/components/icons/index.d.ts +13 -0
- package/dist/features/annotations/hooks/useAnnotationExport.d.ts +9 -0
- package/dist/features/annotations/hooks/useDrawingCanvas.d.ts +15 -0
- package/dist/features/annotations/hooks/useTextSelection.d.ts +10 -0
- package/dist/features/annotations/index.d.ts +13 -0
- package/dist/features/annotations/state/actions.d.ts +52 -0
- package/dist/features/annotations/state/index.d.ts +17 -0
- package/dist/features/annotations/state/reducer.d.ts +17 -0
- package/dist/features/annotations/types/index.d.ts +44 -0
- package/dist/features/drag-drop/components/DropZoneOverlay.d.ts +9 -0
- package/dist/features/drag-drop/hooks/useDragDrop.d.ts +11 -0
- package/dist/features/drag-drop/hooks/useFileProcessor.d.ts +13 -0
- package/dist/features/drag-drop/index.d.ts +4 -0
- package/dist/features/drag-drop/types/index.d.ts +19 -0
- package/dist/features/thumbnail-sidebar/components/ThumbnailItem.d.ts +11 -0
- package/dist/features/thumbnail-sidebar/components/ThumbnailSidebar.d.ts +8 -0
- package/dist/features/thumbnail-sidebar/components/ThumbnailToggle.d.ts +7 -0
- package/dist/features/thumbnail-sidebar/hooks/useThumbnailGenerator.d.ts +13 -0
- package/dist/features/thumbnail-sidebar/index.d.ts +6 -0
- package/dist/features/thumbnail-sidebar/state/actions.d.ts +31 -0
- package/dist/features/thumbnail-sidebar/state/index.d.ts +15 -0
- package/dist/features/thumbnail-sidebar/state/reducer.d.ts +11 -0
- package/dist/hooks/useDocumentLoader.d.ts +13 -0
- package/dist/hooks/useRendererSelector.d.ts +5 -0
- package/dist/hooks/useTranslation.d.ts +3 -0
- package/dist/hooks/useWindowSize.d.ts +4 -0
- package/dist/i18n.d.ts +158 -0
- package/dist/index-BW6EMUiE.cjs +797 -0
- package/dist/index-CYjVmFQ0.cjs +10 -0
- package/dist/index-DHMTXjv6.cjs +1 -0
- package/dist/index-Dg8HfAtq.js +21246 -0
- package/dist/index-dGGNa2HA.js +3350 -0
- package/dist/index-nyGAOsVK.js +42 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/locales/ar.json.d.ts +13 -0
- package/dist/locales/de.json.d.ts +13 -0
- package/dist/locales/en.json.d.ts +26 -0
- package/dist/locales/es.json.d.ts +13 -0
- package/dist/locales/fr.json.d.ts +13 -0
- package/dist/locales/it.json.d.ts +13 -0
- package/dist/locales/ja.json.d.ts +13 -0
- package/dist/locales/pl.json.d.ts +13 -0
- package/dist/locales/pt.json.d.ts +13 -0
- package/dist/locales/ru.json.d.ts +13 -0
- package/dist/locales/se.json.d.ts +13 -0
- package/dist/locales/sr.json.d.ts +13 -0
- package/dist/locales/sr_cyr.json.d.ts +13 -0
- package/dist/locales/tr.json.d.ts +13 -0
- package/dist/models.d.ts +122 -0
- package/dist/react-doc-viewer.cjs +1 -0
- package/dist/react-doc-viewer.js +23 -0
- package/dist/renderers/bmp/index.d.ts +4 -0
- package/dist/renderers/csv/index.d.ts +4 -0
- package/dist/renderers/gif/index.d.ts +4 -0
- package/dist/renderers/html/index.d.ts +4 -0
- package/dist/renderers/image/index.d.ts +4 -0
- package/dist/renderers/index.d.ts +15 -0
- package/dist/renderers/jpg/index.d.ts +4 -0
- package/dist/renderers/msdoc/index.d.ts +4 -0
- package/dist/renderers/pdf/components/PDFControls.d.ts +4 -0
- package/dist/renderers/pdf/components/PDFPagination.d.ts +4 -0
- package/dist/renderers/pdf/components/PDFThumbnailGenerator.d.ts +3 -0
- package/dist/renderers/pdf/components/icons/index.d.ts +9 -0
- package/dist/renderers/pdf/components/pages/PDFAllPages.d.ts +7 -0
- package/dist/renderers/pdf/components/pages/PDFPages.d.ts +4 -0
- package/dist/renderers/pdf/components/pages/PDFSinglePage.d.ts +7 -0
- package/dist/renderers/pdf/index.d.ts +4 -0
- package/dist/renderers/pdf/state/actions.d.ts +32 -0
- package/dist/renderers/pdf/state/index.d.ts +13 -0
- package/dist/renderers/pdf/state/reducer.d.ts +15 -0
- package/dist/renderers/png/index.d.ts +4 -0
- package/dist/renderers/tiff/index.d.ts +4 -0
- package/dist/renderers/tiff/tiffToCanvas.d.ts +1 -0
- package/dist/renderers/txt/index.d.ts +4 -0
- package/dist/renderers/video/index.d.ts +4 -0
- package/dist/renderers/webp/index.d.ts +4 -0
- package/dist/store/DocViewerProvider.d.ts +22 -0
- package/dist/store/actions.d.ts +63 -0
- package/dist/store/mainStateReducer.d.ts +23 -0
- package/dist/url-BH2U_nez.cjs +3 -0
- package/dist/url-Dk8Xia2J.js +560 -0
- package/dist/utils/fileLoaders.d.ts +13 -0
- package/dist/utils/getFileName.d.ts +3 -0
- package/package.json +122 -0
|
@@ -0,0 +1,13 @@
|
|
|
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>;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,10 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,13 @@
|
|
|
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';
|
|
@@ -0,0 +1,52 @@
|
|
|
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;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,13 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,6 @@
|
|
|
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';
|
|
@@ -0,0 +1,31 @@
|
|
|
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;
|
|
@@ -0,0 +1,15 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const useTranslation: () => {
|
|
2
|
+
t: (key: "documentNavInfo" | "noRendererMessage" | "downloadButtonLabel" | "brokenFile" | "msgPluginRecipients" | "msgPluginSender" | "pdfPluginLoading" | "pdfPluginPageNumber", variables?: Record<string, string | number>) => string;
|
|
3
|
+
};
|
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
export declare const locales: {
|
|
2
|
+
en: {
|
|
3
|
+
documentNavInfo: string;
|
|
4
|
+
noRendererMessage: string;
|
|
5
|
+
downloadButtonLabel: string;
|
|
6
|
+
brokenFile: string;
|
|
7
|
+
msgPluginRecipients: string;
|
|
8
|
+
msgPluginSender: string;
|
|
9
|
+
pdfPluginLoading: string;
|
|
10
|
+
pdfPluginPageNumber: string;
|
|
11
|
+
dropFilesHere: string;
|
|
12
|
+
thumbnailSidebar: string;
|
|
13
|
+
showThumbnails: string;
|
|
14
|
+
hideThumbnails: string;
|
|
15
|
+
annotationToolbar: string;
|
|
16
|
+
selectTool: string;
|
|
17
|
+
highlightTool: string;
|
|
18
|
+
penTool: string;
|
|
19
|
+
commentTool: string;
|
|
20
|
+
eraserTool: string;
|
|
21
|
+
addComment: string;
|
|
22
|
+
deleteAnnotation: string;
|
|
23
|
+
saveAnnotations: string;
|
|
24
|
+
};
|
|
25
|
+
pl: {
|
|
26
|
+
documentNavInfo: string;
|
|
27
|
+
noRendererMessage: string;
|
|
28
|
+
downloadButtonLabel: string;
|
|
29
|
+
brokenFile: string;
|
|
30
|
+
msgPluginRecipients: string;
|
|
31
|
+
msgPluginSender: string;
|
|
32
|
+
pdfPluginLoading: string;
|
|
33
|
+
pdfPluginPageNumber: string;
|
|
34
|
+
};
|
|
35
|
+
es: {
|
|
36
|
+
documentNavInfo: string;
|
|
37
|
+
noRendererMessage: string;
|
|
38
|
+
downloadButtonLabel: string;
|
|
39
|
+
brokenFile: string;
|
|
40
|
+
msgPluginRecipients: string;
|
|
41
|
+
msgPluginSender: string;
|
|
42
|
+
pdfPluginLoading: string;
|
|
43
|
+
pdfPluginPageNumber: string;
|
|
44
|
+
};
|
|
45
|
+
de: {
|
|
46
|
+
documentNavInfo: string;
|
|
47
|
+
noRendererMessage: string;
|
|
48
|
+
downloadButtonLabel: string;
|
|
49
|
+
brokenFile: string;
|
|
50
|
+
msgPluginRecipients: string;
|
|
51
|
+
msgPluginSender: string;
|
|
52
|
+
pdfPluginLoading: string;
|
|
53
|
+
pdfPluginPageNumber: string;
|
|
54
|
+
};
|
|
55
|
+
it: {
|
|
56
|
+
documentNavInfo: string;
|
|
57
|
+
noRendererMessage: string;
|
|
58
|
+
downloadButtonLabel: string;
|
|
59
|
+
brokenFile: string;
|
|
60
|
+
msgPluginRecipients: string;
|
|
61
|
+
msgPluginSender: string;
|
|
62
|
+
pdfPluginLoading: string;
|
|
63
|
+
pdfPluginPageNumber: string;
|
|
64
|
+
};
|
|
65
|
+
pt: {
|
|
66
|
+
documentNavInfo: string;
|
|
67
|
+
noRendererMessage: string;
|
|
68
|
+
downloadButtonLabel: string;
|
|
69
|
+
brokenFile: string;
|
|
70
|
+
msgPluginRecipients: string;
|
|
71
|
+
msgPluginSender: string;
|
|
72
|
+
pdfPluginLoading: string;
|
|
73
|
+
pdfPluginPageNumber: string;
|
|
74
|
+
};
|
|
75
|
+
fr: {
|
|
76
|
+
documentNavInfo: string;
|
|
77
|
+
noRendererMessage: string;
|
|
78
|
+
downloadButtonLabel: string;
|
|
79
|
+
brokenFile: string;
|
|
80
|
+
msgPluginRecipients: string;
|
|
81
|
+
msgPluginSender: string;
|
|
82
|
+
pdfPluginLoading: string;
|
|
83
|
+
pdfPluginPageNumber: string;
|
|
84
|
+
};
|
|
85
|
+
ar: {
|
|
86
|
+
documentNavInfo: string;
|
|
87
|
+
noRendererMessage: string;
|
|
88
|
+
downloadButtonLabel: string;
|
|
89
|
+
brokenFile: string;
|
|
90
|
+
msgPluginRecipients: string;
|
|
91
|
+
msgPluginSender: string;
|
|
92
|
+
pdfPluginLoading: string;
|
|
93
|
+
pdfPluginPageNumber: string;
|
|
94
|
+
};
|
|
95
|
+
sr: {
|
|
96
|
+
documentNavInfo: string;
|
|
97
|
+
noRendererMessage: string;
|
|
98
|
+
downloadButtonLabel: string;
|
|
99
|
+
brokenFile: string;
|
|
100
|
+
msgPluginRecipients: string;
|
|
101
|
+
msgPluginSender: string;
|
|
102
|
+
pdfPluginLoading: string;
|
|
103
|
+
pdfPluginPageNumber: string;
|
|
104
|
+
};
|
|
105
|
+
sr_cyr: {
|
|
106
|
+
documentNavInfo: string;
|
|
107
|
+
noRendererMessage: string;
|
|
108
|
+
downloadButtonLabel: string;
|
|
109
|
+
brokenFile: string;
|
|
110
|
+
msgPluginRecipients: string;
|
|
111
|
+
msgPluginSender: string;
|
|
112
|
+
pdfPluginLoading: string;
|
|
113
|
+
pdfPluginPageNumber: string;
|
|
114
|
+
};
|
|
115
|
+
ja: {
|
|
116
|
+
documentNavInfo: string;
|
|
117
|
+
noRendererMessage: string;
|
|
118
|
+
downloadButtonLabel: string;
|
|
119
|
+
brokenFile: string;
|
|
120
|
+
msgPluginRecipients: string;
|
|
121
|
+
msgPluginSender: string;
|
|
122
|
+
pdfPluginLoading: string;
|
|
123
|
+
pdfPluginPageNumber: string;
|
|
124
|
+
};
|
|
125
|
+
ru: {
|
|
126
|
+
documentNavInfo: string;
|
|
127
|
+
noRendererMessage: string;
|
|
128
|
+
downloadButtonLabel: string;
|
|
129
|
+
brokenFile: string;
|
|
130
|
+
msgPluginRecipients: string;
|
|
131
|
+
msgPluginSender: string;
|
|
132
|
+
pdfPluginLoading: string;
|
|
133
|
+
pdfPluginPageNumber: string;
|
|
134
|
+
};
|
|
135
|
+
se: {
|
|
136
|
+
documentNavInfo: string;
|
|
137
|
+
noRendererMessage: string;
|
|
138
|
+
downloadButtonLabel: string;
|
|
139
|
+
brokenFile: string;
|
|
140
|
+
msgPluginRecipients: string;
|
|
141
|
+
msgPluginSender: string;
|
|
142
|
+
pdfPluginLoading: string;
|
|
143
|
+
pdfPluginPageNumber: string;
|
|
144
|
+
};
|
|
145
|
+
tr: {
|
|
146
|
+
documentNavInfo: string;
|
|
147
|
+
noRendererMessage: string;
|
|
148
|
+
downloadButtonLabel: string;
|
|
149
|
+
brokenFile: string;
|
|
150
|
+
msgPluginRecipients: string;
|
|
151
|
+
msgPluginSender: string;
|
|
152
|
+
pdfPluginLoading: string;
|
|
153
|
+
pdfPluginPageNumber: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
export declare const supportedLanguages: string[];
|
|
157
|
+
export type AvailableLanguages = keyof typeof locales;
|
|
158
|
+
export declare const defaultLanguage: AvailableLanguages;
|