@qaiddev/thumbs-embed 1.0.10 → 1.0.11

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.
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Modal positioning utilities
3
+ */
4
+ import type { SelectedBounds } from "./types";
5
+ export interface ModalPosition {
6
+ top: number;
7
+ left: number;
8
+ position: "above" | "below";
9
+ }
10
+ export interface ArrowPosition {
11
+ left: number;
12
+ }
13
+ export interface ModalDimensions {
14
+ width: number;
15
+ height: number;
16
+ arrowHeight: number;
17
+ gap: number;
18
+ viewportPadding: number;
19
+ }
20
+ /**
21
+ * Calculate whether modal should go above or below the target element
22
+ */
23
+ export declare function calculateVerticalPosition(bounds: SelectedBounds, viewportHeight: number, totalHeight: number, gap: number, viewportPadding: number): {
24
+ top: number;
25
+ position: "above" | "below";
26
+ };
27
+ /**
28
+ * Calculate horizontal position of modal, clamped to viewport
29
+ */
30
+ export declare function calculateHorizontalPosition(bounds: SelectedBounds, viewportWidth: number, modalWidth: number, viewportPadding: number): number;
31
+ /**
32
+ * Calculate arrow position relative to modal
33
+ * Points at the click position, not the element center
34
+ */
35
+ export declare function calculateArrowPosition(bounds: SelectedBounds, modalLeft: number, modalWidth: number, minOffset?: number, arrowWidth?: number): number;
36
+ /**
37
+ * Calculate complete modal position based on selected element bounds
38
+ */
39
+ export declare function calculateModalPosition(bounds: SelectedBounds, viewportWidth: number, viewportHeight: number, dimensions?: ModalDimensions): ModalPosition;
40
+ /**
41
+ * Calculate both modal and arrow positions
42
+ */
43
+ export declare function calculateModalAndArrowPosition(bounds: SelectedBounds, viewportWidth: number, viewportHeight: number, dimensions?: ModalDimensions): {
44
+ modal: ModalPosition;
45
+ arrow: ArrowPosition;
46
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Network capture utilities
3
+ * Intercepts fetch() and XMLHttpRequest to capture 4xx/5xx errors
4
+ */
5
+ import type { NetworkError } from "./types";
6
+ export interface NetworkCapture {
7
+ errors: NetworkError[];
8
+ restore: () => void;
9
+ }
10
+ /**
11
+ * Intercept fetch() and XMLHttpRequest to capture network errors (4xx/5xx)
12
+ */
13
+ export declare function captureNetworkErrors(): NetworkCapture;