@gitkraken/gitkraken-components 2.0.0 → 3.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.
- package/dist/components/graph/GraphContainer.d.ts +20 -11
- package/dist/index.js +1 -1
- package/dist/styles.css +3 -2
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// eslint-disable-next-line no-unused-vars
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import {
|
|
4
|
+
CommitDateTimeSources,
|
|
4
5
|
commitNodeType,
|
|
5
6
|
mergeConflictNodeType,
|
|
6
7
|
mergeNodeType,
|
|
@@ -155,7 +156,7 @@ export type GraphRefGroup = Array<GraphRef>;
|
|
|
155
156
|
|
|
156
157
|
export type RefMetadataById = { [id: string]: RefMetadata | null | undefined } | null;
|
|
157
158
|
export type RefMetadata = {
|
|
158
|
-
|
|
159
|
+
pullRequest?: PullRequestMetadata[] | null;
|
|
159
160
|
upstream?: UpstreamMetadata | null;
|
|
160
161
|
};
|
|
161
162
|
|
|
@@ -201,29 +202,37 @@ export type HostingServiceType =
|
|
|
201
202
|
export type RefsMissingMetadata = {
|
|
202
203
|
[refId: string]: RefMetadataType[]
|
|
203
204
|
}
|
|
204
|
-
export
|
|
205
|
+
export type RefMetadataType = keyof RefMetadata;
|
|
206
|
+
export const pullRequestMetadataType = 'pullRequest';
|
|
205
207
|
export const upstreamMetadataType = 'upstream';
|
|
206
208
|
// Expand this as we add more types to RefMetadata
|
|
207
|
-
export type
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
209
|
+
export type RefMetadataItem =
|
|
210
|
+
| {
|
|
211
|
+
refId: string;
|
|
212
|
+
type: typeof pullRequestMetadataType;
|
|
213
|
+
data: PullRequestMetadata;
|
|
214
|
+
}
|
|
215
|
+
| {
|
|
216
|
+
refId: string;
|
|
217
|
+
type: typeof upstreamMetadataType;
|
|
218
|
+
data: UpstreamMetadata;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export type CommitDateTimeSource = CommitDateTimeSources;
|
|
213
222
|
|
|
214
223
|
// Callbacks
|
|
215
224
|
export type GetExternalIcon = (key: string) => React.ReactElement<any>;
|
|
216
225
|
export type TranslationFn = (key: string, ...formatArgs: any) => string;
|
|
217
|
-
export type OnFormatCommitDateTime = (commitDateTime: number) => string;
|
|
226
|
+
export type OnFormatCommitDateTime = (commitDateTime: number, source?: CommitDateTimeSource) => string;
|
|
218
227
|
|
|
219
228
|
// Events
|
|
220
229
|
export type OnRowContextMenu = (event: any, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
221
230
|
export type OnRefContextMenu = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
|
|
222
231
|
export type OnToggleRefsVisibilityClick = (event: React.MouseEvent, refs: GraphRefOptData[], visible: boolean, graphRow?: GraphRow) => void;
|
|
223
232
|
export type OnClickGraphRow = (event: any, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
224
|
-
export type OnClickGraphRef = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow, metadataItem?:
|
|
233
|
+
export type OnClickGraphRef = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow, metadataItem?: RefMetadataItem) => void;
|
|
225
234
|
export type OnDoubleClickGraphRow = (event: any, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
226
|
-
export type OnDoubleClickGraphRef = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow, metadataItem?:
|
|
235
|
+
export type OnDoubleClickGraphRef = (event: any, refGroup: GraphRefGroup, graphRow: GraphRow, metadataItem?: RefMetadataItem) => void;
|
|
227
236
|
export type OnSelectGraphRows = (selectedRows: GraphRow[]) => void;
|
|
228
237
|
export type OnGraphRowHovered = (event: any, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
229
238
|
export type OnGraphRowUnhovered = (event: any, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|