@eric-emg/symphiq-components 1.2.494 → 1.2.495
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/fesm2022/symphiq-components.mjs +42 -7
- package/fesm2022/symphiq-components.mjs.map +1 -1
- package/index.d.ts +26 -26
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -93421,7 +93421,9 @@ class SymphiqProfileShopAnalysisDashboardComponent {
|
|
|
93421
93421
|
const hasCurrency = this.hasBillingCurrency();
|
|
93422
93422
|
const showPlans = this.showPlanSelection();
|
|
93423
93423
|
const hasScrolled = untracked(() => this.hasScrolledToPlanSelection());
|
|
93424
|
+
console.log('[ScrollToPlan] Effect triggered:', { hasCurrency, showPlans, hasScrolled });
|
|
93424
93425
|
if (hasCurrency && showPlans && !hasScrolled) {
|
|
93426
|
+
console.log('[ScrollToPlan] Conditions met, initiating scroll');
|
|
93425
93427
|
this.hasScrolledToPlanSelection.set(true);
|
|
93426
93428
|
this.scrollToPlanSelectionWithRetry();
|
|
93427
93429
|
}
|
|
@@ -93747,22 +93749,55 @@ class SymphiqProfileShopAnalysisDashboardComponent {
|
|
|
93747
93749
|
scrollToPlanSelectionWithRetry(attempts = 0) {
|
|
93748
93750
|
const maxAttempts = 10;
|
|
93749
93751
|
const container = this.planSelectionContainer?.nativeElement;
|
|
93752
|
+
const scrollEl = this.scrollElement();
|
|
93753
|
+
const isEmbedded = this.embedded();
|
|
93754
|
+
console.log('[ScrollToPlan] Retry attempt:', attempts, {
|
|
93755
|
+
containerFound: !!container,
|
|
93756
|
+
isEmbedded,
|
|
93757
|
+
hasScrollElement: !!scrollEl
|
|
93758
|
+
});
|
|
93750
93759
|
if (container) {
|
|
93751
93760
|
const journeyIndicatorHeight = 180;
|
|
93752
|
-
const headerOffset =
|
|
93761
|
+
const headerOffset = isEmbedded ? 60 : 0;
|
|
93753
93762
|
const totalOffset = journeyIndicatorHeight + headerOffset;
|
|
93754
|
-
|
|
93755
|
-
|
|
93756
|
-
|
|
93757
|
-
top
|
|
93758
|
-
|
|
93759
|
-
|
|
93763
|
+
if (isEmbedded && scrollEl) {
|
|
93764
|
+
const containerRect = container.getBoundingClientRect();
|
|
93765
|
+
const scrollElRect = scrollEl.getBoundingClientRect();
|
|
93766
|
+
const relativeTop = containerRect.top - scrollElRect.top + scrollEl.scrollTop;
|
|
93767
|
+
const offsetPosition = relativeTop - totalOffset;
|
|
93768
|
+
console.log('[ScrollToPlan] Embedded scroll to position:', offsetPosition, {
|
|
93769
|
+
containerRectTop: containerRect.top,
|
|
93770
|
+
scrollElRectTop: scrollElRect.top,
|
|
93771
|
+
scrollElScrollTop: scrollEl.scrollTop,
|
|
93772
|
+
totalOffset
|
|
93773
|
+
});
|
|
93774
|
+
scrollEl.scrollTo({
|
|
93775
|
+
top: offsetPosition,
|
|
93776
|
+
behavior: 'smooth'
|
|
93777
|
+
});
|
|
93778
|
+
}
|
|
93779
|
+
else {
|
|
93780
|
+
const elementPosition = container.getBoundingClientRect().top;
|
|
93781
|
+
const offsetPosition = elementPosition + window.scrollY - totalOffset;
|
|
93782
|
+
console.log('[ScrollToPlan] Window scroll to position:', offsetPosition, {
|
|
93783
|
+
elementPosition,
|
|
93784
|
+
windowScrollY: window.scrollY,
|
|
93785
|
+
totalOffset
|
|
93786
|
+
});
|
|
93787
|
+
window.scrollTo({
|
|
93788
|
+
top: offsetPosition,
|
|
93789
|
+
behavior: 'smooth'
|
|
93790
|
+
});
|
|
93791
|
+
}
|
|
93760
93792
|
}
|
|
93761
93793
|
else if (attempts < maxAttempts) {
|
|
93762
93794
|
setTimeout(() => {
|
|
93763
93795
|
this.scrollToPlanSelectionWithRetry(attempts + 1);
|
|
93764
93796
|
}, 100);
|
|
93765
93797
|
}
|
|
93798
|
+
else {
|
|
93799
|
+
console.log('[ScrollToPlan] Max attempts reached, container not found');
|
|
93800
|
+
}
|
|
93766
93801
|
}
|
|
93767
93802
|
onWindowScroll() {
|
|
93768
93803
|
this.headerScrollService.handleScroll(this.embedded());
|