@gemx-dev/heatmap-react 3.5.92-dev.37 → 3.5.92-dev.39
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/configs/heatmap.d.ts +4 -0
- package/dist/esm/configs/heatmap.d.ts.map +1 -0
- package/dist/esm/configs/index.d.ts +1 -0
- package/dist/esm/configs/index.d.ts.map +1 -1
- package/dist/esm/helpers/iframe-height/IframeHeightProcessor.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-canvas/area-overlay-manager-v2.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/view-context/useHeatmapSettingContext.d.ts +2 -2
- package/dist/esm/hooks/view-context/useHeatmapSettingContext.d.ts.map +1 -1
- package/dist/esm/hooks/viz-canvas/useClickmap.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/hooks/viz-scale/useWrapperRefHeight.d.ts.map +1 -1
- package/dist/esm/index.js +154 -116
- package/dist/esm/index.mjs +154 -116
- 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/configs/heatmap.d.ts +4 -0
- package/dist/umd/configs/heatmap.d.ts.map +1 -0
- package/dist/umd/configs/index.d.ts +1 -0
- package/dist/umd/configs/index.d.ts.map +1 -1
- package/dist/umd/helpers/iframe-height/IframeHeightProcessor.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-canvas/area-overlay-manager-v2.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/view-context/useHeatmapSettingContext.d.ts +2 -2
- package/dist/umd/hooks/view-context/useHeatmapSettingContext.d.ts.map +1 -1
- package/dist/umd/hooks/viz-canvas/useClickmap.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/hooks/viz-scale/useWrapperRefHeight.d.ts.map +1 -1
- package/dist/umd/index.js +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 +4 -4
|
@@ -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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heatmap.d.ts","sourceRoot":"","sources":["../../src/configs/heatmap.ts"],"names":[],"mappings":"AAAA,0BAAkB,cAAc;IAC9B,SAAS,QAAQ;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configs/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configs/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IframeHeightProcessor.d.ts","sourceRoot":"","sources":["../../../src/helpers/iframe-height/IframeHeightProcessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,eAAe,EAEf,2BAA2B,EAE3B,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AA4BjB,qBAAa,qBAAqB;IAChC,OAAO,CAAC,MAAM,CAAwC;IACtD,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,eAAe,CAAa;gBAExB,MAAM,EAAE,2BAA2B;IAa/C;;OAEG;IACH,OAAO,CAAC,UAAU;IAiBlB;;OAEG;IACI,eAAe,IAAI,MAAM;IAShC;;OAEG;IACI,cAAc,IAAI,MAAM;IAQ/B;;OAEG;IACI,uBAAuB,IAAI,MAAM;IAmBxC;;;OAGG;IACU,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiCjD;;;OAGG;IACI,qBAAqB,IAAI,IAAI;IAgDpC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IA+DnC;;OAEG;IACI,UAAU,IAAI,IAAI;IAKzB;;OAEG;IACH,OAAO,CAAC,SAAS;IA8DjB;;;OAGG;IACI,UAAU,IAAI,eAAe;IAuBpC;;OAEG;IACH,OAAO,CAAC,eAAe;IAsCvB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAMzB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAMjC;;OAEG;IACH,OAAO,CAAC,YAAY;IAOpB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAQ5B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAO1B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAMxB;;;OAGG;IACH,OAAO,CAAC,cAAc;
|
|
1
|
+
{"version":3,"file":"IframeHeightProcessor.d.ts","sourceRoot":"","sources":["../../../src/helpers/iframe-height/IframeHeightProcessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,eAAe,EAEf,2BAA2B,EAE3B,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AA4BjB,qBAAa,qBAAqB;IAChC,OAAO,CAAC,MAAM,CAAwC;IACtD,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,eAAe,CAAa;gBAExB,MAAM,EAAE,2BAA2B;IAa/C;;OAEG;IACH,OAAO,CAAC,UAAU;IAiBlB;;OAEG;IACI,eAAe,IAAI,MAAM;IAShC;;OAEG;IACI,cAAc,IAAI,MAAM;IAQ/B;;OAEG;IACI,uBAAuB,IAAI,MAAM;IAmBxC;;;OAGG;IACU,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiCjD;;;OAGG;IACI,qBAAqB,IAAI,IAAI;IAgDpC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IA+DnC;;OAEG;IACI,UAAU,IAAI,IAAI;IAKzB;;OAEG;IACH,OAAO,CAAC,SAAS;IA8DjB;;;OAGG;IACI,UAAU,IAAI,eAAe;IAuBpC;;OAEG;IACH,OAAO,CAAC,eAAe;IAsCvB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAMzB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAMjC;;OAEG;IACH,OAAO,CAAC,YAAY;IAOpB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAQ5B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAO1B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAMxB;;;OAGG;IACH,OAAO,CAAC,cAAc;IA6FtB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA8B5B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAU1B;;OAEG;IACI,wBAAwB,IAAI,oBAAoB,EAAE;IA+CzD;;OAEG;IACI,sBAAsB,IAAI,qBAAqB,EAAE;IAwDxD;;OAEG;IACH,OAAO,CAAC,eAAe;IAMvB;;OAEG;IACI,gBAAgB,IAAI,IAAI;IA0B/B;;OAEG;IACI,8BAA8B,IAAI,IAAI;IAY7C;;OAEG;IACI,mBAAmB,IAAI,IAAI;IA0BlC;;OAEG;IACI,qBAAqB,IAAI,OAAO;IAkCvC;;OAEG;IACI,kBAAkB,IAAI,MAAM;IAInC;;OAEG;IACI,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAM/C,OAAO,CAAC,wBAAwB;IAoBhC,OAAO,CAAC,oBAAoB;IAiB5B,OAAO,CAAC,yBAAyB;IAcjC,OAAO,CAAC,sBAAsB;IAgB9B;;OAEG;IACI,OAAO,IAAI,IAAI;CAQvB"}
|
|
@@ -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":"area-overlay-manager-v2.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-canvas/area-overlay-manager-v2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAO1E,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,gBAAgB,CAA+B;IACvD,OAAO,CAAC,KAAK,CAA0C;IACvD,OAAO,CAAC,gBAAgB,CAA0C;IAClE,OAAO,CAAC,eAAe,CAAqC;gBAEhD,MAAM,EAAE,iBAAiB;IAI9B,IAAI,IAAI,IAAI;IA8BZ,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"area-overlay-manager-v2.d.ts","sourceRoot":"","sources":["../../../src/helpers/viz-canvas/area-overlay-manager-v2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAO1E,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,gBAAgB,CAA+B;IACvD,OAAO,CAAC,KAAK,CAA0C;IACvD,OAAO,CAAC,gBAAgB,CAA0C;IAClE,OAAO,CAAC,eAAe,CAAqC;gBAEhD,MAAM,EAAE,iBAAiB;IAI9B,IAAI,IAAI,IAAI;IA8BZ,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAoBtC,OAAO,CAAC,aAAa;IAiFd,KAAK,IAAI,IAAI;IAQb,OAAO,IAAI,IAAI;IAQf,QAAQ,IAAI,mBAAmB,EAAE;CAGzC"}
|
|
@@ -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
|
|
@@ -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,
|
|
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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { EClickMode, EClickRankType, EClickType, EHeatmapType, EScrollType } from '../../types';
|
|
2
|
-
import {
|
|
1
|
+
import type { EClickMode, EClickRankType, EClickType, EDeviceType, EHeatmapType, EScrollType } from '../../types';
|
|
2
|
+
import { EHeatmapDataSource } from '../../types';
|
|
3
3
|
interface IHeatmapSettingState {
|
|
4
4
|
isRendering: boolean;
|
|
5
5
|
isLoadingDom: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeatmapSettingContext.d.ts","sourceRoot":"","sources":["../../../src/hooks/view-context/useHeatmapSettingContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"useHeatmapSettingContext.d.ts","sourceRoot":"","sources":["../../../src/hooks/view-context/useHeatmapSettingContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGlH,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD,UAAU,oBAAoB;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAC;IACrC,UAAU,EAAE,WAAW,GAAG,SAAS,CAAC;IACpC,SAAS,EAAE,UAAU,GAAG,SAAS,CAAC;IAClC,SAAS,EAAE,UAAU,GAAG,SAAS,CAAC;IAClC,UAAU,EAAE,WAAW,GAAG,SAAS,CAAC;IACpC,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC;IACtC,UAAU,EAAE,kBAAkB,CAAC;CAChC;AAED,UAAU,sBAAsB;IAC9B,gBAAgB,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,WAAW,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;IAChD,aAAa,EAAE,CAAC,UAAU,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,YAAY,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,IAAI,CAAC;IAC9C,YAAY,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,IAAI,CAAC;IAC9C,aAAa,EAAE,CAAC,UAAU,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,cAAc,EAAE,CAAC,WAAW,EAAE,YAAY,KAAK,IAAI,CAAC;IACpD,cAAc,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,eAAe,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,kBAAkB,EAAE,CAAC,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,aAAa,EAAE,CAAC,UAAU,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACxD,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,wBAAwB;;;;;;;CAmCnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClickmap.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-canvas/useClickmap.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW;;
|
|
1
|
+
{"version":3,"file":"useClickmap.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-canvas/useClickmap.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW;;CAoBvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeatmapIframeProcessor.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-render/useHeatmapIframeProcessor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHeatmapIframeProcessor.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-render/useHeatmapIframeProcessor.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,6BAA6B;IAC5C,GAAG,EAAE,CAAC,MAAM,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC7E,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,eAAO,MAAM,yBAAyB,QAAO,6BA4D5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeatmapRenderDom.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-render/useHeatmapRenderDom.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,mBAAmB,QAAO,
|
|
1
|
+
{"version":3,"file":"useHeatmapRenderDom.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-render/useHeatmapRenderDom.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,mBAAmB,QAAO,uBAyFtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWrapperRefHeight.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-scale/useWrapperRefHeight.ts"],"names":[],"mappings":"AAGA,UAAU,yBAAyB;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CACpD;AAED,UAAU,0BAA0B;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,yBAAyB,KAAG,
|
|
1
|
+
{"version":3,"file":"useWrapperRefHeight.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-scale/useWrapperRefHeight.ts"],"names":[],"mappings":"AAGA,UAAU,yBAAyB;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CACpD;AAED,UAAU,0BAA0B;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,yBAAyB,KAAG,0BA8EtE,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -70,6 +70,11 @@ const ELM_CALLOUT_CONFIG = {
|
|
|
70
70
|
HIDE_OUTLINE_ON_CLICKED: true,
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
+
var HeatmapSetting;
|
|
74
|
+
(function (HeatmapSetting) {
|
|
75
|
+
HeatmapSetting[HeatmapSetting["MaxHeight"] = 65535] = "MaxHeight";
|
|
76
|
+
})(HeatmapSetting || (HeatmapSetting = {}));
|
|
77
|
+
|
|
73
78
|
// Portal mode: Full permissions for proper functionality
|
|
74
79
|
// Need allow-forms for add to cart, allow-popups for some features
|
|
75
80
|
const HEATMAP_IFRAME = {
|
|
@@ -1393,7 +1398,7 @@ const useHeatmapSettingContext = createViewContextHook({
|
|
|
1393
1398
|
isLoadingCanvas: !!store.isLoadingCanvas.get(viewId),
|
|
1394
1399
|
isShowSidebar: !!store.isShowSidebar.get(viewId),
|
|
1395
1400
|
rankedBy: store.rankedBy.get(viewId),
|
|
1396
|
-
deviceType: store.deviceType.get(viewId)
|
|
1401
|
+
deviceType: store.deviceType.get(viewId),
|
|
1397
1402
|
clickType: store.clickType.get(viewId),
|
|
1398
1403
|
clickMode: store.clickMode.get(viewId),
|
|
1399
1404
|
scrollType: store.scrollType.get(viewId),
|
|
@@ -1698,6 +1703,61 @@ const clearCanvas = (canvas) => {
|
|
|
1698
1703
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
1699
1704
|
};
|
|
1700
1705
|
|
|
1706
|
+
const CLARITY_HEATMAP_CANVAS_ID = 'clarity-heatmap-canvas';
|
|
1707
|
+
const HEATMAP_ELEMENT_ATTRIBUTE = 'data-clarity-hashalpha';
|
|
1708
|
+
function isIgnoredCanvas(element) {
|
|
1709
|
+
if (element.tagName === 'CANVAS') {
|
|
1710
|
+
return true;
|
|
1711
|
+
}
|
|
1712
|
+
if (element.id === CLARITY_HEATMAP_CANVAS_ID) {
|
|
1713
|
+
return true;
|
|
1714
|
+
}
|
|
1715
|
+
return false;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
const AREA_HOVER_BOX_SHADOW = '0 0 0 1px #0078D4, 0 0 0 1px #0078D4 inset, 0 0 0 2px white inset';
|
|
1719
|
+
const AREA_HOVER_ELEMENT_ID = 'clarity-edit-hover';
|
|
1720
|
+
const AREA_MAP_DIV_ATTRIBUTE = 'data-clarity-area-map-div';
|
|
1721
|
+
const HEATMAP_AREA_CONTAINER_CLASS = 'heatmap-area-container';
|
|
1722
|
+
const HEATMAP_AREA_CONTAINER_SELECTOR = `.${HEATMAP_AREA_CONTAINER_CLASS}`;
|
|
1723
|
+
const AREA_CONTAINER_STYLES = `
|
|
1724
|
+
position: absolute;
|
|
1725
|
+
top: 0;
|
|
1726
|
+
left: 0;
|
|
1727
|
+
width: 100%;
|
|
1728
|
+
height: 100%;
|
|
1729
|
+
pointer-events: none;
|
|
1730
|
+
z-index: 999999;
|
|
1731
|
+
`;
|
|
1732
|
+
const AREA_INNER_CONTAINER_STYLES = `
|
|
1733
|
+
position: relative;
|
|
1734
|
+
width: 100%;
|
|
1735
|
+
height: 100%;
|
|
1736
|
+
`;
|
|
1737
|
+
const AREA_COLOR_GRADIENT = [
|
|
1738
|
+
[0, 0, 255], // Blue
|
|
1739
|
+
[0, 255, 255], // Cyan
|
|
1740
|
+
[0, 255, 0], // Green
|
|
1741
|
+
[255, 255, 0], // Yellow
|
|
1742
|
+
[255, 0, 0], // Red
|
|
1743
|
+
];
|
|
1744
|
+
const AREA_RENDERER_SELECTORS = {
|
|
1745
|
+
containerAttribute: AREA_MAP_DIV_ATTRIBUTE,
|
|
1746
|
+
containerSelector: `[${AREA_MAP_DIV_ATTRIBUTE}]`,
|
|
1747
|
+
innerContainerClass: HEATMAP_AREA_CONTAINER_CLASS,
|
|
1748
|
+
innerContainerSelector: HEATMAP_AREA_CONTAINER_SELECTOR,
|
|
1749
|
+
};
|
|
1750
|
+
|
|
1751
|
+
const CALLOUT_PADDING = 0;
|
|
1752
|
+
const CALLOUT_ARROW_SIZE = 8;
|
|
1753
|
+
const CALLOUT_OFFSET = { x: -8, y: 0 };
|
|
1754
|
+
const CALLOUT_ALIGNMENT = 'left';
|
|
1755
|
+
const CLICKED_ELEMENT_ID_BASE = 'gx-hm-clicked-element';
|
|
1756
|
+
const SECONDARY_CLICKED_ELEMENT_ID_BASE = 'gx-hm-secondary-clicked-element';
|
|
1757
|
+
const HOVERED_ELEMENT_ID_BASE = 'gx-hm-hovered-element';
|
|
1758
|
+
const SECONDARY_HOVERED_ELEMENT_ID_BASE = 'gx-hm-secondary-hovered-element';
|
|
1759
|
+
const DEFAULT_POSITION_MODE = 'absolute';
|
|
1760
|
+
|
|
1701
1761
|
function isElementInViewport(elementRect, visualRef, scale) {
|
|
1702
1762
|
if (!elementRect)
|
|
1703
1763
|
return false;
|
|
@@ -1717,21 +1777,37 @@ function isElementInViewport(elementRect, visualRef, scale) {
|
|
|
1717
1777
|
// Element is visible if it overlaps with the viewport
|
|
1718
1778
|
return elementBottom > viewportTop && elementTop < viewportBottom;
|
|
1719
1779
|
}
|
|
1720
|
-
function isElementRectInViewport(
|
|
1721
|
-
|
|
1722
|
-
|
|
1780
|
+
function isElementRectInViewport(params) {
|
|
1781
|
+
const { candidate, options } = params;
|
|
1782
|
+
const { rectDimensions, visualViewport: visualRect, widthScale: scale, containerRect } = options;
|
|
1723
1783
|
if (!visualRect)
|
|
1724
1784
|
return false;
|
|
1725
|
-
|
|
1726
|
-
const
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1731
|
-
|
|
1785
|
+
const { calloutRect, targetAbsoluteRect } = rectDimensions;
|
|
1786
|
+
const { placement, horizontalAlign } = candidate;
|
|
1787
|
+
// candidate position (relative to element) scaled + element absolute position in iframe
|
|
1788
|
+
const offsetTop = (targetAbsoluteRect?.top ?? 0) * scale;
|
|
1789
|
+
const offsetLeft = (targetAbsoluteRect?.left ?? 0) * scale;
|
|
1790
|
+
// Base position in scroll space
|
|
1791
|
+
const baseTop = candidate.top * scale + offsetTop;
|
|
1792
|
+
const baseLeft = candidate.left * scale + offsetLeft;
|
|
1793
|
+
const { width: calloutWidth, height: calloutHeight } = calloutRect;
|
|
1794
|
+
const transformOffsetY = placement === 'top' ? calloutHeight * (scale - 1) : 0;
|
|
1795
|
+
const transformOffsetX = horizontalAlign !== 'left' ? calloutWidth * (scale - 1) : 0;
|
|
1796
|
+
const visualTop = baseTop + transformOffsetY + CALLOUT_ARROW_SIZE;
|
|
1797
|
+
const visualBottom = visualTop + calloutHeight;
|
|
1798
|
+
const visualLeft = baseLeft + transformOffsetX;
|
|
1799
|
+
const visualRight = visualLeft + calloutWidth;
|
|
1800
|
+
// Viewport bounds
|
|
1801
|
+
const scrollTop = visualRect?.scrollTop || 0;
|
|
1802
|
+
const scrollLeft = visualRect?.scrollLeft || 0;
|
|
1732
1803
|
const viewportTop = scrollTop;
|
|
1733
|
-
const viewportBottom = scrollTop +
|
|
1734
|
-
|
|
1804
|
+
const viewportBottom = scrollTop + visualRect.height;
|
|
1805
|
+
const viewportLeft = scrollLeft;
|
|
1806
|
+
const viewportRight = scrollLeft + (containerRect?.width ?? visualRect.width);
|
|
1807
|
+
// Check if element is fully within the visible viewport
|
|
1808
|
+
const isInVertical = visualTop > viewportTop && visualBottom < viewportBottom;
|
|
1809
|
+
const isInHorizontal = visualLeft > viewportLeft && visualRight < viewportRight;
|
|
1810
|
+
return isInVertical && isInHorizontal;
|
|
1735
1811
|
}
|
|
1736
1812
|
|
|
1737
1813
|
function isMobileDevice(userAgent) {
|
|
@@ -1740,18 +1816,6 @@ function isMobileDevice(userAgent) {
|
|
|
1740
1816
|
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
1817
|
}
|
|
1742
1818
|
|
|
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
1819
|
/**
|
|
1756
1820
|
* Get all elements at a specific point (x, y), with support for Shadow DOM
|
|
1757
1821
|
*/
|
|
@@ -2023,49 +2087,6 @@ const throttleRAF = (callback) => {
|
|
|
2023
2087
|
return throttled;
|
|
2024
2088
|
};
|
|
2025
2089
|
|
|
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
2090
|
/**
|
|
2070
2091
|
* Get color from click distribution percentage (0-100)
|
|
2071
2092
|
*/
|
|
@@ -2692,7 +2713,7 @@ const getContainerViewport = (containerElm, _scale) => {
|
|
|
2692
2713
|
if (containerElm) {
|
|
2693
2714
|
const containerRect = containerElm.getBoundingClientRect();
|
|
2694
2715
|
const width = containerRect.width;
|
|
2695
|
-
const height = containerRect.
|
|
2716
|
+
const height = containerRect.height;
|
|
2696
2717
|
return { width, height };
|
|
2697
2718
|
}
|
|
2698
2719
|
return {
|
|
@@ -2893,19 +2914,12 @@ const generateHorizontalPositionCandidates = (options) => {
|
|
|
2893
2914
|
});
|
|
2894
2915
|
};
|
|
2895
2916
|
const generateAllCandidates = (options) => {
|
|
2896
|
-
const { visualViewport, rectDimensions } = options;
|
|
2897
2917
|
const verticalCandidates = generateVerticalPositionCandidates(options);
|
|
2898
2918
|
const horizontalCandidates = generateHorizontalPositionCandidates(options);
|
|
2899
2919
|
const allCandidates = [...verticalCandidates, ...horizontalCandidates];
|
|
2900
|
-
// Thêm isVisibleInViewport cho mỗi candidate
|
|
2901
2920
|
return allCandidates.map((candidate) => ({
|
|
2902
2921
|
...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),
|
|
2922
|
+
isVisibleInViewport: isElementRectInViewport({ candidate, options }),
|
|
2909
2923
|
}));
|
|
2910
2924
|
};
|
|
2911
2925
|
|
|
@@ -2913,6 +2927,12 @@ const selectBestPosition = (candidates) => {
|
|
|
2913
2927
|
// return candidates.find((p) => p.valid && p.isVisibleInViewport) || candidates[0];
|
|
2914
2928
|
return candidates.find((p) => p.valid) || candidates[0];
|
|
2915
2929
|
};
|
|
2930
|
+
const selectBestPositionForClick = (candidates) => {
|
|
2931
|
+
return (candidates.find((p) => p.valid && p.isVisibleInViewport) ||
|
|
2932
|
+
candidates.find((p) => p.isVisibleInViewport) ||
|
|
2933
|
+
candidates.find((p) => p.valid) ||
|
|
2934
|
+
candidates[0]);
|
|
2935
|
+
};
|
|
2916
2936
|
const constrainToViewport = (candidate, options) => {
|
|
2917
2937
|
const { containerRect, padding, rectDimensions, viewport } = options;
|
|
2918
2938
|
const { calloutRect } = rectDimensions;
|
|
@@ -3025,7 +3045,7 @@ const calcCalloutPosition = (options) => {
|
|
|
3025
3045
|
};
|
|
3026
3046
|
};
|
|
3027
3047
|
const calcCalloutPositionAbsolute = (props) => {
|
|
3028
|
-
const { widthScale, calloutElm, containerElm, element, setPosition } = props;
|
|
3048
|
+
const { widthScale, calloutElm, containerElm, element, visualRef, setPosition } = props;
|
|
3029
3049
|
const mousePosition = element?.mousePosition;
|
|
3030
3050
|
if (!mousePosition)
|
|
3031
3051
|
return;
|
|
@@ -3056,28 +3076,57 @@ const calcCalloutPositionAbsolute = (props) => {
|
|
|
3056
3076
|
left: element.left,
|
|
3057
3077
|
},
|
|
3058
3078
|
};
|
|
3059
|
-
const
|
|
3079
|
+
const { viewportInfo } = calcPositionDetail({ element, widthScale, visualRef: visualRef ?? undefined });
|
|
3060
3080
|
const options = {
|
|
3061
3081
|
rectDimensions,
|
|
3062
|
-
viewport,
|
|
3082
|
+
viewport: viewportInfo,
|
|
3063
3083
|
alignment: CALLOUT_ALIGNMENT,
|
|
3064
3084
|
offset: CALLOUT_OFFSET,
|
|
3065
3085
|
padding,
|
|
3066
3086
|
arrowSize,
|
|
3067
3087
|
containerRect,
|
|
3068
3088
|
widthScale,
|
|
3089
|
+
visualViewport: viewportInfo,
|
|
3069
3090
|
};
|
|
3070
3091
|
const candidates = generateAllCandidates(options);
|
|
3071
|
-
const bestPosition =
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3092
|
+
const bestPosition = selectBestPositionForClick(candidates);
|
|
3093
|
+
setPosition(bestPosition);
|
|
3094
|
+
};
|
|
3095
|
+
const calcPositionDetail = ({ element, widthScale, visualRef }) => {
|
|
3096
|
+
const mousePosition = element.mousePosition;
|
|
3097
|
+
// visualRef = scrollable viewport (gx-hm-visual), clientWidth/Height = visible area
|
|
3098
|
+
const visual = visualRef?.current;
|
|
3099
|
+
const viewportInfo = {
|
|
3100
|
+
width: visual?.clientWidth ?? 0,
|
|
3101
|
+
height: visual?.clientHeight ?? 0,
|
|
3102
|
+
scrollTop: visual?.scrollTop ?? 0,
|
|
3103
|
+
scrollLeft: visual?.scrollLeft ?? 0,
|
|
3104
|
+
};
|
|
3105
|
+
const elementInfo = {
|
|
3106
|
+
...element,
|
|
3107
|
+
top: element.top * widthScale,
|
|
3108
|
+
left: element.left * widthScale,
|
|
3109
|
+
width: element.width * widthScale,
|
|
3110
|
+
height: element.height * widthScale,
|
|
3111
|
+
};
|
|
3112
|
+
const result = {
|
|
3113
|
+
elementInfo,
|
|
3114
|
+
viewportInfo,
|
|
3115
|
+
elementToIframe: { x: elementInfo.left, y: elementInfo.top },
|
|
3116
|
+
elementToViewport: { x: elementInfo.left - viewportInfo.scrollLeft, y: elementInfo.top - viewportInfo.scrollTop },
|
|
3117
|
+
};
|
|
3118
|
+
if (mousePosition) {
|
|
3119
|
+
// mousePosition is relative to the element (0,0 = top-left of element)
|
|
3120
|
+
const mx = mousePosition.x;
|
|
3121
|
+
const my = mousePosition.y;
|
|
3122
|
+
// Convert to iframe coordinate space
|
|
3123
|
+
const iframeMx = elementInfo.left + mx;
|
|
3124
|
+
const iframeMy = elementInfo.top + my;
|
|
3125
|
+
result.mouseToIframe = { x: iframeMx, y: iframeMy };
|
|
3126
|
+
result.mouseToElement = { x: mx, y: my };
|
|
3127
|
+
result.mouseToViewport = { x: iframeMx - viewportInfo.scrollLeft, y: iframeMy - viewportInfo.scrollTop };
|
|
3128
|
+
}
|
|
3129
|
+
return result;
|
|
3081
3130
|
};
|
|
3082
3131
|
|
|
3083
3132
|
function validateAreaCreation(dataInfo, hash, areas) {
|
|
@@ -3538,7 +3587,8 @@ const useClickmap = () => {
|
|
|
3538
3587
|
vizRef?.clearmap?.();
|
|
3539
3588
|
if (clickmap.length === 0)
|
|
3540
3589
|
return;
|
|
3541
|
-
|
|
3590
|
+
const win = vizRef.state.window;
|
|
3591
|
+
win.requestIdleCallback(() => vizRef?.clickmap?.(clickmap), { timeout: 300 });
|
|
3542
3592
|
}
|
|
3543
3593
|
catch (error) {
|
|
3544
3594
|
console.error(`useClickmap ~ error:`, error);
|
|
@@ -6746,9 +6796,8 @@ const useHeatmapIframeProcessor = () => {
|
|
|
6746
6796
|
const setIframeHeight = useHeatmapVizRectContext((s) => s.setIframeHeight);
|
|
6747
6797
|
const setIsDomLoaded = useHeatmapVizContext((s) => s.setIsDomLoaded);
|
|
6748
6798
|
const helperRef = useRef(null);
|
|
6749
|
-
const pendingRef = useRef(null);
|
|
6750
6799
|
const reset = useCallback(() => {
|
|
6751
|
-
|
|
6800
|
+
// implement
|
|
6752
6801
|
}, []);
|
|
6753
6802
|
const callStartIframe = useCallback((iframe, t0, abort) => {
|
|
6754
6803
|
startIframe({
|
|
@@ -6762,15 +6811,16 @@ const useHeatmapIframeProcessor = () => {
|
|
|
6762
6811
|
if (abort.signal.aborted)
|
|
6763
6812
|
return;
|
|
6764
6813
|
if (data.height)
|
|
6765
|
-
setIframeHeight(data.height);
|
|
6814
|
+
setIframeHeight(clampIframeHeight(data.height));
|
|
6766
6815
|
setIsDomLoaded(true);
|
|
6767
6816
|
helperRef.current?.startHeightObserver({
|
|
6768
6817
|
onHeightChange: (data) => {
|
|
6769
6818
|
if (abort.signal.aborted)
|
|
6770
6819
|
return;
|
|
6771
6820
|
if (data.height) {
|
|
6772
|
-
|
|
6773
|
-
|
|
6821
|
+
const height = clampIframeHeight(data.height);
|
|
6822
|
+
setIframeHeight(height);
|
|
6823
|
+
iframe.style.height = `${height}px`;
|
|
6774
6824
|
}
|
|
6775
6825
|
},
|
|
6776
6826
|
});
|
|
@@ -6778,24 +6828,10 @@ const useHeatmapIframeProcessor = () => {
|
|
|
6778
6828
|
});
|
|
6779
6829
|
}, [deviceType, shopId, viewport, setIframeHeight, setIsDomLoaded]);
|
|
6780
6830
|
const run = useCallback((iframe, t0, abort) => {
|
|
6781
|
-
if (viewport.width === 0 || viewport.height === 0) {
|
|
6782
|
-
pendingRef.current = { iframe, t0, abort };
|
|
6783
|
-
return;
|
|
6784
|
-
}
|
|
6785
|
-
callStartIframe(iframe, t0, abort);
|
|
6786
|
-
}, [callStartIframe, viewport]);
|
|
6787
|
-
// Retry when dims become available
|
|
6788
|
-
useEffect(() => {
|
|
6789
6831
|
if (viewport.width === 0 || viewport.height === 0)
|
|
6790
6832
|
return;
|
|
6791
|
-
if (!pendingRef.current)
|
|
6792
|
-
return;
|
|
6793
|
-
const { iframe, t0, abort } = pendingRef.current;
|
|
6794
|
-
pendingRef.current = null;
|
|
6795
|
-
if (abort.signal.aborted)
|
|
6796
|
-
return;
|
|
6797
6833
|
callStartIframe(iframe, t0, abort);
|
|
6798
|
-
}, [
|
|
6834
|
+
}, [callStartIframe, viewport]);
|
|
6799
6835
|
useEffect(() => {
|
|
6800
6836
|
return () => {
|
|
6801
6837
|
helperRef.current?.stop();
|
|
@@ -6805,6 +6841,7 @@ const useHeatmapIframeProcessor = () => {
|
|
|
6805
6841
|
return { run, reset };
|
|
6806
6842
|
};
|
|
6807
6843
|
// ── Helpers ───────────────────────────────────────────────────────────────────
|
|
6844
|
+
const clampIframeHeight = (height) => Math.min(height, HeatmapSetting.MaxHeight);
|
|
6808
6845
|
function startIframe({ helperRef, iframe, shopId, deviceType = EDeviceType.Desktop, size, t0, onSuccess, }) {
|
|
6809
6846
|
const docWidth = size.width ?? 0;
|
|
6810
6847
|
const docHeight = size.height ?? 0;
|
|
@@ -6825,7 +6862,8 @@ function startIframe({ helperRef, iframe, shopId, deviceType = EDeviceType.Deskt
|
|
|
6825
6862
|
onSuccess: (data) => {
|
|
6826
6863
|
perf$1.measure('IframeHelper processing', tHelper);
|
|
6827
6864
|
perf$1.measure('Total render', t0);
|
|
6828
|
-
|
|
6865
|
+
const height = clampIframeHeight(data.height);
|
|
6866
|
+
iframe.style.height = `${height}px`;
|
|
6829
6867
|
onSuccess(data);
|
|
6830
6868
|
},
|
|
6831
6869
|
});
|
|
@@ -7220,7 +7258,6 @@ const useWrapperRefHeight = (props) => {
|
|
|
7220
7258
|
updateWrapperHeight();
|
|
7221
7259
|
}
|
|
7222
7260
|
catch (error) {
|
|
7223
|
-
console.log(`🚀 🐥 ~ setupObservers ~ error:`, error);
|
|
7224
7261
|
console.warn('Cannot access wrapper content:', error);
|
|
7225
7262
|
}
|
|
7226
7263
|
};
|
|
@@ -8493,8 +8530,9 @@ const ElementCalloutOverlay = (props) => {
|
|
|
8493
8530
|
containerElm,
|
|
8494
8531
|
element,
|
|
8495
8532
|
setPosition,
|
|
8533
|
+
visualRef: props.visualRef,
|
|
8496
8534
|
});
|
|
8497
|
-
}, [element, widthScale, containerRef]);
|
|
8535
|
+
}, [element, widthScale, containerRef, props.visualRef]);
|
|
8498
8536
|
if (!element)
|
|
8499
8537
|
return null;
|
|
8500
8538
|
return (jsx("div", { ref: calloutRef, style: calloutStyle, className: "clarity-callout", children: CompElementCallout && jsx(CompElementCallout, { elementHash: element.hash }) }));
|
|
@@ -8539,7 +8577,7 @@ const ElementCalloutClickedComponent = (props) => {
|
|
|
8539
8577
|
if (!clickedElement)
|
|
8540
8578
|
return null;
|
|
8541
8579
|
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 }))] }));
|
|
8580
|
+
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
8581
|
};
|
|
8544
8582
|
const ElementCalloutClicked = memo(ElementCalloutClickedComponent);
|
|
8545
8583
|
|
|
@@ -9039,4 +9077,4 @@ const HeatmapLayout = ({ shopId, data, clickmap, clickAreas, scrollmap, attentio
|
|
|
9039
9077
|
}
|
|
9040
9078
|
};
|
|
9041
9079
|
|
|
9042
|
-
export { BACKDROP_CONFIG, DEFAULT_SIDEBAR_WIDTH, DEFAULT_VIEW_ID, DEFAULT_ZOOM_RATIO, EClickMode, EClickRankType, EClickType, EDeviceType, EHeatmapDataSource, EHeatmapMode, EHeatmapType, ELM_CALLOUT_CONFIG, EScrollType, GraphView, HEATMAP_CONFIG, HEATMAP_IFRAME, HEATMAP_STYLE, HeatmapLayout, ViewIdContext, Z_INDEX$1 as Z_INDEX, buildBuckets, compareViewPerformance, convertViewportToIframeCoords, createStorePerformanceTracker, createViewContextHook, decodeArrayClarity, decodeClarity, downloadPerformanceReport, getCompareViewId, getElementAtPoint, getElementHash, getMetricsByViewId, getPerformanceReportJSON, getScrollGradientColor, isElmInDataInfo, performanceLogger, printPerformanceSummary, scrollToElementIfNeeded, sendPerformanceReport, serializeAreas, trackStoreAction, useAreaCreation, useAreaEditMode, useAreaFilterVisible, useAreaHydration, useAreaInteraction, useAreaPositionsUpdater, useAreaRectSync, useAreaRendererContainer, useAreaTopAutoDetect, useClickedElement, useDebounceCallback, useElementCalloutVisible, useHeatmapAreaClickContext, useHeatmapCanvas, useHeatmapClickContext, useHeatmapCompareStore, useHeatmapConfigStore, useHeatmapCopyView, useHeatmapDataContext, useHeatmapEffects, useHeatmapElementPosition, useHeatmapHoverContext, useHeatmapLiveContext, useHeatmapRenderByMode, useHeatmapScale, useHeatmapScroll, useHeatmapScrollContext, useHeatmapSettingContext, useHeatmapViewportByDevice, useHeatmapVizContext, useHeatmapVizRectContext, useHoveredElement, useMeasureFunction, useRegisterConfig, useRegisterControl, useRegisterData, useRegisterHeatmap, useRenderCount, useScrollmapZones, useTrackHookCall, useViewIdContext, useVizLiveRender, useWhyDidYouUpdate, useWrapperRefHeight, useZonePositions, withPerformanceTracking };
|
|
9080
|
+
export { BACKDROP_CONFIG, DEFAULT_SIDEBAR_WIDTH, DEFAULT_VIEW_ID, DEFAULT_ZOOM_RATIO, EClickMode, EClickRankType, EClickType, EDeviceType, EHeatmapDataSource, EHeatmapMode, EHeatmapType, ELM_CALLOUT_CONFIG, EScrollType, GraphView, HEATMAP_CONFIG, HEATMAP_IFRAME, HEATMAP_STYLE, HeatmapLayout, HeatmapSetting, ViewIdContext, Z_INDEX$1 as Z_INDEX, buildBuckets, compareViewPerformance, convertViewportToIframeCoords, createStorePerformanceTracker, createViewContextHook, decodeArrayClarity, decodeClarity, downloadPerformanceReport, getCompareViewId, getElementAtPoint, getElementHash, getMetricsByViewId, getPerformanceReportJSON, getScrollGradientColor, isElmInDataInfo, performanceLogger, printPerformanceSummary, scrollToElementIfNeeded, sendPerformanceReport, serializeAreas, trackStoreAction, useAreaCreation, useAreaEditMode, useAreaFilterVisible, useAreaHydration, useAreaInteraction, useAreaPositionsUpdater, useAreaRectSync, useAreaRendererContainer, useAreaTopAutoDetect, useClickedElement, useDebounceCallback, useElementCalloutVisible, useHeatmapAreaClickContext, useHeatmapCanvas, useHeatmapClickContext, useHeatmapCompareStore, useHeatmapConfigStore, useHeatmapCopyView, useHeatmapDataContext, useHeatmapEffects, useHeatmapElementPosition, useHeatmapHoverContext, useHeatmapLiveContext, useHeatmapRenderByMode, useHeatmapScale, useHeatmapScroll, useHeatmapScrollContext, useHeatmapSettingContext, useHeatmapViewportByDevice, useHeatmapVizContext, useHeatmapVizRectContext, useHoveredElement, useMeasureFunction, useRegisterConfig, useRegisterControl, useRegisterData, useRegisterHeatmap, useRenderCount, useScrollmapZones, useTrackHookCall, useViewIdContext, useVizLiveRender, useWhyDidYouUpdate, useWrapperRefHeight, useZonePositions, withPerformanceTracking };
|