@gemx-dev/heatmap-react 3.5.92-dev.24 → 3.5.92-dev.25

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.
Files changed (24) hide show
  1. package/dist/esm/hooks/viz-render/useHeatmapIframeProcessor.d.ts.map +1 -1
  2. package/dist/esm/index.js +166 -84
  3. package/dist/esm/index.mjs +166 -84
  4. package/dist/esm/libs/iframe-processor/lifecycle.d.ts +1 -0
  5. package/dist/esm/libs/iframe-processor/lifecycle.d.ts.map +1 -1
  6. package/dist/esm/libs/iframe-processor/orchestrator.d.ts +1 -0
  7. package/dist/esm/libs/iframe-processor/orchestrator.d.ts.map +1 -1
  8. package/dist/esm/libs/iframe-processor/processors/height-observer/index.d.ts.map +1 -1
  9. package/dist/esm/libs/iframe-processor/processors/height-observer/types.d.ts +4 -0
  10. package/dist/esm/libs/iframe-processor/processors/height-observer/types.d.ts.map +1 -1
  11. package/dist/esm/libs/iframe-processor/shared/iframe-types.d.ts +2 -0
  12. package/dist/esm/libs/iframe-processor/shared/iframe-types.d.ts.map +1 -1
  13. package/dist/umd/hooks/viz-render/useHeatmapIframeProcessor.d.ts.map +1 -1
  14. package/dist/umd/index.js +2 -2
  15. package/dist/umd/libs/iframe-processor/lifecycle.d.ts +1 -0
  16. package/dist/umd/libs/iframe-processor/lifecycle.d.ts.map +1 -1
  17. package/dist/umd/libs/iframe-processor/orchestrator.d.ts +1 -0
  18. package/dist/umd/libs/iframe-processor/orchestrator.d.ts.map +1 -1
  19. package/dist/umd/libs/iframe-processor/processors/height-observer/index.d.ts.map +1 -1
  20. package/dist/umd/libs/iframe-processor/processors/height-observer/types.d.ts +4 -0
  21. package/dist/umd/libs/iframe-processor/processors/height-observer/types.d.ts.map +1 -1
  22. package/dist/umd/libs/iframe-processor/shared/iframe-types.d.ts +2 -0
  23. package/dist/umd/libs/iframe-processor/shared/iframe-types.d.ts.map +1 -1
  24. package/package.json +1 -1
@@ -4224,6 +4224,30 @@ function createPerfTimer(config) {
4224
4224
  };
4225
4225
  }
4226
4226
 
4227
+ /**
4228
+ * Default iframe dimension calculation.
4229
+ * Used as fallback when no fix overrides getDimensions().
4230
+ */
4231
+ function getFinalHeight(doc, win) {
4232
+ void doc.body.offsetHeight; // trigger reflow
4233
+ // const bodyMinHeight = parseFloat(win.getComputedStyle(doc.body).minHeight) || 0;
4234
+ // const htmlMinHeight = parseFloat(win.getComputedStyle(doc.documentElement).minHeight) || 0;
4235
+ return Math.max(
4236
+ // doc.body?.scrollHeight || 0,
4237
+ // doc.body?.offsetHeight || 0,
4238
+ // doc.documentElement?.scrollHeight || 0,
4239
+ // doc.documentElement?.offsetHeight || 0,
4240
+ doc.documentElement?.clientHeight || 0);
4241
+ }
4242
+ function getFinalWidth(doc) {
4243
+ return Math.max(
4244
+ // doc.body?.scrollWidth || 0,
4245
+ // doc.body?.offsetWidth || 0,
4246
+ // doc.documentElement?.scrollWidth || 0,
4247
+ // doc.documentElement?.offsetWidth || 0,
4248
+ doc.documentElement?.clientWidth || 0);
4249
+ }
4250
+
4227
4251
  /**
4228
4252
  * DOM observation setup — ResizeObserver + MutationObserver.
4229
4253
  * Returns a cleanup function that disconnects both observers.
@@ -4248,36 +4272,74 @@ function setup(doc, onChange) {
4248
4272
  };
4249
4273
  }
4250
4274
 
4275
+ // cspell:ignore cooldown
4251
4276
  /**
4252
4277
  * Height Observer Processor
4253
4278
  * Background observer — watches for iframe content height changes.
4254
4279
  */
4255
- // ── Module-level functions ────────────────────────────────────────────────────
4256
- function clearTimers(s) {
4257
- if (s.throttleTimeout) {
4258
- clearTimeout(s.throttleTimeout);
4259
- s.throttleTimeout = null;
4280
+ // ── Helpers ───────────────────────────────────────────────────────────────────
4281
+ function readCurrentHeight(s) {
4282
+ if (!s.iframe?.contentDocument || !s.iframe?.contentWindow)
4283
+ return 0;
4284
+ const height = getFinalHeight(s.iframe.contentDocument, s.iframe.contentWindow);
4285
+ s.logger.log('Height:', height);
4286
+ return height;
4287
+ }
4288
+ function isBlocked(s) {
4289
+ return s.isProcessing || s.isCoolingDown || s.throttleTimeout !== null;
4290
+ }
4291
+ function hasHeightChanged(s, height) {
4292
+ return height !== s.lastHeight;
4293
+ }
4294
+ // ── Cooldown ──────────────────────────────────────────────────────────────────
4295
+ function startCooldown(s) {
4296
+ s.isCoolingDown = true;
4297
+ s.cooldownTimeout = setTimeout(() => {
4298
+ s.cooldownTimeout = null;
4299
+ s.isCoolingDown = false;
4300
+ }, s.cooldownMs);
4301
+ }
4302
+ function stopCooldown(s) {
4303
+ if (s.cooldownTimeout) {
4304
+ clearTimeout(s.cooldownTimeout);
4305
+ s.cooldownTimeout = null;
4260
4306
  }
4307
+ s.isCoolingDown = false;
4308
+ }
4309
+ // ── Debounce ──────────────────────────────────────────────────────────────────
4310
+ function cancelPendingDebounce(s) {
4261
4311
  if (s.debounceTimeout) {
4262
4312
  clearTimeout(s.debounceTimeout);
4263
4313
  s.debounceTimeout = null;
4264
4314
  }
4265
4315
  }
4266
- function getActualHeight(s) {
4267
- if (!s.iframe?.contentDocument)
4268
- return 0;
4269
- const { documentElement: docEl, body } = s.iframe.contentDocument;
4270
- const heights = [docEl.scrollHeight, docEl.offsetHeight, body.scrollHeight, body.offsetHeight];
4271
- const maxHeight = Math.max(...heights.filter((h) => h > 0));
4272
- s.logger.log('Height sources:', {
4273
- 'documentElement.scrollHeight': docEl.scrollHeight,
4274
- 'documentElement.offsetHeight': docEl.offsetHeight,
4275
- 'body.scrollHeight': body.scrollHeight,
4276
- 'body.offsetHeight': body.offsetHeight,
4277
- maxHeight,
4278
- });
4279
- return maxHeight;
4316
+ function processCurrentHeightIfChanged(s) {
4317
+ const height = readCurrentHeight(s);
4318
+ if (hasHeightChanged(s, height)) {
4319
+ processHeightChange(s, height);
4320
+ }
4321
+ }
4322
+ function scheduleDebounce(s) {
4323
+ cancelPendingDebounce(s);
4324
+ s.debounceTimeout = setTimeout(() => {
4325
+ s.debounceTimeout = null;
4326
+ processCurrentHeightIfChanged(s);
4327
+ }, s.debounceMs);
4280
4328
  }
4329
+ // ── Throttle ──────────────────────────────────────────────────────────────────
4330
+ function scheduleThrottledCheck(s) {
4331
+ s.throttleTimeout = setTimeout(() => {
4332
+ s.throttleTimeout = null;
4333
+ const height = readCurrentHeight(s);
4334
+ if (!hasHeightChanged(s, height)) {
4335
+ cancelPendingDebounce(s);
4336
+ return;
4337
+ }
4338
+ s.logger.log(`Height changed: ${s.lastHeight}px -> ${height}px`);
4339
+ scheduleDebounce(s);
4340
+ }, s.throttleMs);
4341
+ }
4342
+ // ── Core ──────────────────────────────────────────────────────────────────────
4281
4343
  async function processHeightChange(s, newHeight) {
4282
4344
  if (!s.iframe || !s.config)
4283
4345
  return;
@@ -4289,7 +4351,6 @@ async function processHeightChange(s, newHeight) {
4289
4351
  width: s.iframe.contentWindow?.innerWidth ?? 0,
4290
4352
  };
4291
4353
  s.lastHeight = newHeight;
4292
- s.logger.log('Height change processed:', result);
4293
4354
  s.config.onHeightChange?.(result);
4294
4355
  window.dispatchEvent(new CustomEvent('iframe-dimensions-applied', { detail: result }));
4295
4356
  }
@@ -4299,46 +4360,59 @@ async function processHeightChange(s, newHeight) {
4299
4360
  }
4300
4361
  finally {
4301
4362
  s.isProcessing = false;
4363
+ if (s.cooldownMs > 0)
4364
+ startCooldown(s);
4302
4365
  }
4303
4366
  }
4304
4367
  function handleHeightChange(s) {
4305
- if (s.isProcessing || s.throttleTimeout)
4368
+ if (isBlocked(s))
4306
4369
  return;
4307
- s.throttleTimeout = setTimeout(() => {
4308
- s.throttleTimeout = null;
4309
- const currentHeight = getActualHeight(s);
4310
- if (currentHeight === s.lastHeight) {
4311
- // Height returned to known state — cancel any stale pending debounce
4312
- // to prevent it from firing with an outdated height and corrupting lastHeight.
4313
- if (s.debounceTimeout) {
4314
- clearTimeout(s.debounceTimeout);
4315
- s.debounceTimeout = null;
4316
- }
4317
- return;
4318
- }
4319
- s.logger.log(`Height changed: ${s.lastHeight}px -> ${currentHeight}px`);
4320
- if (s.debounceTimeout)
4321
- clearTimeout(s.debounceTimeout);
4322
- s.debounceTimeout = setTimeout(() => {
4323
- s.debounceTimeout = null;
4324
- // Re-read height at dispatch time to avoid using a stale closure value.
4325
- const finalHeight = getActualHeight(s);
4326
- if (finalHeight !== s.lastHeight) {
4327
- processHeightChange(s, finalHeight);
4328
- }
4329
- }, s.debounceMs);
4330
- }, s.throttleMs);
4370
+ scheduleThrottledCheck(s);
4331
4371
  }
4332
- function observe(s) {
4372
+ function attachObserver(s) {
4333
4373
  if (!s.iframe?.contentDocument?.body) {
4334
4374
  s.logger.warn('Cannot observe height changes: iframe body not found');
4335
4375
  return;
4336
4376
  }
4337
4377
  s.observerCleanup?.();
4338
- s.lastHeight = getActualHeight(s);
4378
+ s.lastHeight = readCurrentHeight(s);
4339
4379
  s.logger.log('Initial height:', s.lastHeight);
4340
4380
  s.observerCleanup = setup(s.iframe.contentDocument, () => handleHeightChange(s));
4341
4381
  }
4382
+ function detachObserver(s) {
4383
+ s.observerCleanup?.();
4384
+ s.observerCleanup = null;
4385
+ }
4386
+ function clearAllTimers(s) {
4387
+ if (s.throttleTimeout) {
4388
+ clearTimeout(s.throttleTimeout);
4389
+ s.throttleTimeout = null;
4390
+ }
4391
+ if (s.debounceTimeout) {
4392
+ clearTimeout(s.debounceTimeout);
4393
+ s.debounceTimeout = null;
4394
+ }
4395
+ if (s.startDelayTimeout) {
4396
+ clearTimeout(s.startDelayTimeout);
4397
+ s.startDelayTimeout = null;
4398
+ }
4399
+ stopCooldown(s);
4400
+ }
4401
+ // ── Lifecycle ─────────────────────────────────────────────────────────────────
4402
+ function observeImmediately(s) {
4403
+ attachObserver(s);
4404
+ s.logger.log('Height observer started');
4405
+ }
4406
+ function observeAfterDelay(s, delayMs) {
4407
+ s.logger.log(`Height observer will start in ${delayMs}ms`);
4408
+ s.startDelayTimeout = setTimeout(() => {
4409
+ s.startDelayTimeout = null;
4410
+ if (!s.running)
4411
+ return;
4412
+ attachObserver(s);
4413
+ s.logger.log('Height observer started (after delay)');
4414
+ }, delayMs);
4415
+ }
4342
4416
  function start$5(s, iframe, cfg) {
4343
4417
  if (s.running) {
4344
4418
  s.logger.warn('Observer is already running. Call stop() first.');
@@ -4348,27 +4422,32 @@ function start$5(s, iframe, cfg) {
4348
4422
  s.config = cfg;
4349
4423
  s.throttleMs = cfg.throttleMs ?? 25;
4350
4424
  s.debounceMs = cfg.debounceMs ?? 500;
4425
+ s.cooldownMs = cfg.cooldownMs ?? 0;
4351
4426
  s.running = true;
4352
- observe(s);
4353
- s.logger.log('Height observer started');
4427
+ const startDelayMs = cfg.startDelayMs ?? 0;
4428
+ if (startDelayMs > 0) {
4429
+ observeAfterDelay(s, startDelayMs);
4430
+ }
4431
+ else {
4432
+ observeImmediately(s);
4433
+ }
4354
4434
  }
4355
4435
  function stop$5(s) {
4356
4436
  if (!s.running)
4357
4437
  return;
4358
- s.observerCleanup?.();
4359
- s.observerCleanup = null;
4360
- clearTimers(s);
4438
+ detachObserver(s);
4439
+ clearAllTimers(s);
4361
4440
  s.iframe = null;
4362
4441
  s.config = null;
4363
4442
  s.lastHeight = 0;
4364
4443
  s.isProcessing = false;
4444
+ s.isCoolingDown = false;
4365
4445
  s.running = false;
4366
4446
  s.logger.log('Height observer stopped');
4367
4447
  }
4368
4448
  function clear(s) {
4369
- s.observerCleanup?.();
4370
- s.observerCleanup = null;
4371
- clearTimers(s);
4449
+ detachObserver(s);
4450
+ clearAllTimers(s);
4372
4451
  s.lastHeight = 0;
4373
4452
  s.isProcessing = false;
4374
4453
  }
@@ -4382,6 +4461,8 @@ function updateConfig$3(s, cfg) {
4382
4461
  s.throttleMs = cfg.throttleMs;
4383
4462
  if (cfg.debounceMs !== undefined)
4384
4463
  s.debounceMs = cfg.debounceMs;
4464
+ if (cfg.cooldownMs !== undefined)
4465
+ s.cooldownMs = cfg.cooldownMs;
4385
4466
  s.logger.configure({ enabled: !!s.config.debug });
4386
4467
  s.logger.log('Config updated');
4387
4468
  }
@@ -4395,15 +4476,19 @@ function createHeightObserver() {
4395
4476
  lastHeight: 0,
4396
4477
  throttleTimeout: null,
4397
4478
  debounceTimeout: null,
4479
+ startDelayTimeout: null,
4480
+ cooldownTimeout: null,
4398
4481
  isProcessing: false,
4482
+ isCoolingDown: false,
4399
4483
  throttleMs: 25,
4400
4484
  debounceMs: 500,
4485
+ cooldownMs: 0,
4401
4486
  running: false,
4402
4487
  };
4403
4488
  return {
4404
4489
  start: (iframe, cfg) => start$5(s, iframe, cfg),
4405
4490
  stop: () => stop$5(s),
4406
- observe: () => observe(s),
4491
+ observe: () => attachObserver(s),
4407
4492
  clear: () => clear(s),
4408
4493
  updateConfig: (cfg) => updateConfig$3(s, cfg),
4409
4494
  getCurrentHeight: () => s.lastHeight,
@@ -5150,20 +5235,6 @@ register$1({
5150
5235
  afterProcess,
5151
5236
  });
5152
5237
 
5153
- /**
5154
- * Default iframe dimension calculation.
5155
- * Used as fallback when no fix overrides getDimensions().
5156
- */
5157
- function getFinalHeight(doc, win) {
5158
- void doc.body.offsetHeight; // trigger reflow
5159
- const bodyMinHeight = parseFloat(win.getComputedStyle(doc.body).minHeight) || 0;
5160
- const htmlMinHeight = parseFloat(win.getComputedStyle(doc.documentElement).minHeight) || 0;
5161
- return Math.max(doc.body?.scrollHeight || 0, doc.body?.offsetHeight || 0, doc.documentElement?.scrollHeight || 0, doc.documentElement?.offsetHeight || 0, doc.documentElement?.clientHeight || 0, bodyMinHeight, htmlMinHeight);
5162
- }
5163
- function getFinalWidth(doc) {
5164
- return Math.max(doc.body?.scrollWidth || 0, doc.body?.offsetWidth || 0, doc.documentElement?.scrollWidth || 0, doc.documentElement?.offsetWidth || 0, doc.documentElement?.clientWidth || 0);
5165
- }
5166
-
5167
5238
  /**
5168
5239
  * Viewport fix pipeline runner.
5169
5240
  *
@@ -5445,20 +5516,6 @@ async function process(s) {
5445
5516
  perf$3.endSession();
5446
5517
  s.logger.groupEnd();
5447
5518
  s.logger.log('Process completed:', result);
5448
- s.heightObserver.stop();
5449
- s.heightObserver.start(s.iframe, {
5450
- iframe: s.iframe,
5451
- debug: s.config.debug,
5452
- throttleMs: 25,
5453
- debounceMs: 500,
5454
- onHeightChange: (result) => {
5455
- s.config?.onSuccess?.(result);
5456
- dispatchDimensionsEvent(result);
5457
- },
5458
- onError: (error) => {
5459
- s.config?.onError?.(error);
5460
- },
5461
- });
5462
5519
  s.config.onSuccess?.(result);
5463
5520
  dispatchDimensionsEvent(result);
5464
5521
  }
@@ -5510,6 +5567,26 @@ function stop$1(s) {
5510
5567
  s.running = false;
5511
5568
  s.logger.log('Stopped');
5512
5569
  }
5570
+ function startHeightObserver(s) {
5571
+ if (!s.iframe || !s.config)
5572
+ return;
5573
+ s.heightObserver.stop();
5574
+ s.heightObserver.start(s.iframe, {
5575
+ iframe: s.iframe,
5576
+ debug: s.config.debug,
5577
+ throttleMs: 25,
5578
+ debounceMs: 500,
5579
+ cooldownMs: 1000,
5580
+ startDelayMs: s.config.heightObserverStartDelayMs,
5581
+ onHeightChange: (result) => {
5582
+ s.config?.onSuccess?.(result);
5583
+ dispatchDimensionsEvent(result);
5584
+ },
5585
+ onError: (error) => {
5586
+ s.config?.onError?.(error);
5587
+ },
5588
+ });
5589
+ }
5513
5590
  async function recalculate$1(s) {
5514
5591
  if (!s.running) {
5515
5592
  s.logger.warn('Fixer is not running.');
@@ -5548,6 +5625,7 @@ function createOrchestrator() {
5548
5625
  enableNavigationBlockingMessage: () => s.navigationBlocker.enableMessage(),
5549
5626
  disableNavigationBlocking: () => s.navigationBlocker.disable(),
5550
5627
  disableNavigationBlockingMessage: () => s.navigationBlocker.disableMessage(),
5628
+ startHeightObserver: () => startHeightObserver(s),
5551
5629
  isRunning: () => s.running,
5552
5630
  getStateInfo: () => ({
5553
5631
  isRunning: s.running,
@@ -5606,6 +5684,7 @@ function createIframeHelper() {
5606
5684
  stop: () => stop(s),
5607
5685
  recalculate: () => recalculate(s),
5608
5686
  enableNavigationBlocking: () => enableNavigationBlocking(s),
5687
+ startHeightObserver: () => s.fixer.startHeightObserver(),
5609
5688
  isRunning: () => s.running,
5610
5689
  };
5611
5690
  }
@@ -6637,6 +6716,7 @@ const useHeatmapIframeProcessor = () => {
6637
6716
  if (height)
6638
6717
  setIframeHeight(height);
6639
6718
  setIsDomLoaded(true);
6719
+ helperRef.current?.startHeightObserver();
6640
6720
  },
6641
6721
  });
6642
6722
  }, [deviceType]);
@@ -6663,6 +6743,7 @@ const useHeatmapIframeProcessor = () => {
6663
6743
  if (height)
6664
6744
  setIframeHeight(height);
6665
6745
  setIsDomLoaded(true);
6746
+ helperRef.current?.startHeightObserver();
6666
6747
  },
6667
6748
  });
6668
6749
  }, [viewport]); // eslint-disable-line react-hooks/exhaustive-deps
@@ -6691,6 +6772,7 @@ function startIframe({ helperRef, iframe, shopId, deviceType = EDeviceType.Deskt
6691
6772
  iframe,
6692
6773
  debug: true,
6693
6774
  shopId,
6775
+ heightObserverStartDelayMs: 1000,
6694
6776
  onSuccess: (data) => {
6695
6777
  perf$1.measure('IframeHelper processing', tHelper);
6696
6778
  perf$1.measure('Total render', t0);
@@ -11,6 +11,7 @@ export interface IframeHelperFactory extends LifecycleFactory {
11
11
  stop(): void;
12
12
  recalculate(): Promise<void>;
13
13
  enableNavigationBlocking(): void;
14
+ startHeightObserver(): void;
14
15
  isRunning(): boolean;
15
16
  }
16
17
  export declare function createIframeHelper(): IframeHelperFactory;
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/libs/iframe-processor/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM/D,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,KAAK,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACvC,IAAI,IAAI,IAAI,CAAC;IACb,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,wBAAwB,IAAI,IAAI,CAAC;IACjC,SAAS,IAAI,OAAO,CAAC;CACtB;AA4CD,wBAAgB,kBAAkB,IAAI,mBAAmB,CAaxD;AAED,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC"}
1
+ {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/libs/iframe-processor/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM/D,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,KAAK,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACvC,IAAI,IAAI,IAAI,CAAC;IACb,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,wBAAwB,IAAI,IAAI,CAAC;IACjC,mBAAmB,IAAI,IAAI,CAAC;IAC5B,SAAS,IAAI,OAAO,CAAC;CACtB;AA4CD,wBAAgB,kBAAkB,IAAI,mBAAmB,CAcxD;AAED,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC"}
@@ -7,6 +7,7 @@ export interface OrchestratorFactory extends LifecycleFactory {
7
7
  enableNavigationBlockingMessage(): void;
8
8
  disableNavigationBlocking(): void;
9
9
  disableNavigationBlockingMessage(): void;
10
+ startHeightObserver(): void;
10
11
  getStateInfo(): Record<string, unknown>;
11
12
  }
12
13
  export declare function createOrchestrator(): OrchestratorFactory;
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/libs/iframe-processor/orchestrator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAA0B,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAWvF,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IACpD,wBAAwB,IAAI,IAAI,CAAC;IACjC,+BAA+B,IAAI,IAAI,CAAC;IACxC,yBAAyB,IAAI,IAAI,CAAC;IAClC,gCAAgC,IAAI,IAAI,CAAC;IACzC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAqID,wBAAgB,kBAAkB,IAAI,mBAAmB,CA+BxD;AAED,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC"}
1
+ {"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/libs/iframe-processor/orchestrator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAA0B,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAWvF,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IACpD,wBAAwB,IAAI,IAAI,CAAC;IACjC,+BAA+B,IAAI,IAAI,CAAC;IACxC,yBAAyB,IAAI,IAAI,CAAC;IAClC,gCAAgC,IAAI,IAAI,CAAC;IACzC,mBAAmB,IAAI,IAAI,CAAC;IAC5B,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AA0ID,wBAAgB,kBAAkB,IAAI,mBAAmB,CAgCxD;AAED,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/libs/iframe-processor/processors/height-observer/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA8J3E,wBAAgB,oBAAoB,IAAI,qBAAqB,CA8B5D;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;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"}
@@ -5,6 +5,10 @@ export interface HeightObserverConfig {
5
5
  debug?: boolean;
6
6
  throttleMs?: number;
7
7
  debounceMs?: number;
8
+ /** Delay (ms) before the observer starts watching after start() is called */
9
+ startDelayMs?: number;
10
+ /** Cooldown (ms) after a height change is processed before the next one can trigger */
11
+ cooldownMs?: number;
8
12
  onHeightChange?: (result: IframeDimensionsDetail) => void;
9
13
  onError?: (error: Error) => void;
10
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/libs/iframe-processor/processors/height-observer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC1D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,KAAK,CAAC,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAClE,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,IAAI,IAAI,CAAC;IAChB,KAAK,IAAI,IAAI,CAAC;IACd,gBAAgB,IAAI,MAAM,CAAC;IAC3B,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;IACvD,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1D"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/libs/iframe-processor/processors/height-observer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC1D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,KAAK,CAAC,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAClE,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,IAAI,IAAI,CAAC;IAChB,KAAK,IAAI,IAAI,CAAC;IACd,gBAAgB,IAAI,MAAM,CAAC;IAC3B,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;IACvD,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1D"}
@@ -7,6 +7,8 @@ export interface IframeStyleConfig {
7
7
  targetHeight: number;
8
8
  /** Shop identifier (numeric ID or myshopify domain) used for per-shop viewport fixes */
9
9
  shopId?: string | number;
10
+ /** Delay (ms) before the height observer starts after DOM is loaded */
11
+ heightObserverStartDelayMs?: number;
10
12
  onSuccess?: (result: {
11
13
  height: number;
12
14
  width: number;
@@ -1 +1 @@
1
- {"version":3,"file":"iframe-types.d.ts","sourceRoot":"","sources":["../../../../src/libs/iframe-processor/shared/iframe-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE,WAAW,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"iframe-types.d.ts","sourceRoot":"","sources":["../../../../src/libs/iframe-processor/shared/iframe-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE,WAAW,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,uEAAuE;IACvE,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -1 +1 @@
1
- {"version":3,"file":"useHeatmapIframeProcessor.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-render/useHeatmapIframeProcessor.ts"],"names":[],"mappings":"AAgCA,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,6BAuE5C,CAAC"}
1
+ {"version":3,"file":"useHeatmapIframeProcessor.d.ts","sourceRoot":"","sources":["../../../src/hooks/viz-render/useHeatmapIframeProcessor.ts"],"names":[],"mappings":"AAgCA,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,6BAyE5C,CAAC"}