cryptique-sdk 1.2.13 → 1.2.14

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/lib/cjs/index.js CHANGED
@@ -7926,6 +7926,39 @@ if (window.Cryptique && window.Cryptique.initialized) ; else {
7926
7926
  initializeSDK();
7927
7927
  }
7928
7928
 
7929
+ // ============================================================================
7930
+ // HEATMAP IFRAME BRIDGE
7931
+ // When the SDK-instrumented page is embedded inside the Cryptique heatmap
7932
+ // viewer iframe, report the full document height to the parent so the canvas
7933
+ // overlay can be sized correctly (cross-origin pages cannot be read directly).
7934
+ // ============================================================================
7935
+ if (window.self !== window.top) {
7936
+ const _sendHeatmapDimensions = () => {
7937
+ try {
7938
+ const h = Math.max(
7939
+ document.body ? document.body.scrollHeight : 0,
7940
+ document.documentElement ? document.documentElement.scrollHeight : 0
7941
+ );
7942
+ if (h > 0) {
7943
+ window.parent.postMessage({ type: 'cryptique_heatmap_dimensions', document_height: h }, '*');
7944
+ }
7945
+ } catch (_) {}
7946
+ };
7947
+
7948
+ // Send once the DOM is fully painted
7949
+ if (document.readyState === 'complete') {
7950
+ _sendHeatmapDimensions();
7951
+ } else {
7952
+ window.addEventListener('load', _sendHeatmapDimensions);
7953
+ }
7954
+
7955
+ // Re-send whenever the page grows (lazy-loaded content, SPAs, accordions, etc.)
7956
+ try {
7957
+ const _heatmapRO = new ResizeObserver(_sendHeatmapDimensions);
7958
+ _heatmapRO.observe(document.documentElement);
7959
+ } catch (_) {}
7960
+ }
7961
+
7929
7962
  // ============================================================================
7930
7963
  // END OF SECTION 15
7931
7964
  // ============================================================================
package/lib/esm/index.js CHANGED
@@ -7924,6 +7924,39 @@ if (window.Cryptique && window.Cryptique.initialized) ; else {
7924
7924
  initializeSDK();
7925
7925
  }
7926
7926
 
7927
+ // ============================================================================
7928
+ // HEATMAP IFRAME BRIDGE
7929
+ // When the SDK-instrumented page is embedded inside the Cryptique heatmap
7930
+ // viewer iframe, report the full document height to the parent so the canvas
7931
+ // overlay can be sized correctly (cross-origin pages cannot be read directly).
7932
+ // ============================================================================
7933
+ if (window.self !== window.top) {
7934
+ const _sendHeatmapDimensions = () => {
7935
+ try {
7936
+ const h = Math.max(
7937
+ document.body ? document.body.scrollHeight : 0,
7938
+ document.documentElement ? document.documentElement.scrollHeight : 0
7939
+ );
7940
+ if (h > 0) {
7941
+ window.parent.postMessage({ type: 'cryptique_heatmap_dimensions', document_height: h }, '*');
7942
+ }
7943
+ } catch (_) {}
7944
+ };
7945
+
7946
+ // Send once the DOM is fully painted
7947
+ if (document.readyState === 'complete') {
7948
+ _sendHeatmapDimensions();
7949
+ } else {
7950
+ window.addEventListener('load', _sendHeatmapDimensions);
7951
+ }
7952
+
7953
+ // Re-send whenever the page grows (lazy-loaded content, SPAs, accordions, etc.)
7954
+ try {
7955
+ const _heatmapRO = new ResizeObserver(_sendHeatmapDimensions);
7956
+ _heatmapRO.observe(document.documentElement);
7957
+ } catch (_) {}
7958
+ }
7959
+
7927
7960
  // ============================================================================
7928
7961
  // END OF SECTION 15
7929
7962
  // ============================================================================
package/lib/umd/index.js CHANGED
@@ -7930,6 +7930,39 @@
7930
7930
  initializeSDK();
7931
7931
  }
7932
7932
 
7933
+ // ============================================================================
7934
+ // HEATMAP IFRAME BRIDGE
7935
+ // When the SDK-instrumented page is embedded inside the Cryptique heatmap
7936
+ // viewer iframe, report the full document height to the parent so the canvas
7937
+ // overlay can be sized correctly (cross-origin pages cannot be read directly).
7938
+ // ============================================================================
7939
+ if (window.self !== window.top) {
7940
+ const _sendHeatmapDimensions = () => {
7941
+ try {
7942
+ const h = Math.max(
7943
+ document.body ? document.body.scrollHeight : 0,
7944
+ document.documentElement ? document.documentElement.scrollHeight : 0
7945
+ );
7946
+ if (h > 0) {
7947
+ window.parent.postMessage({ type: 'cryptique_heatmap_dimensions', document_height: h }, '*');
7948
+ }
7949
+ } catch (_) {}
7950
+ };
7951
+
7952
+ // Send once the DOM is fully painted
7953
+ if (document.readyState === 'complete') {
7954
+ _sendHeatmapDimensions();
7955
+ } else {
7956
+ window.addEventListener('load', _sendHeatmapDimensions);
7957
+ }
7958
+
7959
+ // Re-send whenever the page grows (lazy-loaded content, SPAs, accordions, etc.)
7960
+ try {
7961
+ const _heatmapRO = new ResizeObserver(_sendHeatmapDimensions);
7962
+ _heatmapRO.observe(document.documentElement);
7963
+ } catch (_) {}
7964
+ }
7965
+
7933
7966
  // ============================================================================
7934
7967
  // END OF SECTION 15
7935
7968
  // ============================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cryptique-sdk",
3
- "version": "1.2.13",
3
+ "version": "1.2.14",
4
4
  "type": "module",
5
5
  "description": "Cryptique Analytics SDK - Comprehensive web analytics and user tracking for modern web applications",
6
6
  "main": "lib/cjs/index.js",