@eric-emg/symphiq-components 1.2.50 → 1.2.51

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.
@@ -21601,33 +21601,33 @@ class SymphiqFunnelAnalysisDashboardComponent {
21601
21601
  effect(() => {
21602
21602
  this.searchService.setData(this.allMetrics(), this.insights(), this.allBreakdowns());
21603
21603
  });
21604
- // Handle scroll events from parent
21604
+ // Handle scroll events from parent - unified scroll event handler for ALL features
21605
21605
  effect(() => {
21606
21606
  const scrollEvent = this.scrollEvent();
21607
21607
  const isEmbedded = this.embedded();
21608
- console.log('[SCROLL v6] Effect triggered', {
21608
+ console.log('[SCROLL v7] Effect triggered', {
21609
21609
  hasScrollEvent: !!scrollEvent,
21610
21610
  isEmbedded,
21611
21611
  scrollEventType: scrollEvent?.type,
21612
21612
  scrollEventDetail: scrollEvent?.detail
21613
21613
  });
21614
21614
  if (!scrollEvent) {
21615
- console.log('[SCROLL v6] No scroll event provided');
21615
+ console.log('[SCROLL v7] No scroll event provided');
21616
21616
  return;
21617
21617
  }
21618
21618
  if (!isEmbedded) {
21619
- console.log('[SCROLL v6] Not in embedded mode, ignoring scroll event');
21619
+ console.log('[SCROLL v7] Not in embedded mode, ignoring scroll event');
21620
21620
  return;
21621
21621
  }
21622
21622
  const detail = scrollEvent.detail;
21623
21623
  if (!detail) {
21624
- console.log('[SCROLL v6] No detail in scroll event');
21624
+ console.log('[SCROLL v7] No detail in scroll event');
21625
21625
  return;
21626
21626
  }
21627
21627
  const scrollTop = detail.scrollTop || 0;
21628
21628
  const scrollLeft = detail.scrollLeft || 0;
21629
21629
  const isScrolling = detail.isScrolling;
21630
- console.log('[SCROLL v6] Processing scroll event', {
21630
+ console.log('[SCROLL v7] Processing scroll event', {
21631
21631
  scrollTop,
21632
21632
  scrollLeft,
21633
21633
  isScrolling,
@@ -21636,29 +21636,109 @@ class SymphiqFunnelAnalysisDashboardComponent {
21636
21636
  });
21637
21637
  // Skip during programmatic scrolling
21638
21638
  if (this.isProgrammaticScroll) {
21639
- console.log('[SCROLL v6] Skipping - programmatic scroll in progress');
21639
+ console.log('[SCROLL v7] Skipping - programmatic scroll in progress');
21640
21640
  return;
21641
21641
  }
21642
- // Simple threshold-based state changes with hysteresis
21643
- const COLLAPSE_THRESHOLD = 50;
21644
- const EXPAND_THRESHOLD = 30;
21642
+ // ========================================
21643
+ // FEATURE 1: Header Collapse/Expand
21644
+ // ========================================
21645
+ const COLLAPSE_THRESHOLD = 20;
21646
+ const EXPAND_THRESHOLD = 10;
21645
21647
  const currentState = this.isScrolled();
21646
21648
  if (!currentState && scrollTop > COLLAPSE_THRESHOLD) {
21647
- console.log('[SCROLL v6] ✓ COLLAPSING HEADER', { scrollTop, threshold: COLLAPSE_THRESHOLD });
21649
+ console.log('[SCROLL v7] ✓ COLLAPSING HEADER', { scrollTop, threshold: COLLAPSE_THRESHOLD });
21648
21650
  this.isScrolled.set(true);
21649
21651
  }
21650
21652
  else if (currentState && scrollTop < EXPAND_THRESHOLD) {
21651
- console.log('[SCROLL v6] ✓ EXPANDING HEADER', { scrollTop, threshold: EXPAND_THRESHOLD });
21653
+ console.log('[SCROLL v7] ✓ EXPANDING HEADER', { scrollTop, threshold: EXPAND_THRESHOLD });
21652
21654
  this.isScrolled.set(false);
21653
21655
  }
21654
21656
  else {
21655
- console.log('[SCROLL v6] No state change needed', {
21657
+ console.log('[SCROLL v7] No header state change needed', {
21656
21658
  currentState: currentState ? 'collapsed' : 'expanded',
21657
21659
  scrollTop,
21658
21660
  collapseThreshold: COLLAPSE_THRESHOLD,
21659
21661
  expandThreshold: EXPAND_THRESHOLD
21660
21662
  });
21661
21663
  }
21664
+ // ========================================
21665
+ // FEATURE 2: Progress Bar Calculation
21666
+ // ========================================
21667
+ // Calculate scroll progress using the scroll event target element
21668
+ if (scrollEvent.target) {
21669
+ const target = scrollEvent.target;
21670
+ const scrollHeight = target.scrollHeight || 0;
21671
+ const clientHeight = target.clientHeight || 0;
21672
+ const maxScroll = scrollHeight - clientHeight;
21673
+ if (maxScroll > 0) {
21674
+ const progress = (scrollTop / maxScroll) * 100;
21675
+ this.scrollProgress.set(Math.min(100, Math.max(0, progress)));
21676
+ console.log('[SCROLL v7] ✓ Progress bar updated', {
21677
+ progress: progress.toFixed(2),
21678
+ scrollTop,
21679
+ scrollHeight,
21680
+ clientHeight,
21681
+ maxScroll
21682
+ });
21683
+ }
21684
+ else {
21685
+ console.log('[SCROLL v7] Cannot calculate progress - maxScroll is 0', { scrollHeight, clientHeight });
21686
+ }
21687
+ }
21688
+ else {
21689
+ console.log('[SCROLL v7] Cannot calculate progress - no target element');
21690
+ }
21691
+ // ========================================
21692
+ // FEATURE 3: Navigation Dots Active Section
21693
+ // ========================================
21694
+ // Determine which section is currently visible based on scroll position
21695
+ const scrollContainerId = this.scrollContainerId();
21696
+ if (scrollContainerId) {
21697
+ const ionContent = document.getElementById(scrollContainerId);
21698
+ if (ionContent) {
21699
+ const scrollElement = ionContent.shadowRoot?.querySelector('.inner-scroll');
21700
+ if (scrollElement) {
21701
+ // Get all section elements
21702
+ const sectionMap = [
21703
+ { id: 'overview', elementId: 'overall-section' },
21704
+ { id: 'insights', elementId: 'insights-section' },
21705
+ { id: 'metrics', elementId: 'metrics-section' },
21706
+ { id: 'breakdowns', elementId: 'breakdowns-section' },
21707
+ { id: 'competitive', elementId: 'competitive-section' }
21708
+ ];
21709
+ // Find the section that's most visible in the viewport
21710
+ let activeSection = 'overview'; // default
21711
+ const viewportHeight = scrollElement.clientHeight;
21712
+ const viewportTop = scrollTop;
21713
+ const viewportBottom = viewportTop + viewportHeight;
21714
+ const viewportCenter = viewportTop + (viewportHeight / 2);
21715
+ for (const section of sectionMap) {
21716
+ const element = scrollElement.querySelector(`#${section.elementId}`);
21717
+ if (element) {
21718
+ const elementTop = element.offsetTop;
21719
+ const elementBottom = elementTop + element.offsetHeight;
21720
+ // Check if the section's center is in the upper half of the viewport
21721
+ // This provides better UX for navigation dot highlighting
21722
+ const elementCenter = elementTop + (element.offsetHeight / 2);
21723
+ if (elementTop <= viewportCenter && elementBottom >= viewportTop) {
21724
+ activeSection = section.id;
21725
+ // Don't break - continue to find the best match
21726
+ }
21727
+ }
21728
+ }
21729
+ const previousActiveSection = this.activeNavSection();
21730
+ if (previousActiveSection !== activeSection) {
21731
+ this.activeNavSection.set(activeSection);
21732
+ console.log('[SCROLL v7] ✓ Active nav section updated', {
21733
+ from: previousActiveSection,
21734
+ to: activeSection,
21735
+ scrollTop,
21736
+ viewportCenter
21737
+ });
21738
+ }
21739
+ }
21740
+ }
21741
+ }
21662
21742
  });
21663
21743
  // Manage loading state with minimum display time
21664
21744
  effect(() => {
@@ -23295,7 +23375,7 @@ class SymphiqFunnelAnalysisDashboardComponent {
23295
23375
  type: HostListener,
23296
23376
  args: ['window:scroll', ['$event']]
23297
23377
  }] }); })();
23298
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SymphiqFunnelAnalysisDashboardComponent, { className: "SymphiqFunnelAnalysisDashboardComponent", filePath: "lib/components/funnel-analysis-dashboard/symphiq-funnel-analysis-dashboard.component.ts", lineNumber: 1027 }); })();
23378
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SymphiqFunnelAnalysisDashboardComponent, { className: "SymphiqFunnelAnalysisDashboardComponent", filePath: "lib/components/funnel-analysis-dashboard/symphiq-funnel-analysis-dashboard.component.ts", lineNumber: 1044 }); })();
23299
23379
 
23300
23380
  /**
23301
23381
  * Shared Theme Color Utilities