@gitkraken/gitkraken-components 6.0.3 → 7.0.0

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.
Files changed (75) hide show
  1. package/LICENSE +1 -1
  2. package/ThirdPartyNotices.txt +227 -0
  3. package/dist/components/graph/GraphColumn.d.ts +38 -0
  4. package/dist/components/graph/GraphContainer.d.ts +294 -329
  5. package/dist/components/graph/GraphHeaderRow.d.ts +36 -0
  6. package/dist/components/graph/GraphScrollMarker.d.ts +21 -0
  7. package/dist/components/graph/changeszone/ChangesBar.d.ts +11 -0
  8. package/dist/components/graph/commitzone/BackgroundStreak.d.ts +12 -0
  9. package/dist/components/graph/commitzone/CommitNode.d.ts +24 -0
  10. package/dist/components/graph/commitzone/CommitZone.d.ts +48 -0
  11. package/dist/components/graph/commitzone/GraphAvatar.d.ts +39 -0
  12. package/dist/components/graph/commitzone/Gutter.d.ts +22 -0
  13. package/dist/components/graph/commitzone/edges/Arc.d.ts +4 -0
  14. package/dist/components/graph/commitzone/edges/EdgeNodes.d.ts +3 -0
  15. package/dist/components/graph/commitzone/edges/Edges.d.ts +13 -0
  16. package/dist/components/graph/commitzone/edges/EndingEdge.d.ts +4 -0
  17. package/dist/components/graph/commitzone/edges/PassThroughEdge.d.ts +4 -0
  18. package/dist/components/graph/commitzone/edges/StartingEdge.d.ts +4 -0
  19. package/dist/components/graph/common/DraggableGraphHeader.d.ts +42 -0
  20. package/dist/components/graph/common/EntireRowSpan.d.ts +15 -0
  21. package/dist/components/graph/common/GenericGraphZone.d.ts +46 -0
  22. package/dist/components/graph/common/LoadingSpinner.d.ts +11 -0
  23. package/dist/components/graph/common/RefLine.d.ts +17 -0
  24. package/dist/components/graph/common/Timeline.d.ts +6 -0
  25. package/dist/components/graph/dnd/DndContainer.d.ts +44 -0
  26. package/dist/components/graph/refzone/Icon.d.ts +39 -0
  27. package/dist/components/graph/refzone/OverflowCount.d.ts +7 -0
  28. package/dist/components/graph/refzone/RefName.d.ts +6 -0
  29. package/dist/components/graph/refzone/RefNode.d.ts +36 -0
  30. package/dist/components/graph/refzone/RefNodes.d.ts +31 -0
  31. package/dist/components/graph/refzone/RefPopover.d.ts +15 -0
  32. package/dist/components/graph/refzone/RefZone.d.ts +54 -0
  33. package/dist/components/graph/rowRenderers/ChangesZoneRow.d.ts +8 -0
  34. package/dist/components/graph/rowRenderers/CommitAuthorZoneRow.d.ts +7 -0
  35. package/dist/components/graph/rowRenderers/CommitDateTimeZoneRow.d.ts +10 -0
  36. package/dist/components/graph/rowRenderers/CommitMessageZoneRow.d.ts +20 -0
  37. package/dist/components/graph/rowRenderers/CommitShaZoneRow.d.ts +10 -0
  38. package/dist/components/graph/rowRenderers/CommitZoneRow.d.ts +19 -0
  39. package/dist/components/graph/rowRenderers/CommitsInfoRow.d.ts +25 -0
  40. package/dist/components/graph/rowRenderers/RefZoneRow.d.ts +29 -0
  41. package/dist/components/graph/rowRenderers/TimelineMsgRow.d.ts +7 -0
  42. package/dist/components/graph/shared/Avatar.d.ts +13 -0
  43. package/dist/components/graph/shared/FileDiffTypeIcon.d.ts +13 -0
  44. package/dist/components/graph/shared/InlineWorkDirSummary.d.ts +12 -0
  45. package/dist/components/graph/shared/TinyFilesReadout.d.ts +13 -0
  46. package/dist/components/resizable/Resizable.d.ts +78 -0
  47. package/dist/domain/color/ColorHelpers.d.ts +22 -0
  48. package/dist/domain/commit/CommitConstants.d.ts +10 -0
  49. package/dist/domain/commit/CommitHelpers.d.ts +5 -0
  50. package/dist/domain/commit/CommitTypes.d.ts +9 -0
  51. package/dist/domain/cssvariable/CssVariableConstants.d.ts +259 -0
  52. package/dist/domain/cssvariable/CssVariableHelpers.d.ts +4 -0
  53. package/dist/domain/date/DateHelper.d.ts +7 -0
  54. package/dist/domain/diff/DiffConstants.d.ts +5 -0
  55. package/dist/domain/diff/DiffTypes.d.ts +9 -0
  56. package/dist/domain/edge/EdgeHelpers.d.ts +9 -0
  57. package/dist/domain/generic/GenericTypes.d.ts +34 -0
  58. package/dist/domain/graph/GraphConstants.d.ts +146 -0
  59. package/dist/domain/graph/GraphHelpers.d.ts +71 -0
  60. package/dist/domain/graph/GraphTypes.d.ts +367 -0
  61. package/dist/domain/hostingservice/HostingServiceTypes.d.ts +9 -0
  62. package/dist/domain/language/LanguageConstants.d.ts +3 -0
  63. package/dist/domain/language/LanguageHelpers.d.ts +1 -0
  64. package/dist/domain/language/LanguageTypes.d.ts +1 -0
  65. package/dist/domain/reactvirtualized/ReactVirtualizedHelpers.d.ts +11 -0
  66. package/dist/domain/ref/RefConstants.d.ts +5 -0
  67. package/dist/domain/ref/RefTypes.d.ts +2 -0
  68. package/dist/domain/ui/UiTypes.d.ts +28 -0
  69. package/dist/domain/workdir/WorkDirTypes.d.ts +7 -0
  70. package/dist/index.d.ts +8 -2
  71. package/dist/index.js +1 -1
  72. package/dist/styles.css +2 -1
  73. package/dist/utils/MathUtils.d.ts +1 -0
  74. package/dist/utils/TextFormatting.d.ts +2 -0
  75. package/package.json +86 -82
@@ -0,0 +1,7 @@
1
+ type DateStyle = 'full' | 'long' | 'medium' | 'short';
2
+ type TimeStyle = 'full' | 'long' | 'medium' | 'short';
3
+ export type DateTimeFormat = DateStyle | `${DateStyle}+${TimeStyle}`;
4
+ export declare function getDateTimeFormatOptionsFromFormatString(format: DateTimeFormat | string | undefined): Intl.DateTimeFormatOptions;
5
+ export declare function formatWithOrdinal(n: number): string;
6
+ export declare function formatDate(date: Date | number, format: 'full' | 'long' | 'medium' | 'short' | string | null | undefined, locale?: string, cache?: boolean): string;
7
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const types: {
2
+ ADDED: string;
3
+ DELETED: string;
4
+ MODIFIED: string;
5
+ };
@@ -0,0 +1,9 @@
1
+ import type { types as diffTypes } from './DiffConstants';
2
+ export type DiffCountStats = {
3
+ added: number;
4
+ deleted: number;
5
+ modified: number;
6
+ };
7
+ type DiffTypeKeys = keyof typeof diffTypes;
8
+ export type DiffType = (typeof diffTypes)[DiffTypeKeys];
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { CommitType } from '../commit/CommitTypes';
2
+ import type { ColumnColor, LineSvgProps, RowEdges, SvgElement, SvgElementName, SvgProps, SvgStyles } from '../graph/GraphTypes';
3
+ export declare function getXValueAtColumn(column: number): number;
4
+ export declare function getSvgElement(element: SvgElementName, props: SvgProps): SvgElement;
5
+ export declare function getLineElement(props: LineSvgProps): SvgElement;
6
+ export declare function getSvgStyles(type: CommitType, color: ColumnColor): SvgStyles;
7
+ export declare function buildStartingOrEndingEdgeHash(edgeColumn: number, nodeColumn: number, type: CommitType | undefined): string;
8
+ export declare function buildPassThroughEdgeHash(column: number, type: CommitType | undefined): string;
9
+ export declare function buildEdgeHash(edges: RowEdges, edgeColumnMax: number, nodeColumn: number): string;
@@ -0,0 +1,34 @@
1
+ import type { CSSProperties } from 'react';
2
+ export type DateInMilliseconds = number;
3
+ export type ETag = string;
4
+ export type Guid = string;
5
+ export type HexColor = string;
6
+ export type HexColorWithoutOctothorpe = string;
7
+ export type Path = string;
8
+ export type SecStore = any;
9
+ export type Style = CSSProperties;
10
+ export type Url = string;
11
+ export type Hostname = Url;
12
+ export type GitHttpsUrl = Url;
13
+ export type GitSshUrl = Url;
14
+ export type GitRemoteUrl = GitHttpsUrl | GitSshUrl;
15
+ export type Platform = 'darwin' | 'linux' | 'win32';
16
+ export type MapWithCacheQueue<T, U> = {
17
+ data: {
18
+ [key: string]: U;
19
+ };
20
+ cacheQueue: T[];
21
+ };
22
+ /**
23
+ * This represents a pair of synchronous getter and setter callbacks for a value.
24
+ */
25
+ export type ManipulationCallbacks<T> = {
26
+ get: () => T;
27
+ set: (newValue: T) => void;
28
+ };
29
+ export type CssVariables = {
30
+ [variable: string]: string;
31
+ };
32
+ export type HashMap = {
33
+ [hash: string]: string;
34
+ };
@@ -0,0 +1,146 @@
1
+ export declare const DEFAULT_AVATAR_BACKGROUND_COLOR = "#199489";
2
+ export declare const GRAPH_SCROLL_BAR_DEFAULT_WIDTH = 14;
3
+ export declare const GRAPH_SCROLL_MARKER_LANES = 3;
4
+ export declare const GRAPH_HEADER_ROW_HEIGHT = 26;
5
+ export declare const GRAPH_ROW_HEIGHT = 28;
6
+ export declare const GRAPH_ROW_INNER_HEIGHT = 22;
7
+ export declare const GRAPH_ROW_LAZY_LOAD_COMMITS_OFFSET: number;
8
+ export declare const COMMIT_ZONE_LINE_WIDTH = 2;
9
+ export declare const COMMIT_NODE_MIN_ALPHA = 0.5;
10
+ export declare const COMMIT_ZONE_GUTTER_WIDTH = 28;
11
+ export declare const COMMIT_ZONE_MARGIN_BOTTOM = 3;
12
+ export declare const COMMIT_ZONE_MARGIN_TOP = 3;
13
+ export declare const COMMIT_ZONE_PADDING_LEFT = 3;
14
+ export declare const COMMIT_ZONE_PADDING_RIGHT = 3;
15
+ export declare const COMMIT_ZONE_ROW_HEIGHT = 28;
16
+ export declare const COMMIT_ZONE_ROW_INNER_HEIGHT = 22;
17
+ export declare const COMMIT_COLUMN_WIDTH = 22;
18
+ export declare const COMMIT_NODE_DIAMETER = 22;
19
+ export declare const COMMIT_MERGE_NODE_DIAMETER: number;
20
+ export declare const COMMIT_ZONE_EDGE_ARC_PADDING = 3;
21
+ export declare const COMMIT_ZONE_EDGE_ARC_RADIUS: number;
22
+ export declare const COMMIT_ZONE_AVATAR_DIAMETER: number;
23
+ export declare const COMMIT_ZONE_VIEWPORT_WIDTH_MIN: number;
24
+ export declare const RADIUS_DIFF_MERGE_NODE_COMMIT_NODE: number;
25
+ export declare const COMMIT_AUTHOR_ZONE_MIN_WIDTH = 50;
26
+ export declare const COMMIT_DATE_TIME_ZONE_MIN_WIDTH = 50;
27
+ export declare const TIMESTAMP_FORMAT_DATE_TIME = "short+short";
28
+ export declare const COMMIT_SHA_ZONE_MIN_WIDTH = 50;
29
+ export declare const COMMIT_MESSAGE_ZONE_MIN_WIDTH = 50;
30
+ export declare const REF_ZONE_TEXT_HEIGHT = 18;
31
+ export declare const REF_ZONE_MIN_WIDTH = 100;
32
+ export declare const REF_ZONE_MARGIN_LEFT = 2;
33
+ export declare const CHANGES_ZONE_MIN_WIDTH = 50;
34
+ export declare const CHANGES_BAR_MIN_WIDTH = 10;
35
+ export declare const CHANGES_BAR_RIGHT_MARGIN = 15;
36
+ export declare const HEADER_ROW_HEIGHT = 22;
37
+ export declare const HEADER_ROW_MARGIN_BOTTOM = 2;
38
+ export declare const OPACITY_FACTOR_BY_THEME: {
39
+ dark: number;
40
+ light: number;
41
+ };
42
+ export declare const INLINE_SUMMARY_MARGIN_LEFT = 10;
43
+ export declare const TINY_FILES_READOUT_FONT_SIZE = 12;
44
+ export declare const TINY_FILES_READOUT_RIGHT_MARGIN = 6;
45
+ export declare const TINY_ICON_RIGHT_MARGIN = 3;
46
+ export declare const TINY_ICON_SIZE = 12;
47
+ export declare const SCROLL_TO_ALIGNMENT_AUTO = "auto";
48
+ export declare const SCROLL_TO_ALIGNMENT_CENTER = "center";
49
+ export declare const LeftPanelToGraphMarginGap = 7;
50
+ export declare const ResizableHandleCorrection = 4;
51
+ export type TimelineMsgRowRenderIdType = 'timelineMessage';
52
+ export declare const timelineMsgRowRenderId = "timelineMessage";
53
+ export type RefZoneType = 'ref';
54
+ export type CommitZoneType = 'graph';
55
+ export type CommitMessageZoneType = 'message';
56
+ export type CommitAuthorZoneType = 'author';
57
+ export type CommitDateTimeZoneType = 'datetime';
58
+ export type CommitShaZoneType = 'sha';
59
+ export type ChangesZoneType = 'changes';
60
+ export declare const refZone: RefZoneType;
61
+ export declare const commitZone: CommitZoneType;
62
+ export declare const commitMessageZone: CommitMessageZoneType;
63
+ export declare const commitAuthorZone: CommitAuthorZoneType;
64
+ export declare const commitDateTimeZone: CommitDateTimeZoneType;
65
+ export declare const commitShaZone: CommitShaZoneType;
66
+ export declare const changesZone: ChangesZoneType;
67
+ export declare enum GraphMarkerType {
68
+ LocalBranches = "localBranches",
69
+ RemoteBranches = "remoteBranches",
70
+ Selection = "selection",
71
+ Head = "head",
72
+ Upstream = "upstream",
73
+ Highlights = "highlights",
74
+ Stashes = "stashes",
75
+ Tags = "tags"
76
+ }
77
+ export declare enum GraphMarkerShape {
78
+ Block = "block",
79
+ FullLine = "fullLine",
80
+ ThinLine = "thinLine"
81
+ }
82
+ export interface GraphMarkerShapeMetadata {
83
+ type: GraphMarkerShape;
84
+ baseHeight: number;
85
+ minHeight?: number;
86
+ maxHeight?: number;
87
+ }
88
+ export declare const graphMarkerShapeMetadata: {
89
+ [shape: string]: GraphMarkerShapeMetadata;
90
+ };
91
+ export interface GraphMarkerMetadata {
92
+ type: GraphMarkerType;
93
+ colorCssKey: string;
94
+ lanes: number[];
95
+ shape: GraphMarkerShape;
96
+ }
97
+ export declare const graphMarkerMetadata: {
98
+ [marker: string]: GraphMarkerMetadata;
99
+ };
100
+ export declare const numGraphColumnsDefault = 10;
101
+ export declare const DEFAULT_COMMIT_SHA_LENGTH = 6;
102
+ export type GraphZoneType = RefZoneType | CommitZoneType | CommitMessageZoneType | CommitAuthorZoneType | CommitDateTimeZoneType | CommitShaZoneType | ChangesZoneType;
103
+ export interface GraphZoneMetaData {
104
+ contentWidth?: number;
105
+ headerLabelUntranslated: string;
106
+ isCustomizable: boolean;
107
+ listId: string;
108
+ maximumWidth?: number;
109
+ minimumWidth: number;
110
+ }
111
+ export interface GraphZone extends GraphZoneMetaData {
112
+ currentWidth: number;
113
+ preferredWidth?: number;
114
+ isActive?: boolean;
115
+ isHidden: boolean;
116
+ type: GraphZoneType;
117
+ order: number;
118
+ }
119
+ export declare const graphZoneMetaData: {
120
+ [zone: string]: GraphZoneMetaData;
121
+ };
122
+ export type TimelineEntry = {
123
+ date: number;
124
+ label: string;
125
+ timeUnit: string;
126
+ value: number;
127
+ };
128
+ export declare const lookbackLimitByPeriod: {
129
+ hour: number;
130
+ day: number;
131
+ week: number;
132
+ month: number;
133
+ year: number;
134
+ };
135
+ export type TimelineEntriesByPeriod = {
136
+ hour: TimelineEntry[];
137
+ day: TimelineEntry[];
138
+ week: TimelineEntry[];
139
+ month: TimelineEntry[];
140
+ year: TimelineEntry[];
141
+ };
142
+ export declare const DEFAULT_WORKDIR_STATS: {
143
+ added: number;
144
+ deleted: number;
145
+ modified: number;
146
+ };
@@ -0,0 +1,71 @@
1
+ import type { Alignment } from 'react-virtualized';
2
+ import type { Sha } from '../commit/CommitTypes';
3
+ import type { GetRealKeyForCellFunc } from '../reactvirtualized/ReactVirtualizedHelpers';
4
+ import type { GraphRefType } from '../ref/RefTypes';
5
+ import type { WorkDirStats } from '../workdir/WorkDirTypes';
6
+ import type { GraphZone, GraphZoneType, TimelineEntriesByPeriod } from './GraphConstants';
7
+ import type { GetMissingRefMetadata, GraphColumnWidthConstraints, GraphItemContext, GraphRef, GraphRefGroup, GraphRow, HighlightedShas, IsSelectedBySha, ProcessedGraphRow, ProcessedGraphRowBySha, PullRequestMetadata, Ref, RefMetadata, RefMetadataById, RefMetadataType, RowStatsConstraints, UpstreamMetadata } from './GraphTypes';
8
+ export type DebouncableFn = (...args: any) => void;
9
+ export type DebouncedFn = (...args: any) => void;
10
+ export declare const debounceFrame: (func: DebouncableFn) => DebouncedFn;
11
+ export type ThrottleableFn = (...args: any) => void;
12
+ export type ThrottledFn = (...args: any) => void;
13
+ export declare const throttle: (func: ThrottleableFn, time: number, initial?: number) => ThrottledFn;
14
+ export declare function parseContext(context?: GraphItemContext | null): string | null;
15
+ export declare function getRowStatsConstraints(stats: number[]): RowStatsConstraints;
16
+ export declare function getOrAskForRefMetadata(ref: GraphRef, refMetadata: RefMetadataById | undefined, onMissingRefMetadata: GetMissingRefMetadata, refMetadataType?: RefMetadataType): RefMetadata | PullRequestMetadata[] | UpstreamMetadata | null;
17
+ export declare function getTimelineEntriesByPeriod(): TimelineEntriesByPeriod;
18
+ export declare function getRefIdByBaseRef(refType: GraphRefType, ref: Ref): string;
19
+ export declare function getRefIdByGraphRef(ref: GraphRef): string;
20
+ export declare function getLastShrinkableGraphZone(activeGraphZones: GraphZone[], stoppingIndex?: number): GraphZone | undefined;
21
+ export declare function getFirstExpandableGraphZone(activeGraphZones: GraphZone[], startingIndex?: number): GraphZone | undefined;
22
+ export declare function getZoneWidthsTotal(activeGraphZones: GraphZone[], zoneTypeToExclude?: GraphZoneType): number;
23
+ export declare function getFollowingZoneMinWidthsTotal(activeGraphZones: GraphZone[], startingIndex?: number): number;
24
+ export declare function getPrecedingZoneCurrentWidthsTotal(activeGraphZones: GraphZone[], endingIndex?: number): number;
25
+ export declare const isLastColumn: (graphZoneType: GraphZoneType, activeGraphZones: GraphZone[]) => boolean;
26
+ export declare function getClampedZoneWidth(graphZone: GraphZone, activeGraphZones: GraphZone[], width: number): number;
27
+ export declare function getGraphZoneFromGraphZones(graphZoneType: GraphZoneType, activeGraphZones: GraphZone[]): GraphZone | undefined;
28
+ export declare function getGraphZoneIndexFromGraphZones(graphZoneType: GraphZoneType, activeGraphZones: GraphZone[]): number;
29
+ export declare function getGraphZoneWidthConstraintsFromGraphZones(graphZoneType: GraphZoneType, activeGraphZones: GraphZone[], graphWidth: number): GraphColumnWidthConstraints;
30
+ export declare const makeGetKeyForCell: (rows: ProcessedGraphRow[]) => GetRealKeyForCellFunc;
31
+ export declare function getZoneWidth(graphZoneType: GraphZoneType, activeGraphZones: GraphZone[]): number;
32
+ export declare function rowContainsCurrentHeadRef(row?: ProcessedGraphRow | GraphRow): boolean;
33
+ export declare function getHeadRefShaFromGraphRows(graphRows: GraphRow[]): Sha | undefined;
34
+ export declare function workDirStatsHaveChanges(workDirStats?: WorkDirStats): boolean;
35
+ export declare function hasSingleSelectedSha(isSelectedBySha: IsSelectedBySha): boolean;
36
+ export declare function isSingleSelected(isSelectedBySha: IsSelectedBySha, sha: Sha): boolean;
37
+ export declare function getScrollToAlignment(rowHeight: number, clientHeight: number, scrollTop: number, scrollToIndex: number): Alignment;
38
+ export declare function getGraphRefGroup(processedRow: ProcessedGraphRow, showRemoteNamesOnRefs: boolean): GraphRefGroup;
39
+ export declare function getGraphRefGroupsByName(refGroup: GraphRefGroup): GraphRefGroup[];
40
+ export interface GraphRowHelperProps {
41
+ currentlyHoveredCommitSha?: Sha;
42
+ dimRowsOfSelectedCommit: boolean;
43
+ graphZones: GraphZone[];
44
+ highlightedShas?: HighlightedShas;
45
+ hoveredRefGroup?: GraphRefGroup;
46
+ isSelectedBySha: IsSelectedBySha;
47
+ isContainerWindowFocused: boolean;
48
+ processedRows: ProcessedGraphRow[];
49
+ processedGraphRowBySha: ProcessedGraphRowBySha;
50
+ showRemoteNamesOnRefs: boolean;
51
+ }
52
+ export declare class GraphRowHelper {
53
+ props: GraphRowHelperProps;
54
+ constructor(props: GraphRowHelperProps);
55
+ getActiveGraphZone(graphZoneType: GraphZoneType): GraphZone | undefined;
56
+ getGraphRefGroupForRow(rowIndex: number): GraphRefGroup;
57
+ getGraphRefGroupsByNameForRow(rowIndex: number): GraphRefGroup[];
58
+ getRow(rowIndex: number): ProcessedGraphRow | undefined;
59
+ getZoneWidth(graphZoneType: GraphZoneType): number;
60
+ isDateTimeZoneActive(): boolean;
61
+ isFirstRow(rowIndex: number): boolean;
62
+ isHighlighted(rowIndex: number): boolean;
63
+ isHovering(rowIndex: number): boolean;
64
+ isLastColumn(graphZoneType: GraphZoneType): boolean;
65
+ getSelectedRefGroupByName(): GraphRefGroup[];
66
+ isMissingHoveredRefGroup(rowIndex: number): boolean;
67
+ isSelected(rowIndex: number): boolean;
68
+ isSingleSelected(rowIndex: number): boolean;
69
+ hasTimeline(rowIndex: number): boolean;
70
+ rowContainsCurrentHeadRef(row?: ProcessedGraphRow): boolean;
71
+ }
@@ -0,0 +1,367 @@
1
+ import type { GridCellRenderer, ScrollParams } from 'react-virtualized';
2
+ import type { ReactElement } from 'react';
3
+ import type { CommitDateTimeSources } from '../commit/CommitConstants';
4
+ import type { CommitType, Sha } from '../commit/CommitTypes';
5
+ import type { CssVariables } from '../generic/GenericTypes';
6
+ import type { HostingServiceType } from '../hostingservice/HostingServiceTypes';
7
+ import type { TranslationFn } from '../language/LanguageTypes';
8
+ import type { GraphRefType } from '../ref/RefTypes';
9
+ import type { OnResizeFromPropChangeParams, OnResizeParams } from '../ui/UiTypes';
10
+ import type { GraphZone, GraphZoneType, TimelineEntry, TimelineMsgRowRenderIdType } from './GraphConstants';
11
+ export type RowRenderType = GraphZoneType | TimelineMsgRowRenderIdType;
12
+ export type RowRenderersByIds = {
13
+ [id: string]: GridCellRenderer;
14
+ };
15
+ export type ColumnColor = string;
16
+ export type ColumnColorByColumn = {
17
+ [id: number]: ColumnColor;
18
+ };
19
+ export type AbsoluteNodeLeftByColumn = {
20
+ [id: number]: number;
21
+ };
22
+ export type NodeOffsetByColumn = {
23
+ [id: number]: number;
24
+ };
25
+ export type NodeOpacityByColumn = {
26
+ [id: number]: number;
27
+ };
28
+ export type XValueByColumn = {
29
+ [id: number]: number;
30
+ };
31
+ export type ArcSvgElementName = 'path';
32
+ export type LineSvgElementName = 'line';
33
+ export type SvgElementName = ArcSvgElementName | LineSvgElementName;
34
+ export type SvgElement = string;
35
+ export type EdgeCache = {
36
+ [hash: string]: SvgElement;
37
+ };
38
+ export type ArcEndpointAngle = 0 | 90 | 180 | 270;
39
+ export interface SvgStyles {
40
+ fill: string;
41
+ shapeRendering: string;
42
+ strokeLinejoin: string;
43
+ strokeWidth: number;
44
+ strokeDasharray: number;
45
+ stroke: ColumnColor;
46
+ }
47
+ export interface LineSvgProps extends SvgStyles {
48
+ x1: number;
49
+ x2: number;
50
+ y1: number;
51
+ y2: number;
52
+ }
53
+ export interface ArcSvgProps extends SvgStyles {
54
+ d: string;
55
+ }
56
+ export type SvgProps = ArcSvgProps | LineSvgProps;
57
+ export type AnySvgProps = ArcSvgProps & LineSvgProps;
58
+ export type Edge = {
59
+ parentSha: Sha;
60
+ type: CommitType;
61
+ };
62
+ export type EdgeByColumn = {
63
+ [column: number]: Edge;
64
+ };
65
+ export type RowEdge = {
66
+ ending?: Edge;
67
+ passThrough?: Edge;
68
+ starting?: Edge;
69
+ };
70
+ export type RowEdges = {
71
+ [column: number]: RowEdge;
72
+ };
73
+ export interface CommonGraphRowProps {
74
+ enabledRefMetadataTypes: RefMetadataType[];
75
+ avatarUrlByEmail: AvatarUrlByEmail;
76
+ currentlyHoveredCommitSha?: Sha;
77
+ cssVariables: CssVariables;
78
+ dimMergeCommits: boolean;
79
+ dimRowsOfSelectedCommit: boolean;
80
+ highlightRowsOnRefHover: boolean;
81
+ isContainerWindowFocused: boolean;
82
+ isSelectedBySha: IsSelectedBySha;
83
+ showGhostRefsOnRowHover: boolean;
84
+ showRemoteNamesOnRefs: boolean;
85
+ getExternalIcon: GetExternalIcon;
86
+ graphZones: GraphZone[];
87
+ highlightedShas?: HighlightedShas;
88
+ hoveredRefGroup?: GraphRefGroup;
89
+ hoveredRefZoneSha?: Sha;
90
+ isInUnsupportedRebase: boolean;
91
+ numGraphColumns: number;
92
+ processedRows: ProcessedGraphRow[];
93
+ processedGraphRowBySha: ProcessedGraphRowBySha;
94
+ translate: TranslationFn;
95
+ useAuthorInitialsForAvatars: boolean;
96
+ scrollTop: number;
97
+ }
98
+ export interface CommonGraphRowDispatchProps {
99
+ onClickCommit: OnClickCommit;
100
+ onDoubleClickCommit: OnDoubleClickCommit;
101
+ onCommitContextMenu: OnCommitContextMenu;
102
+ clearCurrentlyHoveredGraphCommit: OnClearCurrentlyHoveredGraphCommit;
103
+ setAsCurrentlyHoveredGraphCommit: OnCurrentlyHoveredGraphCommit;
104
+ }
105
+ export type ReserverInfo = {
106
+ type: CommitType;
107
+ newestDate: number;
108
+ column: number;
109
+ };
110
+ export type ExcludeByType = {
111
+ heads?: boolean;
112
+ remotes?: boolean;
113
+ stashes?: boolean;
114
+ tags?: boolean;
115
+ };
116
+ export type ExcludeRefsById = {
117
+ [refId: string]: GraphRefOptData;
118
+ };
119
+ export type ExcludeRemotesByName = {
120
+ [remoteName: string]: boolean;
121
+ };
122
+ export type IncludeOnlyRefsById = {
123
+ [refId: string]: GraphRefOptData;
124
+ };
125
+ export type IncludeOnlyRemotesByName = {
126
+ [remoteName: string]: boolean;
127
+ };
128
+ export type IsSelectedBySha = {
129
+ [id: Sha]: boolean;
130
+ };
131
+ export type HighlightedShas = {
132
+ [sha: Sha]: boolean;
133
+ };
134
+ export type IsExcludedBySha = {
135
+ [id: Sha]: boolean;
136
+ };
137
+ export type HasSpecialChildBySha = {
138
+ [id: Sha]: boolean;
139
+ };
140
+ export type ReserverInfoBySha = {
141
+ [id: Sha]: ReserverInfo;
142
+ };
143
+ export type RefTargetFunc = () => Element | null | undefined;
144
+ export type ColumnContentGenerator = () => ReactElement<any>;
145
+ export type GraphItemContext = string | Object;
146
+ export type RefGroupContexts = {
147
+ [name: string]: GraphItemContext;
148
+ };
149
+ export type RowContexts = {
150
+ row?: GraphItemContext;
151
+ ref?: GraphItemContext;
152
+ refGroups?: RefGroupContexts;
153
+ graph?: GraphItemContext;
154
+ avatar?: GraphItemContext;
155
+ message?: GraphItemContext;
156
+ author?: GraphItemContext;
157
+ date?: GraphItemContext;
158
+ sha?: GraphItemContext;
159
+ stats?: GraphItemContext;
160
+ };
161
+ export type GraphContexts = {
162
+ graph?: GraphItemContext;
163
+ header?: GraphItemContext;
164
+ };
165
+ export interface Ref {
166
+ id?: string;
167
+ name: string;
168
+ context?: GraphItemContext;
169
+ contextGroup?: GraphItemContext;
170
+ }
171
+ export interface Head extends Ref {
172
+ isCurrentHead?: boolean;
173
+ upstream?: string;
174
+ }
175
+ export interface Remote extends Ref {
176
+ owner?: string;
177
+ avatarUrl?: string;
178
+ url?: string;
179
+ current?: boolean;
180
+ }
181
+ export interface Tag extends Ref {
182
+ annotated?: boolean;
183
+ }
184
+ export interface GraphRef extends Head, Remote, Tag {
185
+ refType: GraphRefType;
186
+ fullName?: string;
187
+ }
188
+ export type RefMetadataById = {
189
+ [id: string]: RefMetadata | null;
190
+ } | null;
191
+ export interface RefMetadata {
192
+ pullRequest?: PullRequestMetadata[] | null;
193
+ upstream?: UpstreamMetadata | null;
194
+ }
195
+ export type RefsMissingMetadata = {
196
+ [refId: string]: RefMetadataType[];
197
+ };
198
+ export type RefMetadataRequestedById = {
199
+ [refId: string]: boolean;
200
+ };
201
+ export type RefMetadataType = keyof RefMetadata;
202
+ export declare const pullRequestMetadataType = "pullRequest";
203
+ export declare const upstreamMetadataType = "upstream";
204
+ export declare const allMetadataTypes: RefMetadataType[];
205
+ export type RefMetadataItem = {
206
+ refId: string;
207
+ type: typeof pullRequestMetadataType;
208
+ data: PullRequestMetadata;
209
+ } | {
210
+ refId: string;
211
+ type: typeof upstreamMetadataType;
212
+ data: UpstreamMetadata;
213
+ };
214
+ export interface BaseMetadata {
215
+ context?: GraphItemContext;
216
+ }
217
+ export interface PullRequestMetadata extends BaseMetadata {
218
+ hostingServiceType: HostingServiceType;
219
+ id: number;
220
+ title: string;
221
+ author?: string;
222
+ date?: number;
223
+ state?: string;
224
+ url?: string;
225
+ }
226
+ export interface UpstreamMetadata extends BaseMetadata {
227
+ name: string;
228
+ owner: string;
229
+ ahead: number;
230
+ behind: number;
231
+ sha?: Sha;
232
+ }
233
+ export interface ChildRefsByType {
234
+ heads: Head[];
235
+ remotes: Remote[];
236
+ tags: Tag[];
237
+ }
238
+ export interface ChildRefData extends ChildRefsByType {
239
+ sha: Sha;
240
+ parentIndexScore: number;
241
+ rowEntered: number;
242
+ }
243
+ export type ChildRefCollection = ChildRefData[];
244
+ export type GraphRefOptData = {
245
+ id: string;
246
+ name: string;
247
+ type: GraphRefType;
248
+ owner?: string;
249
+ avatarUrl?: string;
250
+ };
251
+ export type GraphRefGroup = Array<GraphRef>;
252
+ export type HeadsBySha = {
253
+ [id: Sha]: Head[];
254
+ };
255
+ export type RemotesBySha = {
256
+ [id: Sha]: Remote[];
257
+ };
258
+ export type TagsBySha = {
259
+ [id: Sha]: Tag[];
260
+ };
261
+ export interface RowStats {
262
+ files: number;
263
+ additions: number;
264
+ deletions: number;
265
+ }
266
+ export interface RowStatsConstraints {
267
+ min: number;
268
+ max: number;
269
+ }
270
+ export interface GraphRow {
271
+ sha: Sha;
272
+ parents: Sha[];
273
+ author: string;
274
+ email: string;
275
+ date: number;
276
+ message: string;
277
+ type: CommitType;
278
+ heads?: Head[];
279
+ remotes?: Remote[];
280
+ tags?: Tag[];
281
+ contexts?: RowContexts;
282
+ childRefs?: ChildRefsByType;
283
+ stats?: RowStats;
284
+ }
285
+ export interface ProcessedGraphRow extends GraphRow {
286
+ rowIndex?: number;
287
+ column: number;
288
+ edges: RowEdges;
289
+ edgeColumnMaxes: number;
290
+ hasRefs?: boolean;
291
+ messageInline: string;
292
+ timeLineEntry?: TimelineEntry;
293
+ }
294
+ export type TopAndBottomVisibleRowIndex = {
295
+ top: number;
296
+ bottom: number;
297
+ };
298
+ export type GraphRowBySha = {
299
+ [sha: Sha]: GraphRow;
300
+ };
301
+ export type ProcessedGraphRowBySha = {
302
+ [sha: Sha]: ProcessedGraphRow;
303
+ };
304
+ export type ChildrenBySha = {
305
+ [sha: Sha]: Sha[];
306
+ };
307
+ export type GraphZonesByType = {
308
+ [zoneType: string]: GraphZone;
309
+ };
310
+ export type GraphColumnSetting = {
311
+ width: number;
312
+ isHidden: boolean;
313
+ order?: number;
314
+ };
315
+ export type GraphColumnsSettings = {
316
+ [graphZoneType: string]: GraphColumnSetting;
317
+ };
318
+ export type GraphColumnWidthConstraints = {
319
+ min: number;
320
+ max: number;
321
+ };
322
+ export type GraphMarkerColors = {
323
+ [marker: string]: string;
324
+ };
325
+ export type GraphMarkerRowIndices = {
326
+ [marker: string]: number[];
327
+ };
328
+ export type AvatarUrlByEmail = {
329
+ [email: string]: string;
330
+ };
331
+ export type AvatarUrlRequestedByEmail = {
332
+ [email: string]: boolean;
333
+ };
334
+ export type GraphPlatform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin';
335
+ export type GetExternalIcon = (key: string) => ReactElement<any>;
336
+ export type GetMissingAvatar = (email: string, sha: string) => void;
337
+ export type GetMissingRefMetadata = (id: string, types: RefMetadataType[]) => void;
338
+ export type OnHideRefClick = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, sha: Sha) => void;
339
+ export type OnDoubleClickRef = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, sha: Sha, metadataItem?: RefMetadataItem) => void;
340
+ export type OnDoubleClickRefMetadata = (event: React.MouseEvent<any>, metadataItem: RefMetadataItem) => void;
341
+ export type OnRefZoneContextMenu = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, sha: Sha) => void;
342
+ export type OnScrollForZone = (zoneType: GraphZoneType, scroll: ScrollParams, graphWidth: number, graphHeight: number, hasMoreCommits: boolean) => void;
343
+ export type OnCommitMessageChange = (message: string) => void;
344
+ export type OnGraphResized = (width: number, height: number) => void;
345
+ export type OnGraphVisibleRowsChanged = (topVisibleRow: GraphRow, bottomVisibleRow: GraphRow) => void;
346
+ export type OnGraphMouseEnter = (event: React.MouseEvent<any>) => void;
347
+ export type OnGraphMouseLeave = (event: React.MouseEvent<any>) => void;
348
+ export type OnClearCurrentlyHoveredGraphCommit = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha, currentlyHoveredCommitSha?: Sha) => void;
349
+ export type CommitDateTimeSource = CommitDateTimeSources;
350
+ export type OnFormatCommitDateTime = (commitDateTime: number, source?: CommitDateTimeSource) => string;
351
+ export type OnCurrentlyHoveredGraphCommit = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha, currentlyHoveredCommitSha?: Sha) => void;
352
+ export type OnClickCommit = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha) => void;
353
+ export type OnClickRef = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, sha: Sha, metadataItem?: RefMetadataItem) => void;
354
+ export type OnClickRefMetadata = (event: React.MouseEvent<any>, metadataItem: RefMetadataItem) => void;
355
+ export type OnDoubleClickCommit = (event: React.MouseEvent<any>, zoneType: GraphZoneType, sha: Sha) => void;
356
+ export type OnRefNodeHovered = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, sha: Sha) => void;
357
+ export type OnRefNodeUnhovered = (event: React.MouseEvent<any> | React.FocusEvent<any> | null, refGroup: GraphRefGroup, sha: Sha) => void;
358
+ export type OnRefZoneHovered = (sha: Sha) => void;
359
+ export type OnRefZoneUnhovered = () => void;
360
+ export type OnToggleRefNodesShown = (event: React.MouseEvent<any>, refs: GraphRefOptData[], refsVisibles: boolean, sha?: Sha) => void;
361
+ export type OnCommitContextMenu = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha) => void;
362
+ export type OnGraphColumnReOrdered = (sourceGraphZoneType: GraphZoneType, targetGraphZoneType?: GraphZoneType) => void;
363
+ export type OnGraphZoneResize = (graphZone: GraphZone, dimensions: OnResizeParams) => void;
364
+ export type OnGraphZoneResizeEnd = (graphZone: GraphZone, dimensions: OnResizeParams) => void;
365
+ export type OnGraphZoneResizeStart = (graphZone: GraphZone, dimensions: OnResizeParams) => void;
366
+ export type OnGraphZoneResizeFromPropChange = (graphZone: GraphZone, dimensions: OnResizeFromPropChangeParams) => void;
367
+ export type OnPopupGraphHeaderContextMenu = (width: number) => void;
@@ -0,0 +1,9 @@
1
+ export type GitHubDotComHostingServiceType = 'github';
2
+ export type GithubEnterpriseHostingServiceType = 'githubEnterprise';
3
+ export type GitLabHostingServiceType = 'gitlab';
4
+ export type GitLabSelfHostingServiceType = 'gitlabSelfHosted';
5
+ export type AzureDevopsHostingServiceType = 'azureDevops';
6
+ export type BitBucketHostingServiceType = 'bitbucket';
7
+ export type BitBucketServerHostingServiceType = 'bitbucketServer';
8
+ export type HostingServiceType = GitHubDotComHostingServiceType | GithubEnterpriseHostingServiceType | BitBucketHostingServiceType | BitBucketServerHostingServiceType | GitLabHostingServiceType | GitLabSelfHostingServiceType | AzureDevopsHostingServiceType;
9
+ export declare function getHostingServiceName(hostingServiceType: HostingServiceType): string;
@@ -0,0 +1,3 @@
1
+ export declare const DEFAULT_TRANSLATIONS: {
2
+ [key: string]: string;
3
+ };
@@ -0,0 +1 @@
1
+ export declare function formatString(stringBeingFormatted: string, formatArgs: string[]): string;
@@ -0,0 +1 @@
1
+ export type TranslationFn = (key: string, ...formatArgs: any) => string;