@gitkraken/gitkraken-components 13.0.0-vnext.29 → 13.0.0-vnext.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import type { Alignment, GridCellRangeRenderer } from 'react-virtualized';
2
2
  import type { ReactElement } from 'react';
3
3
  import type { GraphMarkerType, GraphZone, GraphZoneType } from '../../domain/graph/GraphConstants';
4
- import type { ColumnContentGenerator, GetExternalIcon, GraphMarkerColors, GraphMarkerRowIndices, OnGraphZoneResize, OnGraphZoneResizeEnd, OnGraphZoneResizeFromPropChange, OnScrollForZone, ProcessedGraphRow, RowRenderersByIds } from '../../domain/graph/GraphTypes';
4
+ import type { ColumnContentGenerator, GetExternalIcon, GraphMarkerColors, GraphMarkerRowIndices, InteractiveScrollMarker, OnGraphZoneResize, OnGraphZoneResizeEnd, OnGraphZoneResizeFromPropChange, OnScrollForZone, OnScrollMarkerClicked, ProcessedGraphRow, RowRenderersByIds } from '../../domain/graph/GraphTypes';
5
5
  import type { TranslationFn } from '../../domain/language/LanguageTypes';
6
6
  import type { GetRealKeyForCellFunc } from '../../domain/reactvirtualized/ReactVirtualizedHelpers';
7
7
  import type { OnMouseEnter } from '../../domain/ui/UiTypes';
@@ -24,6 +24,8 @@ type GraphColumnProps = {
24
24
  isLoadingRows: boolean;
25
25
  markerColors: GraphMarkerColors;
26
26
  markerRowIndices: GraphMarkerRowIndices;
27
+ interactiveScrollMarkers?: readonly InteractiveScrollMarker[];
28
+ onScrollMarkerClicked?: OnScrollMarkerClicked;
27
29
  makeColumnContents?: ColumnContentGenerator;
28
30
  onResize?: OnGraphZoneResize;
29
31
  onResizeEnd?: OnGraphZoneResizeEnd;
@@ -42,5 +44,5 @@ type GraphColumnProps = {
42
44
  translate: TranslationFn;
43
45
  verticalScrollWidth: number;
44
46
  };
45
- export declare function GraphColumn({ branchUpstreamRowIndices, rowCount, cellRenderersByIds, columnIndex, customFooterRow, enabledScrollMarkerTypes, enableResizer, getExternalIcon, getKeyForCell, graphHeight, graphWidth, graphZoneType, graphZones, hasMoreCommits, horizontalScrollHeight, isFilteredSearch, isLoadingRows, markerColors, markerRowIndices, onResize, onResizeEnd, onResizeFromPropChange, onScroll, onScrollToRowCausedUpdate, onZoneEnter, processedRows, scrollLeft, scrollToAlignment, scrollToIndex, scrollTop, smartCellRangeRenderer, stickyTimeline, translate, verticalScrollWidth, }: GraphColumnProps): ReactElement<any> | null;
47
+ export declare function GraphColumn({ branchUpstreamRowIndices, rowCount, cellRenderersByIds, columnIndex, customFooterRow, enabledScrollMarkerTypes, enableResizer, getExternalIcon, getKeyForCell, graphHeight, graphWidth, graphZoneType, graphZones, hasMoreCommits, horizontalScrollHeight, isFilteredSearch, isLoadingRows, markerColors, markerRowIndices, interactiveScrollMarkers, onScrollMarkerClicked, onResize, onResizeEnd, onResizeFromPropChange, onScroll, onScrollToRowCausedUpdate, onZoneEnter, processedRows, scrollLeft, scrollToAlignment, scrollToIndex, scrollTop, smartCellRangeRenderer, stickyTimeline, translate, verticalScrollWidth, }: GraphColumnProps): ReactElement<any> | null;
46
48
  export {};
@@ -5,7 +5,7 @@ import type { Sha } from '../../domain/commit/CommitTypes';
5
5
  import type { CssVariables } from '../../domain/generic/GenericTypes';
6
6
  import type { GraphCommitDescDisplayMode, GraphMarkerType, GraphSearchMode, GraphZone, GraphZoneType, ShiftSelectMode } from '../../domain/graph/GraphConstants';
7
7
  import type { ThrottledFn } from '../../domain/graph/GraphHelpers';
8
- import type { AbsoluteNodeLeftByColumn, AvatarUrlByEmail, AvatarUrlRequestedByEmail, ChildrenBySha, ColumnColorByColumn, DownstreamsByUpstream, ExcludeByType, ExcludeRefsById, ExcludeRemotesByName, FormatCommitMessage, FormatRefShorthand, GetExternalIcon, GetMissingAvatar, GetMissingRefMetadata, GraphColumnSetting, GraphColumnsSettings, GraphContexts, GraphMarkerColors, GraphMarkerRowIndices, GraphPlatform, GraphRefGroup, GraphRow, GraphScope, GraphZoneModeConstants, GraphZonesByType, Head, HighlightedShas, IncludeOnlyRefsById, IncludeOnlyRemotesByName, IsRefShorthandValid, IsSelectedBySha, NodeOffsetByColumn, NodeOpacityByColumn, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnClickGraphRef, OnClickGraphRow, OnClickRef, OnColumnsCalculated, OnCommitContextMenu, OnCommitMessageChange, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, OnDoubleClickGraphRef, OnDoubleClickGraphRow, OnDoubleClickRef, OnEmailsMissingAvatarUrls, OnFilterColumnClick, OnFormatCommitDateTime, OnGraphColumnReOrdered, OnGraphColumnResized, OnGraphColumnsReOrdered, OnGraphMouseEnter, OnGraphMouseLeave, OnGraphRefNodeHovered, OnGraphRefNodeUnhovered, OnGraphResized, OnGraphRowHovered, OnGraphRowUnhovered, OnGraphScrollForZone, OnGraphVisibleRowsChanged, OnGraphZoneResize, OnGraphZoneResizeEnd, OnLoadSelectedGraphRow, OnPopupGraphHeaderContextMenu, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefContextMenu, OnRefCreate, OnRefCreateCancel, OnRefCreateContextMenu, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefShorthandChange, OnRefsMissingMetadata, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnRowContextMenu, OnScrollForZone, OnSelectGraphRows, OnSettingsClick, OnShowMoreCommits, OnToggleRefNodesShown, OnToggleRefsVisibilityClick, OnWipMessageBlur, OnWipMessageFocus, ProcessedGraphRow, ProcessedGraphRowBySha, ReadonlyGraphRow, RefMetadataById, RefMetadataRequestedById, RefMetadataType, RefsMissingMetadata, Remote, ReserverInfoBySha, RowStats, RowStatsConstraints, ShaByRefId, Tag, TopAndBottomVisibleRowIndex } from '../../domain/graph/GraphTypes';
8
+ import type { AbsoluteNodeLeftByColumn, AvatarUrlByEmail, AvatarUrlRequestedByEmail, ChildrenBySha, ColumnColorByColumn, DownstreamsByUpstream, ExcludeByType, ExcludeRefsById, ExcludeRemotesByName, FormatCommitMessage, FormatRefShorthand, GetExternalIcon, GetMissingAvatar, GetMissingRefMetadata, GraphColumnSetting, GraphColumnsSettings, GraphContexts, GraphMarkerColors, GraphMarkerRowIndices, GraphPlatform, GraphRefGroup, GraphRow, GraphScope, GraphZoneModeConstants, GraphZonesByType, Head, HighlightedShas, IncludeOnlyRefsById, IncludeOnlyRemotesByName, InteractiveScrollMarker, IsRefShorthandValid, IsSelectedBySha, NodeOffsetByColumn, NodeOpacityByColumn, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnClickGraphRef, OnClickGraphRow, OnClickRef, OnColumnsCalculated, OnCommitContextMenu, OnCommitMessageChange, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, OnDoubleClickGraphRef, OnDoubleClickGraphRow, OnDoubleClickRef, OnEmailsMissingAvatarUrls, OnFilterColumnClick, OnFormatCommitDateTime, OnGraphColumnReOrdered, OnGraphColumnResized, OnGraphColumnsReOrdered, OnGraphMouseEnter, OnGraphMouseLeave, OnGraphRefNodeHovered, OnGraphRefNodeUnhovered, OnGraphResized, OnGraphRowHovered, OnGraphRowUnhovered, OnGraphScrollForZone, OnGraphVisibleRowsChanged, OnGraphZoneResize, OnGraphZoneResizeEnd, OnLoadSelectedGraphRow, OnPopupGraphHeaderContextMenu, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefContextMenu, OnRefCreate, OnRefCreateCancel, OnRefCreateContextMenu, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefShorthandChange, OnRefsMissingMetadata, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnRowContextMenu, OnScrollForZone, OnSelectGraphRows, OnSettingsClick, OnShowMoreCommits, OnToggleRefNodesShown, OnToggleRefsVisibilityClick, OnWipMessageBlur, OnWipMessageFocus, ProcessedGraphRow, ProcessedGraphRowBySha, ReadonlyGraphRow, RefMetadataById, RefMetadataRequestedById, RefMetadataType, RefsMissingMetadata, Remote, ReserverInfoBySha, RowStats, RowStatsConstraints, ShaByRefId, Tag, TopAndBottomVisibleRowIndex } from '../../domain/graph/GraphTypes';
9
9
  import type { RowAdornmentProvider } from '../../domain/graph/rowAdornment/RowAdornmentTypes';
10
10
  import type { TranslationFn } from '../../domain/language/LanguageTypes';
11
11
  import type { CreateRefFormData, RefIconsPosition } from '../../domain/ref/RefTypes';
@@ -203,6 +203,7 @@ type ComponentState = {
203
203
  isLoadingRows: boolean;
204
204
  numGraphColumns: number;
205
205
  markerRowIndices: GraphMarkerRowIndices;
206
+ interactiveScrollMarkers: InteractiveScrollMarker[];
206
207
  pendingCommitMessageSummary: string;
207
208
  processedRows: ProcessedGraphRow[];
208
209
  refIconsPosition: RefIconsPosition;
@@ -291,6 +292,7 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
291
292
  visibleWipShasTimer?: ReturnType<typeof setTimeout>;
292
293
  lastFiredVisibleWipShas: VisibleWipShas | undefined;
293
294
  branchUpstreamRowIndices: number[];
295
+ private interactiveScrollMarkersFromRows;
294
296
  downstreamsByUpstream: DownstreamsByUpstream;
295
297
  timelinesInterval?: ReturnType<typeof setInterval>;
296
298
  constructor(props: Props);
@@ -500,6 +502,10 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
500
502
  getLeftGutterBoxShadowAlpha(themeOpacityFactor: number): number;
501
503
  getRightGutterBoxShadowAlpha(themeOpacityFactor: number): number;
502
504
  updateMarkerRowIndices(types: GraphMarkerType[], nextProps?: GraphContainerProps): void;
505
+ private computeInteractiveScrollMarkers;
506
+ private onScrollMarkerClicked;
507
+ private getHeadPillDirection;
508
+ private onHeadPillClick;
503
509
  getMarkerColors(): GraphMarkerColors;
504
510
  initializeGraphZones(zoneSettings: GraphColumnsSettings | undefined, zoneOrdering: GraphZoneType[], width: number): GraphZone[];
505
511
  maybeSortGraphZoneOrderingFromSettings(zoneSettings?: GraphColumnsSettings): void;
@@ -1,7 +1,7 @@
1
1
  import type { ReactElement } from 'react';
2
2
  import * as React from 'react';
3
3
  import type { GraphMarkerType } from '../../domain/graph/GraphConstants';
4
- import type { GraphMarkerColors, GraphMarkerRowIndices } from '../../domain/graph/GraphTypes';
4
+ import type { GetExternalIcon, GraphMarkerColors, GraphMarkerRowIndices, InteractiveScrollMarker, OnScrollMarkerClicked } from '../../domain/graph/GraphTypes';
5
5
  interface Props {
6
6
  branchUpstreamRowIndices: number[];
7
7
  enabledScrollMarkerTypes: GraphMarkerType[];
@@ -9,14 +9,35 @@ interface Props {
9
9
  viewportHeight: number;
10
10
  markerRowIndices: GraphMarkerRowIndices;
11
11
  markerColors: GraphMarkerColors;
12
+ scrollTop: number;
12
13
  scrollWidth?: number;
13
14
  totalRows: number;
15
+ interactiveMarkers?: readonly InteractiveScrollMarker[];
16
+ onMarkerClick?: OnScrollMarkerClicked;
17
+ getExternalIcon?: GetExternalIcon;
14
18
  }
15
- export default class ScrollMarker extends React.PureComponent<Props> {
19
+ interface HoveredRow {
20
+ rowIndex: number;
21
+ markers: InteractiveScrollMarker[];
22
+ tooltipTop: number;
23
+ color: string;
24
+ }
25
+ interface State {
26
+ hovered: HoveredRow | null;
27
+ }
28
+ export default class ScrollMarker extends React.PureComponent<Props, State> {
16
29
  canvas: HTMLCanvasElement | null;
30
+ state: State;
31
+ private memoMarkersByRow;
17
32
  componentDidMount(): void;
18
- componentDidUpdate(nextProps: Props): void;
33
+ componentDidUpdate(prevProps: Props): void;
19
34
  updateCanvas(nextProps?: Props): void;
20
- render(): ReactElement<'canvas'>;
35
+ private setHoveredRow;
36
+ private pickRowColor;
37
+ private clearHoveredIfRow;
38
+ private onRowHitMove;
39
+ private onRowHitClick;
40
+ private getMarkersByRowMemo;
41
+ render(): ReactElement<'div'>;
21
42
  }
22
43
  export {};
@@ -66,6 +66,7 @@ export declare function getGraphZoneModeConstants(graphZoneMode?: GraphColumnMod
66
66
  export declare const makeGetKeyForCell: (rows: ProcessedGraphRow[]) => GetRealKeyForCellFunc;
67
67
  export declare function getZoneWidthWithVerticalScrollbar(graphZoneType: GraphZoneType, activeGraphZones: GraphZone[]): number;
68
68
  export declare function rowContainsCurrentHeadRef(row?: ProcessedGraphRow | GraphRow): boolean;
69
+ export declare function rowIsActiveHead(row?: ProcessedGraphRow | GraphRow): boolean;
69
70
  export declare function getHeadRefShaFromGraphRows(graphRows: GraphRow[]): Sha | undefined;
70
71
  export declare function isWorkDirNodeType(nodeType: CommitType): boolean;
71
72
  export declare function isCommitNodeType(nodeType: CommitType): boolean;
@@ -117,6 +118,7 @@ export declare class GraphRowHelper {
117
118
  isSingleSelected(rowIndex: number): boolean;
118
119
  hasTimeline(rowIndex: number): boolean;
119
120
  rowContainsCurrentHeadRef(row?: ProcessedGraphRow): boolean;
121
+ rowIsActiveHead(row?: ProcessedGraphRow): boolean;
120
122
  }
121
123
  export declare function first<T>(source: Iterable<T> | IterableIterator<T>): T | undefined;
122
124
  export declare function last<T>(source: Iterable<T>): T | undefined;
@@ -145,6 +145,17 @@ export interface GraphScope {
145
145
  upstreamRef?: string;
146
146
  /** SHA of the merge-target tip commit. Its ancestors are NOT walked — the tip is kept as a marker. */
147
147
  mergeTargetTipSha?: Sha;
148
+ /**
149
+ * Merge base between branchRef and mergeTargetTipSha (or the fork point of branchRef from
150
+ * its parent line, when mergeTargetTipSha is omitted). When provided, `sha` is the
151
+ * authoritative boundary — no first-parent inference is performed. The branch ancestor walk
152
+ * terminates at this sha and the sha is added to forkPointShas (when loaded) or branchTip is
153
+ * added to unreachableAnchors (when not loaded). Object-typed (rather than a bare Sha) so the
154
+ * host can attach additional metadata in the future without breaking the type.
155
+ */
156
+ mergeBase?: {
157
+ sha: Sha;
158
+ };
148
159
  /**
149
160
  * Additional ref ids to include in the scope. Each tip becomes an anchor (same treatment as
150
161
  * branchRef — shows all refs, acts as visibility floor) and its ancestors contribute to
@@ -442,6 +453,13 @@ export type GraphMarkerColors = {
442
453
  export type GraphMarkerRowIndices = {
443
454
  [marker: string]: number[];
444
455
  };
456
+ export interface InteractiveScrollMarker {
457
+ type: GraphMarkerType;
458
+ rowIndex: number;
459
+ sha: Sha;
460
+ label: string;
461
+ }
462
+ export type OnScrollMarkerClicked = (sha: Sha, rowIndex: number, type: GraphMarkerType) => void;
445
463
  export type AvatarUrlByEmail = {
446
464
  [email: string]: string;
447
465
  };