@epam/statgpt-conversation-view 0.7.0-dev.7 → 0.7.0-dev.9

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.
@@ -0,0 +1,27 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Keeps the conversation content and the attachment's tabs/buttons row fixed on
4
+ * screen while the user switches the visualization (e.g. grid ↔ chart) and the
5
+ * new content has a different height.
6
+ *
7
+ * Call {@link captureAnchor} synchronously right before triggering the switch.
8
+ * It simply locks `scrollTop` for a short settle window:
9
+ *
10
+ * - **Taller / same-size new view** → `scrollTop` is valid throughout, so the
11
+ * view stays exactly put (no jump), even while the chart builds.
12
+ * - **Shorter new view** → holding the old `scrollTop` is only clamped by the
13
+ * browser when it now exceeds the maximum, which happens exactly when the user
14
+ * was at the very bottom of the taller view. In that case the content settles
15
+ * down by the height difference (the one allowed movement); otherwise it still
16
+ * stays put.
17
+ *
18
+ * Native scroll anchoring is suspended during the window (its heuristic is
19
+ * unreliable for the last message / at the bottom), and re-enabled afterwards.
20
+ * A manual scroll (wheel / touch) hands control back to the user immediately.
21
+ *
22
+ * No-op when `enabled` is false (e.g. advanced view has no such scroll
23
+ * container).
24
+ */
25
+ export declare function useViewModeScrollAnchor<T extends HTMLElement>(anchorRef: RefObject<T | null>, enabled: boolean): {
26
+ captureAnchor: () => void;
27
+ };