@gemx-dev/heatmap-react 3.5.92-dev.36 → 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.
- package/dist/esm/components/VizElement/ElementCalloutOverlay.d.ts.map +1 -1
- package/dist/esm/components/VizElement/ElementOverlay.d.ts +2 -1
- package/dist/esm/components/VizElement/ElementOverlay.d.ts.map +1 -1
- package/dist/esm/helpers/viewport/element.d.ts +7 -2
- package/dist/esm/helpers/viewport/element.d.ts.map +1 -1
- package/dist/esm/helpers/viz-elm-callout/position-candidates.d.ts.map +1 -1
- package/dist/esm/helpers/viz-elm-callout/position-selector.d.ts +1 -0
- package/dist/esm/helpers/viz-elm-callout/position-selector.d.ts.map +1 -1
- package/dist/esm/helpers/viz-elm-callout/viz-elm.d.ts.map +1 -1
- package/dist/esm/hooks/viz-render/useHeatmapIframeProcessor.d.ts.map +1 -1
- package/dist/esm/hooks/viz-render/useHeatmapRenderDom.d.ts.map +1 -1
- package/dist/esm/index.js +196 -136
- package/dist/esm/index.mjs +196 -136
- package/dist/esm/libs/visualizer/shadow-dom/extractor.d.ts +26 -15
- package/dist/esm/libs/visualizer/shadow-dom/extractor.d.ts.map +1 -1
- package/dist/esm/types/viz-elm-callout.d.ts +1 -0
- package/dist/esm/types/viz-elm-callout.d.ts.map +1 -1
- package/dist/umd/components/VizElement/ElementCalloutOverlay.d.ts.map +1 -1
- package/dist/umd/components/VizElement/ElementOverlay.d.ts +2 -1
- package/dist/umd/components/VizElement/ElementOverlay.d.ts.map +1 -1
- package/dist/umd/helpers/viewport/element.d.ts +7 -2
- package/dist/umd/helpers/viewport/element.d.ts.map +1 -1
- package/dist/umd/helpers/viz-elm-callout/position-candidates.d.ts.map +1 -1
- package/dist/umd/helpers/viz-elm-callout/position-selector.d.ts +1 -0
- package/dist/umd/helpers/viz-elm-callout/position-selector.d.ts.map +1 -1
- package/dist/umd/helpers/viz-elm-callout/viz-elm.d.ts.map +1 -1
- package/dist/umd/hooks/viz-render/useHeatmapIframeProcessor.d.ts.map +1 -1
- package/dist/umd/hooks/viz-render/useHeatmapRenderDom.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/libs/visualizer/shadow-dom/extractor.d.ts +26 -15
- package/dist/umd/libs/visualizer/shadow-dom/extractor.d.ts.map +1 -1
- package/dist/umd/types/viz-elm-callout.d.ts +1 -0
- package/dist/umd/types/viz-elm-callout.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -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(
|
|
1721
|
-
|
|
1722
|
-
|
|
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
|
-
|
|
1726
|
-
const
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1731
|
-
|
|
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 +
|
|
1734
|
-
|
|
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.
|
|
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
|
|
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 =
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
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) {
|
|
@@ -4431,7 +4475,7 @@ async function processHeightChange(ctx, newHeight) {
|
|
|
4431
4475
|
}
|
|
4432
4476
|
}
|
|
4433
4477
|
function handleHeightChange(ctx) {
|
|
4434
|
-
if (!ctx.running || isBlocked(ctx))
|
|
4478
|
+
if (!ctx.running || !ctx.observerCleanup || isBlocked(ctx))
|
|
4435
4479
|
return;
|
|
4436
4480
|
scheduleThrottledCheck(ctx);
|
|
4437
4481
|
}
|
|
@@ -6436,29 +6480,32 @@ var ShortCircuitStrategy;
|
|
|
6436
6480
|
function isShadowDomNode(tag) {
|
|
6437
6481
|
return tag === Constant.ShadowDomTag || tag === Constant.PolyfillShadowDomTag;
|
|
6438
6482
|
}
|
|
6439
|
-
/**
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
* Pass 1 — seed *S/*P node IDs.
|
|
6452
|
-
* Pass 2 — cascade: any node whose parent is in the set is also in the set (repeat until stable). */
|
|
6453
|
-
function buildShadowSubtreeIds(allDomEvents) {
|
|
6483
|
+
/**
|
|
6484
|
+
* Two-step collection of all shadow-related node IDs across dom + mutation events.
|
|
6485
|
+
*
|
|
6486
|
+
* Step 1 — scan dom + all mutations to find *S/*P nodes and their direct host parents.
|
|
6487
|
+
* Step 2 — cascade: any node whose parent is already in subtreeIds is also included.
|
|
6488
|
+
*
|
|
6489
|
+
* Using IDs (not tag names) makes host detection precise and avoids false positives
|
|
6490
|
+
* from elements that share a tag name with a shadow host but aren't one.
|
|
6491
|
+
*/
|
|
6492
|
+
function collectShadowNodeIds(dom, events) {
|
|
6493
|
+
const mutationEvents = events.filter((e) => e.event === Event.Mutation);
|
|
6494
|
+
const allDomEvents = [dom, ...mutationEvents];
|
|
6454
6495
|
const subtreeIds = new Set();
|
|
6496
|
+
const hostIds = new Set();
|
|
6497
|
+
// Step 1: seed *S/*P node IDs and collect their direct host parent IDs
|
|
6455
6498
|
for (const e of allDomEvents) {
|
|
6456
6499
|
const data = e.data;
|
|
6457
6500
|
for (const node of data ?? []) {
|
|
6458
|
-
if (isShadowDomNode(node.tag))
|
|
6501
|
+
if (isShadowDomNode(node.tag)) {
|
|
6459
6502
|
subtreeIds.add(node.id);
|
|
6503
|
+
if (node.parent)
|
|
6504
|
+
hostIds.add(node.parent);
|
|
6505
|
+
}
|
|
6460
6506
|
}
|
|
6461
6507
|
}
|
|
6508
|
+
// Step 2: cascade — descendants of shadow nodes are also part of the shadow subtree
|
|
6462
6509
|
let changed = true;
|
|
6463
6510
|
while (changed) {
|
|
6464
6511
|
changed = false;
|
|
@@ -6472,29 +6519,24 @@ function buildShadowSubtreeIds(allDomEvents) {
|
|
|
6472
6519
|
}
|
|
6473
6520
|
}
|
|
6474
6521
|
}
|
|
6475
|
-
return subtreeIds;
|
|
6522
|
+
return { subtreeIds, hostIds };
|
|
6476
6523
|
}
|
|
6477
|
-
function
|
|
6478
|
-
return (
|
|
6479
|
-
if (isShadowDomNode(node.tag))
|
|
6480
|
-
return true;
|
|
6481
|
-
if (shadowHostTags.has(node.tag ?? ''))
|
|
6482
|
-
return true;
|
|
6483
|
-
return subtreeIds.has(node.id);
|
|
6484
|
-
}) ?? []);
|
|
6524
|
+
function isShadowRelated(node, ids) {
|
|
6525
|
+
return ids.subtreeIds.has(node.id) || ids.hostIds.has(node.id);
|
|
6485
6526
|
}
|
|
6486
|
-
/**
|
|
6487
|
-
*
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
const shadowNodes =
|
|
6527
|
+
/**
|
|
6528
|
+
* Extract shadow DOM nodes from merged.dom (initial Discover event).
|
|
6529
|
+
* Includes both shadow host elements (hostIds) and shadow subtree nodes (subtreeIds).
|
|
6530
|
+
*/
|
|
6531
|
+
function extractSpecialDom(dom, ids) {
|
|
6532
|
+
const shadowNodes = dom.data?.filter((node) => isShadowRelated(node, ids)) ?? [];
|
|
6492
6533
|
return shadowNodes.length ? { ...dom, data: shadowNodes } : null;
|
|
6493
6534
|
}
|
|
6494
|
-
/**
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6535
|
+
/**
|
|
6536
|
+
* Extract shadow DOM mutations + StyleSheet + CustomElement events from merged.events.
|
|
6537
|
+
* Mutation events are filtered to only include shadow-related nodes.
|
|
6538
|
+
*/
|
|
6539
|
+
function extractSpecialEvents(events, ids) {
|
|
6498
6540
|
const result = [];
|
|
6499
6541
|
for (const e of events) {
|
|
6500
6542
|
const ev = e.event;
|
|
@@ -6505,7 +6547,7 @@ function extractSpecialEvents(events, dom, shadowHostTags) {
|
|
|
6505
6547
|
continue;
|
|
6506
6548
|
}
|
|
6507
6549
|
if (ev === Event.Mutation) {
|
|
6508
|
-
const shadowNodes =
|
|
6550
|
+
const shadowNodes = e.data?.filter((node) => isShadowRelated(node, ids)) ?? [];
|
|
6509
6551
|
if (shadowNodes.length)
|
|
6510
6552
|
result.push({ ...e, data: shadowNodes });
|
|
6511
6553
|
}
|
|
@@ -6708,9 +6750,9 @@ class GXVisualizer extends Visualizer {
|
|
|
6708
6750
|
const timestamp = Date.now();
|
|
6709
6751
|
const version = decoded[0].envelope.version;
|
|
6710
6752
|
const html = doc.documentElement.outerHTML;
|
|
6711
|
-
const
|
|
6712
|
-
const specialDom = extractSpecialDom(merged.dom,
|
|
6713
|
-
const specialEvents = extractSpecialEvents(merged.events,
|
|
6753
|
+
const shadowNodeIds = collectShadowNodeIds(merged.dom, merged.events);
|
|
6754
|
+
const specialDom = extractSpecialDom(merged.dom, shadowNodeIds);
|
|
6755
|
+
const specialEvents = extractSpecialEvents(merged.events, shadowNodeIds);
|
|
6714
6756
|
void htmlCache.set({ key: cacheKey, html, specialDom, specialEvents, version, timestamp });
|
|
6715
6757
|
}
|
|
6716
6758
|
catch (e) {
|
|
@@ -6770,8 +6812,10 @@ const useHeatmapIframeProcessor = () => {
|
|
|
6770
6812
|
onHeightChange: (data) => {
|
|
6771
6813
|
if (abort.signal.aborted)
|
|
6772
6814
|
return;
|
|
6773
|
-
if (data.height)
|
|
6815
|
+
if (data.height) {
|
|
6774
6816
|
setIframeHeight(data.height);
|
|
6817
|
+
iframe.style.height = `${data.height}px`;
|
|
6818
|
+
}
|
|
6775
6819
|
},
|
|
6776
6820
|
});
|
|
6777
6821
|
},
|
|
@@ -6843,15 +6887,19 @@ const useHeatmapRenderDom = () => {
|
|
|
6843
6887
|
const heatmapType = useHeatmapSettingContext((s) => s.heatmapType);
|
|
6844
6888
|
const elementToShow = useHeatmapDataContext((s) => s.dataInfo?.elementToShow);
|
|
6845
6889
|
const dataHash = useHeatmapDataContext((s) => s.dataHash);
|
|
6890
|
+
const isLoadingDom = useHeatmapSettingContext((state) => state.isLoadingDom);
|
|
6846
6891
|
const iframeRef = useRef(null);
|
|
6847
6892
|
const abortRef = useRef(null);
|
|
6848
6893
|
const elementToShowRef = useRef(null);
|
|
6849
6894
|
const dataHashRef = useRef(null);
|
|
6850
6895
|
const heatmapTypeRef = useRef(heatmapType);
|
|
6896
|
+
const lastRenderKeyRef = useRef(null);
|
|
6851
6897
|
elementToShowRef.current = elementToShow ?? null;
|
|
6852
6898
|
dataHashRef.current = dataHash ?? null;
|
|
6853
6899
|
heatmapTypeRef.current = heatmapType;
|
|
6854
6900
|
const { run: runIframeSetup, reset: resetIframeSetup } = useHeatmapIframeProcessor();
|
|
6901
|
+
const runIframeSetupRef = useRef(runIframeSetup);
|
|
6902
|
+
runIframeSetupRef.current = runIframeSetup;
|
|
6855
6903
|
const renderHeatmap = useCallback(async (payloads) => {
|
|
6856
6904
|
if (!payloads || payloads.length === 0)
|
|
6857
6905
|
return;
|
|
@@ -6883,13 +6931,24 @@ const useHeatmapRenderDom = () => {
|
|
|
6883
6931
|
if (abort.signal.aborted)
|
|
6884
6932
|
return;
|
|
6885
6933
|
// Phase 2: iframe setup — deferred to useIframeSetup (handles dims dependency)
|
|
6886
|
-
|
|
6887
|
-
}, [
|
|
6934
|
+
runIframeSetupRef.current(iframe, t0, abort);
|
|
6935
|
+
}, []);
|
|
6888
6936
|
useEffect(() => {
|
|
6937
|
+
if (isLoadingDom)
|
|
6938
|
+
return;
|
|
6889
6939
|
if (!data || data.length === 0)
|
|
6890
6940
|
return;
|
|
6891
|
-
|
|
6892
|
-
|
|
6941
|
+
const renderKey = `${dataHash}-${deviceType}`;
|
|
6942
|
+
if (renderKey === lastRenderKeyRef.current)
|
|
6943
|
+
return;
|
|
6944
|
+
const timer = setTimeout(() => {
|
|
6945
|
+
if (renderKey !== `${dataHashRef.current}-${deviceType}`)
|
|
6946
|
+
return;
|
|
6947
|
+
lastRenderKeyRef.current = renderKey;
|
|
6948
|
+
renderHeatmap(decodeArrayClarity(data));
|
|
6949
|
+
}, 50);
|
|
6950
|
+
return () => clearTimeout(timer);
|
|
6951
|
+
}, [data, deviceType, isLoadingDom]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
6893
6952
|
return { iframeRef };
|
|
6894
6953
|
};
|
|
6895
6954
|
|
|
@@ -8478,8 +8537,9 @@ const ElementCalloutOverlay = (props) => {
|
|
|
8478
8537
|
containerElm,
|
|
8479
8538
|
element,
|
|
8480
8539
|
setPosition,
|
|
8540
|
+
visualRef: props.visualRef,
|
|
8481
8541
|
});
|
|
8482
|
-
}, [element, widthScale, containerRef]);
|
|
8542
|
+
}, [element, widthScale, containerRef, props.visualRef]);
|
|
8483
8543
|
if (!element)
|
|
8484
8544
|
return null;
|
|
8485
8545
|
return (jsx("div", { ref: calloutRef, style: calloutStyle, className: "clarity-callout", children: CompElementCallout && jsx(CompElementCallout, { elementHash: element.hash }) }));
|
|
@@ -8524,7 +8584,7 @@ const ElementCalloutClickedComponent = (props) => {
|
|
|
8524
8584
|
if (!clickedElement)
|
|
8525
8585
|
return null;
|
|
8526
8586
|
const isShowClickedElement = shouldShowCallout && !clickedElement?.mousePosition;
|
|
8527
|
-
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 }))] }));
|
|
8528
8588
|
};
|
|
8529
8589
|
const ElementCalloutClicked = memo(ElementCalloutClickedComponent);
|
|
8530
8590
|
|
|
@@ -4,20 +4,31 @@ export type DomNode = {
|
|
|
4
4
|
parent: number;
|
|
5
5
|
tag?: string;
|
|
6
6
|
};
|
|
7
|
+
export interface ShadowNodeIds {
|
|
8
|
+
/** IDs of shadow container nodes (*S / *P) and all their descendants */
|
|
9
|
+
subtreeIds: Set<number>;
|
|
10
|
+
/** IDs of elements that directly host a shadow root (direct parents of *S/*P nodes) */
|
|
11
|
+
hostIds: Set<number>;
|
|
12
|
+
}
|
|
7
13
|
export declare function isShadowDomNode(tag: string | undefined): boolean;
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export declare function
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export declare function
|
|
14
|
+
/**
|
|
15
|
+
* Two-step collection of all shadow-related node IDs across dom + mutation events.
|
|
16
|
+
*
|
|
17
|
+
* Step 1 — scan dom + all mutations to find *S/*P nodes and their direct host parents.
|
|
18
|
+
* Step 2 — cascade: any node whose parent is already in subtreeIds is also included.
|
|
19
|
+
*
|
|
20
|
+
* Using IDs (not tag names) makes host detection precise and avoids false positives
|
|
21
|
+
* from elements that share a tag name with a shadow host but aren't one.
|
|
22
|
+
*/
|
|
23
|
+
export declare function collectShadowNodeIds(dom: MergedPayload['dom'], events: MergedPayload['events']): ShadowNodeIds;
|
|
24
|
+
/**
|
|
25
|
+
* Extract shadow DOM nodes from merged.dom (initial Discover event).
|
|
26
|
+
* Includes both shadow host elements (hostIds) and shadow subtree nodes (subtreeIds).
|
|
27
|
+
*/
|
|
28
|
+
export declare function extractSpecialDom(dom: MergedPayload['dom'], ids: ShadowNodeIds): MergedPayload['dom'] | null;
|
|
29
|
+
/**
|
|
30
|
+
* Extract shadow DOM mutations + StyleSheet + CustomElement events from merged.events.
|
|
31
|
+
* Mutation events are filtered to only include shadow-related nodes.
|
|
32
|
+
*/
|
|
33
|
+
export declare function extractSpecialEvents(events: MergedPayload['events'], ids: ShadowNodeIds): MergedPayload['events'];
|
|
23
34
|
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../../src/libs/visualizer/shadow-dom/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C,MAAM,MAAM,OAAO,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../../src/libs/visualizer/shadow-dom/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C,MAAM,MAAM,OAAO,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,uFAAuF;IACvF,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,aAAa,CAkC9G;AAMD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,IAAI,CAG5G;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,CAsBjH"}
|
|
@@ -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,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,iBAAiB,CAAC;IAC7B,eAAe,EAAE,oBAAoB,CAAC;CACvC;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,kBAAkB,CAAC,EAAE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AG;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,aAAa,CAAC;IAC5B,eAAe,EAAE,WAAW,CAAC;IAC7B,iBAAiB,EAAE,WAAW,CAAC;IAC/B,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,eAAe,CAAC,EAAE,WAAW,CAAC;CAC/B,CAAC;AAEF,MAAM,WAAW,iCAAiC;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,cAAc,CAAC;IAC3B,YAAY,EAAE,cAAc,CAAC;IAC7B,OAAO,EAAE,WAAW,CAAC;IACrB,WAAW,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,SAAS,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;CAC1C"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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;
|
|
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,
|
|
1
|
+
import type { ElementRect, IHeatmapRef, IPositionCandidate, IPositionCandidateOption } from '../../types';
|
|
2
2
|
export declare function isElementInViewport(elementRect: ElementRect, visualRef: IHeatmapRef['Visual'], scale: number): boolean;
|
|
3
|
-
|
|
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,
|
|
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,
|
|
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
|