@gitkraken/gitkraken-components 11.0.7 → 11.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { Alignment, ScrollParams } from 'react-virtualized';
3
- import type { ReactElement } from 'react';
3
+ import type { ReactElement, ReactNode } from 'react';
4
4
  import React from 'react';
5
5
  import type { Sha } from '../../domain/commit/CommitTypes';
6
6
  import type { CssVariables } from '../../domain/generic/GenericTypes';
@@ -10,7 +10,7 @@ import type { AbsoluteNodeLeftByColumn, AvatarUrlByEmail, AvatarUrlRequestedByEm
10
10
  import type { TranslationFn } from '../../domain/language/LanguageTypes';
11
11
  import type { CreateRefFormData, RefIconsPosition } from '../../domain/ref/RefTypes';
12
12
  import type { OnBlur, OnKeyDown, OnKeyUp, OnMouseDown, OnResizeParams } from '../../domain/ui/UiTypes';
13
- import type { WorkDirStats } from '../../domain/workdir/WorkDirTypes';
13
+ import type { WipNodeMetadataBySha, WorkDirStats } from '../../domain/workdir/WorkDirTypes';
14
14
  import type { IGraphContainer } from './IGraphContainer';
15
15
  type ClearScrollToIndex = () => void;
16
16
  type OnZoneEnter = (e: React.MouseEvent<any>, zoneType: GraphZoneType, hoveredRefGroup?: GraphRefGroup, hoveredSha?: Sha) => void;
@@ -31,6 +31,7 @@ export interface StateProps {
31
31
  createRefFormData?: CreateRefFormData | null;
32
32
  dimMergeCommits?: boolean;
33
33
  enableShowHideRefsOptions?: boolean;
34
+ headerZoneActions?: Partial<Record<GraphZoneType, ReactNode>>;
34
35
  downstreamsByUpstream?: DownstreamsByUpstream;
35
36
  formatRefShorthand?: FormatRefShorthand;
36
37
  highlightRowsOnRefHover?: boolean;
@@ -74,6 +75,7 @@ export interface StateProps {
74
75
  rowsStatsLoading?: boolean;
75
76
  wipMessageEditable?: boolean;
76
77
  workDirStats?: WorkDirStats;
78
+ wipNodeMetadataBySha?: WipNodeMetadataBySha;
77
79
  }
78
80
  export interface DispatchProps {
79
81
  onDoubleClickGraphRef?: OnDoubleClickGraphRef;
@@ -165,6 +167,7 @@ type ComponentState = {
165
167
  themeOpacityFactor: number;
166
168
  width: number;
167
169
  workDirStats: WorkDirStats;
170
+ wipNodeMetadataBySha?: WipNodeMetadataBySha;
168
171
  };
169
172
  type ColumnsToFreeBySha = {
170
173
  [sha: Sha]: number[];
@@ -205,6 +208,7 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
205
208
  pinnedBranchShas: Set<Sha>;
206
209
  rowsStats?: Record<string, RowStats>;
207
210
  workDirStats: WorkDirStats;
211
+ wipNodeMetadataBySha?: WipNodeMetadataBySha;
208
212
  excludeByType: ExcludeByType;
209
213
  excludeRefsById: ExcludeRefsById;
210
214
  includeOnlyRefsById: IncludeOnlyRefsById;
@@ -1,6 +1,6 @@
1
- import type { ReactElement } from 'react';
1
+ import type { ReactElement, ReactNode } from 'react';
2
2
  import React from 'react';
3
- import type { GraphZone } from '../../domain/graph/GraphConstants';
3
+ import type { GraphZone, GraphZoneType } from '../../domain/graph/GraphConstants';
4
4
  import type { ExcludeRefsById, GetExternalIcon, GraphColumnsSettings, GraphItemContext, IncludeOnlyRefsById, OnFilterColumnClick, OnGraphColumnReOrdered, OnGraphZoneResize, OnGraphZoneResizeEnd, OnGraphZoneResizeFromPropChange, OnPopupGraphHeaderContextMenu, OnSettingsClick, OnToggleRefNodesShown } from '../../domain/graph/GraphTypes';
5
5
  import type { TranslationFn } from '../../domain/language/LanguageTypes';
6
6
  import type { OnMouseEnter, OnMouseLeave } from '../../domain/ui/UiTypes';
@@ -13,6 +13,7 @@ type Props = {
13
13
  getExternalIcon: GetExternalIcon;
14
14
  excludeRefsById: ExcludeRefsById;
15
15
  headerContext?: GraphItemContext;
16
+ headerZoneActions?: Partial<Record<GraphZoneType, ReactNode>>;
16
17
  includeOnlyRefsById: IncludeOnlyRefsById;
17
18
  rowsStatsLoading: boolean;
18
19
  onColumnReOrdered?: OnGraphColumnReOrdered;
@@ -16,6 +16,7 @@ type Props = {
16
16
  graphZoneModeConstants: GraphZoneModeConstants;
17
17
  left: number;
18
18
  message: string;
19
+ nodeSpinning?: boolean;
19
20
  opacity: number;
20
21
  suppressNonRefRowTooltips?: boolean;
21
22
  translate: TranslationFn;
@@ -31,6 +31,7 @@ type Props = {
31
31
  message: string;
32
32
  nodeOffset: number;
33
33
  nodeOpacity: number;
34
+ nodeSpinning?: boolean;
34
35
  numGraphColumns: number;
35
36
  onContextMenu: OnCommitContextMenu;
36
37
  onClickCommit: OnClickCommit;
@@ -1,4 +1,4 @@
1
- import type { MouseEventHandler, ReactElement } from 'react';
1
+ import type { MouseEventHandler, ReactElement, ReactNode } from 'react';
2
2
  import React from 'react';
3
3
  import type { GraphZone, GraphZoneType } from '../../../domain/graph/GraphConstants';
4
4
  import type { ExcludeRefsById, GetExternalIcon, GraphColumnSetting, GraphItemContext, GraphRefOptData, IncludeOnlyRefsById, OnFilterColumnClick, OnGraphZoneResize, OnGraphZoneResizeEnd, OnGraphZoneResizeFromPropChange, OnGraphZoneResizeStart, OnSettingsClick, OnToggleRefNodesShown } from '../../../domain/graph/GraphTypes';
@@ -14,6 +14,7 @@ type GraphHeaderProps = {
14
14
  graphZones: GraphZone[];
15
15
  graphZoneType: GraphZoneType;
16
16
  excludeRefsById: ExcludeRefsById;
17
+ headerZoneAction?: ReactNode;
17
18
  id: string;
18
19
  includeOnlyRefsById: IncludeOnlyRefsById;
19
20
  isDraggable: boolean;
@@ -2,12 +2,13 @@ import type { GridCellRenderer } from 'react-virtualized';
2
2
  import type { GraphCommitDescDisplayMode } from '../../../domain/graph/GraphConstants';
3
3
  import type { CommonGraphRowDispatchProps, CommonGraphRowProps, OnCommitMessageChange, OnWipMessageBlur, OnWipMessageFocus } from '../../../domain/graph/GraphTypes';
4
4
  import type { GetRealKeyForCellFunc } from '../../../domain/reactvirtualized/ReactVirtualizedHelpers';
5
- import type { WorkDirStats } from '../../../domain/workdir/WorkDirTypes';
5
+ import type { WipNodeMetadataBySha, WorkDirStats } from '../../../domain/workdir/WorkDirTypes';
6
6
  interface StateProps {
7
7
  graphCommitDescDisplayMode: GraphCommitDescDisplayMode;
8
8
  isCommitting: boolean;
9
9
  pendingCommitMessageSummary: string;
10
10
  workDirStats?: WorkDirStats;
11
+ wipNodeMetadataBySha?: WipNodeMetadataBySha;
11
12
  wipMessageEditable: boolean;
12
13
  }
13
14
  interface DispatchProps {
@@ -1,9 +1,11 @@
1
1
  import type { GridCellRenderer } from 'react-virtualized';
2
2
  import type { AvatarUrlByEmail, ColumnColorByColumn, CommonGraphRowDispatchProps, CommonGraphRowProps, GetMissingAvatar, GraphZoneModeConstants, NodeOffsetByColumn, NodeOpacityByColumn } from '../../../domain/graph/GraphTypes';
3
3
  import type { GetRealKeyForCellFunc } from '../../../domain/reactvirtualized/ReactVirtualizedHelpers';
4
+ import type { WipNodeMetadataBySha } from '../../../domain/workdir/WorkDirTypes';
4
5
  interface OwnProps {
5
6
  avatarUrlByEmail: AvatarUrlByEmail;
6
7
  graphZoneModeConstants: GraphZoneModeConstants;
8
+ wipNodeMetadataBySha?: WipNodeMetadataBySha;
7
9
  height: number;
8
10
  onMissingAvatar: GetMissingAvatar;
9
11
  columnColorByColumn: ColumnColorByColumn;
@@ -0,0 +1,18 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { Sha } from '../commit/CommitTypes';
3
+ import type { WipNodeMetadataBySha, WorkDirStats } from './WorkDirTypes';
4
+ export type ResolvedWipState = {
5
+ isPrimaryWip: boolean;
6
+ effectiveWorkDirStats: WorkDirStats | undefined;
7
+ hasWorkDirChanges: boolean;
8
+ isWipEditable: boolean;
9
+ customWipContent: ReactElement<any> | null;
10
+ };
11
+ /**
12
+ * Resolves the effective WIP state for a given row.
13
+ *
14
+ * For the primary WIP row (sha === workDirType), uses the global workDirStats.
15
+ * For secondary WIP rows, looks up per-row metadata from wipNodeMetadataBySha,
16
+ * falling back to the global workDirStats for backward compatibility.
17
+ */
18
+ export declare function resolveWipState(sha: Sha, type: string, workDirStats: WorkDirStats | undefined, wipNodeMetadataBySha: WipNodeMetadataBySha | undefined, wipMessageEditable: boolean): ResolvedWipState;
@@ -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,13 @@ export type WorkDirStats = {
6
8
  context?: GraphItemContext;
7
9
  renamed?: number;
8
10
  };
11
+ export type WipNodeMetadata = {
12
+ workDirStats?: WorkDirStats;
13
+ /** If provided, renders this element instead of the default InlineWorkDirSummary */
14
+ customContent?: ReactElement<any>;
15
+ /** If provided, renders this avatar URL inside the graph node circle instead of the default WIP dot */
16
+ nodeAvatarUrl?: string;
17
+ /** If true, the WIP node's dashed border spins to indicate an active agent */
18
+ nodeSpinning?: boolean;
19
+ };
20
+ export type WipNodeMetadataBySha = Record<Sha, WipNodeMetadata>;