/** * Locale Switcher * * Names the locale version of the page currently open, and lists the site's * markets: those with a version to switch to, and those still to be created. * * The menu is portalled and positioned against the trigger, so the editor * toolbar's own overflow cannot clip it. */ import React from 'react'; import type { LocaleRow } from '../locale-rows.js'; import type { LocaleReviewStatus } from '../useLocaleReviewStatus.js'; /** What the untagged page is called wherever a locale would otherwise be named. */ export declare const UNTAGGED_LABEL = "Unset"; /** What the open page has yet to take from the page it was translated from. */ export interface LocaleDrift { /** Changes the page can take. Structural ones are reported rather than applied. */ outstanding: number; /** The source's only changes were to add, move or remove blocks. */ structuralOnly: boolean; /** Open the list of those changes. */ onReview: () => void; } export interface LocaleSwitcherProps { rows: LocaleRow[]; /** * The site's configured markets. Counted and gated on separately from `rows`, * which also cover a locale only a document carries. */ markets: string[]; /** * The canonical and its variants, for naming the page behind a row. Only rows * sharing a locale need it, since the locale alone no longer tells them apart. */ documents: { id: string; path: string; }[]; /** The site's markets have not arrived yet. */ loading: boolean; /** The markets could not be read, so what the site publishes in is unknown. */ failed: boolean; open: boolean; onOpenChange: (open: boolean) => void; reviewStatus: ReadonlyMap; /** Ask for the markets and the page's versions again. */ onRetry: () => void; /** Open the locale version held by this document. */ onOpenLocale: (documentId: string) => void; /** Create a version of this page in a market that has none. */ onAddLocale: (locale: string) => void; /** How far the open page has drifted from its source, where it has one. */ drift?: LocaleDrift | null; } export declare function LocaleSwitcher({ rows, markets, documents, loading, failed, open, onOpenChange: setOpen, reviewStatus, onRetry, onOpenLocale, onAddLocale, drift, }: LocaleSwitcherProps): React.ReactElement | null;