@yoamigo.com/core 0.1.14 → 0.2.0

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/lib.js CHANGED
@@ -127,6 +127,7 @@ var BuilderSelectionManager = class {
127
127
  this.setupScrollResizeListeners();
128
128
  this.setupKeyboardListener();
129
129
  this.setupWheelForwarding();
130
+ this.setupHistoryInterception();
130
131
  this.notifyPageReady();
131
132
  window.addEventListener("popstate", () => this.notifyPageReady());
132
133
  }
@@ -445,6 +446,23 @@ var BuilderSelectionManager = class {
445
446
  }
446
447
  }, { passive: false });
447
448
  }
449
+ /**
450
+ * Intercept History API to detect SPA navigation
451
+ * Catches programmatic navigation (wouter, react-router, etc.)
452
+ * Standard pattern used by analytics tools like Google Analytics
453
+ */
454
+ setupHistoryInterception() {
455
+ const originalPushState = history.pushState.bind(history);
456
+ history.pushState = (...args) => {
457
+ originalPushState(...args);
458
+ this.notifyPageReady();
459
+ };
460
+ const originalReplaceState = history.replaceState.bind(history);
461
+ history.replaceState = (...args) => {
462
+ originalReplaceState(...args);
463
+ this.notifyPageReady();
464
+ };
465
+ }
448
466
  showHoverOverlay(element) {
449
467
  if (!this.hoverOverlay) return;
450
468
  const rect = element.getBoundingClientRect();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoamigo.com/core",
3
- "version": "0.1.14",
3
+ "version": "0.2.0",
4
4
  "description": "Core components, router, and utilities for YoAmigo templates",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",