@vue-pdf-viewer/viewer 3.8.0-beta.7 → 3.8.0-beta.8

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.
@@ -2,4 +2,9 @@ import type { PDFDocumentProxy } from 'pdfjs-dist';
2
2
  import type { AnnotationEventPayload } from '@/utils/types';
3
3
  declare const EVENTS_TO_HANDLER: string[];
4
4
  declare function annotationEventsHandler(evt: Event, PDFDoc: PDFDocumentProxy, Annotations: Object[], viewerRotation: number, annotationStorage?: any): AnnotationEventPayload | Promise<AnnotationEventPayload | undefined> | undefined;
5
- export { EVENTS_TO_HANDLER, annotationEventsHandler };
5
+ /**
6
+ * Get the parent annotation element for a popup.
7
+ * Returns the cached annotation element that triggered this popup.
8
+ */
9
+ declare function getPopupParentAnnotation(popupElement: HTMLElement): HTMLElement | null;
10
+ export { EVENTS_TO_HANDLER, annotationEventsHandler, getPopupParentAnnotation };
@@ -36,7 +36,7 @@ export declare const MAX_ZOOM_SCALE = 10;
36
36
  export declare const DEFAULT_SCALE_DELTA = 1.1;
37
37
  export declare const ANNOTATION_OUTLINE_BORDER_WIDTH = 0.0025;
38
38
  export declare const ANNOTATION_OUTLINE_INNER_MARGIN = 0.00025;
39
- export declare const TEXT_MARKUP_LINE_THICKNESS = 0.15;
39
+ export declare const TEXT_MARKUP_LINE_THICKNESS = 0.075;
40
40
  export declare const SCROLL_BAR_WIDTH = 20;
41
41
  export declare const PAGE_PADDING = 1;
42
42
  export declare const PAGE_OFFSET = 0;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Utility for adjusting PDF.js annotation popup position to stay within viewer bounds.
3
+ * Popups use percentage-based positioning relative to their page.
4
+ * The popup should stay visually connected to its parent annotation.
5
+ */
6
+ export interface PopupBoundsResult {
7
+ needsAdjustment: boolean;
8
+ left?: string;
9
+ top?: string;
10
+ }
11
+ /**
12
+ * Check if a popup overflows the container bounds and calculate adjusted position.
13
+ * The popup will try to stay adjacent to its parent annotation, flipping sides if needed.
14
+ *
15
+ * @param popup - The .popup element inside .popupAnnotation
16
+ * @param container - The scroll container (.vpv-pages-inner-container)
17
+ * @param page - The annotation layer element (.vpv-annotation-layer)
18
+ * @param annotationRect - Bounding rect of the parent annotation element
19
+ * @returns Adjustment result with new percentage-based left/top if needed
20
+ */
21
+ export declare function adjustPopupBounds(popup: HTMLElement, container: HTMLElement, page: HTMLElement, annotationRect: DOMRect | null): PopupBoundsResult;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue-pdf-viewer/viewer",
3
3
  "private": false,
4
- "version": "3.8.0-beta.7",
4
+ "version": "3.8.0-beta.8",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
7
7
  "module": "./dist/index.js",