@gitkraken/gitkraken-components 13.0.0-vnext.3 → 13.0.0-vnext.30
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 +6 -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 +7 -2
- package/dist/components/graph/GraphContainer.d.ts +285 -31
- package/dist/components/graph/GraphHeaderRow.d.ts +5 -1
- package/dist/components/graph/GraphScrollMarker.d.ts +26 -5
- package/dist/components/graph/commitzone/CommitNode.d.ts +1 -1
- package/dist/components/graph/commitzone/CommitZone.d.ts +3 -2
- package/dist/components/graph/commitzone/GraphAvatar.d.ts +1 -1
- package/dist/components/graph/commitzone/edges/Arc.d.ts +2 -2
- package/dist/components/graph/commitzone/edges/Edges.d.ts +1 -1
- package/dist/components/graph/commitzone/edges/EndingEdge.d.ts +2 -2
- package/dist/components/graph/commitzone/edges/PassThroughEdge.d.ts +2 -2
- package/dist/components/graph/commitzone/edges/StartingEdge.d.ts +2 -2
- package/dist/components/graph/common/DraggableGraphHeader.d.ts +1 -1
- package/dist/components/graph/common/GenericGraphZone.d.ts +4 -2
- 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 +11 -7
- package/dist/components/graph/refzone/RefNodeAnnotationTarget.d.ts +10 -0
- package/dist/components/graph/refzone/RefNodes.d.ts +4 -2
- package/dist/components/graph/refzone/RefZone.d.ts +8 -3
- 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/CommitMessageZoneRow.d.ts +2 -1
- package/dist/components/graph/rowRenderers/CommitZoneRow.d.ts +2 -0
- package/dist/components/graph/rowRenderers/CommitsInfoRow.d.ts +1 -1
- package/dist/components/graph/rowRenderers/RefZoneRow.d.ts +2 -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/commit/CommitHelpers.d.ts +2 -2
- package/dist/domain/commit/CommitTypes.d.ts +1 -0
- package/dist/domain/edge/EdgeHelpers.d.ts +4 -4
- package/dist/domain/generic/GenericTypes.d.ts +6 -0
- package/dist/domain/graph/GraphConstants.d.ts +18 -2
- package/dist/domain/graph/GraphEdgeHelpers.d.ts +34 -0
- package/dist/domain/graph/GraphHelpers.d.ts +29 -5
- package/dist/domain/graph/GraphTypes.d.ts +101 -10
- package/dist/domain/graph/PinnedBranchHelpers.d.ts +21 -0
- package/dist/domain/graph/ScopedGraphHelpers.d.ts +15 -0
- package/dist/domain/graph/row/ProcessedGraphRowObj.d.ts +6 -5
- package/dist/domain/graph/rowAdornment/RowAdornmentHelpers.d.ts +14 -0
- package/dist/domain/graph/rowAdornment/RowAdornmentTypes.d.ts +97 -0
- package/dist/domain/hostingservice/HostingServiceTypes.d.ts +2 -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/domain/workdir/WorkDirHelpers.d.ts +50 -0
- package/dist/domain/workdir/WorkDirTypes.d.ts +51 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.js +21 -2
- package/dist/styles.css +2 -2
- 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
|
@@ -4,11 +4,16 @@ 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
|
+
export type CachedRowVisibilityState = {
|
|
13
|
+
hasBaseFilteredTags: boolean;
|
|
14
|
+
hasFilteredBranches: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare function getVisibleRowShasWithoutStashAnchoring(graphRows: GraphRow[], cachedRowVisibilityByIndex: CachedRowVisibilityState[], tagsRequireBranchOrVisibleChild: boolean): Set<Sha>;
|
|
12
17
|
export declare const debounceFrame: (func: DebouncableFn) => DebouncedFn;
|
|
13
18
|
export type ThrottleableFn = (...args: any) => void;
|
|
14
19
|
export type ThrottledFn = (...args: any) => void;
|
|
@@ -17,8 +22,23 @@ export declare function hasScrolledToBottom(htmlElement: HTMLElement): boolean;
|
|
|
17
22
|
export declare function hasScrolledToRight(htmlElement: HTMLElement): boolean;
|
|
18
23
|
export declare function parseContext(context?: GraphItemContext | null): string | null;
|
|
19
24
|
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
|
|
25
|
+
export declare function getOrAskForRefMetadata(ref: GraphRef, refMetadata: RefMetadataById | undefined | null, onMissingRefMetadata: GetMissingRefMetadata, refMetadataType?: RefMetadataType, fallbackRefMetadata?: RefMetadataById | null): RefMetadata | BaseMetadata | BaseMetadata[] | null | undefined;
|
|
26
|
+
export declare function getTimelineLabelAndValue(diffMs: number): {
|
|
27
|
+
label: string;
|
|
28
|
+
value: number;
|
|
29
|
+
};
|
|
30
|
+
export declare function getTimelineEntriesByPeriod(): TimelineEntry[];
|
|
31
|
+
/**
|
|
32
|
+
* Assigns timeline entries to graph rows based on commit dates.
|
|
33
|
+
*
|
|
34
|
+
* Timeline markers act as boundaries between time periods:
|
|
35
|
+
* - All commits above a marker must be younger (more recent) than the marker time
|
|
36
|
+
* - All commits at and below a marker must be equal to or older than the marker time
|
|
37
|
+
*
|
|
38
|
+
* @param orderedRows - Array of graph rows ordered from newest to oldest
|
|
39
|
+
* @param entries - Array of timeline entries ordered from newest to oldest
|
|
40
|
+
*/
|
|
41
|
+
export declare function assignTimelineEntriesToRows(orderedRows: ProcessedGraphRow[], entries: TimelineEntry[]): void;
|
|
22
42
|
export declare function getRefIdByBaseRef(refType: GraphRefType, ref: Ref): string;
|
|
23
43
|
export declare function getRefIdByGraphRef(ref: GraphRef): string;
|
|
24
44
|
export declare function getLastShrinkableGraphZone(activeGraphZones: GraphZone[], stoppingIndex?: number): GraphZone | undefined;
|
|
@@ -46,14 +66,16 @@ export declare function getGraphZoneModeConstants(graphZoneMode?: GraphColumnMod
|
|
|
46
66
|
export declare const makeGetKeyForCell: (rows: ProcessedGraphRow[]) => GetRealKeyForCellFunc;
|
|
47
67
|
export declare function getZoneWidthWithVerticalScrollbar(graphZoneType: GraphZoneType, activeGraphZones: GraphZone[]): number;
|
|
48
68
|
export declare function rowContainsCurrentHeadRef(row?: ProcessedGraphRow | GraphRow): boolean;
|
|
69
|
+
export declare function rowIsActiveHead(row?: ProcessedGraphRow | GraphRow): boolean;
|
|
49
70
|
export declare function getHeadRefShaFromGraphRows(graphRows: GraphRow[]): Sha | undefined;
|
|
50
71
|
export declare function isWorkDirNodeType(nodeType: CommitType): boolean;
|
|
51
72
|
export declare function isCommitNodeType(nodeType: CommitType): boolean;
|
|
52
73
|
export declare function workDirStatsHaveChanges(workDirStats?: WorkDirStats): boolean;
|
|
74
|
+
export declare function shouldShowWorkDirRow(workDirStats: WorkDirStats | undefined, wipVisibility: 'always' | 'auto' | undefined): boolean;
|
|
53
75
|
export declare function hasSingleSelectedSha(selectedShas: Set<Sha>): boolean;
|
|
54
76
|
export declare function isSingleSelected(selectedShas: Set<Sha>, sha: Sha): boolean;
|
|
55
77
|
export declare function getScrollToAlignment(rowHeight: number, clientHeight: number, scrollTop: number, scrollToIndex: number): Alignment;
|
|
56
|
-
export declare function getGraphZoneIconByType(zoneType: GraphZoneType):
|
|
78
|
+
export declare function getGraphZoneIconByType(zoneType: GraphZoneType): ExternalIconKeys | undefined;
|
|
57
79
|
export declare function isHeadActive(head: Head): boolean;
|
|
58
80
|
export declare function isGraphRefActive(ref: GraphRef): boolean;
|
|
59
81
|
export interface GraphRowHelperProps {
|
|
@@ -70,6 +92,7 @@ export interface GraphRowHelperProps {
|
|
|
70
92
|
selectedShas: Set<Sha>;
|
|
71
93
|
processedRows: ProcessedGraphRow[];
|
|
72
94
|
processedGraphRowBySha: ProcessedGraphRowBySha;
|
|
95
|
+
scrollTop: number;
|
|
73
96
|
alwaysShowTimelines?: boolean;
|
|
74
97
|
}
|
|
75
98
|
export declare class GraphRowHelper {
|
|
@@ -95,6 +118,7 @@ export declare class GraphRowHelper {
|
|
|
95
118
|
isSingleSelected(rowIndex: number): boolean;
|
|
96
119
|
hasTimeline(rowIndex: number): boolean;
|
|
97
120
|
rowContainsCurrentHeadRef(row?: ProcessedGraphRow): boolean;
|
|
121
|
+
rowIsActiveHead(row?: ProcessedGraphRow): boolean;
|
|
98
122
|
}
|
|
99
123
|
export declare function first<T>(source: Iterable<T> | IterableIterator<T>): T | undefined;
|
|
100
124
|
export declare function last<T>(source: Iterable<T>): T | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
import type { CommitType, Sha } from '../commit/CommitTypes';
|
|
4
|
+
import type { CommitType, EdgeCommitType, Sha } from '../commit/CommitTypes';
|
|
5
5
|
import type { CssVariables } from '../generic/GenericTypes';
|
|
6
6
|
import type { HostingServiceType, IssueTrackerType } from '../hostingservice/HostingServiceTypes';
|
|
7
7
|
import type { TranslationFn } from '../language/LanguageTypes';
|
|
@@ -38,6 +38,7 @@ export type EdgeCache = {
|
|
|
38
38
|
export type ArcEndpointAngle = 0 | 90 | 180 | 270;
|
|
39
39
|
export interface SvgStyles {
|
|
40
40
|
fill: string;
|
|
41
|
+
filter?: string;
|
|
41
42
|
shapeRendering: string;
|
|
42
43
|
strokeLinejoin: string;
|
|
43
44
|
strokeWidth: number;
|
|
@@ -57,7 +58,7 @@ export type SvgProps = ArcSvgProps | LineSvgProps;
|
|
|
57
58
|
export type AnySvgProps = ArcSvgProps & LineSvgProps;
|
|
58
59
|
export type Edge = {
|
|
59
60
|
parentSha: Sha;
|
|
60
|
-
type:
|
|
61
|
+
type: EdgeCommitType;
|
|
61
62
|
};
|
|
62
63
|
export type EdgeByColumn = {
|
|
63
64
|
[column: number]: Edge;
|
|
@@ -136,6 +137,56 @@ export type IsSelectedBySha = {
|
|
|
136
137
|
export type HighlightedShas = {
|
|
137
138
|
[sha: Sha]: boolean;
|
|
138
139
|
};
|
|
140
|
+
export type SyntheticParentsBySha = Map<Sha, Sha[]>;
|
|
141
|
+
export interface GraphScope {
|
|
142
|
+
/** Full ref id of the specific branch to scope to (e.g. 'refs/heads/feature/x'). NOT necessarily HEAD. */
|
|
143
|
+
branchRef: string;
|
|
144
|
+
/** Full ref id of the branch's upstream (e.g. 'refs/remotes/origin/feature/x'). */
|
|
145
|
+
upstreamRef?: string;
|
|
146
|
+
/** SHA of the merge-target tip commit. Its ancestors are NOT walked — the tip is kept as a marker. */
|
|
147
|
+
mergeTargetTipSha?: Sha;
|
|
148
|
+
/**
|
|
149
|
+
* Merge base between branchRef and mergeTargetTipSha (or the fork point of branchRef from
|
|
150
|
+
* its parent line, when mergeTargetTipSha is omitted). When provided, `sha` is the
|
|
151
|
+
* authoritative boundary — no first-parent inference is performed. The branch ancestor walk
|
|
152
|
+
* terminates at this sha and the sha is added to forkPointShas (when loaded) or branchTip is
|
|
153
|
+
* added to unreachableAnchors (when not loaded). Object-typed (rather than a bare Sha) so the
|
|
154
|
+
* host can attach additional metadata in the future without breaking the type.
|
|
155
|
+
*/
|
|
156
|
+
mergeBase?: {
|
|
157
|
+
sha: Sha;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Additional ref ids to include in the scope. Each tip becomes an anchor (same treatment as
|
|
161
|
+
* branchRef — shows all refs, acts as visibility floor) and its ancestors contribute to
|
|
162
|
+
* visibleShas subject to the mergeTarget exclusion.
|
|
163
|
+
*
|
|
164
|
+
* Primary use case: branches stacked on top of the focal branch (e.g. F2, F3 stacked on F1).
|
|
165
|
+
* The helper makes no stackedness check — any refs are valid (siblings, comparisons, etc.).
|
|
166
|
+
*/
|
|
167
|
+
additionalBranchRefs?: string[];
|
|
168
|
+
/** How to render gaps when an anchor's real parents are hidden. Defaults to 'syntheticEdge'. */
|
|
169
|
+
collapseStyle?: 'syntheticEdge' | 'gap';
|
|
170
|
+
}
|
|
171
|
+
export interface ScopeVisibility {
|
|
172
|
+
visibleShas: Set<Sha>;
|
|
173
|
+
anchorShas: Set<Sha>;
|
|
174
|
+
/** Fork points (merge bases) where an anchor's ancestor walk terminated. Visual boundary "below" the focus group. */
|
|
175
|
+
forkPointShas: Set<Sha>;
|
|
176
|
+
/** The merge-target tip sha, when scope.mergeTargetTipSha was provided. Visual boundary "above" the focus group. */
|
|
177
|
+
mergeTargetShas: Set<Sha>;
|
|
178
|
+
syntheticParentsBySha: SyntheticParentsBySha;
|
|
179
|
+
/** Anchors whose synthetic walk failed — merge base not in loaded rows. Consumer should fetch more data. */
|
|
180
|
+
unreachableAnchors: Set<Sha>;
|
|
181
|
+
/**
|
|
182
|
+
* True when scope walks terminated at identified boundaries — at least one fork point was
|
|
183
|
+
* found AND no anchor was left unreachable. When false, the scope may be incomplete due to
|
|
184
|
+
* missing data (merge base not loaded, foreign ref not yet surfaced, partial history). Callers
|
|
185
|
+
* should NOT suppress commit autoloading while this is false — more data could establish the
|
|
186
|
+
* missing boundary.
|
|
187
|
+
*/
|
|
188
|
+
isBounded: boolean;
|
|
189
|
+
}
|
|
139
190
|
export type IsExcludedBySha = {
|
|
140
191
|
[id: Sha]: boolean;
|
|
141
192
|
};
|
|
@@ -145,9 +196,12 @@ export type HasSpecialChildBySha = {
|
|
|
145
196
|
export type ReserverInfoBySha = {
|
|
146
197
|
[id: Sha]: ReserverInfo;
|
|
147
198
|
};
|
|
199
|
+
export type ColumnNumberBySha = {
|
|
200
|
+
[sha: Sha]: number;
|
|
201
|
+
};
|
|
148
202
|
export type RefTargetFunc = () => Element | null | undefined;
|
|
149
203
|
export type ColumnContentGenerator = () => ReactElement<any>;
|
|
150
|
-
export type GraphItemContext = string |
|
|
204
|
+
export type GraphItemContext = string | object;
|
|
151
205
|
export type RefGroupContexts = {
|
|
152
206
|
[name: string]: GraphItemContext;
|
|
153
207
|
};
|
|
@@ -313,21 +367,34 @@ export interface GraphRefsData {
|
|
|
313
367
|
orderedRefGroups: GraphRefGroup[];
|
|
314
368
|
refGroupsByName: GraphRefGroupsByName;
|
|
315
369
|
}
|
|
370
|
+
type ReadonlyDeep<T> = T extends Record<string, unknown> ? {
|
|
371
|
+
readonly [K in keyof T]: ReadonlyDeep<T[K]>;
|
|
372
|
+
} : T extends Array<infer U> ? ReadonlyArray<ReadonlyDeep<U>> : T;
|
|
373
|
+
export interface ReadonlyGraphRow extends ReadonlyDeep<GraphRow> {
|
|
374
|
+
rowIndex?: number;
|
|
375
|
+
readonly hasRefs?: boolean;
|
|
376
|
+
/** Whether the row is hidden from the graph (filtered out by type or other filters). Output only */
|
|
377
|
+
readonly hidden: boolean;
|
|
378
|
+
}
|
|
379
|
+
/** Which scope-boundary role this row plays, when an active scope identifies it as one. */
|
|
380
|
+
export type ScopeBoundaryKind = 'forkPoint' | 'mergeTarget';
|
|
316
381
|
export interface ProcessedGraphRow extends GraphRow {
|
|
317
382
|
rowIndex?: number;
|
|
318
383
|
column: number;
|
|
319
384
|
columnForColoring?: number;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
displayBody?: string;
|
|
385
|
+
displaySummary: string | ReactNode;
|
|
386
|
+
displayBody?: string | ReactNode;
|
|
323
387
|
edges: RowEdges;
|
|
324
388
|
edgeColumnMaxes: number;
|
|
325
389
|
hasRefs?: boolean;
|
|
390
|
+
/** Whether the row is hidden from the graph (filtered out by type or other filters). Output only */
|
|
391
|
+
hidden: boolean;
|
|
326
392
|
summary: string;
|
|
327
393
|
body?: string;
|
|
328
394
|
timeLineEntry?: TimelineEntry;
|
|
329
395
|
childRefs?: ChildRefsByType;
|
|
330
396
|
refsData?: GraphRefsData;
|
|
397
|
+
scopeBoundaryKind?: ScopeBoundaryKind;
|
|
331
398
|
}
|
|
332
399
|
export type TopAndBottomVisibleRowIndex = {
|
|
333
400
|
top: number;
|
|
@@ -386,6 +453,13 @@ export type GraphMarkerColors = {
|
|
|
386
453
|
export type GraphMarkerRowIndices = {
|
|
387
454
|
[marker: string]: number[];
|
|
388
455
|
};
|
|
456
|
+
export interface InteractiveScrollMarker {
|
|
457
|
+
type: GraphMarkerType;
|
|
458
|
+
rowIndex: number;
|
|
459
|
+
sha: Sha;
|
|
460
|
+
label: string;
|
|
461
|
+
}
|
|
462
|
+
export type OnScrollMarkerClicked = (sha: Sha, rowIndex: number, type: GraphMarkerType) => void;
|
|
389
463
|
export type AvatarUrlByEmail = {
|
|
390
464
|
[email: string]: string;
|
|
391
465
|
};
|
|
@@ -396,7 +470,8 @@ export type DownstreamsByUpstream = {
|
|
|
396
470
|
[upstreamName: string]: string[];
|
|
397
471
|
};
|
|
398
472
|
export type GraphPlatform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin';
|
|
399
|
-
export type
|
|
473
|
+
export type ExternalIconKeys = 'added' | 'author' | 'branch' | 'changes' | 'check' | 'commit' | 'datetime' | 'deleted' | 'files' | 'filter' | 'graph' | 'head' | 'hide' | `issue-${IssueTrackerType}` | 'loading' | 'message' | 'modified' | 'pin' | 'pull-request' | 'remote' | `remote-${HostingServiceType}` | 'renamed' | 'resolved' | 'settings' | 'show' | 'stash' | 'tag' | 'upstream-ahead' | 'upstream-behind' | 'warning' | 'worktree';
|
|
474
|
+
export type GetExternalIcon = (key: ExternalIconKeys) => ReactElement<any>;
|
|
400
475
|
export type GetMissingAvatar = (email: string, sha: string) => void;
|
|
401
476
|
export type GetMissingRefMetadata = (id: string, types: RefMetadataType[]) => void;
|
|
402
477
|
export type FormatRefShorthand = (shorthand: RefShorthand, sha: Sha, refType: GraphRefType, data?: any | null) => RefShorthand;
|
|
@@ -429,7 +504,10 @@ export type OnGraphMouseLeave = (event: React.MouseEvent<any>) => void;
|
|
|
429
504
|
export type OnClearCurrentlyHoveredGraphCommit = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha, currentlyHoveredCommitSha?: Sha) => void;
|
|
430
505
|
export type CommitDateTimeSource = CommitDateTimeSources;
|
|
431
506
|
export type OnFormatCommitDateTime = (commitDateTime: number, source?: CommitDateTimeSource) => string;
|
|
432
|
-
export type FormatCommitMessage = (commitMessage: string) =>
|
|
507
|
+
export type FormatCommitMessage = (commitMessage: string) => {
|
|
508
|
+
summary: string | ReactNode;
|
|
509
|
+
body?: string | ReactNode;
|
|
510
|
+
};
|
|
433
511
|
export type OnCurrentlyHoveredGraphCommit = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha, currentlyHoveredCommitSha?: Sha) => void;
|
|
434
512
|
export type OnClickCommit = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha) => void;
|
|
435
513
|
export type OnClickRef = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, sha: Sha, metadataItem?: RefMetadataItem) => void;
|
|
@@ -462,7 +540,13 @@ export type OnDoubleClickGraphRef = (event: React.MouseEvent<any>, refGroup: Gra
|
|
|
462
540
|
export type OnRowContextMenu = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
463
541
|
export type OnRefContextMenu = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
|
|
464
542
|
export type OnToggleRefsVisibilityClick = (event: React.MouseEvent<any>, refs: GraphRefOptData[], visible: boolean, graphRow?: GraphRow) => void;
|
|
465
|
-
export
|
|
543
|
+
export interface GraphSelectionState {
|
|
544
|
+
/** Whether the selected rows form a topologically contiguous selection (connected via parent-child relationships) */
|
|
545
|
+
isContiguous: boolean;
|
|
546
|
+
/** Whether the selection was made topologically (via ctrl/shift+click following graph topology) */
|
|
547
|
+
isTopological: boolean;
|
|
548
|
+
}
|
|
549
|
+
export type OnSelectGraphRows = (rows: ReadonlyGraphRow[], focusedRow: ReadonlyGraphRow | undefined, state: GraphSelectionState) => void;
|
|
466
550
|
export type OnGraphRowHovered = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
467
551
|
export type OnGraphRowUnhovered = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
468
552
|
export type OnGraphRefNodeHovered = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, graphRow: GraphRow) => void;
|
|
@@ -473,3 +557,10 @@ export type OnGraphColumnResized = (graphZoneType: GraphZoneType, columnSettings
|
|
|
473
557
|
export type OnShowMoreCommits = () => void;
|
|
474
558
|
export type OnEmailsMissingAvatarUrls = (emails: AvatarUrlByEmail) => void;
|
|
475
559
|
export type OnRefsMissingMetadata = (refs: RefsMissingMetadata) => void;
|
|
560
|
+
/**
|
|
561
|
+
* Callback invoked when column numbers are calculated for each commit.
|
|
562
|
+
* Receives a map of SHA → column number.
|
|
563
|
+
* Used to sync column layout data back to the parent application.
|
|
564
|
+
*/
|
|
565
|
+
export type OnColumnsCalculated = (columnsBySha: ColumnNumberBySha) => void;
|
|
566
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Sha } from '../commit/CommitTypes';
|
|
2
|
+
import type { GraphRow } from './GraphTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Identifies commits that belong to the pinned branch by following the first-parent chain.
|
|
5
|
+
* Returns a Set of SHAs that are part of the pinned branch.
|
|
6
|
+
*/
|
|
7
|
+
export declare function identifyPinnedBranchCommits(graphRows: GraphRow[], pinnedBranchFullName?: string | null): Set<Sha>;
|
|
8
|
+
/**
|
|
9
|
+
* Gets the next available column number, marking it as used.
|
|
10
|
+
* When reserveColumn0ForPinned is true, starts searching from column 1.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAvailableColumnAndUseIt(columnsUsed: {
|
|
13
|
+
[column: number]: boolean;
|
|
14
|
+
}, reserveColumn0ForPinned?: boolean): number;
|
|
15
|
+
/**
|
|
16
|
+
* Determines the column number for a parent commit based on pinning status and parent index.
|
|
17
|
+
* For pinned parents, always reserve column 0; for non-pinned, use normal logic.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getParentColumn(columnsUsed: {
|
|
20
|
+
[column: number]: boolean;
|
|
21
|
+
}, isParentPinned: boolean, parentIndex: number, currentColumn: number, hasPinnedBranch: boolean): number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GraphRow, GraphScope, ScopeVisibility } from './GraphTypes';
|
|
2
|
+
export declare function computeScopeVisibility(rows: GraphRow[], scope: GraphScope): ScopeVisibility;
|
|
3
|
+
/**
|
|
4
|
+
* Returns true when a WIP row should be hidden under an active scope.
|
|
5
|
+
*
|
|
6
|
+
* Secondary (per-worktree) WIP rows are kept only when their parent is a branch anchor of the
|
|
7
|
+
* scope — i.e. the tip of `branchRef`, `upstreamRef`, or one of `additionalBranchRefs` (so a
|
|
8
|
+
* worktree checked out on a scoped branch still surfaces its WIP, even when empty). The merge
|
|
9
|
+
* target tip is excluded: it's a boundary, not a focused branch.
|
|
10
|
+
*
|
|
11
|
+
* The primary WIP row, merge-conflict node, and unsupported-rebase warning node are tied to
|
|
12
|
+
* the primary repo's HEAD. They are kept whenever at least one of their parents is in the
|
|
13
|
+
* scope's visible set; otherwise they would render as floating nodes with no anchoring topology.
|
|
14
|
+
*/
|
|
15
|
+
export declare function shouldHideWipRowForScope(row: GraphRow, scopeVisibility: ScopeVisibility | null): boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
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';
|
|
4
|
-
import type { ChildRefsByType, GraphRefsData, GraphRow, Head, ProcessedGraphRow, Remote, RowContexts, RowEdges, Tag } from '../GraphTypes';
|
|
5
|
+
import type { ChildRefsByType, GraphRefsData, GraphRow, Head, ProcessedGraphRow, Remote, RowContexts, RowEdges, ScopeBoundaryKind, Tag } from '../GraphTypes';
|
|
5
6
|
export declare class ProcessedGraphRowObj implements ProcessedGraphRow {
|
|
6
7
|
private _graph;
|
|
7
8
|
private _message;
|
|
@@ -26,11 +27,11 @@ export declare class ProcessedGraphRowObj implements ProcessedGraphRow {
|
|
|
26
27
|
edges: RowEdges;
|
|
27
28
|
childRefs: ChildRefsByType;
|
|
28
29
|
timeLineEntry?: TimelineEntry;
|
|
30
|
+
scopeBoundaryKind?: ScopeBoundaryKind;
|
|
29
31
|
summary: string;
|
|
30
32
|
body?: string;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
displayBody?: string;
|
|
33
|
+
displaySummary: string | ReactNode;
|
|
34
|
+
displayBody?: string | ReactNode;
|
|
34
35
|
set message(message: string);
|
|
35
36
|
get message(): string;
|
|
36
37
|
get heads(): Head[];
|
|
@@ -41,9 +42,9 @@ export declare class ProcessedGraphRowObj implements ProcessedGraphRow {
|
|
|
41
42
|
get tags(): Tag[];
|
|
42
43
|
get hasRefs(): boolean;
|
|
43
44
|
get hasChildRefs(): boolean;
|
|
45
|
+
get hidden(): boolean;
|
|
44
46
|
get refsData(): GraphRefsData | undefined;
|
|
45
47
|
constructor(graphContainer: IGraphContainer, row: GraphRow, column?: number, edgeColumnMaxes?: number, edges?: RowEdges, childRefs?: ChildRefsByType, timeLineEntry?: TimelineEntry, columnForColoring?: number);
|
|
46
|
-
private updateSummaryAndBody;
|
|
47
48
|
private initializeRefGroups;
|
|
48
49
|
private addRefToRefGroup;
|
|
49
50
|
private loadGraphRefGroupsData;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Sha } from '../../commit/CommitTypes';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the CSS `<dashed-ident>` used to tie a graph row's `anchor-name`
|
|
4
|
+
* to the overlay's `position-anchor`. Shas are arbitrary caller-provided
|
|
5
|
+
* strings (e.g. `worktree-wip::/some/path` for multi-WIP rows) and may
|
|
6
|
+
* contain characters that aren't valid inside a CSS <custom-ident>, so
|
|
7
|
+
* each unsafe character is prefixed with `\` — a single-character CSS
|
|
8
|
+
* escape that preserves readability in DevTools while keeping the
|
|
9
|
+
* identifier parseable by the browser.
|
|
10
|
+
*
|
|
11
|
+
* Letters, digits, hyphen, underscore, and non-ASCII code points are
|
|
12
|
+
* already legal inside a CSS ident and pass through unchanged.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getRowAnchorName(sha: Sha): string;
|
|
@@ -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,6 +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 LinearIssueTrackerType = 'linear';
|
|
17
18
|
export type BitbucketIssueTrackerType = 'bitbucket';
|
|
18
|
-
export type IssueTrackerType = GitHubIssueTrackerType | GithubEnterpriseIssueTrackerType | GitLabIssueTrackerType | GitLabSelfHostedIssueTrackerType | JiraCloudIssueTrackerType | JiraServerIssueTrackerType | TrelloIssueTrackerType | AzureDevopsIssueTrackerType | BitbucketIssueTrackerType;
|
|
19
|
+
export type IssueTrackerType = GitHubIssueTrackerType | GithubEnterpriseIssueTrackerType | GitLabIssueTrackerType | GitLabSelfHostedIssueTrackerType | JiraCloudIssueTrackerType | JiraServerIssueTrackerType | TrelloIssueTrackerType | LinearIssueTrackerType | AzureDevopsIssueTrackerType | BitbucketIssueTrackerType;
|
|
19
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 = {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { Sha } from '../commit/CommitTypes';
|
|
3
|
+
import type { VisibleWipShas, WipNodeMetadataBySha, WipShasMissingStats, WorkDirStats } from './WorkDirTypes';
|
|
4
|
+
/** Translation key for the WIP row's label, selected based on stats state. */
|
|
5
|
+
export type WipRowMessageKey = 'Graph-WorkInProgress' | 'Graph-WorkInProgress-Changes' | 'Graph-WorkInProgress-Clean';
|
|
6
|
+
/**
|
|
7
|
+
* Picks the translation key for a WIP row's label based on the stats it has (or doesn't have):
|
|
8
|
+
* - `Graph-WorkInProgress-Changes` when stats show any added/modified/deleted activity
|
|
9
|
+
* - `Graph-WorkInProgress-Clean` when stats are present but all zero (queried, clean)
|
|
10
|
+
* - `Graph-WorkInProgress` when stats are not yet known (neutral fallback)
|
|
11
|
+
*/
|
|
12
|
+
export declare function getWipRowMessageKey(workDirStats: WorkDirStats | undefined): WipRowMessageKey;
|
|
13
|
+
export type ResolvedWipState = {
|
|
14
|
+
isPrimaryWip: boolean;
|
|
15
|
+
effectiveWorkDirStats: WorkDirStats | undefined;
|
|
16
|
+
hasWorkDirChanges: boolean;
|
|
17
|
+
isWipEditable: boolean;
|
|
18
|
+
customWipContent: ReactElement<any> | null;
|
|
19
|
+
needsWipStatsRequest: boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Resolves the effective WIP state for a given row.
|
|
23
|
+
*
|
|
24
|
+
* For the primary WIP row (sha === workDirType), uses the global workDirStats.
|
|
25
|
+
* For secondary WIP rows, uses the per-row metadata from wipNodeMetadataBySha. There is
|
|
26
|
+
* NO fallback to the global workDirStats — secondary rows belong to other worktrees, and
|
|
27
|
+
* painting the primary repo's counts on them would be wrong. Until per-row stats arrive,
|
|
28
|
+
* the pill renders nothing and `needsWipStatsRequest` triggers a deferred fetch.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveWipState(sha: Sha, type: string, workDirStats: WorkDirStats | undefined, wipNodeMetadataBySha: WipNodeMetadataBySha | undefined, wipMessageEditable: boolean): ResolvedWipState;
|
|
31
|
+
/** Predicate for secondary-WIP rows (per-worktree WIPs), excluding the primary WIP row. */
|
|
32
|
+
export declare function isSecondaryWipRow(row: {
|
|
33
|
+
sha: Sha;
|
|
34
|
+
type?: string;
|
|
35
|
+
}): boolean;
|
|
36
|
+
/** Key-set equality for `VisibleWipShas` / `WipShasMissingStats`-shaped records (values are always `true`). */
|
|
37
|
+
export declare function areVisibleWipShasEqual(a: VisibleWipShas, b: VisibleWipShas): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Given the set of currently-visible secondary-WIP shas, the prior dedup map of shas already
|
|
40
|
+
* requested, and the per-sha metadata, compute (a) the pruned dedup map that only retains entries
|
|
41
|
+
* for shas still visible, and (b) the set of shas whose stats should be requested this tick.
|
|
42
|
+
*
|
|
43
|
+
* Shas that have left the viewport are dropped from the dedup so they can be re-asked on re-entry.
|
|
44
|
+
* Shas with `customContent` override or with non-stale `workDirStats` already populated are not
|
|
45
|
+
* added to `missing`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function computeWipMissingShasUpdate(current: VisibleWipShas, priorRequestedDedup: WipShasMissingStats, metadataBySha: WipNodeMetadataBySha | undefined): {
|
|
48
|
+
missing: WipShasMissingStats;
|
|
49
|
+
prunedRequestedDedup: WipShasMissingStats;
|
|
50
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { Sha } from '../commit/CommitTypes';
|
|
1
3
|
import type { GraphItemContext } from '../graph/GraphTypes';
|
|
2
4
|
export type WorkDirStats = {
|
|
3
5
|
added: number;
|
|
@@ -6,3 +8,52 @@ export type WorkDirStats = {
|
|
|
6
8
|
context?: GraphItemContext;
|
|
7
9
|
renamed?: number;
|
|
8
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Per-row decoration for a secondary (worktree) WIP graph row. Looked up by the row's `sha`.
|
|
13
|
+
*
|
|
14
|
+
* Not applied to the primary WIP row (`sha === workDirType`); use the `workDirStats` prop for that one.
|
|
15
|
+
*
|
|
16
|
+
* @see docs/multi-wip-rows.md
|
|
17
|
+
*/
|
|
18
|
+
export type WipNodeMetadata = {
|
|
19
|
+
/**
|
|
20
|
+
* Stats for this secondary WIP row's worktree. Omit to have the library request them via
|
|
21
|
+
* `onWipShasMissingStats`. Until per-row stats arrive, the pill renders nothing — the library does
|
|
22
|
+
* NOT fall back to the global `workDirStats` (which belongs to the primary repo).
|
|
23
|
+
*/
|
|
24
|
+
workDirStats?: WorkDirStats;
|
|
25
|
+
/** When true, the library requests fresh stats while continuing to render `workDirStats` (stale-while-revalidate). */
|
|
26
|
+
workDirStatsStale?: boolean;
|
|
27
|
+
/** If provided, renders this element in place of the default WIP stats pill. Suppresses any stats request. */
|
|
28
|
+
customContent?: ReactElement<any>;
|
|
29
|
+
/** If provided, renders this avatar URL inside the graph node circle instead of the default WIP dot. */
|
|
30
|
+
nodeAvatarUrl?: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Decoration map for secondary WIP rows, keyed by the row's `sha`. The library does not create rows from
|
|
34
|
+
* this map — provide the row in `graphRows` and this map augments it.
|
|
35
|
+
*/
|
|
36
|
+
export type WipNodeMetadataBySha = Record<Sha, WipNodeMetadata>;
|
|
37
|
+
/**
|
|
38
|
+
* Batched set of secondary-WIP shas for which the library is requesting stats. Delivered to the
|
|
39
|
+
* `onWipShasMissingStats` callback after a 100ms debounce with dedup.
|
|
40
|
+
*/
|
|
41
|
+
export type WipShasMissingStats = Record<Sha, true>;
|
|
42
|
+
/**
|
|
43
|
+
* Caller-supplied handler invoked when one or more secondary WIP rows need stats fetched.
|
|
44
|
+
* Handler should async-fetch and push back an updated `wipNodeMetadataBySha` reference with
|
|
45
|
+
* `workDirStats` populated for each requested sha.
|
|
46
|
+
*/
|
|
47
|
+
export type OnWipShasMissingStats = (shas: WipShasMissingStats) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Batched set of secondary-WIP shas currently rendered in the viewport. Delivered to the
|
|
50
|
+
* `onVisibleWipShasChanged` callback after a 100ms debounce when the set changes.
|
|
51
|
+
*/
|
|
52
|
+
export type VisibleWipShas = Record<Sha, true>;
|
|
53
|
+
/**
|
|
54
|
+
* Caller-supplied handler invoked when the set of secondary WIP rows visible in the viewport changes.
|
|
55
|
+
* Use this to acquire/release per-worktree resources (filesystem watchers, subscriptions, etc.) as
|
|
56
|
+
* rows scroll in and out of view. Consumers diff the provided set against their own tracking to
|
|
57
|
+
* decide what to hook/unhook.
|
|
58
|
+
*/
|
|
59
|
+
export type OnVisibleWipShasChanged = (shas: VisibleWipShas) => void;
|
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;
|