@gitkraken/gitkraken-components 13.0.0-vnext.36 → 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.
@@ -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: AvatarUrlByEmail;
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?: string | null;
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?: string;
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?: string | null;
8
+ avatarUrl?: AvatarUrlSpec | null;
9
9
  className?: string;
10
10
  column?: number;
11
11
  context?: GraphItemContext | null;
@@ -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?: string;
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]: 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: AvatarUrlByEmail) => void;
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.