asma-doc-viewer 1.0.14 → 1.0.16
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/CHANGELOG.md +0 -293
- package/Readme.md +0 -0
- package/dist/__vite-browser-external-afb87ea8.js +2 -0
- package/dist/__vite-browser-external-afb87ea8.js.map +1 -0
- package/dist/asma-doc-viewer.es.js +311 -0
- package/dist/asma-doc-viewer.es.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/src/DocViewer.d.ts +19 -0
- package/dist/src/components/DocumentNav.d.ts +2 -0
- package/dist/src/components/FileName.d.ts +2 -0
- package/dist/src/components/HeaderBar.d.ts +2 -0
- package/dist/src/components/LoadingTimout.d.ts +2 -0
- package/dist/src/components/ProxyRenderer.d.ts +2 -0
- package/dist/src/components/common/Button.d.ts +16 -0
- package/dist/src/components/icons/index.d.ts +8 -0
- package/dist/src/cssStyles.d.ts +0 -0
- package/{build/theme/index.d.ts → dist/src/defaultTheme.d.ts} +1 -1
- package/{build/utils → dist/src/hooks}/useDocumentLoader.d.ts +4 -4
- package/dist/src/hooks/useRendererSelector.d.ts +4 -0
- package/dist/src/hooks/useTranslation.d.ts +3 -0
- package/dist/src/i18n.d.ts +135 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/models.d.ts +65 -0
- package/{build/plugins → dist/src/renderers}/bmp/index.d.ts +1 -1
- package/dist/src/renderers/csv/index.d.ts +3 -0
- package/{build/plugins/jpg → dist/src/renderers/gif}/index.d.ts +1 -1
- package/{build/plugins → dist/src/renderers}/html/index.d.ts +1 -1
- package/{build/plugins → dist/src/renderers}/image/index.d.ts +1 -1
- package/dist/src/renderers/index.d.ts +14 -0
- package/dist/src/renderers/jpg/index.d.ts +3 -0
- package/{build/plugins → dist/src/renderers}/msdoc/index.d.ts +1 -1
- package/dist/src/renderers/pdf/components/PDFControls.d.ts +3 -0
- package/dist/src/renderers/pdf/components/PDFPagination.d.ts +3 -0
- package/dist/src/renderers/pdf/components/icons/index.d.ts +8 -0
- package/{build/plugins → dist/src/renderers}/pdf/components/pages/PDFAllPages.d.ts +1 -1
- package/{build/plugins → dist/src/renderers}/pdf/components/pages/PDFPages.d.ts +1 -1
- package/{build/plugins → dist/src/renderers}/pdf/components/pages/PDFSinglePage.d.ts +1 -1
- package/{build/plugins → dist/src/renderers}/pdf/index.d.ts +1 -1
- package/dist/src/renderers/pdf/state/index.d.ts +12 -0
- package/{build/plugins → dist/src/renderers}/pdf/state/reducer.d.ts +4 -2
- package/{build/plugins → dist/src/renderers}/png/index.d.ts +1 -1
- package/{build/plugins → dist/src/renderers}/tiff/index.d.ts +1 -1
- package/dist/src/renderers/tiff/tiffToCanvas.d.ts +1 -0
- package/{build/plugins → dist/src/renderers}/txt/index.d.ts +1 -1
- package/dist/src/renderers/video/index.d.ts +3 -0
- package/dist/src/renderers/webp/index.d.ts +3 -0
- package/dist/src/store/DocViewerProvider.d.ts +13 -0
- package/{build/state → dist/src/store}/actions.d.ts +24 -23
- package/{build/state/reducer.d.ts → dist/src/store/mainStateReducer.d.ts} +8 -2
- package/{build → dist/src}/utils/fileLoaders.d.ts +1 -0
- package/dist/src/utils/getFileName.d.ts +2 -0
- package/dist/tailwind.config.d.ts +241 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +103 -55
- package/LICENSE +0 -201
- package/README.md +0 -484
- package/build/components/DocumentNav.d.ts +0 -2
- package/build/components/DocumentNav.js +0 -64
- package/build/components/FileName.d.ts +0 -2
- package/build/components/FileName.js +0 -61
- package/build/components/HeaderBar.d.ts +0 -2
- package/build/components/HeaderBar.js +0 -58
- package/build/components/ProxyRenderer.d.ts +0 -2
- package/build/components/ProxyRenderer.js +0 -80
- package/build/components/common/Button.d.ts +0 -11
- package/build/components/common/Button.js +0 -38
- package/build/components/common/index.js +0 -17
- package/build/components/icons/index.d.ts +0 -9
- package/build/components/icons/index.js +0 -45
- package/build/index.d.ts +0 -27
- package/build/index.js +0 -91
- package/build/plugins/bmp/index.js +0 -22
- package/build/plugins/html/index.js +0 -60
- package/build/plugins/image/index.js +0 -34
- package/build/plugins/index.d.ts +0 -1
- package/build/plugins/index.js +0 -26
- package/build/plugins/jpg/index.js +0 -22
- package/build/plugins/msdoc/index.js +0 -54
- package/build/plugins/pdf/components/PDFControls.d.ts +0 -3
- package/build/plugins/pdf/components/PDFControls.js +0 -73
- package/build/plugins/pdf/components/PDFPagination.d.ts +0 -3
- package/build/plugins/pdf/components/PDFPagination.js +0 -57
- package/build/plugins/pdf/components/icons/index.d.ts +0 -10
- package/build/plugins/pdf/components/icons/index.js +0 -79
- package/build/plugins/pdf/components/pages/PDFAllPages.js +0 -41
- package/build/plugins/pdf/components/pages/PDFPages.js +0 -56
- package/build/plugins/pdf/components/pages/PDFSinglePage.js +0 -53
- package/build/plugins/pdf/index.js +0 -55
- package/build/plugins/pdf/state/actions.js +0 -31
- package/build/plugins/pdf/state/index.d.ts +0 -13
- package/build/plugins/pdf/state/index.js +0 -47
- package/build/plugins/pdf/state/reducer.js +0 -45
- package/build/plugins/png/index.js +0 -29
- package/build/plugins/tiff/index.js +0 -77
- package/build/plugins/tiff/tiffToCanvas.d.ts +0 -1
- package/build/plugins/tiff/tiffToCanvas.js +0 -602
- package/build/plugins/txt/index.js +0 -24
- package/build/plugins/webp/index.d.ts +0 -3
- package/build/plugins/webp/index.js +0 -28
- package/build/state/actions.js +0 -45
- package/build/state/index.d.ts +0 -10
- package/build/state/index.js +0 -54
- package/build/state/reducer.js +0 -64
- package/build/theme/index.js +0 -12
- package/build/types/index.d.ts +0 -41
- package/build/types/index.js +0 -2
- package/build/utils/fileLoaders.js +0 -105
- package/build/utils/useDocumentLoader.js +0 -82
- package/build/utils/useRendererSelector.d.ts +0 -7
- package/build/utils/useRendererSelector.js +0 -40
- package/build/utils/useWindowSize.js +0 -34
- package/pnpm-lock.yaml +0 -12723
- /package/{build → dist/src}/components/common/index.d.ts +0 -0
- /package/{build/utils → dist/src/hooks}/useWindowSize.d.ts +0 -0
- /package/{build/plugins → dist/src/renderers}/pdf/state/actions.d.ts +0 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { type CSSProperties } from 'react';
|
|
2
|
+
import { type AvailableLanguages } from './i18n';
|
|
3
|
+
import { type DocRenderer, type DocViewerRef, type IConfig, type IDocument, type ITheme } from './models';
|
|
4
|
+
export interface DocViewerProps {
|
|
5
|
+
documents: IDocument[];
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
config?: IConfig;
|
|
9
|
+
theme?: ITheme;
|
|
10
|
+
pluginRenderers?: DocRenderer[];
|
|
11
|
+
prefetchMethod?: string;
|
|
12
|
+
requestHeaders?: Record<string, string>;
|
|
13
|
+
initialActiveDocument?: IDocument;
|
|
14
|
+
language?: AvailableLanguages;
|
|
15
|
+
activeDocument?: IDocument;
|
|
16
|
+
onDocumentChange?: (document: IDocument) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<DocViewerProps & React.RefAttributes<DocViewerRef>>>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IStyledProps } from "src/models";
|
|
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 {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface IIconProps {
|
|
2
|
+
color?: string;
|
|
3
|
+
size?: string | number | string | undefined;
|
|
4
|
+
reverse?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const PrevDocIcon: (props: IIconProps) => JSX.Element;
|
|
7
|
+
export declare const NextDocIcon: (props: IIconProps) => JSX.Element;
|
|
8
|
+
export declare const LoadingIcon: (props: IIconProps) => JSX.Element;
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ITheme } from
|
|
1
|
+
import type { ITheme } from 'src';
|
|
2
2
|
export declare const defaultTheme: ITheme;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Dispatch } from
|
|
2
|
-
import { MainStateActions } from
|
|
3
|
-
import { IMainState } from
|
|
4
|
-
import { DocRenderer } from
|
|
1
|
+
import { type Dispatch } from 'react';
|
|
2
|
+
import { type MainStateActions } from '../store/actions';
|
|
3
|
+
import { type IMainState } from '../store/mainStateReducer';
|
|
4
|
+
import type { DocRenderer } from 'src/models';
|
|
5
5
|
/**
|
|
6
6
|
* Custom Hook for loading the current document into context
|
|
7
7
|
*/
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
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
|
+
};
|
|
12
|
+
pl: {
|
|
13
|
+
documentNavInfo: string;
|
|
14
|
+
noRendererMessage: string;
|
|
15
|
+
downloadButtonLabel: string;
|
|
16
|
+
brokenFile: string;
|
|
17
|
+
msgPluginRecipients: string;
|
|
18
|
+
msgPluginSender: string;
|
|
19
|
+
pdfPluginLoading: string;
|
|
20
|
+
pdfPluginPageNumber: string;
|
|
21
|
+
};
|
|
22
|
+
es: {
|
|
23
|
+
documentNavInfo: string;
|
|
24
|
+
noRendererMessage: string;
|
|
25
|
+
downloadButtonLabel: string;
|
|
26
|
+
brokenFile: string;
|
|
27
|
+
msgPluginRecipients: string;
|
|
28
|
+
msgPluginSender: string;
|
|
29
|
+
pdfPluginLoading: string;
|
|
30
|
+
pdfPluginPageNumber: string;
|
|
31
|
+
};
|
|
32
|
+
de: {
|
|
33
|
+
documentNavInfo: string;
|
|
34
|
+
noRendererMessage: string;
|
|
35
|
+
downloadButtonLabel: string;
|
|
36
|
+
brokenFile: string;
|
|
37
|
+
msgPluginRecipients: string;
|
|
38
|
+
msgPluginSender: string;
|
|
39
|
+
pdfPluginLoading: string;
|
|
40
|
+
pdfPluginPageNumber: string;
|
|
41
|
+
};
|
|
42
|
+
it: {
|
|
43
|
+
documentNavInfo: string;
|
|
44
|
+
noRendererMessage: string;
|
|
45
|
+
downloadButtonLabel: string;
|
|
46
|
+
brokenFile: string;
|
|
47
|
+
msgPluginRecipients: string;
|
|
48
|
+
msgPluginSender: string;
|
|
49
|
+
pdfPluginLoading: string;
|
|
50
|
+
pdfPluginPageNumber: string;
|
|
51
|
+
};
|
|
52
|
+
pt: {
|
|
53
|
+
documentNavInfo: string;
|
|
54
|
+
noRendererMessage: string;
|
|
55
|
+
downloadButtonLabel: string;
|
|
56
|
+
brokenFile: string;
|
|
57
|
+
msgPluginRecipients: string;
|
|
58
|
+
msgPluginSender: string;
|
|
59
|
+
pdfPluginLoading: string;
|
|
60
|
+
pdfPluginPageNumber: string;
|
|
61
|
+
};
|
|
62
|
+
fr: {
|
|
63
|
+
documentNavInfo: string;
|
|
64
|
+
noRendererMessage: string;
|
|
65
|
+
downloadButtonLabel: string;
|
|
66
|
+
brokenFile: string;
|
|
67
|
+
msgPluginRecipients: string;
|
|
68
|
+
msgPluginSender: string;
|
|
69
|
+
pdfPluginLoading: string;
|
|
70
|
+
pdfPluginPageNumber: string;
|
|
71
|
+
};
|
|
72
|
+
ar: {
|
|
73
|
+
documentNavInfo: string;
|
|
74
|
+
noRendererMessage: string;
|
|
75
|
+
downloadButtonLabel: string;
|
|
76
|
+
brokenFile: string;
|
|
77
|
+
msgPluginRecipients: string;
|
|
78
|
+
msgPluginSender: string;
|
|
79
|
+
pdfPluginLoading: string;
|
|
80
|
+
pdfPluginPageNumber: string;
|
|
81
|
+
};
|
|
82
|
+
sr: {
|
|
83
|
+
documentNavInfo: string;
|
|
84
|
+
noRendererMessage: string;
|
|
85
|
+
downloadButtonLabel: string;
|
|
86
|
+
brokenFile: string;
|
|
87
|
+
msgPluginRecipients: string;
|
|
88
|
+
msgPluginSender: string;
|
|
89
|
+
pdfPluginLoading: string;
|
|
90
|
+
pdfPluginPageNumber: string;
|
|
91
|
+
};
|
|
92
|
+
sr_cyr: {
|
|
93
|
+
documentNavInfo: string;
|
|
94
|
+
noRendererMessage: string;
|
|
95
|
+
downloadButtonLabel: string;
|
|
96
|
+
brokenFile: string;
|
|
97
|
+
msgPluginRecipients: string;
|
|
98
|
+
msgPluginSender: string;
|
|
99
|
+
pdfPluginLoading: string;
|
|
100
|
+
pdfPluginPageNumber: string;
|
|
101
|
+
};
|
|
102
|
+
ja: {
|
|
103
|
+
documentNavInfo: string;
|
|
104
|
+
noRendererMessage: string;
|
|
105
|
+
downloadButtonLabel: string;
|
|
106
|
+
brokenFile: string;
|
|
107
|
+
msgPluginRecipients: string;
|
|
108
|
+
msgPluginSender: string;
|
|
109
|
+
pdfPluginLoading: string;
|
|
110
|
+
pdfPluginPageNumber: string;
|
|
111
|
+
};
|
|
112
|
+
ru: {
|
|
113
|
+
documentNavInfo: string;
|
|
114
|
+
noRendererMessage: string;
|
|
115
|
+
downloadButtonLabel: string;
|
|
116
|
+
brokenFile: string;
|
|
117
|
+
msgPluginRecipients: string;
|
|
118
|
+
msgPluginSender: string;
|
|
119
|
+
pdfPluginLoading: string;
|
|
120
|
+
pdfPluginPageNumber: string;
|
|
121
|
+
};
|
|
122
|
+
se: {
|
|
123
|
+
documentNavInfo: string;
|
|
124
|
+
noRendererMessage: string;
|
|
125
|
+
downloadButtonLabel: string;
|
|
126
|
+
brokenFile: string;
|
|
127
|
+
msgPluginRecipients: string;
|
|
128
|
+
msgPluginSender: string;
|
|
129
|
+
pdfPluginLoading: string;
|
|
130
|
+
pdfPluginPageNumber: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
export declare const supportedLanguages: string[];
|
|
134
|
+
export type AvailableLanguages = keyof typeof locales;
|
|
135
|
+
export declare const defaultLanguage: AvailableLanguages;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import DocViewer from "./DocViewer";
|
|
2
|
+
export default DocViewer;
|
|
3
|
+
export { DocViewerRenderers } from "./renderers";
|
|
4
|
+
export * from "./models";
|
|
5
|
+
export * from "./utils/fileLoaders";
|
|
6
|
+
export { type AvailableLanguages, supportedLanguages } from "./i18n";
|
|
7
|
+
export * from "./renderers";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { FC, ReactElement, ComponentType, PropsWithChildren } from 'react';
|
|
2
|
+
import type { IMainState } from './store/mainStateReducer';
|
|
3
|
+
import type { FileLoaderFunction } from './utils/fileLoaders';
|
|
4
|
+
export interface IConfig {
|
|
5
|
+
header?: IHeaderConfig;
|
|
6
|
+
loadingRenderer?: ILoadingRendererConfig;
|
|
7
|
+
noRenderer?: INoRendererConfig;
|
|
8
|
+
csvDelimiter?: string;
|
|
9
|
+
pdfZoom?: IPdfZoomConfig;
|
|
10
|
+
pdfVerticalScrollByDefault?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ILoadingRendererConfig {
|
|
13
|
+
overrideComponent?: ComponentType<{
|
|
14
|
+
document: IDocument | undefined;
|
|
15
|
+
fileName: string;
|
|
16
|
+
}>;
|
|
17
|
+
showLoadingTimeout?: false | number;
|
|
18
|
+
}
|
|
19
|
+
export interface INoRendererConfig {
|
|
20
|
+
overrideComponent?: ComponentType<{
|
|
21
|
+
document: IDocument | undefined;
|
|
22
|
+
fileName: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export interface IHeaderConfig {
|
|
26
|
+
disableHeader?: boolean;
|
|
27
|
+
disableFileName?: boolean;
|
|
28
|
+
retainURLParams?: boolean;
|
|
29
|
+
overrideComponent?: IHeaderOverride;
|
|
30
|
+
}
|
|
31
|
+
export interface IPdfZoomConfig {
|
|
32
|
+
defaultZoom: number;
|
|
33
|
+
zoomJump: number;
|
|
34
|
+
}
|
|
35
|
+
export type IHeaderOverride = (state: IMainState, previousDocument: () => void, nextDocument: () => void) => ReactElement<any, any> | null;
|
|
36
|
+
export interface ITheme {
|
|
37
|
+
primary?: string;
|
|
38
|
+
secondary?: string;
|
|
39
|
+
tertiary?: string;
|
|
40
|
+
textPrimary?: string;
|
|
41
|
+
textSecondary?: string;
|
|
42
|
+
textTertiary?: string;
|
|
43
|
+
disableThemeScrollbar?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface IStyledProps {
|
|
46
|
+
theme: ITheme;
|
|
47
|
+
}
|
|
48
|
+
export interface IDocument {
|
|
49
|
+
uri: string;
|
|
50
|
+
fileType?: string;
|
|
51
|
+
fileData?: string | ArrayBuffer;
|
|
52
|
+
fileName?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface DocRendererProps {
|
|
55
|
+
mainState: IMainState;
|
|
56
|
+
}
|
|
57
|
+
export interface DocRenderer extends FC<PropsWithChildren<DocRendererProps>> {
|
|
58
|
+
fileTypes: string[];
|
|
59
|
+
weight: number;
|
|
60
|
+
fileLoader?: FileLoaderFunction | null | undefined;
|
|
61
|
+
}
|
|
62
|
+
export interface DocViewerRef {
|
|
63
|
+
prev: () => void;
|
|
64
|
+
next: () => void;
|
|
65
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import BMPRenderer from "./bmp";
|
|
2
|
+
import HTMLRenderer from "./html";
|
|
3
|
+
import JPGRenderer from "./jpg";
|
|
4
|
+
import MSDocRenderer from "./msdoc";
|
|
5
|
+
import PDFRenderer from "./pdf";
|
|
6
|
+
import PNGRenderer from "./png";
|
|
7
|
+
import TIFFRenderer from "./tiff";
|
|
8
|
+
import TXTRenderer from "./txt";
|
|
9
|
+
import CSVRenderer from "./csv";
|
|
10
|
+
import GIFRenderer from "./gif";
|
|
11
|
+
import VideoRenderer from "./video";
|
|
12
|
+
import WebPRenderer from "./webp";
|
|
13
|
+
export declare const DocViewerRenderers: import("..").DocRenderer[];
|
|
14
|
+
export { BMPRenderer, HTMLRenderer, JPGRenderer, MSDocRenderer, PDFRenderer, PNGRenderer, TIFFRenderer, TXTRenderer, CSVRenderer, GIFRenderer, VideoRenderer, WebPRenderer, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IIconProps } from '../../../../components/icons';
|
|
2
|
+
export declare const PrevPDFNavIcon: (props: IIconProps) => JSX.Element;
|
|
3
|
+
export declare const NextPDFNavIcon: (props: IIconProps) => JSX.Element;
|
|
4
|
+
export declare const DownloadPDFIcon: (props: IIconProps) => JSX.Element;
|
|
5
|
+
export declare const ZoomInPDFIcon: (props: IIconProps) => JSX.Element;
|
|
6
|
+
export declare const ZoomOutPDFIcon: (props: IIconProps) => JSX.Element;
|
|
7
|
+
export declare const ResetZoomPDFIcon: (props: IIconProps) => JSX.Element;
|
|
8
|
+
export declare const TogglePaginationPDFIcon: (props: IIconProps) => JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { type Dispatch, type FC, type PropsWithChildren } from 'react';
|
|
2
|
+
import { type IMainState } from '../../../store/mainStateReducer';
|
|
3
|
+
import { type PDFActions } from './actions';
|
|
4
|
+
import { type IPDFState } from './reducer';
|
|
5
|
+
declare const PDFContext: React.Context<{
|
|
6
|
+
state: IPDFState;
|
|
7
|
+
dispatch: Dispatch<PDFActions>;
|
|
8
|
+
}>;
|
|
9
|
+
declare const PDFProvider: FC<PropsWithChildren<{
|
|
10
|
+
mainState: IMainState;
|
|
11
|
+
}>>;
|
|
12
|
+
export { PDFContext, PDFProvider };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { IMainState } from
|
|
2
|
-
import { PDFActions as PDFStateActions } from
|
|
1
|
+
import { type IMainState } from '../../../store/mainStateReducer';
|
|
2
|
+
import { type PDFActions as PDFStateActions } from './actions';
|
|
3
3
|
export type IPDFState = {
|
|
4
|
+
defaultZoomLevel: number;
|
|
4
5
|
zoomLevel: number;
|
|
6
|
+
zoomJump: number;
|
|
5
7
|
paginated: boolean;
|
|
6
8
|
numPages: number;
|
|
7
9
|
currentPage: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseTIFF: (tiffArrayBuffer: any, _canvas: any) => any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { type Dispatch } from 'react';
|
|
2
|
+
import { type DocViewerRef } from '..';
|
|
3
|
+
import { type DocViewerProps } from '../DocViewer';
|
|
4
|
+
import { type MainStateActions } from './actions';
|
|
5
|
+
import { type IMainState } from './mainStateReducer';
|
|
6
|
+
declare const DocViewerContext: React.Context<{
|
|
7
|
+
state: IMainState;
|
|
8
|
+
dispatch: Dispatch<MainStateActions>;
|
|
9
|
+
}>;
|
|
10
|
+
declare const DocViewerProvider: React.ForwardRefExoticComponent<DocViewerProps & {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
} & React.RefAttributes<DocViewerRef>>;
|
|
13
|
+
export { DocViewerContext, DocViewerProvider };
|
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { IConfig, IDocument } from
|
|
2
|
-
export declare const SET_ALL_DOCUMENTS
|
|
1
|
+
import type { IConfig, IDocument } from '../models';
|
|
2
|
+
export declare const SET_ALL_DOCUMENTS = "SET_ALL_DOCUMENTS";
|
|
3
|
+
export declare const SET_DOCUMENT_LOADING = "SET_DOCUMENT_LOADING";
|
|
4
|
+
export declare const NEXT_DOCUMENT = "NEXT_DOCUMENT";
|
|
5
|
+
export declare const PREVIOUS_DOCUMENT = "PREVIOUS_DOCUMENT";
|
|
6
|
+
export declare const UPDATE_CURRENT_DOCUMENT = "UPDATE_CURRENT_DOCUMENT";
|
|
7
|
+
export declare const SET_RENDERER_RECT = "SET_RENDERER_RECT";
|
|
8
|
+
export declare const SET_MAIN_CONFIG = "SET_MAIN_CONFIG";
|
|
3
9
|
export interface SetAllDocuments {
|
|
4
10
|
type: typeof SET_ALL_DOCUMENTS;
|
|
5
11
|
documents: IDocument[];
|
|
12
|
+
initialActiveDocument?: IDocument;
|
|
6
13
|
}
|
|
7
|
-
export declare const setAllDocuments: (documents: IDocument[]) => SetAllDocuments;
|
|
8
|
-
export declare const SET_DOCUMENT_LOADING: string;
|
|
9
14
|
export interface SetDocumentLoading {
|
|
10
15
|
type: typeof SET_DOCUMENT_LOADING;
|
|
11
16
|
value: boolean;
|
|
12
17
|
}
|
|
13
|
-
export
|
|
14
|
-
|
|
18
|
+
export interface SetRendererRect {
|
|
19
|
+
type: typeof SET_RENDERER_RECT;
|
|
20
|
+
rect: DOMRect;
|
|
21
|
+
}
|
|
22
|
+
export interface SetMainConfig {
|
|
23
|
+
type: typeof SET_MAIN_CONFIG;
|
|
24
|
+
config: IConfig;
|
|
25
|
+
}
|
|
15
26
|
export interface NextDocument {
|
|
16
27
|
type: typeof NEXT_DOCUMENT;
|
|
17
28
|
}
|
|
18
|
-
export declare const nextDocument: () => NextDocument;
|
|
19
|
-
export declare const PREVIOUS_DOCUMENT: string;
|
|
20
|
-
export interface PreviousDocument {
|
|
21
|
-
type: typeof PREVIOUS_DOCUMENT;
|
|
22
|
-
}
|
|
23
|
-
export declare const previousDocument: () => PreviousDocument;
|
|
24
|
-
export declare const UPDATE_CURRENT_DOCUMENT: string;
|
|
25
29
|
export interface UpdateCurrentDocument {
|
|
26
30
|
type: typeof UPDATE_CURRENT_DOCUMENT;
|
|
27
31
|
document: IDocument;
|
|
28
32
|
}
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
export interface SetRendererRect {
|
|
32
|
-
type: typeof SET_RENDERER_RECT;
|
|
33
|
-
rect: DOMRect;
|
|
33
|
+
export interface PreviousDocument {
|
|
34
|
+
type: typeof PREVIOUS_DOCUMENT;
|
|
34
35
|
}
|
|
36
|
+
export declare const setAllDocuments: (documents: IDocument[], initialActiveDocument?: IDocument) => SetAllDocuments;
|
|
37
|
+
export declare const setDocumentLoading: (value: boolean) => SetDocumentLoading;
|
|
38
|
+
export declare const nextDocument: () => NextDocument;
|
|
39
|
+
export declare const previousDocument: () => PreviousDocument;
|
|
40
|
+
export declare const updateCurrentDocument: (document: IDocument) => UpdateCurrentDocument;
|
|
35
41
|
export declare const setRendererRect: (rect: DOMRect) => SetRendererRect;
|
|
36
|
-
export declare const SET_MAIN_CONFIG: string;
|
|
37
|
-
export interface SetMainConfig {
|
|
38
|
-
type: typeof SET_MAIN_CONFIG;
|
|
39
|
-
config: IConfig;
|
|
40
|
-
}
|
|
41
42
|
export declare const setMainConfig: (config: IConfig) => SetMainConfig;
|
|
42
43
|
export type MainStateActions = SetAllDocuments | SetDocumentLoading | NextDocument | PreviousDocument | UpdateCurrentDocument | SetRendererRect | SetMainConfig;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { DocRenderer, IConfig, IDocument } from
|
|
2
|
-
import { MainStateActions } from
|
|
1
|
+
import type { DocRenderer, IConfig, IDocument } from '..';
|
|
2
|
+
import { type MainStateActions } from './actions';
|
|
3
|
+
import { type AvailableLanguages } from '../i18n';
|
|
3
4
|
export type IMainState = {
|
|
4
5
|
currentFileNo: number;
|
|
5
6
|
documents: IDocument[];
|
|
@@ -8,6 +9,11 @@ export type IMainState = {
|
|
|
8
9
|
rendererRect?: DOMRect;
|
|
9
10
|
config?: IConfig;
|
|
10
11
|
pluginRenderers?: DocRenderer[];
|
|
12
|
+
prefetchMethod?: string;
|
|
13
|
+
requestHeaders?: Record<string, string>;
|
|
14
|
+
language: AvailableLanguages;
|
|
15
|
+
activeDocument?: IDocument;
|
|
16
|
+
onDocumentChange?: (document: IDocument) => void;
|
|
11
17
|
};
|
|
12
18
|
export declare const initialState: IMainState;
|
|
13
19
|
export type MainStateReducer = (state: IMainState, action: MainStateActions) => IMainState;
|
|
@@ -2,6 +2,7 @@ export interface FileLoaderFuncProps {
|
|
|
2
2
|
documentURI: string;
|
|
3
3
|
signal: AbortSignal;
|
|
4
4
|
fileLoaderComplete: FileLoaderComplete;
|
|
5
|
+
headers?: Record<string, string>;
|
|
5
6
|
}
|
|
6
7
|
export type FileLoaderComplete = (fileReader?: FileReader) => void;
|
|
7
8
|
export type FileLoaderFunction = (props: FileLoaderFuncProps) => void;
|