@gemx-dev/heatmap-react 3.5.92-dev.26 → 3.5.92-dev.27

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.
@@ -1,4 +1,5 @@
1
- import type { ICalcCalloutPositionAbsoluteProps, ICalcCalloutPositionProps } from '../../types';
1
+ import type { ICalcCalloutPositionAbsoluteProps, ICalcCalloutPositionProps, ICalcPositionDetailProps, IPositionDetail } from '../../types';
2
2
  export declare const calcCalloutPosition: (options: ICalcCalloutPositionProps) => () => void;
3
3
  export declare const calcCalloutPositionAbsolute: (props: ICalcCalloutPositionAbsoluteProps) => void;
4
+ export declare const calcPositionDetail: ({ element, widthScale, visualRef }: ICalcPositionDetailProps) => IPositionDetail;
4
5
  //# sourceMappingURL=viz-elm.d.ts.map
@@ -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,EAM1B,MAAM,aAAa,CAAC;AAgErB,eAAO,MAAM,mBAAmB,GAAI,SAAS,yBAAyB,eAkDrE,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,OAAO,iCAAiC,SAiEnF,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,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"}
package/dist/esm/index.js CHANGED
@@ -4286,7 +4286,7 @@ function setup(doc, onChange) {
4286
4286
  function readCurrentHeight(s) {
4287
4287
  if (!s.iframe?.contentDocument || !s.iframe?.contentWindow)
4288
4288
  return 0;
4289
- const height = getFinalHeight(s.iframe.contentDocument, s.iframe.contentWindow);
4289
+ const height = getFinalHeight(s.iframe.contentDocument, false);
4290
4290
  s.logger.log('Height:', height);
4291
4291
  return height;
4292
4292
  }
@@ -4380,8 +4380,14 @@ function attachObserver(s) {
4380
4380
  return;
4381
4381
  }
4382
4382
  s.observerCleanup?.();
4383
- s.lastHeight = readCurrentHeight(s);
4384
- s.logger.log('Initial height:', s.lastHeight);
4383
+ const height = readCurrentHeight(s);
4384
+ s.logger.log('Initial height:', height);
4385
+ if (hasHeightChanged(s, height)) {
4386
+ processHeightChange(s, height);
4387
+ }
4388
+ else {
4389
+ s.lastHeight = height;
4390
+ }
4385
4391
  s.observerCleanup = setup(s.iframe.contentDocument, () => handleHeightChange(s));
4386
4392
  }
4387
4393
  function detachObserver(s) {
@@ -4286,7 +4286,7 @@ function setup(doc, onChange) {
4286
4286
  function readCurrentHeight(s) {
4287
4287
  if (!s.iframe?.contentDocument || !s.iframe?.contentWindow)
4288
4288
  return 0;
4289
- const height = getFinalHeight(s.iframe.contentDocument, s.iframe.contentWindow);
4289
+ const height = getFinalHeight(s.iframe.contentDocument, false);
4290
4290
  s.logger.log('Height:', height);
4291
4291
  return height;
4292
4292
  }
@@ -4380,8 +4380,14 @@ function attachObserver(s) {
4380
4380
  return;
4381
4381
  }
4382
4382
  s.observerCleanup?.();
4383
- s.lastHeight = readCurrentHeight(s);
4384
- s.logger.log('Initial height:', s.lastHeight);
4383
+ const height = readCurrentHeight(s);
4384
+ s.logger.log('Initial height:', height);
4385
+ if (hasHeightChanged(s, height)) {
4386
+ processHeightChange(s, height);
4387
+ }
4388
+ else {
4389
+ s.lastHeight = height;
4390
+ }
4385
4391
  s.observerCleanup = setup(s.iframe.contentDocument, () => handleHeightChange(s));
4386
4392
  }
4387
4393
  function detachObserver(s) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/libs/iframe-processor/processors/height-observer/index.ts"],"names":[],"mappings":"AACA;;;GAGG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAyO3E,wBAAgB,oBAAoB,IAAI,qBAAqB,CAkC5D;AAED,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC;AACnD,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAErC,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/libs/iframe-processor/processors/height-observer/index.ts"],"names":[],"mappings":"AACA;;;GAGG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA8O3E,wBAAgB,oBAAoB,IAAI,qBAAqB,CAkC5D;AAED,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC;AACnD,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAErC,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
@@ -75,6 +75,30 @@ export interface ICalcCalloutPositionProps {
75
75
  positionMode?: ICalloutPositionMode;
76
76
  visualRef?: IHeatmapRef['Visual'] | null;
77
77
  }
78
+ export type IPointCoord = {
79
+ x: number;
80
+ y: number;
81
+ };
82
+ export type ICalcPositionDetailProps = {
83
+ element: ElementInfo;
84
+ widthScale: number;
85
+ visualRef?: IHeatmapRef['Visual'];
86
+ };
87
+ export type IViewportInfo = {
88
+ width: number;
89
+ height: number;
90
+ scrollTop: number;
91
+ scrollLeft: number;
92
+ };
93
+ export type IPositionDetail = {
94
+ elementInfo: ElementInfo;
95
+ viewportInfo: IViewportInfo;
96
+ elementToIframe: IPointCoord;
97
+ elementToViewport: IPointCoord;
98
+ mouseToIframe?: IPointCoord;
99
+ mouseToElement?: IPointCoord;
100
+ mouseToViewport?: IPointCoord;
101
+ };
78
102
  export interface ICalcCalloutPositionAbsoluteProps {
79
103
  widthScale: number;
80
104
  padding?: number;
@@ -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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EAAE,oBAAoB,CAAC;IACpC,SAAS,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;CAC1C;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;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;CACnD"}
@@ -1,4 +1,5 @@
1
- import type { ICalcCalloutPositionAbsoluteProps, ICalcCalloutPositionProps } from '../../types';
1
+ import type { ICalcCalloutPositionAbsoluteProps, ICalcCalloutPositionProps, ICalcPositionDetailProps, IPositionDetail } from '../../types';
2
2
  export declare const calcCalloutPosition: (options: ICalcCalloutPositionProps) => () => void;
3
3
  export declare const calcCalloutPositionAbsolute: (props: ICalcCalloutPositionAbsoluteProps) => void;
4
+ export declare const calcPositionDetail: ({ element, widthScale, visualRef }: ICalcPositionDetailProps) => IPositionDetail;
4
5
  //# sourceMappingURL=viz-elm.d.ts.map
@@ -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,EAM1B,MAAM,aAAa,CAAC;AAgErB,eAAO,MAAM,mBAAmB,GAAI,SAAS,yBAAyB,eAkDrE,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,OAAO,iCAAiC,SAiEnF,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,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"}