@vue-pdf-viewer/viewer 1.4.0-beta.0 → 1.4.0-beta.1
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/dist/index.js +4340 -4382
- package/dist/index.umd.cjs +7 -7
- package/dist/types/components/VPdfViewer.vue.d.ts +3 -0
- package/dist/types/composables/usePdfPagesSizes.d.ts +1 -1
- package/dist/types/composables/usePdfProperties.d.ts +1 -1
- package/dist/types/composables/usePrintProcess.d.ts +3 -3
- package/dist/types/composables/useRenderTask.d.ts +1 -1
- package/dist/types/composables/useSearch.d.ts +2 -45
- package/dist/types/composables/useVisibilities.d.ts +1 -1
- package/dist/types/const.d.ts +11 -28
- package/dist/types/utils/types.d.ts +28 -1
- package/package.json +1 -1
|
@@ -62,6 +62,7 @@ declare const _default: {
|
|
|
62
62
|
onLoadProgress?: ((payload: number) => any) | undefined;
|
|
63
63
|
onXfaLoaded?: (() => any) | undefined;
|
|
64
64
|
}, {
|
|
65
|
+
searchControl: import("@/utils/types").SearchControl;
|
|
65
66
|
goToPage: (page: number) => void;
|
|
66
67
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
67
68
|
annotation: (payload: AnnotationEventPayload) => void;
|
|
@@ -215,6 +216,7 @@ declare const _default: {
|
|
|
215
216
|
onLoadProgress?: ((payload: number) => any) | undefined;
|
|
216
217
|
onXfaLoaded?: (() => any) | undefined;
|
|
217
218
|
}, {
|
|
219
|
+
searchControl: import("@/utils/types").SearchControl;
|
|
218
220
|
goToPage: (page: number) => void;
|
|
219
221
|
}, {}, {}, {}, {
|
|
220
222
|
readonly initialViewMode: ViewMode;
|
|
@@ -292,6 +294,7 @@ declare const _default: {
|
|
|
292
294
|
onLoadProgress?: ((payload: number) => any) | undefined;
|
|
293
295
|
onXfaLoaded?: (() => any) | undefined;
|
|
294
296
|
}, {
|
|
297
|
+
searchControl: import("@/utils/types").SearchControl;
|
|
295
298
|
goToPage: (page: number) => void;
|
|
296
299
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
297
300
|
annotation: (payload: AnnotationEventPayload) => void;
|
|
@@ -5,5 +5,5 @@ export declare function usePdfPageSizes(props: UnwrapRef<ViewerState>, initialSc
|
|
|
5
5
|
pdfPages: import("vue").ComputedRef<ViewerPdfPage[]>;
|
|
6
6
|
estimatedPdfPages: import("vue").ShallowRef<Omit<ViewerPdfPage, "page">[]>;
|
|
7
7
|
actualPdfPages: import("vue").ShallowRef<ViewerPdfPage[]>;
|
|
8
|
-
defaultScale: import("vue").Ref<number
|
|
8
|
+
defaultScale: import("vue").Ref<number>;
|
|
9
9
|
};
|
|
@@ -20,5 +20,5 @@ type CMapSource = {
|
|
|
20
20
|
cMapPacked: boolean;
|
|
21
21
|
cMapUrl: string;
|
|
22
22
|
};
|
|
23
|
-
export declare const usePdfProperties: (pdfDoc: ShallowRef<PDFDocumentProxy | undefined>, source: Ref<PDFSrc | CMapSource>, filename: Ref<string | undefined>) => Ref<PdfProperties | undefined
|
|
23
|
+
export declare const usePdfProperties: (pdfDoc: ShallowRef<PDFDocumentProxy | undefined>, source: Ref<PDFSrc | CMapSource>, filename: Ref<string | undefined>) => Ref<PdfProperties | undefined>;
|
|
24
24
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const usePrintProcess: () => {
|
|
2
|
-
isCancel: import("vue").Ref<boolean
|
|
3
|
-
percent: import("vue").Ref<number
|
|
4
|
-
showPrintProcess: import("vue").Ref<boolean
|
|
2
|
+
isCancel: import("vue").Ref<boolean>;
|
|
3
|
+
percent: import("vue").Ref<number>;
|
|
4
|
+
showPrintProcess: import("vue").Ref<boolean>;
|
|
5
5
|
onCancel: () => void;
|
|
6
6
|
onLoading: () => void;
|
|
7
7
|
changePercent: (value: number) => void;
|
|
@@ -1,47 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PdfPageSize, SearchControlValue } from '@/components';
|
|
2
2
|
import { Ref, ShallowRef } from 'vue';
|
|
3
3
|
import type { PDFDocumentProxy } from 'pdfjs-dist';
|
|
4
|
-
|
|
5
|
-
page: number;
|
|
6
|
-
pageMatchIdx: number;
|
|
7
|
-
}
|
|
8
|
-
export declare const useSearch: (pdfDoc: ShallowRef<PDFDocumentProxy | undefined>, pageSizes: Ref<PdfPageSize[] | undefined>) => {
|
|
9
|
-
searchValue: Ref<string, string>;
|
|
10
|
-
matches: Ref<{
|
|
11
|
-
page: number;
|
|
12
|
-
pageMatchIdx: number;
|
|
13
|
-
start: {
|
|
14
|
-
idx: number;
|
|
15
|
-
offset: number;
|
|
16
|
-
};
|
|
17
|
-
end: {
|
|
18
|
-
idx: number;
|
|
19
|
-
offset: number;
|
|
20
|
-
};
|
|
21
|
-
str: string;
|
|
22
|
-
oIndex: number;
|
|
23
|
-
}[], MatchValue[] | {
|
|
24
|
-
page: number;
|
|
25
|
-
pageMatchIdx: number;
|
|
26
|
-
start: {
|
|
27
|
-
idx: number;
|
|
28
|
-
offset: number;
|
|
29
|
-
};
|
|
30
|
-
end: {
|
|
31
|
-
idx: number;
|
|
32
|
-
offset: number;
|
|
33
|
-
};
|
|
34
|
-
str: string;
|
|
35
|
-
oIndex: number;
|
|
36
|
-
}[]>;
|
|
37
|
-
matchCount: import("vue").ComputedRef<number>;
|
|
38
|
-
currentMatchIndex: Ref<number | undefined, number | undefined>;
|
|
39
|
-
currentMatch: import("vue").ComputedRef<MatchValue | undefined>;
|
|
40
|
-
searching: Ref<boolean, boolean>;
|
|
41
|
-
openSearch: Ref<boolean, boolean>;
|
|
42
|
-
onOpenSearch: () => void;
|
|
43
|
-
onCloseSearch: () => void;
|
|
44
|
-
handleSelectNext: () => void;
|
|
45
|
-
handleSelectPrev: () => void;
|
|
46
|
-
};
|
|
47
|
-
export {};
|
|
4
|
+
export declare const useSearch: (pdfDoc: ShallowRef<PDFDocumentProxy | undefined>, pageSizes: Ref<PdfPageSize[] | undefined>, initialSearch?: string, initialCurrentIndex?: number) => SearchControlValue;
|
|
@@ -3,6 +3,6 @@ import { VirtualRange, VisibilityInfo } from '@/utils/types';
|
|
|
3
3
|
export declare function useVisibilities(totalPages: Ref<number>): {
|
|
4
4
|
resetVisibility: () => void;
|
|
5
5
|
updateVisibility: (info: VisibilityInfo) => void;
|
|
6
|
-
currentPage: Ref<number
|
|
6
|
+
currentPage: Ref<number>;
|
|
7
7
|
calculateCurrentPage: (range?: VirtualRange) => number;
|
|
8
8
|
};
|
package/dist/types/const.d.ts
CHANGED
|
@@ -30,28 +30,10 @@ export declare const FILE_INPUT: InjectionKey<Ref<ComponentPublicInstance<import
|
|
|
30
30
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
31
31
|
onChange?: ((file: string) => any) | undefined;
|
|
32
32
|
onFilenameChange?: ((file: string) => any) | undefined;
|
|
33
|
-
}, {}, {}>, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | undefined, ComponentPublicInstance<import("vue").DefineComponent<{}, {
|
|
34
|
-
triggerClick: () => void;
|
|
35
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
-
change: (file: string) => void;
|
|
37
|
-
} & {
|
|
38
|
-
filenameChange: (file: string) => void;
|
|
39
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
40
|
-
onChange?: ((file: string) => any) | undefined;
|
|
41
|
-
onFilenameChange?: ((file: string) => any) | undefined;
|
|
42
|
-
}, {}, {}>, {}, {}, {}, {}, {}, import("vue").DefineComponent<{}, {
|
|
43
|
-
triggerClick: () => void;
|
|
44
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
45
|
-
change: (file: string) => void;
|
|
46
|
-
} & {
|
|
47
|
-
filenameChange: (file: string) => void;
|
|
48
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
49
|
-
onChange?: ((file: string) => any) | undefined;
|
|
50
|
-
onFilenameChange?: ((file: string) => any) | undefined;
|
|
51
33
|
}, {}, {}>, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | undefined>>;
|
|
52
34
|
export declare const EMPTY_KEYWORD_REGEXP: NormalizedKeyword;
|
|
53
35
|
export declare const CURRENT_MATCH_CSS_CLASS = "vpv-highlight__text-current";
|
|
54
|
-
export declare const LATEST_MATCH_POSITION: InjectionKey<Ref<HighlightMatchPosition | undefined
|
|
36
|
+
export declare const LATEST_MATCH_POSITION: InjectionKey<Ref<HighlightMatchPosition | undefined>>;
|
|
55
37
|
export declare const GET_PAGE: InjectionKey<(doc: PDFDocumentProxy, pageIndex: number) => Promise<PDFPageProxy>>;
|
|
56
38
|
export declare const VIEWER_STATE: InjectionKey<{
|
|
57
39
|
pdfDocument: PDFDocumentProxy | undefined;
|
|
@@ -62,16 +44,17 @@ export declare const VIEWER_STATE: InjectionKey<{
|
|
|
62
44
|
scale: number;
|
|
63
45
|
rotation: number;
|
|
64
46
|
}>;
|
|
65
|
-
export declare const VIEWER_PAGES_PER_ROW: InjectionKey<Ref<number
|
|
66
|
-
export declare const TOOLBAR_OPTIONS: InjectionKey<Ref<ToolbarOptions | undefined
|
|
67
|
-
export declare const TOTAL_TOOL_OTHERS_MENU: InjectionKey<Ref<number
|
|
68
|
-
export declare const IS_DARK: InjectionKey<Ref<boolean
|
|
69
|
-
export declare const IS_MOBILE_VIEW: InjectionKey<Ref<boolean
|
|
47
|
+
export declare const VIEWER_PAGES_PER_ROW: InjectionKey<Ref<number>>;
|
|
48
|
+
export declare const TOOLBAR_OPTIONS: InjectionKey<Ref<ToolbarOptions | undefined>>;
|
|
49
|
+
export declare const TOTAL_TOOL_OTHERS_MENU: InjectionKey<Ref<number>>;
|
|
50
|
+
export declare const IS_DARK: InjectionKey<Ref<boolean>>;
|
|
51
|
+
export declare const IS_MOBILE_VIEW: InjectionKey<Ref<boolean>>;
|
|
52
|
+
export declare const CONTAINER: InjectionKey<ShallowRef<HTMLDivElement | undefined>>;
|
|
70
53
|
export declare const PAGES_CONTAINER: InjectionKey<ShallowRef<HTMLDivElement | undefined>>;
|
|
71
54
|
export declare const pdfPagesKey: InjectionKey<ViewerPdfPage[] | null>;
|
|
72
|
-
export declare const FOCUSED_PAGE_NUMBER: InjectionKey<Ref<number
|
|
73
|
-
export declare const ROTATION_DEGREE: InjectionKey<Ref<number
|
|
74
|
-
export declare const TOTAL_PAGE: InjectionKey<Ref<number
|
|
55
|
+
export declare const FOCUSED_PAGE_NUMBER: InjectionKey<Ref<number>>;
|
|
56
|
+
export declare const ROTATION_DEGREE: InjectionKey<Ref<number>>;
|
|
57
|
+
export declare const TOTAL_PAGE: InjectionKey<Ref<number>>;
|
|
75
58
|
export declare const INITIAL_TEXT_LAYER: InjectionKey<boolean>;
|
|
76
59
|
export declare const DOWNLOAD_FILE: InjectionKey<() => Promise<void>>;
|
|
77
60
|
export declare const LICENSE: InjectionKey<ShallowRef<License | undefined>>;
|
|
@@ -80,5 +63,5 @@ export declare const SLOT_ICON_OPEN_FILE: InjectionKey<Slot<any> | undefined>;
|
|
|
80
63
|
export declare const SLOT_ICON_DOWNLOAD: InjectionKey<Slot<any> | undefined>;
|
|
81
64
|
export declare const SLOT_ICON_PRINT: InjectionKey<Slot<any> | undefined>;
|
|
82
65
|
export declare const SLOT_ICON_FULLSCREEN: InjectionKey<Slot<any> | undefined>;
|
|
83
|
-
export declare const LANG: InjectionKey<Ref<Localization
|
|
66
|
+
export declare const LANG: InjectionKey<Ref<Localization> | undefined>;
|
|
84
67
|
export declare const FUNC_GO_TO_PAGE: InjectionKey<(page: number) => void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MaybeRef, PropType, Ref, ShallowRef } from 'vue';
|
|
1
|
+
import { ComputedRef, MaybeRef, PropType, Ref, ShallowRef } from 'vue';
|
|
2
2
|
import type { PageViewport } from 'pdfjs-dist';
|
|
3
3
|
import type { DocumentInitParameters, OnProgressParameters, PDFDataRangeTransport, TextContent, TypedArray, PDFPageProxy, PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
|
|
4
4
|
import type { Metadata } from 'pdfjs-dist/types/src/display/metadata';
|
|
@@ -460,3 +460,30 @@ export declare const VPVBaseProps: {
|
|
|
460
460
|
readonly default: () => Record<string, Localization>;
|
|
461
461
|
};
|
|
462
462
|
};
|
|
463
|
+
export interface MatchValue extends Match {
|
|
464
|
+
page: number;
|
|
465
|
+
pageMatchIdx: number;
|
|
466
|
+
}
|
|
467
|
+
export interface SearchControlValue {
|
|
468
|
+
searchValue: Ref<string | undefined>;
|
|
469
|
+
matches: Ref<MatchValue[]>;
|
|
470
|
+
matchCount: ComputedRef<number>;
|
|
471
|
+
currentSearchMatchIndex: Ref<number | undefined>;
|
|
472
|
+
currentSearchMatch: ComputedRef<MatchValue | undefined>;
|
|
473
|
+
searching: Ref<boolean>;
|
|
474
|
+
openSearch: Ref<boolean>;
|
|
475
|
+
onOpenSearch: () => void;
|
|
476
|
+
onCloseSearch: () => void;
|
|
477
|
+
handleSelectNext: () => void;
|
|
478
|
+
handleSelectPrev: () => void;
|
|
479
|
+
}
|
|
480
|
+
export interface SearchControl {
|
|
481
|
+
totalSearchMatch?: Ref<number>;
|
|
482
|
+
searching: Ref<boolean>;
|
|
483
|
+
nextSearchMatch: () => void;
|
|
484
|
+
prevSearchMatch: () => void;
|
|
485
|
+
}
|
|
486
|
+
export interface VPViewer {
|
|
487
|
+
searchControl: SearchControl;
|
|
488
|
+
goToPage: (page: number) => void;
|
|
489
|
+
}
|