import { type FormPage } from '../../types'; interface UseCurrentActivePageProps { pages: FormPage[]; defaultPage: string; activePages: string[]; evaluatedPagesVisibility: boolean; } interface UseCurrentActivePageResult { currentActivePage: string | null; requestPage: (pageId: string) => void; } /** * Hook to manage the currently active page in a form sidebar. * * This implementation includes a locking mechanism to handle a specific limitation with Waypoint: * When dealing with short forms where multiple pages are visible in the viewport simultaneously, * Waypoint's initial visibility detection can be unpredictable. It might: * 1. Report pages in a different order than their DOM position * 2. Miss reporting some visible pages in the first few renders * 3. Report visibility events before our desired initial scroll position is established * * The locking mechanism (isInitialPhaseRef) prevents these early Waypoint events from * overriding our intended initial page selection. Without this lock: * - The form might initially select the first page * - But then immediately jump to a different page due to Waypoint's visibility events * - This creates a jarring user experience where the form appears to "jump" during initialization * * The lock is released either: * 1. Automatically after a timeout (allowing for initial render and scroll stabilization) * 2. Immediately when the user explicitly interacts with the form */ export declare const useCurrentActivePage: ({ pages, defaultPage, activePages, evaluatedPagesVisibility, }: UseCurrentActivePageProps) => UseCurrentActivePageResult; export {}; //# sourceMappingURL=useCurrentActivePage.d.ts.map