@gitkraken/gitkraken-components 1.1.0-rc.2 → 1.1.0-rc.22

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.
@@ -11,10 +11,17 @@ import {
11
11
 
12
12
  // Input variables
13
13
  export type Sha = string;
14
- export type CssVariables = {[variable: string]: string};
15
- export type HiddenRefsById = {[refId: string]: GraphRefOptData};
16
- export type IsSelectedBySha = {[sha: Sha]: boolean};
17
- export type HighlightedShas = {[sha: Sha]: boolean};
14
+ export type CssVariables = { [variable: string]: string };
15
+ export type ExcludeByType = {
16
+ heads?: boolean;
17
+ remotes?: boolean;
18
+ stashes?: boolean;
19
+ tags?: boolean;
20
+ };
21
+ export type ExcludeRefsById = { [refId: string]: GraphRefOptData };
22
+ export type IncludeOnlyRefsById = { [refId: string]: GraphRefOptData };
23
+ export type IsSelectedBySha = { [sha: Sha]: boolean };
24
+ export type HighlightedShas = { [sha: Sha]: boolean };
18
25
 
19
26
  export type WorkDirType = typeof mergeConflictNodeType
20
27
  | typeof unsupportedRebaseWarningNodeType
@@ -59,35 +66,33 @@ export type RowContexts = {
59
66
  sha?: GraphItemContext;
60
67
  };
61
68
 
69
+ export type RowStats = {
70
+ files: number;
71
+ additions: number;
72
+ deletions: number;
73
+ };
74
+
62
75
  export type GraphContexts = {
63
76
  graph?: GraphItemContext;
64
77
  header?: GraphItemContext;
65
78
  };
66
79
 
67
- export interface Head {
68
- id?: string,
80
+ interface Ref {
81
+ id?: string;
69
82
  name: string;
70
- isCurrentHead?: boolean;
71
83
  context?: GraphItemContext;
72
84
  contextGroup?: GraphItemContext;
73
85
  }
74
-
75
- export interface Remote {
76
- id?: string,
77
- name: string;
86
+ export interface Head extends Ref {
87
+ isCurrentHead?: boolean;
88
+ }
89
+ export interface Remote extends Ref {
78
90
  owner?: string;
79
91
  avatarUrl?: string;
80
92
  url?: string;
81
- context?: GraphItemContext;
82
- contextGroup?: GraphItemContext;
83
93
  }
84
-
85
- export interface Tag {
86
- id?: string,
87
- name: string;
94
+ export interface Tag extends Ref {
88
95
  annotated?: boolean;
89
- context?: GraphItemContext;
90
- contextGroup?: GraphItemContext;
91
96
  }
92
97
 
93
98
  export type GraphRow = {
@@ -102,11 +107,13 @@ export type GraphRow = {
102
107
  remotes?: Remote[];
103
108
  tags?: Tag[];
104
109
  contexts?: RowContexts;
110
+ stats?: RowStats;
105
111
  };
106
112
 
107
113
  export type GraphColumnSetting = {
108
114
  width: number,
109
- isHidden: boolean
115
+ isHidden: boolean,
116
+ order?: number
110
117
  };
111
118
 
112
119
  export type AvatarUrlByEmail = { [email: string]: string };
@@ -148,6 +155,7 @@ export type GraphRefGroup = Array<GraphRef>;
148
155
  export type RefMetadataById = { [id: string]: RefMetadata | null | undefined } | null;
149
156
  export type RefMetadata = {
150
157
  pullRequests?: PullRequestMetadata[] | null;
158
+ upstream?: UpstreamMetadata | null;
151
159
  };
152
160
 
153
161
  export type PullRequestMetadata = {
@@ -161,6 +169,14 @@ export type PullRequestMetadata = {
161
169
  context?: GraphItemContext;
162
170
  };
163
171
 
172
+ export type UpstreamMetadata = {
173
+ name: string,
174
+ owner: string,
175
+ ahead: number,
176
+ behind: number,
177
+ sha?: Sha
178
+ };
179
+
164
180
  // Hosting service types for pull request metadata
165
181
  export const gitHubDotComHostingServiceType = 'github';
166
182
  export const githubEnterpriseHostingServiceType = 'githubEnterprise';
@@ -182,8 +198,9 @@ export type RefsMissingMetadata = {
182
198
  [refId: string]: RefMetadataType[]
183
199
  }
184
200
  export const pullRequestMetadataType = 'pullRequests';
201
+ export const upstreamMetadataType = 'upstream';
185
202
  // Expand this as we add more types to RefMetadata
186
- export type RefMetadataType = typeof pullRequestMetadataType;
203
+ export type RefMetadataType = typeof pullRequestMetadataType | typeof upstreamMetadataType;
187
204
 
188
205
  // Callbacks
189
206
  export type GetExternalIcon = (key: string) => React.ReactElement<any>;
@@ -203,10 +220,12 @@ export type OnGraphRowHovered = (event: any, graphZoneType: GraphZoneType, graph
203
220
  export type OnGraphRowUnhovered = (event: any, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
204
221
  export type OnGraphRefNodeHovered = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
205
222
  export type OnGraphRefNodeUnhovered = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
223
+ export type OnGraphColumnsReOrdered = (columnsSettings: GraphColumnsSettings) => void;
206
224
  export type OnGraphColumnResized = (graphZoneType: GraphZoneType, columnSettings: GraphColumnSetting) => void;
207
225
  export type OnGraphResized = (width: number, height: number) => void;
226
+ export type OnGraphVisibleRowsChanged = (topVisibleRow: GraphRow, bottomVisibleRow: GraphRow) => void;
208
227
  export type OnShowMoreCommits = () => void;
209
- export type OnEmailsMissingAvatarUrls = (emails: { [email: string]: string }) => void;
228
+ export type OnEmailsMissingAvatarUrls = (emails: AvatarUrlByEmail) => void;
210
229
  export type OnRefsMissingMetadata = (refs: RefsMissingMetadata) => void;
211
230
 
212
231
  // Main graph component
@@ -215,15 +234,21 @@ export interface GraphContainerProps {
215
234
  contexts?: GraphContexts;
216
235
  platform?: GraphPlatform;
217
236
  cssVariables?: CssVariables;
237
+ dimMergeCommits?: boolean;
218
238
  getExternalIcon: GetExternalIcon;
219
- highlightRowsOnRefHover?: boolean,
220
- showGhostRefsOnRowHover?: boolean,
221
- showRemoteNamesOnRefs?: boolean,
222
- enableMultiSelection?: boolean,
239
+ highlightRowsOnRefHover?: boolean;
240
+ isContainerWindowFocused?: boolean;
241
+ showGhostRefsOnRowHover?: boolean;
242
+ showRemoteNamesOnRefs?: boolean;
243
+ showUpstreamStatus?: boolean;
244
+ scrollRowPadding?: number;
245
+ enableMultiSelection?: boolean;
223
246
  graphRows: GraphRow[];
224
247
  hasMoreCommits?: boolean;
225
248
  highlightedShas?: HighlightedShas;
226
- hiddenRefsById?: HiddenRefsById;
249
+ excludeByType?: ExcludeByType;
250
+ excludeRefsById?: ExcludeRefsById;
251
+ includeOnlyRefsById?: IncludeOnlyRefsById;
227
252
  isSelectedBySha?: IsSelectedBySha;
228
253
  isLoadingRows?: boolean;
229
254
  columnsSettings?: GraphColumnsSettings;
@@ -234,11 +259,12 @@ export interface GraphContainerProps {
234
259
  workDirStats?: WorkDirStats;
235
260
  onRowContextMenu?: OnRowContextMenu;
236
261
  onRefContextMenu?: OnRefContextMenu;
237
- onToggleRefsVisibilityClick?: OnToggleRefsVisibilityClick,
262
+ onToggleRefsVisibilityClick?: OnToggleRefsVisibilityClick;
238
263
  onGraphRowHovered?: OnGraphRowHovered;
239
264
  onGraphRowUnhovered?: OnGraphRowUnhovered;
240
265
  onGraphRefNodeHovered?: OnGraphRefNodeHovered;
241
266
  onGraphRefNodeUnhovered?: OnGraphRefNodeUnhovered;
267
+ onGraphColumnsReOrdered?: OnGraphColumnsReOrdered;
242
268
  onColumnResized?: OnGraphColumnResized;
243
269
  onClickGraphRef?: OnClickGraphRef;
244
270
  onClickGraphRow?: OnClickGraphRow;
@@ -247,10 +273,11 @@ export interface GraphContainerProps {
247
273
  onSelectGraphRows?: OnSelectGraphRows;
248
274
  onShowMoreCommits?: OnShowMoreCommits;
249
275
  onGraphResized?: OnGraphResized;
276
+ onGraphVisibleRowsChanged?: OnGraphVisibleRowsChanged;
250
277
  onEmailsMissingAvatarUrls?: OnEmailsMissingAvatarUrls;
251
278
  onRefsMissingMetadata?: OnRefsMissingMetadata;
252
279
  formatCommitDateTime?: OnFormatCommitDateTime;
253
- shaLength?: number;
280
+ shaLength?: number | null;
254
281
  nonce?: string;
255
282
  }
256
283
 
@@ -268,7 +295,7 @@ declare class GraphContainer extends React.PureComponent<GraphContainerProps, an
268
295
  ): void;
269
296
  forceUpdate(callback?: () => void): void;
270
297
  render(): JSX.Element;
271
- selectCommits(shas: Sha[], includeToPrevSel: boolean): void;
298
+ selectCommits(shas: Sha[], includeToPrevSel: boolean, isAutoOrKeyScroll: boolean): void;
272
299
  }
273
300
 
274
301
  export default GraphContainer;