import * as React from '@theia/core/shared/react'; import { ReactWidget } from '@theia/core/lib/browser/widgets/react-widget'; import { LabelProvider } from '@theia/core/lib/browser/label-provider'; import { HoverService } from '@theia/core/lib/browser/hover-service'; import { MarkdownRenderer, MarkdownRendererFactory } from '@theia/core/lib/browser/markdown-rendering/markdown-renderer'; import { ScmHistoryGraphModel, HistoryGraphEntry } from './scm-history-graph-model'; import { ScmHistoryItemRef, ScmHistoryItemChange } from './scm-provider'; import { ScmService } from './scm-service'; import { GraphRow } from './scm-history-graph-lanes'; import { CancellationTokenSource } from '@theia/core/lib/common/cancellation'; import { MenuPath } from '@theia/core/lib/common/menu/menu-types'; import { ContextMenuRenderer } from '@theia/core/lib/browser/context-menu-renderer'; import { OpenerService } from '@theia/core/lib/browser/opener-service'; import { ScmContextKeyService } from './scm-context-key-service'; /** Menu path matching the VS Code 'scm/history/title' contribution point (graph section toolbar). */ export declare const SCM_HISTORY_TITLE_MENU: MenuPath; /** Menu path matching the VS Code 'scm/historyItem/context' contribution point (commit row context menu). */ export declare const SCM_HISTORY_ITEM_CONTEXT_MENU: MenuPath; /** Menu path matching the VS Code 'scm/historyItemRef/context' contribution point (ref badge context menu). */ export declare const SCM_HISTORY_ITEM_REF_CONTEXT_MENU: MenuPath; export declare class ScmHistoryGraphWidget extends ReactWidget { static readonly ID = "scm-history-graph-widget"; static readonly LABEL: string; protected readonly model: ScmHistoryGraphModel; protected readonly hoverService: HoverService; protected readonly markdownRendererFactory: MarkdownRendererFactory; protected readonly scmService: ScmService; protected readonly labelProvider: LabelProvider; protected readonly contextMenuRenderer: ContextMenuRenderer; protected readonly openerService: OpenerService; protected readonly scmContextKeys: ScmContextKeyService; protected selectedIndex: number; /** Currently selected change row key (`${itemId}-${ci}`), or undefined. */ protected selectedChangeKey: string | undefined; /** Map from commit id → loaded changes (undefined = not loaded yet). */ protected expandedChanges: Map; /** Set of commit ids that are currently expanded. */ protected expandedIds: Set; /** Map from commit id → in-flight CancellationTokenSource for loadChanges. */ protected loadChangesCts: Map; constructor(); protected init(): void; protected updateContextKeys(): void; protected render(): React.ReactNode; protected handleEndReached: () => void; protected renderRow(entry: HistoryGraphEntry, idx: number, svgWidth: number): React.ReactElement; protected _markdownRenderer: MarkdownRenderer | undefined; protected get markdownRenderer(): MarkdownRenderer; protected handleRowMouseEnter: (e: React.MouseEvent, entry: HistoryGraphEntry) => void; protected renderChangesRows(itemId: string, svgWidth: number, graphRow: GraphRow, changes: ScmHistoryItemChange[] | 'loading' | undefined): React.ReactElement; protected renderChangeRow(change: ScmHistoryItemChange, ci: number, itemId: string, svgWidth: number, graphRow: GraphRow): React.ReactElement; protected handleChangeClick: (e: React.MouseEvent, change: ScmHistoryItemChange, changeKey: string) => void; protected openChange(change: ScmHistoryItemChange): void; protected renderChangeRowSvg(graphRow: GraphRow, svgWidth: number): React.ReactElement; /** * Renders the SVG graph column for a commit row, matching VS Code's SVG structure: * * - Each lane is 22px wide; circle cx = lane * 22 + 11, cy = 11 * - Pass-through lanes: full vertical line M x 0 V 22 * - Commit lane: top segment (M commitX 0 V 11) + bottom segment (M commitX 11 V 22) * - HEAD/current commit (first entry): r=7 with inner dot, NO top segment * - Normal commit: r=5 * - Branch-out edge: diagonal S-curve bezier from commit position (commitX, cy) * sweeping down to the new lane at the bottom: M commitX cy C commitX 22 newX cy newX 22 * - Merge-in edge: bezier from the source lane at the top curving into * the commit position: M srcX 0 C srcX cy commitX cy commitX cy */ protected renderGraphSvg(row: GraphRow, svgWidth: number, isHead: boolean): React.ReactElement; protected renderRefBadges(refs?: readonly ScmHistoryItemRef[], entry?: HistoryGraphEntry): React.ReactNode; protected handleRowContextMenu: (e: React.MouseEvent, entry: HistoryGraphEntry) => void; protected handleRefBadgeContextMenu: (e: React.MouseEvent, entry: HistoryGraphEntry, ref: ScmHistoryItemRef) => void; protected handleRowClick: (idx: number, entry: HistoryGraphEntry) => void; protected loadChanges(entry: HistoryGraphEntry): Promise; protected handleLoadMore: () => void; protected handleLoadMoreKey: (e: React.KeyboardEvent) => void; } //# sourceMappingURL=scm-history-graph-widget.d.ts.map