/** * Sidebar — Translation editing panel * Shows original text, translation textarea, live preview, and page blocks list. */ import type { ResolvedKey } from './key-resolver.js'; import type { EditorAPI } from './editor-api.js'; export declare class Sidebar { private el; private bodyEl; private statusEl; private api; private locale; private namespace; private defaultLocale; private current; private blockExtractor; private onBlockClick; private statusMap; private unsavedKeys; private onProgressUpdate; private lastFetchTime; private lastFlushTime; private userRole; private workflowInfo; constructor(shadowRoot: ShadowRoot, api: EditorAPI, locale: string, namespace: string, defaultLocale: string, onBlockClick: (resolved: ResolvedKey) => void, userRole?: string); open(resolved: ResolvedKey): void; close(): void; isOpen(): boolean; updateLocale(locale: string): void; setProgressCallback(cb: (translated: number, total: number) => void): void; /** * Hydrate the status map with server data for all page blocks. * Called once on editor init. */ hydrateStatus(): Promise; getTranslatedCount(): number; getTotalCount(): number; private emitProgress; destroy(): void; private renderContent; /** * Render Confirm/Reject/Mark-Ready/Unmark-Ready buttons under the preview. * Visibility: * - Confirm: shown when row is not locked and not already ready * - Reject: shown when row is not locked and not already ready (server * returns 400 if stage_index is already 0) * - Unconfirm: shown when isConfirmed * - Mark Ready: PM/admin only, hidden when already ready * - Unmark Ready: PM/admin only, only when ready * After any successful click we re-fetch status for this key so the UI * reflects the new state and the unaffected buttons hide/show themselves. */ private renderWorkflowActions; /** * Render the workflow context strip ('Workflow: A → B → C — you are at stage X'). * Highlights the user's POV stage and greys the rest. * * Highlight rule: * - PM/admin: highlight = row's current stage_index (deep-dive view) * - Non-PM: highlight = first userAssignedStages entry (fixed POV) * * Renders immediately from the latest known shape, then revalidates through * the API's TTL-bound per-locale cache (cache hits resolve instantly) so a * mid-session workflow change or a per-target override is picked up. While * the first fetch is in flight, the host stays empty (no flash). */ private renderWorkflowStrip; private buildWorkflowStripNode; /** Re-fetch status for one key and re-render the current view. */ private refreshStatusForKey; /** * Render an "Open linked page →" button when the selected block is or * contains a same-origin link. Cross-origin links are skipped — the editor * session only applies to this site. No-op when there's no usable link. */ private renderLinkNav; private addField; /** * Get CSS class for the status dot based on actual row state, with one * viewer-relative override: rows that have advanced past the viewer's * stage assignment render as 'readonly' (greyed) — same data for everyone, * different signal per viewer. Avoids the new-color-per-stage explosion the * user was originally considering; reuses existing semantics. */ private getDotClass; private renderTextWithTags; private renderPreview; private initResize; private refreshBlocksList; private renderBlocksList; } //# sourceMappingURL=sidebar.d.ts.map