@gemx-dev/heatmap-react 3.5.92-dev.37 → 3.5.92-dev.38

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.
Files changed (26) hide show
  1. package/dist/esm/components/VizElement/ElementCalloutOverlay.d.ts.map +1 -1
  2. package/dist/esm/components/VizElement/ElementOverlay.d.ts +2 -1
  3. package/dist/esm/components/VizElement/ElementOverlay.d.ts.map +1 -1
  4. package/dist/esm/helpers/viewport/element.d.ts +7 -2
  5. package/dist/esm/helpers/viewport/element.d.ts.map +1 -1
  6. package/dist/esm/helpers/viz-elm-callout/position-candidates.d.ts.map +1 -1
  7. package/dist/esm/helpers/viz-elm-callout/position-selector.d.ts +1 -0
  8. package/dist/esm/helpers/viz-elm-callout/position-selector.d.ts.map +1 -1
  9. package/dist/esm/helpers/viz-elm-callout/viz-elm.d.ts.map +1 -1
  10. package/dist/esm/index.js +136 -91
  11. package/dist/esm/index.mjs +136 -91
  12. package/dist/esm/types/viz-elm-callout.d.ts +1 -0
  13. package/dist/esm/types/viz-elm-callout.d.ts.map +1 -1
  14. package/dist/umd/components/VizElement/ElementCalloutOverlay.d.ts.map +1 -1
  15. package/dist/umd/components/VizElement/ElementOverlay.d.ts +2 -1
  16. package/dist/umd/components/VizElement/ElementOverlay.d.ts.map +1 -1
  17. package/dist/umd/helpers/viewport/element.d.ts +7 -2
  18. package/dist/umd/helpers/viewport/element.d.ts.map +1 -1
  19. package/dist/umd/helpers/viz-elm-callout/position-candidates.d.ts.map +1 -1
  20. package/dist/umd/helpers/viz-elm-callout/position-selector.d.ts +1 -0
  21. package/dist/umd/helpers/viz-elm-callout/position-selector.d.ts.map +1 -1
  22. package/dist/umd/helpers/viz-elm-callout/viz-elm.d.ts.map +1 -1
  23. package/dist/umd/index.js +1 -1
  24. package/dist/umd/types/viz-elm-callout.d.ts +1 -0
  25. package/dist/umd/types/viz-elm-callout.d.ts.map +1 -1
  26. package/package.json +1 -1
@@ -1698,6 +1698,61 @@ const clearCanvas = (canvas) => {
1698
1698
  ctx.clearRect(0, 0, canvas.width, canvas.height);
1699
1699
  };
1700
1700
 
1701
+ const CLARITY_HEATMAP_CANVAS_ID = 'clarity-heatmap-canvas';
1702
+ const HEATMAP_ELEMENT_ATTRIBUTE = 'data-clarity-hashalpha';
1703
+ function isIgnoredCanvas(element) {
1704
+ if (element.tagName === 'CANVAS') {
1705
+ return true;
1706
+ }
1707
+ if (element.id === CLARITY_HEATMAP_CANVAS_ID) {
1708
+ return true;
1709
+ }
1710
+ return false;
1711
+ }
1712
+
1713
+ const AREA_HOVER_BOX_SHADOW = '0 0 0 1px #0078D4, 0 0 0 1px #0078D4 inset, 0 0 0 2px white inset';
1714
+ const AREA_HOVER_ELEMENT_ID = 'clarity-edit-hover';
1715
+ const AREA_MAP_DIV_ATTRIBUTE = 'data-clarity-area-map-div';
1716
+ const HEATMAP_AREA_CONTAINER_CLASS = 'heatmap-area-container';
1717
+ const HEATMAP_AREA_CONTAINER_SELECTOR = `.${HEATMAP_AREA_CONTAINER_CLASS}`;
1718
+ const AREA_CONTAINER_STYLES = `
1719
+ position: absolute;
1720
+ top: 0;
1721
+ left: 0;
1722
+ width: 100%;
1723
+ height: 100%;
1724
+ pointer-events: none;
1725
+ z-index: 999999;
1726
+ `;
1727
+ const AREA_INNER_CONTAINER_STYLES = `
1728
+ position: relative;
1729
+ width: 100%;
1730
+ height: 100%;
1731
+ `;
1732
+ const AREA_COLOR_GRADIENT = [
1733
+ [0, 0, 255], // Blue
1734
+ [0, 255, 255], // Cyan
1735
+ [0, 255, 0], // Green
1736
+ [255, 255, 0], // Yellow
1737
+ [255, 0, 0], // Red
1738
+ ];
1739
+ const AREA_RENDERER_SELECTORS = {
1740
+ containerAttribute: AREA_MAP_DIV_ATTRIBUTE,
1741
+ containerSelector: `[${AREA_MAP_DIV_ATTRIBUTE}]`,
1742
+ innerContainerClass: HEATMAP_AREA_CONTAINER_CLASS,
1743
+ innerContainerSelector: HEATMAP_AREA_CONTAINER_SELECTOR,
1744
+ };
1745
+
1746
+ const CALLOUT_PADDING = 0;
1747
+ const CALLOUT_ARROW_SIZE = 8;
1748
+ const CALLOUT_OFFSET = { x: -8, y: 0 };
1749
+ const CALLOUT_ALIGNMENT = 'left';
1750
+ const CLICKED_ELEMENT_ID_BASE = 'gx-hm-clicked-element';
1751
+ const SECONDARY_CLICKED_ELEMENT_ID_BASE = 'gx-hm-secondary-clicked-element';
1752
+ const HOVERED_ELEMENT_ID_BASE = 'gx-hm-hovered-element';
1753
+ const SECONDARY_HOVERED_ELEMENT_ID_BASE = 'gx-hm-secondary-hovered-element';
1754
+ const DEFAULT_POSITION_MODE = 'absolute';
1755
+
1701
1756
  function isElementInViewport(elementRect, visualRef, scale) {
1702
1757
  if (!elementRect)
1703
1758
  return false;
@@ -1717,21 +1772,37 @@ function isElementInViewport(elementRect, visualRef, scale) {
1717
1772
  // Element is visible if it overlaps with the viewport
1718
1773
  return elementBottom > viewportTop && elementTop < viewportBottom;
1719
1774
  }
1720
- function isElementRectInViewport(elementRect, visualRect, scale) {
1721
- if (!elementRect)
1722
- return false;
1775
+ function isElementRectInViewport(params) {
1776
+ const { candidate, options } = params;
1777
+ const { rectDimensions, visualViewport: visualRect, widthScale: scale, containerRect } = options;
1723
1778
  if (!visualRect)
1724
1779
  return false;
1725
- // Element position relative to the document (or container's content)
1726
- const elementTop = elementRect.top * scale;
1727
- const elementBottom = (elementRect.top + elementRect.height) * scale;
1728
- // Current scroll position
1729
- const scrollTop = (visualRect?.scrollTop || 0) - 8;
1730
- const viewportHeight = visualRect.height;
1731
- // Visible viewport range in the scrollable content
1780
+ const { calloutRect, targetAbsoluteRect } = rectDimensions;
1781
+ const { placement, horizontalAlign } = candidate;
1782
+ // candidate position (relative to element) scaled + element absolute position in iframe
1783
+ const offsetTop = (targetAbsoluteRect?.top ?? 0) * scale;
1784
+ const offsetLeft = (targetAbsoluteRect?.left ?? 0) * scale;
1785
+ // Base position in scroll space
1786
+ const baseTop = candidate.top * scale + offsetTop;
1787
+ const baseLeft = candidate.left * scale + offsetLeft;
1788
+ const { width: calloutWidth, height: calloutHeight } = calloutRect;
1789
+ const transformOffsetY = placement === 'top' ? calloutHeight * (scale - 1) : 0;
1790
+ const transformOffsetX = horizontalAlign !== 'left' ? calloutWidth * (scale - 1) : 0;
1791
+ const visualTop = baseTop + transformOffsetY + CALLOUT_ARROW_SIZE;
1792
+ const visualBottom = visualTop + calloutHeight;
1793
+ const visualLeft = baseLeft + transformOffsetX;
1794
+ const visualRight = visualLeft + calloutWidth;
1795
+ // Viewport bounds
1796
+ const scrollTop = visualRect?.scrollTop || 0;
1797
+ const scrollLeft = visualRect?.scrollLeft || 0;
1732
1798
  const viewportTop = scrollTop;
1733
- const viewportBottom = scrollTop + viewportHeight;
1734
- return elementTop > viewportTop && elementBottom < viewportBottom;
1799
+ const viewportBottom = scrollTop + visualRect.height;
1800
+ const viewportLeft = scrollLeft;
1801
+ const viewportRight = scrollLeft + (containerRect?.width ?? visualRect.width);
1802
+ // Check if element is fully within the visible viewport
1803
+ const isInVertical = visualTop > viewportTop && visualBottom < viewportBottom;
1804
+ const isInHorizontal = visualLeft > viewportLeft && visualRight < viewportRight;
1805
+ return isInVertical && isInHorizontal;
1735
1806
  }
1736
1807
 
1737
1808
  function isMobileDevice(userAgent) {
@@ -1740,18 +1811,6 @@ function isMobileDevice(userAgent) {
1740
1811
  return /android|webos|iphone|ipad|ipod|blackberry|windows phone|opera mini|iemobile|mobile|silk|fennec|bada|tizen|symbian|nokia|palmsource|meego|sailfish|kindle|playbook|bb10|rim/i.test(userAgent);
1741
1812
  }
1742
1813
 
1743
- const CLARITY_HEATMAP_CANVAS_ID = 'clarity-heatmap-canvas';
1744
- const HEATMAP_ELEMENT_ATTRIBUTE = 'data-clarity-hashalpha';
1745
- function isIgnoredCanvas(element) {
1746
- if (element.tagName === 'CANVAS') {
1747
- return true;
1748
- }
1749
- if (element.id === CLARITY_HEATMAP_CANVAS_ID) {
1750
- return true;
1751
- }
1752
- return false;
1753
- }
1754
-
1755
1814
  /**
1756
1815
  * Get all elements at a specific point (x, y), with support for Shadow DOM
1757
1816
  */
@@ -2023,49 +2082,6 @@ const throttleRAF = (callback) => {
2023
2082
  return throttled;
2024
2083
  };
2025
2084
 
2026
- const AREA_HOVER_BOX_SHADOW = '0 0 0 1px #0078D4, 0 0 0 1px #0078D4 inset, 0 0 0 2px white inset';
2027
- const AREA_HOVER_ELEMENT_ID = 'clarity-edit-hover';
2028
- const AREA_MAP_DIV_ATTRIBUTE = 'data-clarity-area-map-div';
2029
- const HEATMAP_AREA_CONTAINER_CLASS = 'heatmap-area-container';
2030
- const HEATMAP_AREA_CONTAINER_SELECTOR = `.${HEATMAP_AREA_CONTAINER_CLASS}`;
2031
- const AREA_CONTAINER_STYLES = `
2032
- position: absolute;
2033
- top: 0;
2034
- left: 0;
2035
- width: 100%;
2036
- height: 100%;
2037
- pointer-events: none;
2038
- z-index: 999999;
2039
- `;
2040
- const AREA_INNER_CONTAINER_STYLES = `
2041
- position: relative;
2042
- width: 100%;
2043
- height: 100%;
2044
- `;
2045
- const AREA_COLOR_GRADIENT = [
2046
- [0, 0, 255], // Blue
2047
- [0, 255, 255], // Cyan
2048
- [0, 255, 0], // Green
2049
- [255, 255, 0], // Yellow
2050
- [255, 0, 0], // Red
2051
- ];
2052
- const AREA_RENDERER_SELECTORS = {
2053
- containerAttribute: AREA_MAP_DIV_ATTRIBUTE,
2054
- containerSelector: `[${AREA_MAP_DIV_ATTRIBUTE}]`,
2055
- innerContainerClass: HEATMAP_AREA_CONTAINER_CLASS,
2056
- innerContainerSelector: HEATMAP_AREA_CONTAINER_SELECTOR,
2057
- };
2058
-
2059
- const CALLOUT_PADDING = 0;
2060
- const CALLOUT_ARROW_SIZE = 8;
2061
- const CALLOUT_OFFSET = { x: -8, y: 0 };
2062
- const CALLOUT_ALIGNMENT = 'left';
2063
- const CLICKED_ELEMENT_ID_BASE = 'gx-hm-clicked-element';
2064
- const SECONDARY_CLICKED_ELEMENT_ID_BASE = 'gx-hm-secondary-clicked-element';
2065
- const HOVERED_ELEMENT_ID_BASE = 'gx-hm-hovered-element';
2066
- const SECONDARY_HOVERED_ELEMENT_ID_BASE = 'gx-hm-secondary-hovered-element';
2067
- const DEFAULT_POSITION_MODE = 'absolute';
2068
-
2069
2085
  /**
2070
2086
  * Get color from click distribution percentage (0-100)
2071
2087
  */
@@ -2692,7 +2708,7 @@ const getContainerViewport = (containerElm, _scale) => {
2692
2708
  if (containerElm) {
2693
2709
  const containerRect = containerElm.getBoundingClientRect();
2694
2710
  const width = containerRect.width;
2695
- const height = containerRect.width;
2711
+ const height = containerRect.height;
2696
2712
  return { width, height };
2697
2713
  }
2698
2714
  return {
@@ -2893,19 +2909,12 @@ const generateHorizontalPositionCandidates = (options) => {
2893
2909
  });
2894
2910
  };
2895
2911
  const generateAllCandidates = (options) => {
2896
- const { visualViewport, rectDimensions } = options;
2897
2912
  const verticalCandidates = generateVerticalPositionCandidates(options);
2898
2913
  const horizontalCandidates = generateHorizontalPositionCandidates(options);
2899
2914
  const allCandidates = [...verticalCandidates, ...horizontalCandidates];
2900
- // Thêm isVisibleInViewport cho mỗi candidate
2901
2915
  return allCandidates.map((candidate) => ({
2902
2916
  ...candidate,
2903
- isVisibleInViewport: isElementRectInViewport({
2904
- top: candidate.top,
2905
- left: candidate.left,
2906
- width: rectDimensions.calloutRect.width,
2907
- height: rectDimensions.calloutRect.height,
2908
- }, visualViewport || { scrollTop: 0, scrollLeft: 0, width: 0, height: 0 }, options.widthScale),
2917
+ isVisibleInViewport: isElementRectInViewport({ candidate, options }),
2909
2918
  }));
2910
2919
  };
2911
2920
 
@@ -2913,6 +2922,12 @@ const selectBestPosition = (candidates) => {
2913
2922
  // return candidates.find((p) => p.valid && p.isVisibleInViewport) || candidates[0];
2914
2923
  return candidates.find((p) => p.valid) || candidates[0];
2915
2924
  };
2925
+ const selectBestPositionForClick = (candidates) => {
2926
+ return (candidates.find((p) => p.valid && p.isVisibleInViewport) ||
2927
+ candidates.find((p) => p.isVisibleInViewport) ||
2928
+ candidates.find((p) => p.valid) ||
2929
+ candidates[0]);
2930
+ };
2916
2931
  const constrainToViewport = (candidate, options) => {
2917
2932
  const { containerRect, padding, rectDimensions, viewport } = options;
2918
2933
  const { calloutRect } = rectDimensions;
@@ -3025,7 +3040,7 @@ const calcCalloutPosition = (options) => {
3025
3040
  };
3026
3041
  };
3027
3042
  const calcCalloutPositionAbsolute = (props) => {
3028
- const { widthScale, calloutElm, containerElm, element, setPosition } = props;
3043
+ const { widthScale, calloutElm, containerElm, element, visualRef, setPosition } = props;
3029
3044
  const mousePosition = element?.mousePosition;
3030
3045
  if (!mousePosition)
3031
3046
  return;
@@ -3056,28 +3071,57 @@ const calcCalloutPositionAbsolute = (props) => {
3056
3071
  left: element.left,
3057
3072
  },
3058
3073
  };
3059
- const viewport = getContainerViewport(containerElm);
3074
+ const { viewportInfo } = calcPositionDetail({ element, widthScale, visualRef: visualRef ?? undefined });
3060
3075
  const options = {
3061
3076
  rectDimensions,
3062
- viewport,
3077
+ viewport: viewportInfo,
3063
3078
  alignment: CALLOUT_ALIGNMENT,
3064
3079
  offset: CALLOUT_OFFSET,
3065
3080
  padding,
3066
3081
  arrowSize,
3067
3082
  containerRect,
3068
3083
  widthScale,
3084
+ visualViewport: viewportInfo,
3069
3085
  };
3070
3086
  const candidates = generateAllCandidates(options);
3071
- const bestPosition = selectBestPosition(candidates);
3072
- const finalPosition = {
3073
- top: bestPosition.top,
3074
- left: bestPosition.left,
3075
- placement: bestPosition.placement,
3076
- horizontalAlign: bestPosition.horizontalAlign,
3077
- };
3078
- setPosition(finalPosition);
3079
- // const styleBestPosition = getStyleFromCandidate(bestPosition, widthScale);
3080
- // onChange(styleBestPosition);
3087
+ const bestPosition = selectBestPositionForClick(candidates);
3088
+ setPosition(bestPosition);
3089
+ };
3090
+ const calcPositionDetail = ({ element, widthScale, visualRef }) => {
3091
+ const mousePosition = element.mousePosition;
3092
+ // visualRef = scrollable viewport (gx-hm-visual), clientWidth/Height = visible area
3093
+ const visual = visualRef?.current;
3094
+ const viewportInfo = {
3095
+ width: visual?.clientWidth ?? 0,
3096
+ height: visual?.clientHeight ?? 0,
3097
+ scrollTop: visual?.scrollTop ?? 0,
3098
+ scrollLeft: visual?.scrollLeft ?? 0,
3099
+ };
3100
+ const elementInfo = {
3101
+ ...element,
3102
+ top: element.top * widthScale,
3103
+ left: element.left * widthScale,
3104
+ width: element.width * widthScale,
3105
+ height: element.height * widthScale,
3106
+ };
3107
+ const result = {
3108
+ elementInfo,
3109
+ viewportInfo,
3110
+ elementToIframe: { x: elementInfo.left, y: elementInfo.top },
3111
+ elementToViewport: { x: elementInfo.left - viewportInfo.scrollLeft, y: elementInfo.top - viewportInfo.scrollTop },
3112
+ };
3113
+ if (mousePosition) {
3114
+ // mousePosition is relative to the element (0,0 = top-left of element)
3115
+ const mx = mousePosition.x;
3116
+ const my = mousePosition.y;
3117
+ // Convert to iframe coordinate space
3118
+ const iframeMx = elementInfo.left + mx;
3119
+ const iframeMy = elementInfo.top + my;
3120
+ result.mouseToIframe = { x: iframeMx, y: iframeMy };
3121
+ result.mouseToElement = { x: mx, y: my };
3122
+ result.mouseToViewport = { x: iframeMx - viewportInfo.scrollLeft, y: iframeMy - viewportInfo.scrollTop };
3123
+ }
3124
+ return result;
3081
3125
  };
3082
3126
 
3083
3127
  function validateAreaCreation(dataInfo, hash, areas) {
@@ -8493,8 +8537,9 @@ const ElementCalloutOverlay = (props) => {
8493
8537
  containerElm,
8494
8538
  element,
8495
8539
  setPosition,
8540
+ visualRef: props.visualRef,
8496
8541
  });
8497
- }, [element, widthScale, containerRef]);
8542
+ }, [element, widthScale, containerRef, props.visualRef]);
8498
8543
  if (!element)
8499
8544
  return null;
8500
8545
  return (jsx("div", { ref: calloutRef, style: calloutStyle, className: "clarity-callout", children: CompElementCallout && jsx(CompElementCallout, { elementHash: element.hash }) }));
@@ -8539,7 +8584,7 @@ const ElementCalloutClickedComponent = (props) => {
8539
8584
  if (!clickedElement)
8540
8585
  return null;
8541
8586
  const isShowClickedElement = shouldShowCallout && !clickedElement?.mousePosition;
8542
- return (jsxs(Fragment, { children: [jsx(ElementOverlay, { type: "clicked", element: clickedElement, elementId: elementId, containerRef: props.containerRef }), isShowClickedElement && (jsx(ElementCallout, { element: clickedElement, target: `#${elementId}`, visualRef: props.visualRef, positionMode: props.positionMode }))] }));
8587
+ return (jsxs(Fragment, { children: [jsx(ElementOverlay, { type: "clicked", element: clickedElement, elementId: elementId, containerRef: props.containerRef, visualRef: props.visualRef }), isShowClickedElement && (jsx(ElementCallout, { element: clickedElement, target: `#${elementId}`, visualRef: props.visualRef, positionMode: props.positionMode }))] }));
8543
8588
  };
8544
8589
  const ElementCalloutClicked = memo(ElementCalloutClickedComponent);
8545
8590
 
@@ -107,5 +107,6 @@ export interface ICalcCalloutPositionAbsoluteProps {
107
107
  containerElm: HTMLDivElement;
108
108
  element: ElementInfo;
109
109
  setPosition: (position: ICalloutPosition) => void;
110
+ visualRef?: IHeatmapRef['Visual'] | null;
110
111
  }
111
112
  //# sourceMappingURL=viz-elm-callout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"viz-elm-callout.d.ts","sourceRoot":"","sources":["../../src/types/viz-elm-callout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,CAAC;AACpD,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG,oBAAoB,CAAC;AAC1E,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG,QAAQ,CAAC;AAEnE,MAA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VizElement/ElementCalloutOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAO5D,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8C/D,CAAC"}
1
+ {"version":3,"file":"ElementCalloutOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/VizElement/ElementCalloutOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAO5D,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+C/D,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ElementInfo } from '../../types';
1
+ import type { ElementInfo, IHeatmapRef } from '../../types';
2
2
  export interface ElementOverlayProps {
3
3
  type: 'hovered' | 'clicked';
4
4
  element: ElementInfo | null;
@@ -6,6 +6,7 @@ export interface ElementOverlayProps {
6
6
  elementId: string;
7
7
  containerRef?: React.RefObject<HTMLDivElement>;
8
8
  onClick?: (event?: React.MouseEvent<HTMLDivElement>) => void;
9
+ visualRef?: IHeatmapRef['Visual'] | null;
9
10
  }
10
11
  export declare const ElementOverlay: import("react").NamedExoticComponent<ElementOverlayProps>;
11
12
  //# sourceMappingURL=ElementOverlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ElementOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/VizElement/ElementOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS/C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CAC9D;AA2DD,eAAO,MAAM,cAAc,2DAAgC,CAAC"}
1
+ {"version":3,"file":"ElementOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/VizElement/ElementOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS5D,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC7D,SAAS,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;CAC1C;AA2DD,eAAO,MAAM,cAAc,2DAAgC,CAAC"}
@@ -1,4 +1,9 @@
1
- import type { ElementRect, IHeatmapRef, IVisualDomViewport } from '../../types';
1
+ import type { ElementRect, IHeatmapRef, IPositionCandidate, IPositionCandidateOption } from '../../types';
2
2
  export declare function isElementInViewport(elementRect: ElementRect, visualRef: IHeatmapRef['Visual'], scale: number): boolean;
3
- export declare function isElementRectInViewport(elementRect: ElementRect, visualRect: IVisualDomViewport, scale: number): boolean;
3
+ interface IElementRectInViewportParams {
4
+ candidate: IPositionCandidate;
5
+ options: IPositionCandidateOption;
6
+ }
7
+ export declare function isElementRectInViewport(params: IElementRectInViewportParams): boolean;
8
+ export {};
4
9
  //# sourceMappingURL=element.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../src/helpers/viewport/element.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEhF,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,EAChC,KAAK,EAAE,MAAM,GACZ,OAAO,CAqBT;AAED,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,kBAAkB,EAC9B,KAAK,EAAE,MAAM,GACZ,OAAO,CAoBT"}
1
+ {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../src/helpers/viewport/element.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,aAAa,CAAC;AAIrB,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,EAChC,KAAK,EAAE,MAAM,GACZ,OAAO,CAqBT;AAED,UAAU,4BAA4B;IACpC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,OAAO,EAAE,wBAAwB,CAAC;CACnC;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAsCrF"}
@@ -1 +1 @@
1
- {"version":3,"file":"position-candidates.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/position-candidates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,kBAAkB,EAClB,wBAAwB,EAEzB,MAAM,aAAa,CAAC;AAgBrB,eAAO,MAAM,kCAAkC,GAAI,SAAS,wBAAwB,KAAG,kBAAkB,EA+BxG,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAAI,SAAS,wBAAwB,KAAG,kBAAkB,EAU1G,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,SAAS,wBAAwB,KAAG,kBAAkB,EAsB3F,CAAC"}
1
+ {"version":3,"file":"position-candidates.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/position-candidates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,kBAAkB,EAClB,wBAAwB,EAEzB,MAAM,aAAa,CAAC;AAgBrB,eAAO,MAAM,kCAAkC,GAAI,SAAS,wBAAwB,KAAG,kBAAkB,EA+BxG,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAAI,SAAS,wBAAwB,KAAG,kBAAkB,EAU1G,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,SAAS,wBAAwB,KAAG,kBAAkB,EAU3F,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { IPositionCandidate, IPositionCandidateBase, IPositionCandidateOption } from '../../types';
2
2
  export declare const selectBestPosition: (candidates: IPositionCandidate[]) => IPositionCandidate;
3
+ export declare const selectBestPositionForClick: (candidates: IPositionCandidate[]) => IPositionCandidate;
3
4
  export declare const constrainToViewport: (candidate: IPositionCandidate, options: IPositionCandidateOption) => IPositionCandidateBase;
4
5
  //# sourceMappingURL=position-selector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"position-selector.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/position-selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAExG,eAAO,MAAM,kBAAkB,GAAI,YAAY,kBAAkB,EAAE,KAAG,kBAGrE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,WAAW,kBAAkB,EAC7B,SAAS,wBAAwB,KAChC,sBA0BF,CAAC"}
1
+ {"version":3,"file":"position-selector.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/position-selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAExG,eAAO,MAAM,kBAAkB,GAAI,YAAY,kBAAkB,EAAE,KAAG,kBAGrE,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,YAAY,kBAAkB,EAAE,KAAG,kBAO7E,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,WAAW,kBAAkB,EAC7B,SAAS,wBAAwB,KAChC,sBA0BF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"viz-elm.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/viz-elm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,yBAAyB,EACzB,wBAAwB,EAIxB,eAAe,EAGhB,MAAM,aAAa,CAAC;AAgErB,eAAO,MAAM,mBAAmB,GAAI,SAAS,yBAAyB,eAkDrE,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,OAAO,iCAAiC,SAiEnF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,oCAAoC,wBAAwB,KAAG,eAgCjG,CAAC"}
1
+ {"version":3,"file":"viz-elm.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-elm-callout/viz-elm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,yBAAyB,EACzB,wBAAwB,EAIxB,eAAe,EAEhB,MAAM,aAAa,CAAC;AAgErB,eAAO,MAAM,mBAAmB,GAAI,SAAS,yBAAyB,eAkDrE,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,OAAO,iCAAiC,SAwDnF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,oCAAoC,wBAAwB,KAAG,eA0CjG,CAAC"}