@vue-pdf-viewer/viewer 2.4.0-rc.0 → 2.5.0-beta.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/dist/assets/pdf-annotations/altText_add.svg +3 -0
- package/dist/assets/pdf-annotations/altText_disclaimer.svg +3 -0
- package/dist/assets/pdf-annotations/altText_done.svg +3 -0
- package/dist/assets/pdf-annotations/altText_spinner.svg +30 -0
- package/dist/assets/pdf-annotations/altText_warning.svg +3 -0
- package/dist/assets/pdf-annotations/annotation-check.svg +11 -0
- package/dist/assets/pdf-annotations/annotation-comment.svg +16 -0
- package/dist/assets/pdf-annotations/annotation-help.svg +26 -0
- package/dist/assets/pdf-annotations/annotation-insert.svg +10 -0
- package/dist/assets/pdf-annotations/annotation-key.svg +11 -0
- package/dist/assets/pdf-annotations/annotation-noicon.svg +7 -0
- package/dist/assets/pdf-annotations/annotation-note.svg +42 -0
- package/dist/assets/pdf-annotations/annotation-paperclip.svg +6 -0
- package/dist/assets/pdf-annotations/annotation-paragraph.svg +16 -0
- package/dist/assets/pdf-annotations/annotation-pushpin.svg +7 -0
- package/dist/assets/pdf-annotations/cursor-editorFreeHighlight.svg +6 -0
- package/dist/assets/pdf-annotations/cursor-editorFreeText.svg +3 -0
- package/dist/assets/pdf-annotations/cursor-editorInk.svg +4 -0
- package/dist/assets/pdf-annotations/cursor-editorTextHighlight.svg +8 -0
- package/dist/assets/pdf-annotations/editor-toolbar-delete.svg +5 -0
- package/dist/assets/pdf-annotations/loading-icon.gif +0 -0
- package/dist/assets/pdf-annotations/messageBar_closingButton.svg +3 -0
- package/dist/assets/pdf-annotations/messageBar_warning.svg +3 -0
- package/dist/assets/pdf-annotations/secondaryToolbarButton-documentProperties.svg +3 -0
- package/dist/assets/pdf-annotations/toolbarButton-editorHighlight.svg +6 -0
- package/dist/assets/pdf-annotations/toolbarButton-menuArrow.svg +3 -0
- package/dist/index.js +5220 -5168
- package/dist/index.umd.cjs +17 -17
- package/dist/types/assets/pdf-annotations/index.d.ts +31 -0
- package/dist/types/components/VPdfViewer.vue.d.ts +6 -6
- package/dist/types/components/ui/popover/PopoverContent.vue.d.ts +3 -3
- package/dist/types/composables/useHighlight.d.ts +3 -3
- package/dist/types/composables/useSearch.d.ts +1 -1
- package/dist/types/composables/useVirtualPages.d.ts +2 -2
- package/dist/types/const.d.ts +3 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/types.d.ts +18 -1
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const annoImageResourcesPath: string;
|
|
2
|
+
declare const annoImageResources: {
|
|
3
|
+
annotationNoicon: string;
|
|
4
|
+
annotationNote: string;
|
|
5
|
+
annotationPaperclip: string;
|
|
6
|
+
annotationParagraph: string;
|
|
7
|
+
annotationPushpin: string;
|
|
8
|
+
annotationKey: string;
|
|
9
|
+
annotationInsert: string;
|
|
10
|
+
annotationHelp: string;
|
|
11
|
+
annotationComment: string;
|
|
12
|
+
annotationCheck: string;
|
|
13
|
+
altTextWarning: string;
|
|
14
|
+
altTextSpinner: string;
|
|
15
|
+
altTextDone: string;
|
|
16
|
+
altTextDisclaimer: string;
|
|
17
|
+
altTextAdd: string;
|
|
18
|
+
cursorEditorTextHighlight: string;
|
|
19
|
+
cursorEditorInk: string;
|
|
20
|
+
cursorEditorFreeText: string;
|
|
21
|
+
cursorEditorFreeHighlight: string;
|
|
22
|
+
editorToolbarDelete: string;
|
|
23
|
+
loadingIcon: string;
|
|
24
|
+
messageBarWarning: string;
|
|
25
|
+
messageBarClosingButton: string;
|
|
26
|
+
secondaryToolbarButtonDocumentProperties: string;
|
|
27
|
+
toolbarButtonMenuArrow: string;
|
|
28
|
+
toolbarButtonEditorHighlight: string;
|
|
29
|
+
};
|
|
30
|
+
export { annoImageResources };
|
|
31
|
+
export default annoImageResourcesPath;
|
|
@@ -84,7 +84,7 @@ declare const _default: {
|
|
|
84
84
|
onPageChanged?: ((progress: number) => any) | undefined;
|
|
85
85
|
}>, {
|
|
86
86
|
highlightControl: {
|
|
87
|
-
highlight: (args: import("@/utils/types").TextHighlight[]) => Promise<
|
|
87
|
+
highlight: (args: import("@/utils/types").TextHighlight[]) => Promise<Record<string, import("@/utils/types").MatchHighlightResult[]>>;
|
|
88
88
|
clear: () => void;
|
|
89
89
|
};
|
|
90
90
|
printControl: {
|
|
@@ -117,7 +117,7 @@ declare const _default: {
|
|
|
117
117
|
};
|
|
118
118
|
searching: boolean;
|
|
119
119
|
goToMatch: (index: number) => void;
|
|
120
|
-
search: (value: string) =>
|
|
120
|
+
search: (value: string) => Promise<import("@/utils/types").MatchHighlightResult[]>;
|
|
121
121
|
nextSearchMatch: () => void;
|
|
122
122
|
prevSearchMatch: () => void;
|
|
123
123
|
};
|
|
@@ -262,7 +262,7 @@ declare const _default: {
|
|
|
262
262
|
onPageChanged?: ((progress: number) => any) | undefined;
|
|
263
263
|
}>, {
|
|
264
264
|
highlightControl: {
|
|
265
|
-
highlight: (args: import("@/utils/types").TextHighlight[]) => Promise<
|
|
265
|
+
highlight: (args: import("@/utils/types").TextHighlight[]) => Promise<Record<string, import("@/utils/types").MatchHighlightResult[]>>;
|
|
266
266
|
clear: () => void;
|
|
267
267
|
};
|
|
268
268
|
printControl: {
|
|
@@ -295,7 +295,7 @@ declare const _default: {
|
|
|
295
295
|
};
|
|
296
296
|
searching: boolean;
|
|
297
297
|
goToMatch: (index: number) => void;
|
|
298
|
-
search: (value: string) =>
|
|
298
|
+
search: (value: string) => Promise<import("@/utils/types").MatchHighlightResult[]>;
|
|
299
299
|
nextSearchMatch: () => void;
|
|
300
300
|
prevSearchMatch: () => void;
|
|
301
301
|
};
|
|
@@ -415,7 +415,7 @@ declare const _default: {
|
|
|
415
415
|
onPageChanged?: ((progress: number) => any) | undefined;
|
|
416
416
|
}>, {
|
|
417
417
|
highlightControl: {
|
|
418
|
-
highlight: (args: import("@/utils/types").TextHighlight[]) => Promise<
|
|
418
|
+
highlight: (args: import("@/utils/types").TextHighlight[]) => Promise<Record<string, import("@/utils/types").MatchHighlightResult[]>>;
|
|
419
419
|
clear: () => void;
|
|
420
420
|
};
|
|
421
421
|
printControl: {
|
|
@@ -448,7 +448,7 @@ declare const _default: {
|
|
|
448
448
|
};
|
|
449
449
|
searching: boolean;
|
|
450
450
|
goToMatch: (index: number) => void;
|
|
451
|
-
search: (value: string) =>
|
|
451
|
+
search: (value: string) => Promise<import("@/utils/types").MatchHighlightResult[]>;
|
|
452
452
|
nextSearchMatch: () => void;
|
|
453
453
|
prevSearchMatch: () => void;
|
|
454
454
|
};
|
|
@@ -9,7 +9,7 @@ declare const _default: {
|
|
|
9
9
|
sideOffset: number;
|
|
10
10
|
}>>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
11
11
|
sideOffset: number;
|
|
12
|
-
align: "
|
|
12
|
+
align: "start" | "end" | "center";
|
|
13
13
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
14
14
|
P: {};
|
|
15
15
|
B: {};
|
|
@@ -25,7 +25,7 @@ declare const _default: {
|
|
|
25
25
|
sideOffset: number;
|
|
26
26
|
}>>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
27
27
|
sideOffset: number;
|
|
28
|
-
align: "
|
|
28
|
+
align: "start" | "end" | "center";
|
|
29
29
|
}>;
|
|
30
30
|
__isFragment?: undefined;
|
|
31
31
|
__isTeleport?: undefined;
|
|
@@ -38,7 +38,7 @@ declare const _default: {
|
|
|
38
38
|
sideOffset: number;
|
|
39
39
|
}>>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
40
40
|
sideOffset: number;
|
|
41
|
-
align: "
|
|
41
|
+
align: "start" | "end" | "center";
|
|
42
42
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
43
43
|
$slots: {
|
|
44
44
|
default: (_: {}) => any;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Ref, ShallowRef } from 'vue';
|
|
2
|
-
import { TextHighlight,
|
|
2
|
+
import { TextHighlight, MatchHighlightResult } from '@/components';
|
|
3
3
|
import type { PDFDocumentProxy } from 'pdfjs-dist';
|
|
4
4
|
export interface UseHighlight {
|
|
5
|
-
highlight: (args: TextHighlight[]) => Promise<
|
|
6
|
-
highlightMatches: Ref<
|
|
5
|
+
highlight: (args: TextHighlight[]) => Promise<Record<string, MatchHighlightResult[]>>;
|
|
6
|
+
highlightMatches: Ref<Record<string, MatchHighlightResult[]>>;
|
|
7
7
|
highlightKeywords: Ref<TextHighlight[] | undefined>;
|
|
8
8
|
clear: () => void;
|
|
9
9
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ShallowRef } from 'vue';
|
|
2
2
|
import type { PDFDocumentProxy } from 'pdfjs-dist';
|
|
3
|
-
import { SearchControlValue, HighlightOptions } from '@/
|
|
3
|
+
import type { SearchControlValue, HighlightOptions } from '@/utils/types';
|
|
4
4
|
declare const useSearch: (pdfDoc: ShallowRef<PDFDocumentProxy | undefined>, initialSearch?: string, options?: ShallowRef<HighlightOptions>) => SearchControlValue;
|
|
5
5
|
export default useSearch;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComputedRef, CSSProperties, Ref, StyleValue, UnwrapRef } from 'vue';
|
|
2
|
-
import type { ViewerPdfPage, VirtualRange } from '@/utils/types';
|
|
2
|
+
import type { ViewerPdfPage, VirtualRange, ElementRect } from '@/utils/types';
|
|
3
3
|
import { ScrollMode, ViewMode } from '@/utils/enumerators';
|
|
4
4
|
interface UseVirtualListItem<T> {
|
|
5
5
|
data: T;
|
|
@@ -7,7 +7,7 @@ interface UseVirtualListItem<T> {
|
|
|
7
7
|
}
|
|
8
8
|
export interface UseVirtualListReturn {
|
|
9
9
|
list: Ref<UseVirtualListItem<ViewerPdfPage>[]>;
|
|
10
|
-
scrollTo: (index: number, rect?:
|
|
10
|
+
scrollTo: (index: number, rect?: ElementRect) => void;
|
|
11
11
|
pageGroups: ComputedRef<Array<UseVirtualListItem<ViewerPdfPage>[]> | undefined>;
|
|
12
12
|
containerProps: {
|
|
13
13
|
ref: Ref<HTMLElement | null>;
|
package/dist/types/const.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
|
|
2
2
|
import type { PDFPageProxy } from 'pdfjs-dist/types/web/interfaces';
|
|
3
|
-
import type { InjectionKey, Slot, Ref, ComponentPublicInstance, ShallowRef, ComputedRef } from 'vue';
|
|
3
|
+
import type { InjectionKey, Slot, Ref, ComponentPublicInstance, ShallowRef, Reactive, ComputedRef } from 'vue';
|
|
4
4
|
import type { HighlightMatchPosition, HighlightOptions, Localization, NormalizedKeyword, Offset, PdfProperties, ToolbarOptions, ViewerPdfPage, Comment } from './utils/types';
|
|
5
5
|
import { LicenseType, ScrollMode, ViewMode, ZoomLevel } from './components';
|
|
6
6
|
export declare const DEFAULT_TOOLBAR_OPTIONS: ToolbarOptions;
|
|
@@ -28,6 +28,7 @@ export declare const SCROLL_BAR_WIDTH = 20;
|
|
|
28
28
|
export declare const PAGE_PADDING = 1;
|
|
29
29
|
export declare const PAGE_OFFSET = 0;
|
|
30
30
|
export declare const LAST_PAGE_OFFSET = 4;
|
|
31
|
+
export declare const SEARCH_MAX_HEIGHT = 97;
|
|
31
32
|
export declare const FILE_INPUT: InjectionKey<Ref<ComponentPublicInstance<import("vue").DefineComponent<{}, {
|
|
32
33
|
triggerClick: () => void;
|
|
33
34
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -102,3 +103,4 @@ export declare const PDF_COMMENTS: InjectionKey<{
|
|
|
102
103
|
comments: Map<number, Comment[]>;
|
|
103
104
|
repliedCommentPages: import("./components").PdfCommentPage[];
|
|
104
105
|
}>;
|
|
106
|
+
export declare const ANNOTATION_CANVAS_MAP: InjectionKey<Reactive<Map<string, HTMLCanvasElement>>>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { Locales } from './const';
|
|
|
3
3
|
export declare const VPdfViewerPlugin: Plugin;
|
|
4
4
|
export { Locales };
|
|
5
5
|
export * from './components';
|
|
6
|
-
export type { VPVInstance, CanvasLoadedCallback, Localization, PrintControl, ToolbarOptions } from './utils/types';
|
|
6
|
+
export type { VPVInstance, CanvasLoadedCallback, Localization, PrintControl, ToolbarOptions, MatchHighlightResult } from './utils/types';
|
|
7
7
|
export default VPdfViewerPlugin;
|
|
@@ -7,6 +7,12 @@ export interface VirtualRange {
|
|
|
7
7
|
start: number;
|
|
8
8
|
end: number;
|
|
9
9
|
}
|
|
10
|
+
export interface ElementRect {
|
|
11
|
+
left: number;
|
|
12
|
+
top: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}
|
|
10
16
|
export interface Match {
|
|
11
17
|
start: {
|
|
12
18
|
idx: number;
|
|
@@ -19,6 +25,7 @@ export interface Match {
|
|
|
19
25
|
str: string;
|
|
20
26
|
oIndex: number;
|
|
21
27
|
pageIndex: number;
|
|
28
|
+
rect: ElementRect;
|
|
22
29
|
}
|
|
23
30
|
export type LoadedEventPayload = number;
|
|
24
31
|
export type FocusedPageEventPayload = number;
|
|
@@ -619,6 +626,16 @@ export interface MatchHighlight extends MatchValue {
|
|
|
619
626
|
keyword: string | RegExp;
|
|
620
627
|
color: string;
|
|
621
628
|
}
|
|
629
|
+
export interface MatchHighlightResult {
|
|
630
|
+
/**
|
|
631
|
+
* The index of the page that contains the match
|
|
632
|
+
*/
|
|
633
|
+
pageIndex: number;
|
|
634
|
+
/**
|
|
635
|
+
* The index of the match in the page
|
|
636
|
+
*/
|
|
637
|
+
pageMatchIdx: number;
|
|
638
|
+
}
|
|
622
639
|
export interface SearchControlValue {
|
|
623
640
|
textContentPages: Ref<Record<string, TextContent>>;
|
|
624
641
|
searchValue: Ref<string | undefined>;
|
|
@@ -632,7 +649,7 @@ export interface SearchControlValue {
|
|
|
632
649
|
onCloseSearch: () => void;
|
|
633
650
|
handleSelectNext: () => void;
|
|
634
651
|
handleSelectPrev: () => void;
|
|
635
|
-
search: (value: string) =>
|
|
652
|
+
search: (value: string) => Promise<MatchHighlightResult[]>;
|
|
636
653
|
goToMatch: (index: number) => void;
|
|
637
654
|
}
|
|
638
655
|
export interface SearchControl {
|