@vue-pdf-viewer/viewer 3.5.0 → 3.5.1-rc.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.
@@ -1,11 +1,12 @@
1
1
  import type { TextHighlight } from '@/utils/types';
2
- import type { PageViewport } from 'pdfjs-dist';
2
+ import type { PageViewport, PDFDocumentProxy } from 'pdfjs-dist';
3
3
  import type { TextContent } from 'pdfjs-dist/types/src/display/text_layer';
4
4
  interface OwnProps {
5
5
  pageIndex: number;
6
6
  viewport: PageViewport;
7
7
  textContent: TextContent;
8
8
  highlightKeywords: TextHighlight[];
9
+ pdfDocument: PDFDocumentProxy;
9
10
  }
10
11
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<OwnProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<OwnProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
11
12
  export default _default;
@@ -0,0 +1,2 @@
1
+ import { ShallowRef } from 'vue';
2
+ export declare const useCopyText: (container: ShallowRef<HTMLDivElement | undefined, HTMLDivElement | undefined>) => void;
@@ -1,9 +1,9 @@
1
1
  import { Ref, ShallowRef } from 'vue';
2
- import { TextHighlight, MatchHighlightResult } from '@/components';
2
+ import { TextHighlight, MatchHighlightResult, FullMatchHighlightResult } from '@/components';
3
3
  import type { PDFDocumentProxy } from 'pdfjs-dist';
4
4
  export interface UseHighlight {
5
5
  highlight: (args: TextHighlight[]) => Promise<Record<string, MatchHighlightResult[]>>;
6
- highlightMatches: Ref<Record<string, MatchHighlightResult[]>>;
6
+ highlightMatches: Ref<Record<string, FullMatchHighlightResult[]>>;
7
7
  highlightKeywords: Ref<TextHighlight[] | undefined>;
8
8
  clear: () => void;
9
9
  }
@@ -1,7 +1,7 @@
1
1
  import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
2
2
  import type { PDFPageProxy } from 'pdfjs-dist/types/web/interfaces';
3
3
  import { type InjectionKey, type Slot, type Ref, type ComponentPublicInstance, type ShallowRef, type Reactive, type ComputedRef } from 'vue';
4
- import type { HighlightMatchPosition, HighlightOptions, NormalizedKeyword, Offset, PdfProperties, ToolbarOptions, ViewerPdfPage, ViewerState, Comment, RenderQueueItem } from './utils/types';
4
+ import type { HighlightMatchPosition, HighlightOptions, NormalizedKeyword, Offset, PdfProperties, ToolbarOptions, ViewerPdfPage, ViewerState, RenderQueueItem, FullMatchHighlightResult } from './utils/types';
5
5
  import { LicenseProduct } from './utils/enumerators';
6
6
  import { LicenseType, ScrollMode, ViewMode, ZoomLevel } from './components';
7
7
  import { AnnotationFreeTextFontColors, AnnotationHighlightColors } from '@vue-pdf-viewer/shared';
@@ -105,6 +105,7 @@ export declare const SLOT_ICON_DOWNLOAD: InjectionKey<Slot<any> | undefined>;
105
105
  export declare const SLOT_ICON_PRINT: InjectionKey<Slot<any> | undefined>;
106
106
  export declare const SLOT_ICON_FULLSCREEN: InjectionKey<Slot<any> | undefined>;
107
107
  export declare const HISTORY_MANAGER: InjectionKey<HistoryManager>;
108
+ export declare const HIGHLIGHT_MATCHES: InjectionKey<Ref<Record<string, FullMatchHighlightResult[]>, Record<string, FullMatchHighlightResult[]>>>;
108
109
  export declare const SYMBOL_ANNOTATION_KEYS: {
109
110
  ANNOTATION_IMAGE_MANAGER: InjectionKey<AnnotationImageManager>;
110
111
  ENABLE_ANNOTATION_EDITOR: InjectionKey<Ref<boolean, boolean>>;
@@ -153,7 +154,7 @@ export declare const LICENSE_DEFAULT: {
153
154
  product: LicenseProduct;
154
155
  };
155
156
  export declare const PDF_COMMENTS: InjectionKey<{
156
- comments: Map<number, Comment[]>;
157
+ comments: Map<number, import("./components").Comment[]>;
157
158
  repliedCommentPages: import("./components").PdfCommentPage[];
158
159
  }>;
159
160
  export declare const ANNOTATION_CANVAS_MAP: InjectionKey<Reactive<Map<string, HTMLCanvasElement>>>;
@@ -1,8 +1,11 @@
1
1
  import type { TextContent } from 'pdfjs-dist/types/src/display/text_layer';
2
2
  import type { HighlightOptions, Match } from './types';
3
+ interface MatchWithLines extends Match {
4
+ lines?: any[];
5
+ }
3
6
  declare function isMatchEntireWord(content: string, startIdx: number, length: number): boolean;
4
7
  declare function highlightMatches(matches: Match[], textContent: TextContent, textDivs: HTMLElement[]): void;
5
8
  declare function resetDivs(textContent: TextContent, textDivs: HTMLElement[]): void;
6
- declare function findMatches(queries: (string | RegExp)[], textContent: TextContent, pageIndex: number, options: HighlightOptions): Match[];
9
+ declare function findMatches(queries: (string | RegExp)[], textContent: TextContent, pageIndex: number, options: HighlightOptions): MatchWithLines[];
7
10
  declare function getHighlightOptionsWithDefaults(options?: HighlightOptions): HighlightOptions;
8
11
  export { findMatches, highlightMatches, resetDivs, getHighlightOptionsWithDefaults, isMatchEntireWord };
@@ -0,0 +1,3 @@
1
+ import { TextItem } from 'pdfjs-dist/types/src/display/api';
2
+ import { ElementRect } from './types';
3
+ export declare function calculateMatchRect(textItem: TextItem, startOffset: number, endOffset: number): ElementRect;
@@ -540,6 +540,13 @@ export interface MatchHighlight extends MatchValue {
540
540
  keyword: string | RegExp;
541
541
  color: string;
542
542
  }
543
+ export interface FullMatchHighlightResult extends Match {
544
+ pageIndex: number;
545
+ pageMatchIdx: number;
546
+ color: string;
547
+ keyword: string | RegExp;
548
+ lines?: any[];
549
+ }
543
550
  export interface MatchHighlightResult {
544
551
  /**
545
552
  * The index of the page that contains the match
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue-pdf-viewer/viewer",
3
3
  "private": false,
4
- "version": "3.5.0",
4
+ "version": "3.5.1-rc.1",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
7
7
  "module": "./dist/index.js",
@@ -62,7 +62,7 @@
62
62
  "dependencies": {
63
63
  "@vue-pdf-viewer/shared": "1.1.3",
64
64
  "@vueuse/core": "^13.6.0",
65
- "node-forge": "^1.3.1",
65
+ "node-forge": "^1.3.2",
66
66
  "pdfjs-dist": "4.10.38",
67
67
  "reka-ui": "^2.4.1",
68
68
  "vite-plugin-css-injected-by-js": "^3.5.1"