@gitkraken/gitkraken-components 13.0.0-vnext.35 → 13.0.0-vnext.38
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 +2 -2
- package/dist/components/graph/commitzone/CommitNode.d.ts +2 -2
- package/dist/components/graph/commitzone/CommitZone.d.ts +2 -2
- package/dist/components/graph/commitzone/GraphAvatar.d.ts +2 -2
- package/dist/components/graph/rowAdornment/RowAdornmentLayer.d.ts +1 -0
- package/dist/components/graph/shared/Avatar.d.ts +4 -2
- package/dist/domain/graph/GraphTypes.d.ts +10 -2
- package/dist/domain/graph/rowAdornment/RowAdornmentTypes.d.ts +19 -6
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import type { Sha } from '../../domain/commit/CommitTypes';
|
|
|
5
5
|
import type { CssVariables } from '../../domain/generic/GenericTypes';
|
|
6
6
|
import type { GraphCommitDescDisplayMode, GraphMarkerType, GraphSearchMode, GraphZone, GraphZoneType, ShiftSelectMode } from '../../domain/graph/GraphConstants';
|
|
7
7
|
import type { ThrottledFn } from '../../domain/graph/GraphHelpers';
|
|
8
|
-
import type { AbsoluteNodeLeftByColumn, AvatarUrlByEmail, AvatarUrlRequestedByEmail, ChildrenBySha, ColumnColorByColumn, DownstreamsByUpstream, ExcludeByType, ExcludeRefsById, ExcludeRemotesByName, FormatCommitMessage, FormatRefShorthand, GetExternalIcon, GetMissingAvatar, GetMissingRefMetadata, GraphColumnSetting, GraphColumnsSettings, GraphContexts, GraphMarkerColors, GraphMarkerRowIndices, GraphPlatform, GraphRefGroup, GraphRow, GraphScope, GraphZoneModeConstants, GraphZonesByType, Head, HighlightedShas, IncludeOnlyRefsById, IncludeOnlyRemotesByName, InteractiveScrollMarker, IsRefShorthandValid, IsSelectedBySha, NodeOffsetByColumn, NodeOpacityByColumn, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnClickGraphRef, OnClickGraphRow, OnClickRef, OnColumnsCalculated, OnCommitContextMenu, OnCommitMessageChange, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, OnDoubleClickGraphRef, OnDoubleClickGraphRow, OnDoubleClickRef, OnEmailsMissingAvatarUrls, OnFilterColumnClick, OnFormatCommitDateTime, OnGraphColumnReOrdered, OnGraphColumnResized, OnGraphColumnsReOrdered, OnGraphMouseEnter, OnGraphMouseLeave, OnGraphRefNodeHovered, OnGraphRefNodeUnhovered, OnGraphResized, OnGraphRowHovered, OnGraphRowUnhovered, OnGraphScrollForZone, OnGraphVisibleRowsChanged, OnGraphZoneResize, OnGraphZoneResizeEnd, OnLoadSelectedGraphRow, OnPopupGraphHeaderContextMenu, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefContextMenu, OnRefCreate, OnRefCreateCancel, OnRefCreateContextMenu, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefShorthandChange, OnRefsMissingMetadata, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnRowContextMenu, OnScrollForZone, OnSelectGraphRows, OnSettingsClick, OnShowMoreCommits, OnToggleRefNodesShown, OnToggleRefsVisibilityClick, OnWipMessageBlur, OnWipMessageFocus, ProcessedGraphRow, ProcessedGraphRowBySha, ReadonlyGraphRow, RefMetadataById, RefMetadataRequestedById, RefMetadataType, RefsMissingMetadata, Remote, ReserverInfoBySha, RowStats, RowStatsConstraints, ShaByRefId, Tag, TopAndBottomVisibleRowIndex } from '../../domain/graph/GraphTypes';
|
|
8
|
+
import type { AbsoluteNodeLeftByColumn, AvatarUrlByEmail, AvatarUrlRequestedByEmail, ChildrenBySha, ColumnColorByColumn, DownstreamsByUpstream, ExcludeByType, ExcludeRefsById, ExcludeRemotesByName, FormatCommitMessage, FormatRefShorthand, GetExternalIcon, GetMissingAvatar, GetMissingRefMetadata, GraphColumnSetting, GraphColumnsSettings, GraphContexts, GraphMarkerColors, GraphMarkerRowIndices, GraphPlatform, GraphRefGroup, GraphRow, GraphScope, GraphZoneModeConstants, GraphZonesByType, Head, HighlightedShas, IncludeOnlyRefsById, IncludeOnlyRemotesByName, InteractiveScrollMarker, IsRefShorthandValid, IsSelectedBySha, NodeOffsetByColumn, NodeOpacityByColumn, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnClickGraphRef, OnClickGraphRow, OnClickRef, OnColumnsCalculated, OnCommitContextMenu, OnCommitMessageChange, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, OnDoubleClickGraphRef, OnDoubleClickGraphRow, OnDoubleClickRef, OnEmailsMissingAvatarUrls, OnFilterColumnClick, OnFormatCommitDateTime, OnGraphColumnReOrdered, OnGraphColumnResized, OnGraphColumnsReOrdered, OnGraphMouseEnter, OnGraphMouseLeave, OnGraphRefNodeHovered, OnGraphRefNodeUnhovered, OnGraphResized, OnGraphRowHovered, OnGraphRowUnhovered, OnGraphScrollForZone, OnGraphVisibleRowsChanged, OnGraphZoneResize, OnGraphZoneResizeEnd, OnLoadSelectedGraphRow, OnPopupGraphHeaderContextMenu, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefContextMenu, OnRefCreate, OnRefCreateCancel, OnRefCreateContextMenu, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefShorthandChange, OnRefsMissingMetadata, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnRowContextMenu, OnScrollForZone, OnSelectGraphRows, OnSettingsClick, OnShowMoreCommits, OnToggleRefNodesShown, OnToggleRefsVisibilityClick, OnWipMessageBlur, OnWipMessageFocus, ProcessedGraphRow, ProcessedGraphRowBySha, ReadonlyGraphRow, RefMetadataById, RefMetadataRequestedById, RefMetadataType, RefsMissingMetadata, Remote, ReserverInfoBySha, RowStats, RowStatsConstraints, ShaByEmail, ShaByRefId, Tag, TopAndBottomVisibleRowIndex } from '../../domain/graph/GraphTypes';
|
|
9
9
|
import type { RowAdornmentProvider } from '../../domain/graph/rowAdornment/RowAdornmentTypes';
|
|
10
10
|
import type { TranslationFn } from '../../domain/language/LanguageTypes';
|
|
11
11
|
import type { CreateRefFormData, RefIconsPosition } from '../../domain/ref/RefTypes';
|
|
@@ -292,7 +292,7 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
|
|
|
292
292
|
graphZoneOrdering: GraphZoneType[];
|
|
293
293
|
clientHeight: number;
|
|
294
294
|
missingAvatarsTimer?: ReturnType<typeof setTimeout>;
|
|
295
|
-
pendingMissingAvatars:
|
|
295
|
+
pendingMissingAvatars: ShaByEmail;
|
|
296
296
|
requestedMissingAvatars: AvatarUrlRequestedByEmail;
|
|
297
297
|
missingRefsMetadataTimer?: ReturnType<typeof setTimeout>;
|
|
298
298
|
pendingMissingRefsMetadata: RefsMissingMetadata;
|
|
@@ -2,13 +2,13 @@ import type { ReactElement } from 'react';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { CommitType } from '../../../domain/commit/CommitTypes';
|
|
4
4
|
import type { CssVariables } from '../../../domain/generic/GenericTypes';
|
|
5
|
-
import type { GetExternalIcon, GraphItemContext, GraphZoneModeConstants } from '../../../domain/graph/GraphTypes';
|
|
5
|
+
import type { AvatarUrlSpec, GetExternalIcon, GraphItemContext, GraphZoneModeConstants } from '../../../domain/graph/GraphTypes';
|
|
6
6
|
import type { TranslationFn } from '../../../domain/language/LanguageTypes';
|
|
7
7
|
type Props = {
|
|
8
8
|
authorEmail: string;
|
|
9
9
|
authorInitials: string;
|
|
10
10
|
authorName: string;
|
|
11
|
-
avatarUrl?:
|
|
11
|
+
avatarUrl?: AvatarUrlSpec | null;
|
|
12
12
|
column: number;
|
|
13
13
|
context?: GraphItemContext | null;
|
|
14
14
|
cssVariables: CssVariables;
|
|
@@ -2,13 +2,13 @@ import type { ReactElement } from 'react';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { CommitType, Sha } from '../../../domain/commit/CommitTypes';
|
|
4
4
|
import type { CssVariables, Style } from '../../../domain/generic/GenericTypes';
|
|
5
|
-
import type { ColumnColorByColumn, GetExternalIcon, GraphItemContext, GraphZoneModeConstants, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnCommitContextMenu, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, RowEdges, ScopeBoundaryKind } from '../../../domain/graph/GraphTypes';
|
|
5
|
+
import type { AvatarUrlSpec, ColumnColorByColumn, GetExternalIcon, GraphItemContext, GraphZoneModeConstants, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnCommitContextMenu, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, RowEdges, ScopeBoundaryKind } from '../../../domain/graph/GraphTypes';
|
|
6
6
|
import type { TranslationFn } from '../../../domain/language/LanguageTypes';
|
|
7
7
|
type Props = {
|
|
8
8
|
authorEmail: string;
|
|
9
9
|
authorName: string;
|
|
10
10
|
avatarContext?: GraphItemContext;
|
|
11
|
-
avatarUrl?:
|
|
11
|
+
avatarUrl?: AvatarUrlSpec;
|
|
12
12
|
clearCurrentlyHoveredGraphCommit: OnClearCurrentlyHoveredGraphCommit;
|
|
13
13
|
column: number;
|
|
14
14
|
columnColorByColumn: ColumnColorByColumn;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { CssVariables, Style } from '../../../domain/generic/GenericTypes';
|
|
4
|
-
import type { GraphItemContext } from '../../../domain/graph/GraphTypes';
|
|
4
|
+
import type { AvatarUrlSpec, GraphItemContext } from '../../../domain/graph/GraphTypes';
|
|
5
5
|
import type { ComponentTooltip } from '../../../domain/ui/UiTypes';
|
|
6
6
|
type Props = {
|
|
7
7
|
authorInitials?: string;
|
|
8
|
-
avatarUrl?:
|
|
8
|
+
avatarUrl?: AvatarUrlSpec | null;
|
|
9
9
|
className?: string;
|
|
10
10
|
column?: number;
|
|
11
11
|
context?: GraphItemContext | null;
|
|
@@ -46,6 +46,7 @@ declare class RowAdornmentLayer extends React.Component<RowAdornmentLayerProps,
|
|
|
46
46
|
private applyProvideResults;
|
|
47
47
|
private evictDistantAdornments;
|
|
48
48
|
private shouldShowAdornment;
|
|
49
|
+
private stateKey;
|
|
49
50
|
private getOrResolveContent;
|
|
50
51
|
render(): React.ReactNode;
|
|
51
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import type { GraphItemContext } from '../../../domain/graph/GraphTypes';
|
|
3
|
+
import type { AvatarUrlSpec, GraphItemContext } from '../../../domain/graph/GraphTypes';
|
|
4
4
|
type DataURLBase64 = string;
|
|
5
5
|
type Props = {
|
|
6
6
|
avatarClassName?: string;
|
|
@@ -13,7 +13,7 @@ type Props = {
|
|
|
13
13
|
height?: number;
|
|
14
14
|
hint?: string;
|
|
15
15
|
size: number;
|
|
16
|
-
url?:
|
|
16
|
+
url?: AvatarUrlSpec;
|
|
17
17
|
width?: number;
|
|
18
18
|
};
|
|
19
19
|
type State = {
|
|
@@ -22,11 +22,13 @@ type State = {
|
|
|
22
22
|
declare class Avatar extends React.Component<Props, State> {
|
|
23
23
|
private image;
|
|
24
24
|
constructor(props: Props);
|
|
25
|
+
static resolveUrl(spec: AvatarUrlSpec | undefined): string | undefined;
|
|
25
26
|
static getDerivedStateFromProps(props: Props, state: State): State;
|
|
26
27
|
componentDidMount(): void;
|
|
27
28
|
componentDidUpdate(prevProps: Props): void;
|
|
28
29
|
componentWillUnmount(): void;
|
|
29
30
|
private refreshImage;
|
|
31
|
+
private onImageError;
|
|
30
32
|
startImgLoading(url: string): void;
|
|
31
33
|
render(): ReactElement<any>;
|
|
32
34
|
}
|
|
@@ -460,12 +460,20 @@ export interface InteractiveScrollMarker {
|
|
|
460
460
|
label: string;
|
|
461
461
|
}
|
|
462
462
|
export type OnScrollMarkerClicked = (sha: Sha, rowIndex: number, type: GraphMarkerType) => void;
|
|
463
|
+
export type OnAvatarUrlError = (url: string, error: unknown) => void;
|
|
464
|
+
export type AvatarUrlSpec = string | {
|
|
465
|
+
url: string;
|
|
466
|
+
onError?: OnAvatarUrlError;
|
|
467
|
+
};
|
|
463
468
|
export type AvatarUrlByEmail = {
|
|
464
|
-
[email: string]:
|
|
469
|
+
[email: string]: AvatarUrlSpec;
|
|
465
470
|
};
|
|
466
471
|
export type AvatarUrlRequestedByEmail = {
|
|
467
472
|
[email: string]: boolean;
|
|
468
473
|
};
|
|
474
|
+
export type ShaByEmail = {
|
|
475
|
+
[email: string]: string;
|
|
476
|
+
};
|
|
469
477
|
export type DownstreamsByUpstream = {
|
|
470
478
|
[upstreamName: string]: string[];
|
|
471
479
|
};
|
|
@@ -555,7 +563,7 @@ export type OnGraphRefNodeUnhovered = (event: React.MouseEvent<any> | React.Focu
|
|
|
555
563
|
export type OnGraphColumnsReOrdered = (columnsSettings: GraphColumnsSettings) => void;
|
|
556
564
|
export type OnGraphColumnResized = (graphZoneType: GraphZoneType, columnSettings: GraphColumnSetting) => void;
|
|
557
565
|
export type OnShowMoreCommits = () => void;
|
|
558
|
-
export type OnEmailsMissingAvatarUrls = (emails:
|
|
566
|
+
export type OnEmailsMissingAvatarUrls = (emails: ShaByEmail) => void;
|
|
559
567
|
export type OnRefsMissingMetadata = (refs: RefsMissingMetadata) => void;
|
|
560
568
|
/**
|
|
561
569
|
* Callback invoked when column numbers are calculated for each commit.
|
|
@@ -7,6 +7,15 @@ import type { ReadonlyGraphRow } from '../GraphTypes';
|
|
|
7
7
|
* - Array of triggers = visible when ANY of the specified triggers are active
|
|
8
8
|
*/
|
|
9
9
|
export type AdornmentVisibility = true | readonly ('hover' | 'focus' | 'selected')[];
|
|
10
|
+
/**
|
|
11
|
+
* Live interaction state for a row, passed to resolveAdornment so the adornment
|
|
12
|
+
* content can vary by state (e.g. compact at rest, expanded on hover).
|
|
13
|
+
*/
|
|
14
|
+
export interface AdornmentState {
|
|
15
|
+
isHovered: boolean;
|
|
16
|
+
isFocused: boolean;
|
|
17
|
+
isSelected: boolean;
|
|
18
|
+
}
|
|
10
19
|
/**
|
|
11
20
|
* Adornment configuration returned from provideAdornments for each row.
|
|
12
21
|
* @template TContext - Type of context data passed from provide to resolve
|
|
@@ -20,11 +29,13 @@ export interface RowAdornment<TContext = unknown> {
|
|
|
20
29
|
*/
|
|
21
30
|
context?: TContext;
|
|
22
31
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
32
|
+
* Controls when resolve() is re-called:
|
|
33
|
+
* - false (default): content is cached until invalidated
|
|
34
|
+
* - true: resolve() is called on every render (content not cached)
|
|
35
|
+
* - 'interaction': resolve() is re-called when the row's hover/focus/selected state changes
|
|
36
|
+
* (content cached per interaction state). Use for adornments whose UI varies by state.
|
|
26
37
|
*/
|
|
27
|
-
dynamic?: boolean;
|
|
38
|
+
dynamic?: boolean | 'interaction';
|
|
28
39
|
}
|
|
29
40
|
/**
|
|
30
41
|
* Invalidation level
|
|
@@ -76,9 +87,10 @@ export interface RowAdornmentProvider<TContext = unknown> {
|
|
|
76
87
|
*
|
|
77
88
|
* @param row - The row to render adornment for
|
|
78
89
|
* @param context - Context data from provideAdornments (if any)
|
|
90
|
+
* @param state - Current interaction state (hover/focus/selected) of the row, when available
|
|
79
91
|
* @returns Content to render, or null/Promise for no/pending content
|
|
80
92
|
*/
|
|
81
|
-
resolveAdornment(row: ReadonlyGraphRow, context?: TContext): ReactNode | null | Promise<ReactNode | null>;
|
|
93
|
+
resolveAdornment(row: ReadonlyGraphRow, context?: TContext, state?: AdornmentState): ReactNode | null | Promise<ReactNode | null>;
|
|
82
94
|
/**
|
|
83
95
|
* EventTarget for invalidation.
|
|
84
96
|
* - Graph subscribes to 'invalidate' events
|
|
@@ -91,7 +103,8 @@ export interface RowAdornmentProvider<TContext = unknown> {
|
|
|
91
103
|
*/
|
|
92
104
|
export interface CachedAdornment {
|
|
93
105
|
visibility: AdornmentVisibility;
|
|
94
|
-
dynamic: boolean;
|
|
106
|
+
dynamic: boolean | 'interaction';
|
|
95
107
|
context?: unknown;
|
|
96
108
|
content?: ReactNode;
|
|
109
|
+
contentStateKey?: string;
|
|
97
110
|
}
|