@gitkraken/gitkraken-components 1.1.0-rc.9 → 2.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.
@@ -30,7 +30,8 @@ export type WorkDirType = typeof mergeConflictNodeType
30
30
  export type WorkDirStats = {
31
31
  added: number,
32
32
  deleted: number,
33
- modified: number
33
+ modified: number,
34
+ context?: GraphItemContext
34
35
  // TODO: Add renamed once available in GitLens from provider
35
36
  // renamed: number
36
37
  };
@@ -66,6 +67,12 @@ export type RowContexts = {
66
67
  sha?: GraphItemContext;
67
68
  };
68
69
 
70
+ export type RowStats = {
71
+ files: number;
72
+ additions: number;
73
+ deletions: number;
74
+ };
75
+
69
76
  export type GraphContexts = {
70
77
  graph?: GraphItemContext;
71
78
  header?: GraphItemContext;
@@ -101,6 +108,7 @@ export type GraphRow = {
101
108
  remotes?: Remote[];
102
109
  tags?: Tag[];
103
110
  contexts?: RowContexts;
111
+ stats?: RowStats;
104
112
  };
105
113
 
106
114
  export type GraphColumnSetting = {
@@ -148,9 +156,14 @@ export type GraphRefGroup = Array<GraphRef>;
148
156
  export type RefMetadataById = { [id: string]: RefMetadata | null | undefined } | null;
149
157
  export type RefMetadata = {
150
158
  pullRequests?: PullRequestMetadata[] | null;
159
+ upstream?: UpstreamMetadata | null;
151
160
  };
152
161
 
153
- export type PullRequestMetadata = {
162
+ export interface BaseMetadata {
163
+ context?: GraphItemContext;
164
+ }
165
+
166
+ export interface PullRequestMetadata extends BaseMetadata {
154
167
  hostingServiceType: HostingServiceType;
155
168
  id: number;
156
169
  title: string;
@@ -158,8 +171,15 @@ export type PullRequestMetadata = {
158
171
  date?: number;
159
172
  state?: string;
160
173
  url?: string;
161
- context?: GraphItemContext;
162
- };
174
+ }
175
+
176
+ export interface UpstreamMetadata extends BaseMetadata {
177
+ name: string;
178
+ owner: string;
179
+ ahead: number;
180
+ behind: number;
181
+ sha?: Sha;
182
+ }
163
183
 
164
184
  // Hosting service types for pull request metadata
165
185
  export const gitHubDotComHostingServiceType = 'github';
@@ -182,8 +202,14 @@ export type RefsMissingMetadata = {
182
202
  [refId: string]: RefMetadataType[]
183
203
  }
184
204
  export const pullRequestMetadataType = 'pullRequests';
205
+ export const upstreamMetadataType = 'upstream';
185
206
  // Expand this as we add more types to RefMetadata
186
- export type RefMetadataType = typeof pullRequestMetadataType;
207
+ export type RefMetadataType = typeof pullRequestMetadataType | typeof upstreamMetadataType;
208
+ export type RefMetadataItem = PullRequestMetadata | UpstreamMetadata;
209
+ export type RefMetadataItemWithIdAndType = RefMetadataItem & {
210
+ refId: string;
211
+ metadataType: RefMetadataType;
212
+ };
187
213
 
188
214
  // Callbacks
189
215
  export type GetExternalIcon = (key: string) => React.ReactElement<any>;
@@ -195,9 +221,9 @@ export type OnRowContextMenu = (event: any, graphZoneType: GraphZoneType, graphR
195
221
  export type OnRefContextMenu = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
196
222
  export type OnToggleRefsVisibilityClick = (event: React.MouseEvent, refs: GraphRefOptData[], visible: boolean, graphRow?: GraphRow) => void;
197
223
  export type OnClickGraphRow = (event: any, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
198
- export type OnClickGraphRef = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
224
+ export type OnClickGraphRef = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow, metadataItem?: RefMetadataItemWithIdAndType) => void;
199
225
  export type OnDoubleClickGraphRow = (event: any, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
200
- export type OnDoubleClickGraphRef = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
226
+ export type OnDoubleClickGraphRef = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow, metadataItem?: RefMetadataItemWithIdAndType) => void;
201
227
  export type OnSelectGraphRows = (selectedRows: GraphRow[]) => void;
202
228
  export type OnGraphRowHovered = (event: any, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
203
229
  export type OnGraphRowUnhovered = (event: any, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
@@ -206,6 +232,9 @@ export type OnGraphRefNodeUnhovered = (event: any, refGroup: GraphRefGroup, grap
206
232
  export type OnGraphColumnsReOrdered = (columnsSettings: GraphColumnsSettings) => void;
207
233
  export type OnGraphColumnResized = (graphZoneType: GraphZoneType, columnSettings: GraphColumnSetting) => void;
208
234
  export type OnGraphResized = (width: number, height: number) => void;
235
+ export type OnGraphVisibleRowsChanged = (topVisibleRow: GraphRow, bottomVisibleRow: GraphRow) => void;
236
+ export type OnGraphMouseEnter = (event: any) => void;
237
+ export type OnGraphMouseLeave = (event: any) => void;
209
238
  export type OnShowMoreCommits = () => void;
210
239
  export type OnEmailsMissingAvatarUrls = (emails: AvatarUrlByEmail) => void;
211
240
  export type OnRefsMissingMetadata = (refs: RefsMissingMetadata) => void;
@@ -216,13 +245,15 @@ export interface GraphContainerProps {
216
245
  contexts?: GraphContexts;
217
246
  platform?: GraphPlatform;
218
247
  cssVariables?: CssVariables;
248
+ dimMergeCommits?: boolean;
219
249
  getExternalIcon: GetExternalIcon;
220
- highlightRowsOnRefHover?: boolean,
250
+ highlightRowsOnRefHover?: boolean;
221
251
  isContainerWindowFocused?: boolean;
222
- showGhostRefsOnRowHover?: boolean,
223
- showRemoteNamesOnRefs?: boolean,
224
- scrollRowPadding?: number,
225
- enableMultiSelection?: boolean,
252
+ showGhostRefsOnRowHover?: boolean;
253
+ showRemoteNamesOnRefs?: boolean;
254
+ enabledRefMetadataTypes?: RefMetadataType[];
255
+ scrollRowPadding?: number;
256
+ enableMultiSelection?: boolean;
226
257
  graphRows: GraphRow[];
227
258
  hasMoreCommits?: boolean;
228
259
  highlightedShas?: HighlightedShas;
@@ -239,12 +270,12 @@ export interface GraphContainerProps {
239
270
  workDirStats?: WorkDirStats;
240
271
  onRowContextMenu?: OnRowContextMenu;
241
272
  onRefContextMenu?: OnRefContextMenu;
242
- onToggleRefsVisibilityClick?: OnToggleRefsVisibilityClick,
273
+ onToggleRefsVisibilityClick?: OnToggleRefsVisibilityClick;
243
274
  onGraphRowHovered?: OnGraphRowHovered;
244
275
  onGraphRowUnhovered?: OnGraphRowUnhovered;
245
276
  onGraphRefNodeHovered?: OnGraphRefNodeHovered;
246
277
  onGraphRefNodeUnhovered?: OnGraphRefNodeUnhovered;
247
- onGraphColumnsReOrdered?: OnGraphColumnsReOrdered,
278
+ onGraphColumnsReOrdered?: OnGraphColumnsReOrdered;
248
279
  onColumnResized?: OnGraphColumnResized;
249
280
  onClickGraphRef?: OnClickGraphRef;
250
281
  onClickGraphRow?: OnClickGraphRow;
@@ -253,10 +284,13 @@ export interface GraphContainerProps {
253
284
  onSelectGraphRows?: OnSelectGraphRows;
254
285
  onShowMoreCommits?: OnShowMoreCommits;
255
286
  onGraphResized?: OnGraphResized;
287
+ onGraphVisibleRowsChanged?: OnGraphVisibleRowsChanged;
288
+ onGraphMouseEnter?: OnGraphMouseEnter;
289
+ onGraphMouseLeave?: OnGraphMouseLeave;
256
290
  onEmailsMissingAvatarUrls?: OnEmailsMissingAvatarUrls;
257
291
  onRefsMissingMetadata?: OnRefsMissingMetadata;
258
292
  formatCommitDateTime?: OnFormatCommitDateTime;
259
- shaLength?: number;
293
+ shaLength?: number | null;
260
294
  nonce?: string;
261
295
  }
262
296