/** * PageNavigator component. * * Overlay panel for navigating between pages (documents) in the editor. * Uses createPortal + position:fixed to escape header overflow constraints. * Filters out archived documents and internal _registry/* paths. * * The `portalStyle` prop should be computed SYNCHRONOUSLY in the click handler * of the parent (before this component first renders) to avoid a two-render * flash where the portal appears at y=0 before being repositioned. */ import React from 'react'; import type { TemplateSummary } from '../../features/content-type-templates/types.js'; export interface PageNavigatorDocument { id: string; path: string; archived: boolean; isPublished?: boolean; inherited?: boolean; } export interface PageNavigatorProps { documents: PageNavigatorDocument[]; currentDocument: PageNavigatorDocument | null; onSelect: (doc: PageNavigatorDocument) => void; onClose: () => void; open: boolean; /** Whether the current branch is main/live. Inherited docs are dimmed when false. */ isMainBranch?: boolean; /** Called when the user creates a new page. If omitted, the "+ New page" button has no effect. */ onCreateDocument?: (path: string, template?: TemplateSummary | null) => Promise; /** * Called when "+ New page" is clicked. When provided, it takes over the button * (e.g. to open the Create Page modal) instead of the inline create form. */ onCreatePage?: () => void; /** * Called when "+ New template" is clicked on the Templates tab (e.g. to open * the Create Page modal directly on the New-template form). When omitted, the * button is not shown. */ onCreateTemplate?: () => void; /** Available templates for document creation. When non-empty, a template selector step is shown. */ templates?: TemplateSummary[]; /** Whether templates are still loading. */ templatesLoading?: boolean; /** * Pre-computed fixed positioning style. Caller must compute this * synchronously (e.g. in the trigger's onClick) so it is available on the * first render — avoids a layout flash at document top. */ portalStyle?: React.CSSProperties; } export declare function PageNavigator({ documents, currentDocument, onSelect, onClose, open, isMainBranch, onCreateDocument, onCreatePage, onCreateTemplate, templates, templatesLoading, portalStyle, }: PageNavigatorProps): React.JSX.Element | null;