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

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/index.js CHANGED
@@ -5264,7 +5264,8 @@ async function runTracked(label, fn) {
5264
5264
  await fn();
5265
5265
  perf$3.measure(label, t);
5266
5266
  }
5267
- async function runPhase(phaseKey, methodName, entries, ctx) {
5267
+ async function runPhase(ctx, options) {
5268
+ const { phaseKey, methodName, entries } = options;
5268
5269
  await runTracked(`${phaseKey}.${methodName}`, async () => {
5269
5270
  for (const { name, fn } of entries) {
5270
5271
  logger.log(`[${methodName}] ${name}`);
@@ -5299,9 +5300,25 @@ function resolveFirstDimensions(ctx, candidates) {
5299
5300
  }
5300
5301
  // ── Pipeline ──────────────────────────────────────────────────────────────────
5301
5302
  async function run$1(ctx, activeGlobal, shopFix) {
5302
- await runPhase('phase1', 'beforeProcess', [...collectGlobalEntries(activeGlobal, 'beforeProcess'), ...shopEntry(shopFix, 'beforeProcess')], ctx);
5303
- await runPhase('phase2', 'process', collectGlobalEntries(activeGlobal, 'process'), ctx);
5304
- await runPhase('phase3', 'afterProcess', [...shopEntry(shopFix, 'afterProcess'), ...collectGlobalEntries(activeGlobal, 'afterProcess')], ctx);
5303
+ // [Phase 1]: beforeProcess (global shop)
5304
+ const beforeGlobalEntries = collectGlobalEntries(activeGlobal, 'beforeProcess');
5305
+ const beforeShopEntries = shopEntry(shopFix, 'beforeProcess');
5306
+ await runPhase(ctx, {
5307
+ phaseKey: 'phase1',
5308
+ methodName: 'beforeProcess',
5309
+ entries: [...beforeGlobalEntries, ...beforeShopEntries],
5310
+ });
5311
+ // [Phase 2]: process (global fixes)
5312
+ const processGlobalEntries = collectGlobalEntries(activeGlobal, 'process');
5313
+ await runPhase(ctx, { phaseKey: 'phase2', methodName: 'process', entries: [...processGlobalEntries] });
5314
+ // [Phase 3]: afterProcess (shop → global)
5315
+ const afterShopEntries = shopEntry(shopFix, 'afterProcess');
5316
+ const afterGlobalEntries = collectGlobalEntries(activeGlobal, 'afterProcess');
5317
+ await runPhase(ctx, {
5318
+ phaseKey: 'phase3',
5319
+ methodName: 'afterProcess',
5320
+ entries: [...afterShopEntries, ...afterGlobalEntries],
5321
+ });
5305
5322
  const t4 = perf$3.mark('phase4.getDimensions');
5306
5323
  await waitForAnimationFrame();
5307
5324
  const dimensions = resolveFirstDimensions(ctx, [
@@ -6612,7 +6629,7 @@ class GXVisualizer extends Visualizer {
6612
6629
  try {
6613
6630
  await this.setup(target, { version: cached.version, useproxy, portalCanvasId });
6614
6631
  doc.open();
6615
- doc.write(cached.html);
6632
+ doc.writeln(cached.html);
6616
6633
  doc.close();
6617
6634
  const process = async () => {
6618
6635
  this.layout.hydrate(doc);
@@ -6639,6 +6656,7 @@ class GXVisualizer extends Visualizer {
6639
6656
  const merged = this.mergeForHtml(decoded);
6640
6657
  await this.setup(target, { version: decoded[0].envelope.version, dom: merged.dom, useproxy, portalCanvasId });
6641
6658
  await this.renderLoop(this, { events: merged.events, target, useproxy });
6659
+ // if (hasVoidContainerChildren(target.document)) return this;
6642
6660
  const timestamp = Date.now();
6643
6661
  const version = decoded[0].envelope.version;
6644
6662
  const html = target.document.documentElement.outerHTML;
@@ -6650,6 +6668,7 @@ class GXVisualizer extends Visualizer {
6650
6668
  catch (e) {
6651
6669
  if (logerror)
6652
6670
  logerror(e);
6671
+ console.log(`[BuildHtmlForCache] Error:`, e);
6653
6672
  }
6654
6673
  return this;
6655
6674
  };
@@ -8780,7 +8799,7 @@ const VizDomRenderer = ({ mode }) => {
8780
8799
  const viewId = useViewIdContext();
8781
8800
  const viewport = useHeatmapViewportByDevice();
8782
8801
  const iframeHeight = useHeatmapVizRectContext((s) => s.iframeHeight);
8783
- const wrapperHeight = useHeatmapVizRectContext((s) => s.wrapperHeight);
8802
+ // const wrapperHeight = useHeatmapVizRectContext((s) => s.wrapperHeight);
8784
8803
  const wrapperRef = useRef(null);
8785
8804
  const visualRef = useRef(null);
8786
8805
  const { iframeRef } = useHeatmapRenderDom();
@@ -8791,7 +8810,7 @@ const VizDomRenderer = ({ mode }) => {
8791
8810
  const scrollTop = e.currentTarget.scrollTop;
8792
8811
  handleScroll(scrollTop);
8793
8812
  };
8794
- return (jsxs(WrapperVisual, { visualRef: visualRef, wrapperRef: wrapperRef, scaledHeight: scaledHeight, onScroll: onScroll, iframeHeight: iframeHeight, children: [jsx(VizClickmap, { iframeRef: iframeRef, visualRef: visualRef, wrapperRef: wrapperRef }), jsx("iframe", { ...HEATMAP_IFRAME, id: `clarity-iframe-${viewId}`, ref: iframeRef, width: viewport.width, height: wrapperHeight }), jsx(VizLoadingCanvas, {}), jsx(VizScrollMap, { visualRef: visualRef, iframeRef: iframeRef, wrapperRef: wrapperRef })] }));
8813
+ return (jsxs(WrapperVisual, { visualRef: visualRef, wrapperRef: wrapperRef, scaledHeight: scaledHeight, onScroll: onScroll, iframeHeight: iframeHeight, children: [jsx(VizClickmap, { iframeRef: iframeRef, visualRef: visualRef, wrapperRef: wrapperRef }), jsx("iframe", { ...HEATMAP_IFRAME, id: `clarity-iframe-${viewId}`, ref: iframeRef, width: viewport.width, height: viewport.height }), jsx(VizLoadingCanvas, {}), jsx(VizScrollMap, { visualRef: visualRef, iframeRef: iframeRef, wrapperRef: wrapperRef })] }));
8795
8814
  };
8796
8815
 
8797
8816
  const VizLoading = () => {
@@ -5264,7 +5264,8 @@ async function runTracked(label, fn) {
5264
5264
  await fn();
5265
5265
  perf$3.measure(label, t);
5266
5266
  }
5267
- async function runPhase(phaseKey, methodName, entries, ctx) {
5267
+ async function runPhase(ctx, options) {
5268
+ const { phaseKey, methodName, entries } = options;
5268
5269
  await runTracked(`${phaseKey}.${methodName}`, async () => {
5269
5270
  for (const { name, fn } of entries) {
5270
5271
  logger.log(`[${methodName}] ${name}`);
@@ -5299,9 +5300,25 @@ function resolveFirstDimensions(ctx, candidates) {
5299
5300
  }
5300
5301
  // ── Pipeline ──────────────────────────────────────────────────────────────────
5301
5302
  async function run$1(ctx, activeGlobal, shopFix) {
5302
- await runPhase('phase1', 'beforeProcess', [...collectGlobalEntries(activeGlobal, 'beforeProcess'), ...shopEntry(shopFix, 'beforeProcess')], ctx);
5303
- await runPhase('phase2', 'process', collectGlobalEntries(activeGlobal, 'process'), ctx);
5304
- await runPhase('phase3', 'afterProcess', [...shopEntry(shopFix, 'afterProcess'), ...collectGlobalEntries(activeGlobal, 'afterProcess')], ctx);
5303
+ // [Phase 1]: beforeProcess (global shop)
5304
+ const beforeGlobalEntries = collectGlobalEntries(activeGlobal, 'beforeProcess');
5305
+ const beforeShopEntries = shopEntry(shopFix, 'beforeProcess');
5306
+ await runPhase(ctx, {
5307
+ phaseKey: 'phase1',
5308
+ methodName: 'beforeProcess',
5309
+ entries: [...beforeGlobalEntries, ...beforeShopEntries],
5310
+ });
5311
+ // [Phase 2]: process (global fixes)
5312
+ const processGlobalEntries = collectGlobalEntries(activeGlobal, 'process');
5313
+ await runPhase(ctx, { phaseKey: 'phase2', methodName: 'process', entries: [...processGlobalEntries] });
5314
+ // [Phase 3]: afterProcess (shop → global)
5315
+ const afterShopEntries = shopEntry(shopFix, 'afterProcess');
5316
+ const afterGlobalEntries = collectGlobalEntries(activeGlobal, 'afterProcess');
5317
+ await runPhase(ctx, {
5318
+ phaseKey: 'phase3',
5319
+ methodName: 'afterProcess',
5320
+ entries: [...afterShopEntries, ...afterGlobalEntries],
5321
+ });
5305
5322
  const t4 = perf$3.mark('phase4.getDimensions');
5306
5323
  await waitForAnimationFrame();
5307
5324
  const dimensions = resolveFirstDimensions(ctx, [
@@ -6612,7 +6629,7 @@ class GXVisualizer extends Visualizer {
6612
6629
  try {
6613
6630
  await this.setup(target, { version: cached.version, useproxy, portalCanvasId });
6614
6631
  doc.open();
6615
- doc.write(cached.html);
6632
+ doc.writeln(cached.html);
6616
6633
  doc.close();
6617
6634
  const process = async () => {
6618
6635
  this.layout.hydrate(doc);
@@ -6639,6 +6656,7 @@ class GXVisualizer extends Visualizer {
6639
6656
  const merged = this.mergeForHtml(decoded);
6640
6657
  await this.setup(target, { version: decoded[0].envelope.version, dom: merged.dom, useproxy, portalCanvasId });
6641
6658
  await this.renderLoop(this, { events: merged.events, target, useproxy });
6659
+ // if (hasVoidContainerChildren(target.document)) return this;
6642
6660
  const timestamp = Date.now();
6643
6661
  const version = decoded[0].envelope.version;
6644
6662
  const html = target.document.documentElement.outerHTML;
@@ -6650,6 +6668,7 @@ class GXVisualizer extends Visualizer {
6650
6668
  catch (e) {
6651
6669
  if (logerror)
6652
6670
  logerror(e);
6671
+ console.log(`[BuildHtmlForCache] Error:`, e);
6653
6672
  }
6654
6673
  return this;
6655
6674
  };
@@ -8780,7 +8799,7 @@ const VizDomRenderer = ({ mode }) => {
8780
8799
  const viewId = useViewIdContext();
8781
8800
  const viewport = useHeatmapViewportByDevice();
8782
8801
  const iframeHeight = useHeatmapVizRectContext((s) => s.iframeHeight);
8783
- const wrapperHeight = useHeatmapVizRectContext((s) => s.wrapperHeight);
8802
+ // const wrapperHeight = useHeatmapVizRectContext((s) => s.wrapperHeight);
8784
8803
  const wrapperRef = useRef(null);
8785
8804
  const visualRef = useRef(null);
8786
8805
  const { iframeRef } = useHeatmapRenderDom();
@@ -8791,7 +8810,7 @@ const VizDomRenderer = ({ mode }) => {
8791
8810
  const scrollTop = e.currentTarget.scrollTop;
8792
8811
  handleScroll(scrollTop);
8793
8812
  };
8794
- return (jsxs(WrapperVisual, { visualRef: visualRef, wrapperRef: wrapperRef, scaledHeight: scaledHeight, onScroll: onScroll, iframeHeight: iframeHeight, children: [jsx(VizClickmap, { iframeRef: iframeRef, visualRef: visualRef, wrapperRef: wrapperRef }), jsx("iframe", { ...HEATMAP_IFRAME, id: `clarity-iframe-${viewId}`, ref: iframeRef, width: viewport.width, height: wrapperHeight }), jsx(VizLoadingCanvas, {}), jsx(VizScrollMap, { visualRef: visualRef, iframeRef: iframeRef, wrapperRef: wrapperRef })] }));
8813
+ return (jsxs(WrapperVisual, { visualRef: visualRef, wrapperRef: wrapperRef, scaledHeight: scaledHeight, onScroll: onScroll, iframeHeight: iframeHeight, children: [jsx(VizClickmap, { iframeRef: iframeRef, visualRef: visualRef, wrapperRef: wrapperRef }), jsx("iframe", { ...HEATMAP_IFRAME, id: `clarity-iframe-${viewId}`, ref: iframeRef, width: viewport.width, height: viewport.height }), jsx(VizLoadingCanvas, {}), jsx(VizScrollMap, { visualRef: visualRef, iframeRef: iframeRef, wrapperRef: wrapperRef })] }));
8795
8814
  };
8796
8815
 
8797
8816
  const VizLoading = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../../src/libs/iframe-processor/processors/viewport/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAQxD,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE9C;AA6DD,wBAAsB,GAAG,CACvB,GAAG,EAAE,kBAAkB,EACvB,YAAY,EAAE,SAAS,SAAS,EAAE,EAClC,OAAO,EAAE,eAAe,GAAG,IAAI,GAC9B,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CA2B5C"}
1
+ {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../../src/libs/iframe-processor/processors/viewport/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAQxD,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE9C;AAiED,wBAA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