@gitkraken/gitkraken-components 13.0.0-vnext.2 → 13.0.0-vnext.27
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/README.md +2 -0
- package/dist/components/dnd/DndComponent.d.ts +1 -1
- package/dist/components/dnd/DndContainer.d.ts +1 -1
- package/dist/components/graph/GraphColumn.d.ts +5 -2
- package/dist/components/graph/GraphContainer.d.ts +211 -21
- package/dist/components/graph/GraphHeaderRow.d.ts +5 -1
- package/dist/components/graph/GraphScrollMarker.d.ts +1 -1
- package/dist/components/graph/commitzone/CommitNode.d.ts +1 -1
- package/dist/components/graph/commitzone/CommitZone.d.ts +1 -1
- package/dist/components/graph/commitzone/GraphAvatar.d.ts +1 -1
- package/dist/components/graph/commitzone/edges/Edges.d.ts +1 -1
- package/dist/components/graph/common/DraggableGraphHeader.d.ts +1 -1
- package/dist/components/graph/common/GenericGraphZone.d.ts +1 -1
- package/dist/components/graph/common/ScrollbarContainer.d.ts +1 -1
- package/dist/components/graph/common/StickyTimeline.d.ts +10 -0
- package/dist/components/graph/common/TimelineMessage.d.ts +6 -0
- package/dist/components/graph/messagezone/WorkDirMessageInput.d.ts +1 -1
- package/dist/components/graph/refzone/CreateRefNode.d.ts +1 -1
- package/dist/components/graph/refzone/RefNode.d.ts +2 -1
- package/dist/components/graph/refzone/RefNodes.d.ts +2 -1
- package/dist/components/graph/refzone/RefZone.d.ts +4 -1
- package/dist/components/graph/rowAdornment/RowAdornmentLayer.d.ts +52 -0
- package/dist/components/graph/rowAdornment/RowAdornmentOverlay.d.ts +19 -0
- package/dist/components/graph/rowRenderers/CommitsInfoRow.d.ts +1 -1
- package/dist/components/graph/rowRenderers/RefZoneRow.d.ts +1 -0
- package/dist/components/graph/shared/Avatar.d.ts +1 -1
- package/dist/components/graph/shared/FileDiffTypeIcon.d.ts +2 -1
- package/dist/components/graph/shared/WipStatsPill.d.ts +11 -0
- package/dist/components/resizable/Resizable.d.ts +2 -7
- package/dist/domain/generic/GenericTypes.d.ts +6 -0
- package/dist/domain/graph/GraphConstants.d.ts +15 -1
- package/dist/domain/graph/GraphHelpers.d.ts +21 -5
- package/dist/domain/graph/GraphTypes.d.ts +29 -8
- package/dist/domain/graph/row/ProcessedGraphRowObj.d.ts +4 -4
- package/dist/domain/graph/rowAdornment/RowAdornmentTypes.d.ts +97 -0
- package/dist/domain/hostingservice/HostingServiceTypes.d.ts +3 -1
- package/dist/domain/reactvirtualized/ReactVirtualizedHelpers.d.ts +1 -1
- package/dist/domain/ref/RefConstants.d.ts +4 -1
- package/dist/domain/ref/RefTypes.d.ts +1 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +21 -2
- package/dist/styles.css +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/utils/ObjectUtils.d.ts +29 -0
- package/package.json +100 -93
- package/CHANGELOG.md +0 -15
- package/ThirdPartyNotices.txt +0 -227
- package/dist/types.js +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Sha } from '../../../domain/commit/CommitTypes';
|
|
3
|
+
import type { ProcessedGraphRow } from '../../../domain/graph/GraphTypes';
|
|
4
|
+
import type { RowAdornmentProvider } from '../../../domain/graph/rowAdornment/RowAdornmentTypes';
|
|
5
|
+
interface RowAdornmentLayerProps {
|
|
6
|
+
/** The row adornment provider */
|
|
7
|
+
provider: RowAdornmentProvider;
|
|
8
|
+
/** Lazily get currently visible rows - only called when needed */
|
|
9
|
+
getVisibleRows: () => ProcessedGraphRow[];
|
|
10
|
+
/** All processed rows for index lookups */
|
|
11
|
+
allRows: ProcessedGraphRow[];
|
|
12
|
+
/** Set of selected SHAs */
|
|
13
|
+
selectedShas: Set<Sha>;
|
|
14
|
+
/** Currently hovered commit SHA */
|
|
15
|
+
hoveredSha?: Sha;
|
|
16
|
+
/** Currently focused commit SHA */
|
|
17
|
+
focusedSha?: Sha;
|
|
18
|
+
/** Whether vertical scrollbar is visible (to offset adornments) */
|
|
19
|
+
hasVerticalScrollbar?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface RowAdornmentLayerState {
|
|
22
|
+
/** Trigger re-render when cache changes */
|
|
23
|
+
cacheVersion: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Manages row adornment state and rendering.
|
|
27
|
+
* Encapsulates all adornment caching, provide/resolve flows, and overlay rendering.
|
|
28
|
+
*/
|
|
29
|
+
declare class RowAdornmentLayer extends React.Component<RowAdornmentLayerProps, RowAdornmentLayerState> {
|
|
30
|
+
/** Cached adornment info per SHA */
|
|
31
|
+
private adornments;
|
|
32
|
+
/** Tracks pending async resolve calls to cancel stale ones */
|
|
33
|
+
private pendingResolves;
|
|
34
|
+
/** Abort controller for canceling in-flight provide calls */
|
|
35
|
+
private provideAbortController?;
|
|
36
|
+
/** Counter for generating unique resolve IDs */
|
|
37
|
+
private resolveIdCounter;
|
|
38
|
+
state: RowAdornmentLayerState;
|
|
39
|
+
componentDidMount(): void;
|
|
40
|
+
componentDidUpdate(prevProps: RowAdornmentLayerProps): void;
|
|
41
|
+
componentWillUnmount(): void;
|
|
42
|
+
private setupProvider;
|
|
43
|
+
private teardownProvider;
|
|
44
|
+
private onInvalidate;
|
|
45
|
+
private provideForVisibleRows;
|
|
46
|
+
private applyProvideResults;
|
|
47
|
+
private evictDistantAdornments;
|
|
48
|
+
private shouldShowAdornment;
|
|
49
|
+
private getOrResolveContent;
|
|
50
|
+
render(): React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
export default RowAdornmentLayer;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { Sha } from '../../../domain/commit/CommitTypes';
|
|
4
|
+
interface RowAdornmentOverlayProps {
|
|
5
|
+
/** The SHA of the row this adornment is for */
|
|
6
|
+
sha: Sha;
|
|
7
|
+
/** The content to render */
|
|
8
|
+
content: ReactNode;
|
|
9
|
+
/** Whether the row is hovered */
|
|
10
|
+
isHovered?: boolean;
|
|
11
|
+
/** Whether the row is selected */
|
|
12
|
+
isSelected?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders a row adornment overlay positioned at the right edge of a row.
|
|
16
|
+
* Uses CSS anchor positioning to attach to the row element.
|
|
17
|
+
*/
|
|
18
|
+
declare function RowAdornmentOverlay({ sha, content, isHovered, isSelected, }: RowAdornmentOverlayProps): React.ReactElement | null;
|
|
19
|
+
export default RowAdornmentOverlay;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import type { Style } from '../../../domain/generic/GenericTypes';
|
|
4
4
|
import type { GraphZoneType } from '../../../domain/graph/GraphConstants';
|
|
5
5
|
import type { GetExternalIcon } from '../../../domain/graph/GraphTypes';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import type { Style } from '../../../domain/generic/GenericTypes';
|
|
4
4
|
import type { GetExternalIcon } from '../../../domain/graph/GraphTypes';
|
|
5
5
|
import type { TranslationFn } from '../../../domain/language/LanguageTypes';
|
|
@@ -8,6 +8,7 @@ type Props = {
|
|
|
8
8
|
fileDiffType: string;
|
|
9
9
|
getExternalIcon: GetExternalIcon;
|
|
10
10
|
translate: TranslationFn;
|
|
11
|
+
noMargin?: boolean;
|
|
11
12
|
};
|
|
12
13
|
declare class FileDiffTypeIcon extends React.Component<Props> {
|
|
13
14
|
render(): ReactElement<'span'> | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { GetExternalIcon } from '../../../domain/graph/GraphTypes';
|
|
3
|
+
import type { TranslationFn } from '../../../domain/language/LanguageTypes';
|
|
4
|
+
import type { WorkDirStats } from '../../../domain/workdir/WorkDirTypes';
|
|
5
|
+
type Props = {
|
|
6
|
+
workDirStats: WorkDirStats;
|
|
7
|
+
getExternalIcon: GetExternalIcon;
|
|
8
|
+
translate: TranslationFn;
|
|
9
|
+
};
|
|
10
|
+
declare function WipStatsPill({ workDirStats, getExternalIcon, translate }: Props): ReactElement<'span'> | null;
|
|
11
|
+
export default WipStatsPill;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { HandleStyles, ResizeCallback, ResizeStartCallback } from 're-resizable';
|
|
3
2
|
import type { ReactElement, ReactNode } from 'react';
|
|
4
|
-
import React from 'react';
|
|
3
|
+
import * as React from 'react';
|
|
5
4
|
import type { Style } from '../../domain/generic/GenericTypes';
|
|
6
5
|
import type { TranslationFn } from '../../domain/language/LanguageTypes';
|
|
7
|
-
import type { OnResize, OnResizeEnd, OnResizeFromPropChange, OnResizeStart
|
|
6
|
+
import type { OnResize, OnResizeEnd, OnResizeFromPropChange, OnResizeStart } from '../../domain/ui/UiTypes';
|
|
8
7
|
declare const resizableEdges: {
|
|
9
8
|
bottom: string;
|
|
10
9
|
left: string;
|
|
@@ -61,19 +60,15 @@ interface State extends Dimensions {
|
|
|
61
60
|
initialWidth: number;
|
|
62
61
|
resizing: boolean;
|
|
63
62
|
vertical: boolean;
|
|
64
|
-
isMouseWheeling: boolean;
|
|
65
63
|
}
|
|
66
64
|
export default class Resizable extends React.PureComponent<Props, State> {
|
|
67
65
|
static defaultProps: DefaultProps;
|
|
68
|
-
onWheelTimeOut?: NodeJS.Timeout;
|
|
69
|
-
isMouseWheeling: boolean;
|
|
70
66
|
constructor(props: Props);
|
|
71
67
|
static getDerivedStateFromProps(props: Props, state: State): State;
|
|
72
68
|
componentDidUpdate(nextProps: Props): void;
|
|
73
69
|
_onResize: ResizeCallback;
|
|
74
70
|
_onResizeStart: ResizeStartCallback;
|
|
75
71
|
_onResizeEnd: ResizeCallback;
|
|
76
|
-
_onWheel: OnWheel;
|
|
77
72
|
render(): ReactElement<'div'>;
|
|
78
73
|
}
|
|
79
74
|
export {};
|
|
@@ -15,9 +15,15 @@ export type GitRemoteUrl = GitHttpsUrl | GitSshUrl;
|
|
|
15
15
|
export type Platform = 'darwin' | 'linux' | 'win32';
|
|
16
16
|
export declare enum NamedKeys {
|
|
17
17
|
arrowDownKey = "ArrowDown",
|
|
18
|
+
arrowLeftKey = "ArrowLeft",
|
|
19
|
+
arrowRightKey = "ArrowRight",
|
|
18
20
|
arrowUpKey = "ArrowUp",
|
|
19
21
|
controlKey = "Control",
|
|
22
|
+
endKey = "End",
|
|
23
|
+
homeKey = "Home",
|
|
20
24
|
metaKey = "Meta",
|
|
25
|
+
pageDownKey = "PageDown",
|
|
26
|
+
pageUpKey = "PageUp",
|
|
21
27
|
shiftKey = "Shift"
|
|
22
28
|
}
|
|
23
29
|
export type MapWithCacheQueue<T, U> = {
|
|
@@ -70,6 +70,20 @@ export declare const commitAuthorZone: CommitAuthorZoneType;
|
|
|
70
70
|
export declare const commitDateTimeZone: CommitDateTimeZoneType;
|
|
71
71
|
export declare const commitShaZone: CommitShaZoneType;
|
|
72
72
|
export declare const changesZone: ChangesZoneType;
|
|
73
|
+
/**
|
|
74
|
+
* A sentinel key used as a key in objects to indicate "empty set" state
|
|
75
|
+
* This distinguishes between:
|
|
76
|
+
* - `{}` (empty object) - no filtering applied or null/undefined
|
|
77
|
+
* - `{ [emptySetMarker]: true }` - filtering applied but yielded no results
|
|
78
|
+
*
|
|
79
|
+
* Example usage:
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const highlightedShas = searchResults.count === 0
|
|
82
|
+
* ? { [emptySetMarker]: true } // No results found
|
|
83
|
+
* : searchResults.ids; // Results found
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare const emptySetMarker = "gk.empty-set-marker";
|
|
73
87
|
export declare enum GraphColumnMode {
|
|
74
88
|
Compact = "compact",
|
|
75
89
|
Rich = "rich",
|
|
@@ -154,5 +168,5 @@ export declare enum graphCommitDescDisplayModes {
|
|
|
154
168
|
NEVER = "NEVER"
|
|
155
169
|
}
|
|
156
170
|
export type GraphCommitDescDisplayMode = graphCommitDescDisplayModes.ALWAYS | graphCommitDescDisplayModes.ON_HOVER | graphCommitDescDisplayModes.NEVER;
|
|
157
|
-
export type ShiftSelectMode = 'simple';
|
|
171
|
+
export type ShiftSelectMode = 'simple' | 'topological';
|
|
158
172
|
export type GraphSearchMode = 'normal' | 'filter';
|
|
@@ -4,9 +4,9 @@ import type { CssVariables } from '../generic/GenericTypes';
|
|
|
4
4
|
import type { GetRealKeyForCellFunc } from '../reactvirtualized/ReactVirtualizedHelpers';
|
|
5
5
|
import type { GraphRefType } from '../ref/RefTypes';
|
|
6
6
|
import type { WorkDirStats } from '../workdir/WorkDirTypes';
|
|
7
|
-
import type { GraphMarkerType, GraphZone, GraphZoneType,
|
|
7
|
+
import type { GraphMarkerType, GraphZone, GraphZoneType, TimelineEntry } from './GraphConstants';
|
|
8
8
|
import { GraphColumnMode } from './GraphConstants';
|
|
9
|
-
import type { BaseMetadata, GetMissingRefMetadata, GraphColumnWidthConstraints, GraphItemContext, GraphRef, GraphRefGroup, GraphRow, GraphZoneModeConstants, Head, HighlightedShas, ProcessedGraphRow, ProcessedGraphRowBySha, Ref, RefMetadata, RefMetadataById, RefMetadataType, RowStatsConstraints } from './GraphTypes';
|
|
9
|
+
import type { BaseMetadata, ExternalIconKeys, GetMissingRefMetadata, GraphColumnWidthConstraints, GraphItemContext, GraphRef, GraphRefGroup, GraphRow, GraphZoneModeConstants, Head, HighlightedShas, ProcessedGraphRow, ProcessedGraphRowBySha, Ref, RefMetadata, RefMetadataById, RefMetadataType, RowStatsConstraints } from './GraphTypes';
|
|
10
10
|
export type DebouncableFn = (...args: any) => void;
|
|
11
11
|
export type DebouncedFn = (...args: any) => void;
|
|
12
12
|
export declare const debounceFrame: (func: DebouncableFn) => DebouncedFn;
|
|
@@ -17,8 +17,23 @@ export declare function hasScrolledToBottom(htmlElement: HTMLElement): boolean;
|
|
|
17
17
|
export declare function hasScrolledToRight(htmlElement: HTMLElement): boolean;
|
|
18
18
|
export declare function parseContext(context?: GraphItemContext | null): string | null;
|
|
19
19
|
export declare function getRowStatsConstraints(stats: number[]): RowStatsConstraints;
|
|
20
|
-
export declare function getOrAskForRefMetadata(ref: GraphRef, refMetadata: RefMetadataById | undefined, onMissingRefMetadata: GetMissingRefMetadata, refMetadataType?: RefMetadataType): RefMetadata | BaseMetadata | BaseMetadata[] | null | undefined;
|
|
21
|
-
export declare function
|
|
20
|
+
export declare function getOrAskForRefMetadata(ref: GraphRef, refMetadata: RefMetadataById | undefined, onMissingRefMetadata: GetMissingRefMetadata, refMetadataType?: RefMetadataType, fallbackRefMetadata?: RefMetadataById | null): RefMetadata | BaseMetadata | BaseMetadata[] | null | undefined;
|
|
21
|
+
export declare function getTimelineLabelAndValue(diffMs: number): {
|
|
22
|
+
label: string;
|
|
23
|
+
value: number;
|
|
24
|
+
};
|
|
25
|
+
export declare function getTimelineEntriesByPeriod(): TimelineEntry[];
|
|
26
|
+
/**
|
|
27
|
+
* Assigns timeline entries to graph rows based on commit dates.
|
|
28
|
+
*
|
|
29
|
+
* Timeline markers act as boundaries between time periods:
|
|
30
|
+
* - All commits above a marker must be younger (more recent) than the marker time
|
|
31
|
+
* - All commits at and below a marker must be equal to or older than the marker time
|
|
32
|
+
*
|
|
33
|
+
* @param orderedRows - Array of graph rows ordered from newest to oldest
|
|
34
|
+
* @param entries - Array of timeline entries ordered from newest to oldest
|
|
35
|
+
*/
|
|
36
|
+
export declare function assignTimelineEntriesToRows(orderedRows: ProcessedGraphRow[], entries: TimelineEntry[]): void;
|
|
22
37
|
export declare function getRefIdByBaseRef(refType: GraphRefType, ref: Ref): string;
|
|
23
38
|
export declare function getRefIdByGraphRef(ref: GraphRef): string;
|
|
24
39
|
export declare function getLastShrinkableGraphZone(activeGraphZones: GraphZone[], stoppingIndex?: number): GraphZone | undefined;
|
|
@@ -53,7 +68,7 @@ export declare function workDirStatsHaveChanges(workDirStats?: WorkDirStats): bo
|
|
|
53
68
|
export declare function hasSingleSelectedSha(selectedShas: Set<Sha>): boolean;
|
|
54
69
|
export declare function isSingleSelected(selectedShas: Set<Sha>, sha: Sha): boolean;
|
|
55
70
|
export declare function getScrollToAlignment(rowHeight: number, clientHeight: number, scrollTop: number, scrollToIndex: number): Alignment;
|
|
56
|
-
export declare function getGraphZoneIconByType(zoneType: GraphZoneType):
|
|
71
|
+
export declare function getGraphZoneIconByType(zoneType: GraphZoneType): ExternalIconKeys | undefined;
|
|
57
72
|
export declare function isHeadActive(head: Head): boolean;
|
|
58
73
|
export declare function isGraphRefActive(ref: GraphRef): boolean;
|
|
59
74
|
export interface GraphRowHelperProps {
|
|
@@ -70,6 +85,7 @@ export interface GraphRowHelperProps {
|
|
|
70
85
|
selectedShas: Set<Sha>;
|
|
71
86
|
processedRows: ProcessedGraphRow[];
|
|
72
87
|
processedGraphRowBySha: ProcessedGraphRowBySha;
|
|
88
|
+
scrollTop: number;
|
|
73
89
|
alwaysShowTimelines?: boolean;
|
|
74
90
|
}
|
|
75
91
|
export declare class GraphRowHelper {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GridCellRenderer, ScrollParams } from 'react-virtualized';
|
|
2
|
-
import type { ReactElement } from 'react';
|
|
2
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
3
3
|
import type { CommitDateTimeSources } from '../commit/CommitConstants';
|
|
4
4
|
import type { CommitType, Sha } from '../commit/CommitTypes';
|
|
5
5
|
import type { CssVariables } from '../generic/GenericTypes';
|
|
@@ -147,7 +147,7 @@ export type ReserverInfoBySha = {
|
|
|
147
147
|
};
|
|
148
148
|
export type RefTargetFunc = () => Element | null | undefined;
|
|
149
149
|
export type ColumnContentGenerator = () => ReactElement<any>;
|
|
150
|
-
export type GraphItemContext = string |
|
|
150
|
+
export type GraphItemContext = string | object;
|
|
151
151
|
export type RefGroupContexts = {
|
|
152
152
|
[name: string]: GraphItemContext;
|
|
153
153
|
};
|
|
@@ -313,16 +313,26 @@ export interface GraphRefsData {
|
|
|
313
313
|
orderedRefGroups: GraphRefGroup[];
|
|
314
314
|
refGroupsByName: GraphRefGroupsByName;
|
|
315
315
|
}
|
|
316
|
+
type ReadonlyDeep<T> = T extends Record<string, unknown> ? {
|
|
317
|
+
readonly [K in keyof T]: ReadonlyDeep<T[K]>;
|
|
318
|
+
} : T extends Array<infer U> ? ReadonlyArray<ReadonlyDeep<U>> : T;
|
|
319
|
+
export interface ReadonlyGraphRow extends ReadonlyDeep<GraphRow> {
|
|
320
|
+
rowIndex?: number;
|
|
321
|
+
readonly hasRefs?: boolean;
|
|
322
|
+
/** Whether the row is hidden from the graph (filtered out by type or other filters). Output only */
|
|
323
|
+
readonly hidden: boolean;
|
|
324
|
+
}
|
|
316
325
|
export interface ProcessedGraphRow extends GraphRow {
|
|
317
326
|
rowIndex?: number;
|
|
318
327
|
column: number;
|
|
319
328
|
columnForColoring?: number;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
displayBody?: string;
|
|
329
|
+
displaySummary: string | ReactNode;
|
|
330
|
+
displayBody?: string | ReactNode;
|
|
323
331
|
edges: RowEdges;
|
|
324
332
|
edgeColumnMaxes: number;
|
|
325
333
|
hasRefs?: boolean;
|
|
334
|
+
/** Whether the row is hidden from the graph (filtered out by type or other filters). Output only */
|
|
335
|
+
hidden: boolean;
|
|
326
336
|
summary: string;
|
|
327
337
|
body?: string;
|
|
328
338
|
timeLineEntry?: TimelineEntry;
|
|
@@ -396,7 +406,8 @@ export type DownstreamsByUpstream = {
|
|
|
396
406
|
[upstreamName: string]: string[];
|
|
397
407
|
};
|
|
398
408
|
export type GraphPlatform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin';
|
|
399
|
-
export type
|
|
409
|
+
export type ExternalIconKeys = 'added' | 'author' | 'branch' | 'changes' | 'check' | 'commit' | 'datetime' | 'deleted' | 'files' | 'filter' | 'graph' | 'head' | 'hide' | `issue-${IssueTrackerType}` | 'loading' | 'message' | 'modified' | 'pull-request' | 'remote' | `remote-${HostingServiceType}` | 'renamed' | 'resolved' | 'settings' | 'show' | 'stash' | 'tag' | 'upstream-ahead' | 'upstream-behind' | 'warning' | 'worktree';
|
|
410
|
+
export type GetExternalIcon = (key: ExternalIconKeys) => ReactElement<any>;
|
|
400
411
|
export type GetMissingAvatar = (email: string, sha: string) => void;
|
|
401
412
|
export type GetMissingRefMetadata = (id: string, types: RefMetadataType[]) => void;
|
|
402
413
|
export type FormatRefShorthand = (shorthand: RefShorthand, sha: Sha, refType: GraphRefType, data?: any | null) => RefShorthand;
|
|
@@ -429,7 +440,10 @@ export type OnGraphMouseLeave = (event: React.MouseEvent<any>) => void;
|
|
|
429
440
|
export type OnClearCurrentlyHoveredGraphCommit = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha, currentlyHoveredCommitSha?: Sha) => void;
|
|
430
441
|
export type CommitDateTimeSource = CommitDateTimeSources;
|
|
431
442
|
export type OnFormatCommitDateTime = (commitDateTime: number, source?: CommitDateTimeSource) => string;
|
|
432
|
-
export type FormatCommitMessage = (commitMessage: string) =>
|
|
443
|
+
export type FormatCommitMessage = (commitMessage: string) => {
|
|
444
|
+
summary: string | ReactNode;
|
|
445
|
+
body?: string | ReactNode;
|
|
446
|
+
};
|
|
433
447
|
export type OnCurrentlyHoveredGraphCommit = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha, currentlyHoveredCommitSha?: Sha) => void;
|
|
434
448
|
export type OnClickCommit = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha) => void;
|
|
435
449
|
export type OnClickRef = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, sha: Sha, metadataItem?: RefMetadataItem) => void;
|
|
@@ -462,7 +476,13 @@ export type OnDoubleClickGraphRef = (event: React.MouseEvent<any>, refGroup: Gra
|
|
|
462
476
|
export type OnRowContextMenu = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
463
477
|
export type OnRefContextMenu = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
|
|
464
478
|
export type OnToggleRefsVisibilityClick = (event: React.MouseEvent<any>, refs: GraphRefOptData[], visible: boolean, graphRow?: GraphRow) => void;
|
|
465
|
-
export
|
|
479
|
+
export interface GraphSelectionState {
|
|
480
|
+
/** Whether the selected rows form a topologically contiguous selection (connected via parent-child relationships) */
|
|
481
|
+
isContiguous: boolean;
|
|
482
|
+
/** Whether the selection was made topologically (via shift+click following graph topology) */
|
|
483
|
+
isTopological: boolean;
|
|
484
|
+
}
|
|
485
|
+
export type OnSelectGraphRows = (rows: ReadonlyGraphRow[], focusedRow: ReadonlyGraphRow | undefined, state: GraphSelectionState) => void;
|
|
466
486
|
export type OnGraphRowHovered = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
467
487
|
export type OnGraphRowUnhovered = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
468
488
|
export type OnGraphRefNodeHovered = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
|
|
@@ -473,3 +493,4 @@ export type OnGraphColumnResized = (graphZoneType: GraphZoneType, columnSettings
|
|
|
473
493
|
export type OnShowMoreCommits = () => void;
|
|
474
494
|
export type OnEmailsMissingAvatarUrls = (emails: AvatarUrlByEmail) => void;
|
|
475
495
|
export type OnRefsMissingMetadata = (refs: RefsMissingMetadata) => void;
|
|
496
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import type { IGraphContainer } from '../../../components/graph/IGraphContainer';
|
|
2
3
|
import type { CommitType, Sha } from '../../commit/CommitTypes';
|
|
3
4
|
import type { TimelineEntry } from '../GraphConstants';
|
|
@@ -28,9 +29,8 @@ export declare class ProcessedGraphRowObj implements ProcessedGraphRow {
|
|
|
28
29
|
timeLineEntry?: TimelineEntry;
|
|
29
30
|
summary: string;
|
|
30
31
|
body?: string;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
displayBody?: string;
|
|
32
|
+
displaySummary: string | ReactNode;
|
|
33
|
+
displayBody?: string | ReactNode;
|
|
34
34
|
set message(message: string);
|
|
35
35
|
get message(): string;
|
|
36
36
|
get heads(): Head[];
|
|
@@ -41,9 +41,9 @@ export declare class ProcessedGraphRowObj implements ProcessedGraphRow {
|
|
|
41
41
|
get tags(): Tag[];
|
|
42
42
|
get hasRefs(): boolean;
|
|
43
43
|
get hasChildRefs(): boolean;
|
|
44
|
+
get hidden(): boolean;
|
|
44
45
|
get refsData(): GraphRefsData | undefined;
|
|
45
46
|
constructor(graphContainer: IGraphContainer, row: GraphRow, column?: number, edgeColumnMaxes?: number, edges?: RowEdges, childRefs?: ChildRefsByType, timeLineEntry?: TimelineEntry, columnForColoring?: number);
|
|
46
|
-
private updateSummaryAndBody;
|
|
47
47
|
private initializeRefGroups;
|
|
48
48
|
private addRefToRefGroup;
|
|
49
49
|
private loadGraphRefGroupsData;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Sha } from '../../commit/CommitTypes';
|
|
3
|
+
import type { ReadonlyGraphRow } from '../GraphTypes';
|
|
4
|
+
/**
|
|
5
|
+
* When the adornment should be visible:
|
|
6
|
+
* - `true` = always visible
|
|
7
|
+
* - Array of triggers = visible when ANY of the specified triggers are active
|
|
8
|
+
*/
|
|
9
|
+
export type AdornmentVisibility = true | readonly ('hover' | 'focus' | 'selected')[];
|
|
10
|
+
/**
|
|
11
|
+
* Adornment configuration returned from provideAdornments for each row.
|
|
12
|
+
* @template TContext - Type of context data passed from provide to resolve
|
|
13
|
+
*/
|
|
14
|
+
export interface RowAdornment<TContext = unknown> {
|
|
15
|
+
/** When the adornment is visible */
|
|
16
|
+
visibility?: AdornmentVisibility;
|
|
17
|
+
/**
|
|
18
|
+
* Optional context data to pass to resolveAdornment.
|
|
19
|
+
* Use for passing batch-fetched data (e.g., PR status) to the resolve phase.
|
|
20
|
+
*/
|
|
21
|
+
context?: TContext;
|
|
22
|
+
/**
|
|
23
|
+
* If true, resolve() is called on every render (content not cached).
|
|
24
|
+
* Use for adornments whose content depends on external state.
|
|
25
|
+
* Default: false (content is cached until invalidated)
|
|
26
|
+
*/
|
|
27
|
+
dynamic?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Invalidation level
|
|
31
|
+
*/
|
|
32
|
+
export type InvalidationType = 'all' | 'content';
|
|
33
|
+
/**
|
|
34
|
+
* Custom event dispatched when adornments need re-evaluation
|
|
35
|
+
*/
|
|
36
|
+
export declare class RowAdornmentInvalidateEvent extends CustomEvent<{
|
|
37
|
+
shas?: Set<Sha>;
|
|
38
|
+
type: InvalidationType;
|
|
39
|
+
}> {
|
|
40
|
+
static readonly type = "invalidate";
|
|
41
|
+
constructor(type: InvalidationType, shas?: Iterable<Sha>);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Provider interface - consumer implements, graph consumes
|
|
45
|
+
* @template TContext - Type of context data passed from provide to resolve
|
|
46
|
+
*/
|
|
47
|
+
export interface RowAdornmentProvider<TContext = unknown> {
|
|
48
|
+
/**
|
|
49
|
+
* Batch evaluation: which rows should have adornments?
|
|
50
|
+
*
|
|
51
|
+
* Called for:
|
|
52
|
+
* - Newly visible rows (scrolled into view)
|
|
53
|
+
* - Rows with 'all' invalidation
|
|
54
|
+
*
|
|
55
|
+
* Can return sync or async:
|
|
56
|
+
* - Sync: Result applied immediately
|
|
57
|
+
* - Async: Rows render without adornments until resolved
|
|
58
|
+
* (AbortSignal can be used to cancel in-flight requests)
|
|
59
|
+
*
|
|
60
|
+
* @param rows - Rows needing evaluation
|
|
61
|
+
* @param signal - Abort signal (check before applying async results)
|
|
62
|
+
* @returns Map of SHA → adornment config. Rows not in result have no adornment.
|
|
63
|
+
*/
|
|
64
|
+
provideAdornments(rows: readonly ReadonlyGraphRow[], signal: AbortSignal): Record<Sha, RowAdornment<TContext>> | Promise<Record<Sha, RowAdornment<TContext>>>;
|
|
65
|
+
/**
|
|
66
|
+
* Render content for a specific row.
|
|
67
|
+
*
|
|
68
|
+
* Called when:
|
|
69
|
+
* - Row becomes active (visible for 'always', hovered/focused for triggers)
|
|
70
|
+
* - Row has 'content' invalidation and is active
|
|
71
|
+
* - Row is dynamic (every render when active)
|
|
72
|
+
*
|
|
73
|
+
* Can return sync or async:
|
|
74
|
+
* - Sync (ReactNode): Content rendered immediately
|
|
75
|
+
* - Async (Promise<ReactNode>): Nothing shown until resolved
|
|
76
|
+
*
|
|
77
|
+
* @param row - The row to render adornment for
|
|
78
|
+
* @param context - Context data from provideAdornments (if any)
|
|
79
|
+
* @returns Content to render, or null/Promise for no/pending content
|
|
80
|
+
*/
|
|
81
|
+
resolveAdornment(row: ReadonlyGraphRow, context?: TContext): ReactNode | null | Promise<ReactNode | null>;
|
|
82
|
+
/**
|
|
83
|
+
* EventTarget for invalidation.
|
|
84
|
+
* - Graph subscribes to 'invalidate' events
|
|
85
|
+
* - Consumer dispatches RowAdornmentInvalidateEvent to trigger re-evaluation
|
|
86
|
+
*/
|
|
87
|
+
invalidate?: EventTarget;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Cached adornment state per row. Single map contains everything.
|
|
91
|
+
*/
|
|
92
|
+
export interface CachedAdornment {
|
|
93
|
+
visibility: AdornmentVisibility;
|
|
94
|
+
dynamic: boolean;
|
|
95
|
+
context?: unknown;
|
|
96
|
+
content?: ReactNode;
|
|
97
|
+
}
|
|
@@ -14,5 +14,7 @@ export type GitLabSelfHostedIssueTrackerType = GitLabSelfHostingServiceType;
|
|
|
14
14
|
export type JiraCloudIssueTrackerType = 'jiraCloud';
|
|
15
15
|
export type JiraServerIssueTrackerType = 'jiraServer';
|
|
16
16
|
export type TrelloIssueTrackerType = 'trello';
|
|
17
|
-
export type
|
|
17
|
+
export type LinearIssueTrackerType = 'linear';
|
|
18
|
+
export type BitbucketIssueTrackerType = 'bitbucket';
|
|
19
|
+
export type IssueTrackerType = GitHubIssueTrackerType | GithubEnterpriseIssueTrackerType | GitLabIssueTrackerType | GitLabSelfHostedIssueTrackerType | JiraCloudIssueTrackerType | JiraServerIssueTrackerType | TrelloIssueTrackerType | LinearIssueTrackerType | AzureDevopsIssueTrackerType | BitbucketIssueTrackerType;
|
|
18
20
|
export declare function getHostingServiceName(hostingServiceType: HostingServiceType): string;
|
|
@@ -8,4 +8,4 @@ export type CustomCellCacheValue = {
|
|
|
8
8
|
export type CustomCellCache = {
|
|
9
9
|
[key: string]: CustomCellCacheValue;
|
|
10
10
|
};
|
|
11
|
-
export declare const makeSmartCellRangeRenderer: (getRealKeyForCell: GetRealKeyForCellFunc) => GridCellRangeRenderer;
|
|
11
|
+
export declare const makeSmartCellRangeRenderer: (getRealKeyForCell: GetRealKeyForCellFunc, scrollLeft?: number, forceCache?: boolean) => GridCellRangeRenderer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Sha } from '../commit/CommitTypes';
|
|
2
2
|
import type * as RefConstants from './RefConstants';
|
|
3
|
-
export type GraphRefType = keyof typeof RefConstants.refTypes;
|
|
3
|
+
export type GraphRefType = (typeof RefConstants.refTypes)[keyof typeof RefConstants.refTypes];
|
|
4
4
|
export type RefFullName = string;
|
|
5
5
|
export type RefShorthand = string;
|
|
6
6
|
export type CreateRefFormData = {
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,21 @@ import ScrollbarContainer from './components/graph/common/ScrollbarContainer';
|
|
|
3
3
|
import GraphContainer from './components/graph/GraphContainer';
|
|
4
4
|
export * from './components/graph/GraphContainer';
|
|
5
5
|
export * from './components/dnd/DndComponent';
|
|
6
|
-
export * from './
|
|
6
|
+
export * from './domain/commit/CommitConstants';
|
|
7
|
+
export * from './domain/generic/GenericTypes';
|
|
8
|
+
export * from './domain/commit/CommitTypes';
|
|
9
|
+
export * from './domain/graph/GraphConstants';
|
|
10
|
+
export * from './domain/graph/GraphTypes';
|
|
11
|
+
export * from './domain/graph/rowAdornment/RowAdornmentTypes';
|
|
12
|
+
export * from './domain/hostingservice/HostingServiceTypes';
|
|
13
|
+
export * from './domain/ref/RefConstants';
|
|
14
|
+
export * from './domain/ref/RefTypes';
|
|
15
|
+
export * from './domain/workdir/WorkDirTypes';
|
|
16
|
+
export * from './domain/ui/UiTypes';
|
|
17
|
+
export * from './domain/language/LanguageTypes';
|
|
18
|
+
export * from './domain/language/LanguageConstants';
|
|
19
|
+
export * from './domain/cssvariable/CssVariableConstants';
|
|
20
|
+
export * from './domain/diff/DiffTypes';
|
|
21
|
+
export * from './domain/diff/DiffConstants';
|
|
7
22
|
export { DndComponent, ScrollbarContainer };
|
|
8
23
|
export default GraphContainer;
|