@eric-emg/symphiq-components 1.2.509 → 1.2.511
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 +100 -12
- package/fesm2022/symphiq-components.mjs.map +1 -1
- package/index.d.ts +42 -40
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1929,6 +1929,7 @@ class HeaderScrollService {
|
|
|
1929
1929
|
stateChangeCooldown: this.DEFAULT_STATE_CHANGE_COOLDOWN,
|
|
1930
1930
|
debounceDelay: this.DEFAULT_DEBOUNCE_DELAY
|
|
1931
1931
|
};
|
|
1932
|
+
console.warn('[HeaderScrollService] INITIALIZED - v2 with bounce prevention');
|
|
1932
1933
|
}
|
|
1933
1934
|
log(message, data) {
|
|
1934
1935
|
if (this.DEBUG) {
|
|
@@ -2038,8 +2039,7 @@ class HeaderScrollService {
|
|
|
2038
2039
|
return;
|
|
2039
2040
|
}
|
|
2040
2041
|
this.stateChangeCount++;
|
|
2041
|
-
|
|
2042
|
-
stateChangeNumber: this.stateChangeCount,
|
|
2042
|
+
console.warn('[HeaderScroll] STATE CHANGE #' + this.stateChangeCount, {
|
|
2043
2043
|
from: finalCurrentState ? 'collapsed' : 'expanded',
|
|
2044
2044
|
to: finalDesiredState ? 'collapsed' : 'expanded',
|
|
2045
2045
|
finalPosition,
|
|
@@ -2087,6 +2087,100 @@ class HeaderScrollService {
|
|
|
2087
2087
|
this.scrollTimeout = null;
|
|
2088
2088
|
}
|
|
2089
2089
|
}
|
|
2090
|
+
handleEmbeddedScroll(scrollTop, collapseThreshold, expandThreshold) {
|
|
2091
|
+
const now = Date.now();
|
|
2092
|
+
if (this.isProgrammaticScroll) {
|
|
2093
|
+
this.log('Embedded ignored: programmatic scroll', { scrollTop });
|
|
2094
|
+
return;
|
|
2095
|
+
}
|
|
2096
|
+
const timeSinceLastChange = now - this.lastStateChangeTime;
|
|
2097
|
+
if (timeSinceLastChange < this.config.stateChangeCooldown) {
|
|
2098
|
+
return;
|
|
2099
|
+
}
|
|
2100
|
+
const scrollDelta = scrollTop - this.lastScrollPosition;
|
|
2101
|
+
const absScrollDelta = Math.abs(scrollDelta);
|
|
2102
|
+
const newDirection = scrollDelta > 2 ? 'down' : scrollDelta < -2 ? 'up' : 'none';
|
|
2103
|
+
if (newDirection !== 'none') {
|
|
2104
|
+
if (newDirection === this.scrollDirection) {
|
|
2105
|
+
this.consecutiveDirectionCount++;
|
|
2106
|
+
}
|
|
2107
|
+
else {
|
|
2108
|
+
this.consecutiveDirectionCount = 1;
|
|
2109
|
+
this.scrollDirection = newDirection;
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
if (absScrollDelta < 3) {
|
|
2113
|
+
this.scrollStabilityCount++;
|
|
2114
|
+
}
|
|
2115
|
+
else {
|
|
2116
|
+
this.scrollStabilityCount = 0;
|
|
2117
|
+
}
|
|
2118
|
+
this.lastScrollPosition = scrollTop;
|
|
2119
|
+
const currentState = this.isScrolled();
|
|
2120
|
+
let desiredState = currentState;
|
|
2121
|
+
if (!currentState && scrollTop > collapseThreshold) {
|
|
2122
|
+
desiredState = true;
|
|
2123
|
+
}
|
|
2124
|
+
else if (currentState && scrollTop < expandThreshold) {
|
|
2125
|
+
desiredState = false;
|
|
2126
|
+
}
|
|
2127
|
+
if (currentState === desiredState) {
|
|
2128
|
+
return;
|
|
2129
|
+
}
|
|
2130
|
+
const isStable = this.scrollStabilityCount >= this.STABILITY_THRESHOLD;
|
|
2131
|
+
const hasConsistentDirection = this.consecutiveDirectionCount >= 3;
|
|
2132
|
+
const directionMatchesIntent = (desiredState && this.scrollDirection === 'down') ||
|
|
2133
|
+
(!desiredState && this.scrollDirection === 'up');
|
|
2134
|
+
this.log('Embedded state change candidate', {
|
|
2135
|
+
scrollTop,
|
|
2136
|
+
currentState: currentState ? 'collapsed' : 'expanded',
|
|
2137
|
+
desiredState: desiredState ? 'collapsed' : 'expanded',
|
|
2138
|
+
stability: this.scrollStabilityCount,
|
|
2139
|
+
direction: this.scrollDirection,
|
|
2140
|
+
isStable,
|
|
2141
|
+
hasConsistentDirection,
|
|
2142
|
+
directionMatchesIntent
|
|
2143
|
+
});
|
|
2144
|
+
if (!isStable && !hasConsistentDirection) {
|
|
2145
|
+
this.log('Embedded blocked: insufficient stability');
|
|
2146
|
+
return;
|
|
2147
|
+
}
|
|
2148
|
+
if (!directionMatchesIntent && !isStable) {
|
|
2149
|
+
this.log('Embedded blocked: direction mismatch');
|
|
2150
|
+
return;
|
|
2151
|
+
}
|
|
2152
|
+
if (this.scrollTimeout) {
|
|
2153
|
+
clearTimeout(this.scrollTimeout);
|
|
2154
|
+
}
|
|
2155
|
+
this.scrollTimeout = setTimeout(() => {
|
|
2156
|
+
const finalCurrentState = this.isScrolled();
|
|
2157
|
+
let finalDesiredState = finalCurrentState;
|
|
2158
|
+
if (!finalCurrentState && scrollTop > collapseThreshold) {
|
|
2159
|
+
finalDesiredState = true;
|
|
2160
|
+
}
|
|
2161
|
+
else if (finalCurrentState && scrollTop < expandThreshold) {
|
|
2162
|
+
finalDesiredState = false;
|
|
2163
|
+
}
|
|
2164
|
+
if (finalCurrentState === finalDesiredState) {
|
|
2165
|
+
return;
|
|
2166
|
+
}
|
|
2167
|
+
this.stateChangeCount++;
|
|
2168
|
+
console.warn('[HeaderScroll] EMBEDDED STATE CHANGE #' + this.stateChangeCount, {
|
|
2169
|
+
from: finalCurrentState ? 'collapsed' : 'expanded',
|
|
2170
|
+
to: finalDesiredState ? 'collapsed' : 'expanded',
|
|
2171
|
+
scrollTop
|
|
2172
|
+
});
|
|
2173
|
+
this.isProgrammaticScroll = true;
|
|
2174
|
+
this.isScrolled.set(finalDesiredState);
|
|
2175
|
+
this.lastStateChangeTime = Date.now();
|
|
2176
|
+
this.scrollStabilityCount = 0;
|
|
2177
|
+
this.consecutiveDirectionCount = 0;
|
|
2178
|
+
setTimeout(() => {
|
|
2179
|
+
this.isProgrammaticScroll = false;
|
|
2180
|
+
this.lastScrollPosition = scrollTop;
|
|
2181
|
+
}, 400);
|
|
2182
|
+
}, this.config.debounceDelay);
|
|
2183
|
+
}
|
|
2090
2184
|
static { this.ɵfac = function HeaderScrollService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HeaderScrollService)(); }; }
|
|
2091
2185
|
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: HeaderScrollService, factory: HeaderScrollService.ɵfac, providedIn: 'root' }); }
|
|
2092
2186
|
}
|
|
@@ -2095,7 +2189,7 @@ class HeaderScrollService {
|
|
|
2095
2189
|
args: [{
|
|
2096
2190
|
providedIn: 'root'
|
|
2097
2191
|
}]
|
|
2098
|
-
}],
|
|
2192
|
+
}], () => [], null); })();
|
|
2099
2193
|
|
|
2100
2194
|
class IconService {
|
|
2101
2195
|
constructor(http, sanitizer) {
|
|
@@ -95715,8 +95809,8 @@ class SymphiqProfileFocusAreasAnalysesDashboardComponent {
|
|
|
95715
95809
|
this.FocusAreaDetailStatusEnum = FocusAreaDetailStatusEnum;
|
|
95716
95810
|
this.AiDynamicContentStatusEnum = AiDynamicContentStatusEnum;
|
|
95717
95811
|
this.ProfileAnalysisReviewStatusEnum = ProfileAnalysisReviewStatusEnum;
|
|
95718
|
-
this.COLLAPSE_THRESHOLD =
|
|
95719
|
-
this.EXPAND_THRESHOLD =
|
|
95812
|
+
this.COLLAPSE_THRESHOLD = 150;
|
|
95813
|
+
this.EXPAND_THRESHOLD = 10;
|
|
95720
95814
|
this.embeddedScrollEffect = effect(() => {
|
|
95721
95815
|
const scrollEvent = this.scrollEvent();
|
|
95722
95816
|
const isEmbedded = this.embedded();
|
|
@@ -95731,13 +95825,7 @@ class SymphiqProfileFocusAreasAnalysesDashboardComponent {
|
|
|
95731
95825
|
return;
|
|
95732
95826
|
}
|
|
95733
95827
|
const scrollTop = detail.scrollTop || 0;
|
|
95734
|
-
|
|
95735
|
-
if (!currentState && scrollTop > this.COLLAPSE_THRESHOLD) {
|
|
95736
|
-
this.headerScrollService.isScrolled.set(true);
|
|
95737
|
-
}
|
|
95738
|
-
else if (currentState && scrollTop < this.EXPAND_THRESHOLD) {
|
|
95739
|
-
this.headerScrollService.isScrolled.set(false);
|
|
95740
|
-
}
|
|
95828
|
+
this.headerScrollService.handleEmbeddedScroll(scrollTop, this.COLLAPSE_THRESHOLD, this.EXPAND_THRESHOLD);
|
|
95741
95829
|
const scrollElement = this.scrollElement();
|
|
95742
95830
|
if (scrollElement) {
|
|
95743
95831
|
const scrollHeight = scrollElement.scrollHeight || 0;
|