@gitkraken/gitkraken-components 10.1.9 → 10.1.11
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/dnd/DndComponent.d.ts +50 -0
- package/dist/components/graph/GraphContainer.d.ts +22 -8
- package/dist/components/graph/GraphHeaderRow.d.ts +1 -1
- package/dist/components/graph/messagezone/WorkDirMessageInput.d.ts +43 -0
- package/dist/components/graph/refzone/RefNode.d.ts +11 -2
- package/dist/components/graph/refzone/RefNodes.d.ts +12 -3
- package/dist/components/graph/refzone/RefZone.d.ts +8 -1
- package/dist/components/graph/rowRenderers/CommitMessageZoneRow.d.ts +4 -5
- package/dist/components/graph/rowRenderers/RefZoneRow.d.ts +8 -1
- package/dist/domain/generic/EventService.d.ts +14 -0
- package/dist/domain/graph/GraphTypes.d.ts +17 -1
- package/dist/domain/ui/UiTypes.d.ts +0 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- /package/dist/components/{graph/dnd → dnd}/DndContainer.d.ts +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type DndCanDrag = (sourceData?: any) => boolean;
|
|
4
|
+
export type DndOnBeginDrag = (event: React.DragEvent, sourceData?: any) => void;
|
|
5
|
+
export type DndOnDragEnter = (event: React.DragEvent, sourceData?: any, targetData?: any) => void;
|
|
6
|
+
export type DndOnDragLeave = (event: React.DragEvent, sourceData?: any, targetData?: any) => void;
|
|
7
|
+
export type DndOnEndDrag = (event: React.DragEvent, sourceData?: any, targetData?: any) => void;
|
|
8
|
+
export type DndCanDrop = (event?: React.DragEvent, sourceData?: any, targetData?: any) => boolean;
|
|
9
|
+
export type DndOnDrop = (event: React.DragEvent, sourceData?: any, targetData?: any) => void;
|
|
10
|
+
export type DndId = string;
|
|
11
|
+
export type DndComponentProps = {
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
canDrag?: DndCanDrag | boolean;
|
|
15
|
+
canDrop?: DndCanDrop | boolean;
|
|
16
|
+
dndId: DndId;
|
|
17
|
+
onBeginDrag?: DndOnBeginDrag;
|
|
18
|
+
onDragEnter?: DndOnDragEnter;
|
|
19
|
+
onDragLeave?: DndOnDragLeave;
|
|
20
|
+
onDrop?: DndOnDrop;
|
|
21
|
+
onEndDrag?: DndOnEndDrag;
|
|
22
|
+
dndData?: any;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
};
|
|
25
|
+
export type DndComponentState = {
|
|
26
|
+
isDragging: boolean;
|
|
27
|
+
isDroppable: boolean;
|
|
28
|
+
isOver: boolean;
|
|
29
|
+
};
|
|
30
|
+
declare class DndComponent extends React.Component<DndComponentProps, DndComponentState> {
|
|
31
|
+
private dndComponentRef;
|
|
32
|
+
private mounted;
|
|
33
|
+
private onDragStartSubscription;
|
|
34
|
+
private onDragEndSubscription;
|
|
35
|
+
constructor(props: DndComponentProps);
|
|
36
|
+
componentDidMount(): void;
|
|
37
|
+
componentWillUnmount(): void;
|
|
38
|
+
private canDrop;
|
|
39
|
+
private addDragEndEventListenerOnce;
|
|
40
|
+
private isDraggable;
|
|
41
|
+
private onDragEnter;
|
|
42
|
+
private onDragLeave;
|
|
43
|
+
private onDrag;
|
|
44
|
+
private onDragOver;
|
|
45
|
+
private onDragStart;
|
|
46
|
+
private onDragEnd;
|
|
47
|
+
private onDrop;
|
|
48
|
+
render(): ReactElement<any>;
|
|
49
|
+
}
|
|
50
|
+
export default DndComponent;
|
|
@@ -6,9 +6,9 @@ import type { Sha } from '../../domain/commit/CommitTypes';
|
|
|
6
6
|
import type { CssVariables } from '../../domain/generic/GenericTypes';
|
|
7
7
|
import type { GraphMarkerType, GraphZone, GraphZoneType } from '../../domain/graph/GraphConstants';
|
|
8
8
|
import type { ThrottledFn } from '../../domain/graph/GraphHelpers';
|
|
9
|
-
import type { AbsoluteNodeLeftByColumn, AvatarUrlByEmail, AvatarUrlRequestedByEmail, ChildrenBySha, ColumnColorByColumn, DownstreamsByUpstream, EdgeByColumn, ExcludeByType, ExcludeRefsById, ExcludeRemotesByName, GetExternalIcon, GetMissingAvatar, GetMissingRefMetadata, GraphColumnSetting, GraphColumnsSettings, GraphContexts, GraphMarkerColors, GraphMarkerRowIndices, GraphPlatform, GraphRefGroup, GraphRefOptData, GraphRow, GraphZoneModeConstants, GraphZonesByType, Head, HighlightedShas, IncludeOnlyRefsById, IncludeOnlyRemotesByName, IsSelectedBySha, NodeOffsetByColumn, NodeOpacityByColumn, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnClickRef, OnCommitContextMenu, OnCommitMessageChange, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, OnDoubleClickRef, OnFormatCommitDateTime, OnGraphColumnReOrdered, OnGraphMouseEnter, OnGraphMouseLeave, OnGraphResized, OnGraphVisibleRowsChanged, OnGraphZoneResize, OnGraphZoneResizeEnd, OnPopupGraphHeaderContextMenu, OnRefNodeHovered, OnRefNodeUnhovered, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnScrollForZone, OnSettingsClick, OnToggleRefNodesShown, ProcessedGraphRow, ProcessedGraphRowBySha, RefMetadataById, RefMetadataItem, RefMetadataRequestedById, RefMetadataType, RefsMissingMetadata, Remote, ReserverInfoBySha, RowEdges, RowStats, RowStatsConstraints, Tag, TopAndBottomVisibleRowIndex } from '../../domain/graph/GraphTypes';
|
|
9
|
+
import type { AbsoluteNodeLeftByColumn, AvatarUrlByEmail, AvatarUrlRequestedByEmail, ChildrenBySha, ColumnColorByColumn, DownstreamsByUpstream, EdgeByColumn, ExcludeByType, ExcludeRefsById, ExcludeRemotesByName, GetExternalIcon, GetMissingAvatar, GetMissingRefMetadata, GraphColumnSetting, GraphColumnsSettings, GraphContexts, GraphMarkerColors, GraphMarkerRowIndices, GraphPlatform, GraphRefGroup, GraphRefOptData, GraphRow, GraphZoneModeConstants, GraphZonesByType, Head, HighlightedShas, IncludeOnlyRefsById, IncludeOnlyRemotesByName, IsSelectedBySha, NodeOffsetByColumn, NodeOpacityByColumn, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnClickRef, OnCommitContextMenu, OnCommitMessageChange, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, OnDoubleClickRef, OnFormatCommitDateTime, OnGraphColumnReOrdered, OnGraphMouseEnter, OnGraphMouseLeave, OnGraphResized, OnGraphVisibleRowsChanged, OnGraphZoneResize, OnGraphZoneResizeEnd, OnPopupGraphHeaderContextMenu, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnScrollForZone, OnSettingsClick, OnToggleRefNodesShown, OnWipMessageBlur, OnWipMessageFocus, ProcessedGraphRow, ProcessedGraphRowBySha, RefMetadataById, RefMetadataItem, RefMetadataRequestedById, RefMetadataType, RefsMissingMetadata, Remote, ReserverInfoBySha, RowEdges, RowStats, RowStatsConstraints, Tag, TopAndBottomVisibleRowIndex } from '../../domain/graph/GraphTypes';
|
|
10
10
|
import type { TranslationFn } from '../../domain/language/LanguageTypes';
|
|
11
|
-
import type { OnBlur,
|
|
11
|
+
import type { OnBlur, OnKeyDown, OnKeyUp, OnMouseDown, OnResizeParams } from '../../domain/ui/UiTypes';
|
|
12
12
|
import type { WorkDirStats } from '../../domain/workdir/WorkDirTypes';
|
|
13
13
|
type OnClickGraphRow = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
14
14
|
type OnDoubleClickGraphRow = (event: React.MouseEvent<any>, graphZoneType: GraphZoneType, graphRow: GraphRow) => void;
|
|
@@ -71,6 +71,7 @@ export interface StateProps {
|
|
|
71
71
|
useAuthorInitialsForAvatars: boolean;
|
|
72
72
|
rowsStats?: Record<string, RowStats>;
|
|
73
73
|
rowsStatsLoading?: boolean;
|
|
74
|
+
wipMessageEditable?: boolean;
|
|
74
75
|
workDirStats?: WorkDirStats;
|
|
75
76
|
}
|
|
76
77
|
export interface DispatchProps {
|
|
@@ -78,14 +79,21 @@ export interface DispatchProps {
|
|
|
78
79
|
onGraphRowHovered?: OnGraphRowHovered;
|
|
79
80
|
onGraphRowUnhovered?: OnGraphRowUnhovered;
|
|
80
81
|
onRefContextMenu?: OnRefContextMenu;
|
|
82
|
+
onRefBeginDrag?: OnRefBeginDrag;
|
|
83
|
+
onRefCanDrag?: OnRefCanDrag;
|
|
84
|
+
onRefCanDrop?: OnRefCanDrop;
|
|
85
|
+
onRefDragEnter?: OnRefDragEnter;
|
|
86
|
+
onRefDragLeave?: OnRefDragLeave;
|
|
87
|
+
onRefDrop?: OnRefDrop;
|
|
88
|
+
onRefEndDrag?: OnRefEndDrag;
|
|
81
89
|
onToggleRefsVisibilityClick?: OnToggleRefsVisibilityClick;
|
|
82
90
|
onRowContextMenu?: OnRowContextMenu;
|
|
83
91
|
onGraphRefNodeHovered?: OnGraphRefNodeHovered;
|
|
84
92
|
onGraphRefNodeUnhovered?: OnGraphRefNodeUnhovered;
|
|
85
|
-
onBlurWipNodeInput?:
|
|
93
|
+
onBlurWipNodeInput?: OnWipMessageBlur;
|
|
86
94
|
onGraphColumnsReOrdered?: OnGraphColumnsReOrdered;
|
|
87
95
|
onColumnResized?: OnGraphColumnResized;
|
|
88
|
-
onFocusWipNodeInput?:
|
|
96
|
+
onFocusWipNodeInput?: OnWipMessageFocus;
|
|
89
97
|
onMessageChange?: OnCommitMessageChange;
|
|
90
98
|
onPopupGraphHeaderContextMenu?: OnPopupGraphHeaderContextMenu;
|
|
91
99
|
onClickGraphRef?: OnClickGraphRef;
|
|
@@ -96,7 +104,6 @@ export interface DispatchProps {
|
|
|
96
104
|
onScrollForZone?: OnGraphScrollForZone;
|
|
97
105
|
onScrollToRowCausedUpdateForRefZone?: OnGraphScrollForZone;
|
|
98
106
|
onShowMoreCommits?: OnShowMoreCommits;
|
|
99
|
-
onWipNodeInputWillUnmount?: OnComponentWillUnmount;
|
|
100
107
|
onGraphResized?: OnGraphResized;
|
|
101
108
|
onGraphVisibleRowsChanged?: OnGraphVisibleRowsChanged;
|
|
102
109
|
onGraphMouseEnter?: OnGraphMouseEnter;
|
|
@@ -129,6 +136,7 @@ type ComponentState = {
|
|
|
129
136
|
isContainerWindowFocused: boolean;
|
|
130
137
|
isLoadingRows: boolean;
|
|
131
138
|
numGraphColumns: number;
|
|
139
|
+
pendingCommitMessageSummary: string;
|
|
132
140
|
processedRows: ProcessedGraphRow[];
|
|
133
141
|
refMetadataById?: RefMetadataById | null;
|
|
134
142
|
rowsStats?: Record<string, RowStats>;
|
|
@@ -197,9 +205,9 @@ declare class GraphContainer extends React.PureComponent<Props, ComponentState>
|
|
|
197
205
|
componentWillReceiveProps(nextProps: Props): void;
|
|
198
206
|
componentWillUnmount(): void;
|
|
199
207
|
onGraphVisibleRowsUpdatedThrottled: ThrottledFn;
|
|
200
|
-
onBlurWipNodeInput:
|
|
208
|
+
onBlurWipNodeInput: OnWipMessageBlur;
|
|
201
209
|
onDoubleClickRef: OnDoubleClickRef;
|
|
202
|
-
onFocusWipNodeInput:
|
|
210
|
+
onFocusWipNodeInput: OnWipMessageFocus;
|
|
203
211
|
onCurrentlyHoveredGraphCommit: OnCurrentlyHoveredGraphCommit;
|
|
204
212
|
onClearCurrentlyHoveredGraphCommit: OnClearCurrentlyHoveredGraphCommit;
|
|
205
213
|
onGraphColumnReOrdered: OnGraphColumnReOrdered;
|
|
@@ -208,6 +216,13 @@ declare class GraphContainer extends React.PureComponent<Props, ComponentState>
|
|
|
208
216
|
onPopupGraphHeaderContextMenu: OnPopupGraphHeaderContextMenu;
|
|
209
217
|
onSettingsClick: OnSettingsClick;
|
|
210
218
|
onMessageChange: OnCommitMessageChange;
|
|
219
|
+
onRefBeginDrag: OnRefBeginDrag;
|
|
220
|
+
onRefCanDrag: OnRefCanDrag;
|
|
221
|
+
onRefCanDrop: OnRefCanDrop;
|
|
222
|
+
onRefDragEnter: OnRefDragEnter;
|
|
223
|
+
onRefDragLeave: OnRefDragLeave;
|
|
224
|
+
onRefDrop: OnRefDrop;
|
|
225
|
+
onRefEndDrag: OnRefEndDrag;
|
|
211
226
|
onClickRef: OnClickRef;
|
|
212
227
|
onClickCommit: OnClickCommit;
|
|
213
228
|
onDoubleClickCommit: OnDoubleClickCommit;
|
|
@@ -224,7 +239,6 @@ declare class GraphContainer extends React.PureComponent<Props, ComponentState>
|
|
|
224
239
|
onScrollToRowCausedUpdateForRefZone: OnScrollForZone;
|
|
225
240
|
onCommitContextMenu: OnCommitContextMenu;
|
|
226
241
|
onRefContextMenu: OnRefZoneContextMenu;
|
|
227
|
-
onWipNodeInputWillUnmount: OnComponentWillUnmount;
|
|
228
242
|
selectCommits(shas: Sha[], includeToPrevSel: boolean, isAutoOrKeyScroll: boolean): void;
|
|
229
243
|
getCommitZoneContentWidthBetweenGutters(): number;
|
|
230
244
|
getSelectedShas(): Sha[];
|
|
@@ -4,7 +4,7 @@ import type { GraphZone } from '../../domain/graph/GraphConstants';
|
|
|
4
4
|
import type { ExcludeRefsById, GetExternalIcon, GraphItemContext, IncludeOnlyRefsById, 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';
|
|
7
|
-
import type { DndIsDraggable, DndIsDroppable, DndOnDrop } from '
|
|
7
|
+
import type { DndIsDraggable, DndIsDroppable, DndOnDrop } from '../dnd/DndContainer';
|
|
8
8
|
type Props = {
|
|
9
9
|
dragAppendToContainer?: Element | undefined;
|
|
10
10
|
enableResizer?: boolean;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { Sha } from '../../../domain/commit/CommitTypes';
|
|
4
|
+
import type { Style } from '../../../domain/generic/GenericTypes';
|
|
5
|
+
import type { GraphZoneType } from '../../../domain/graph/GraphConstants';
|
|
6
|
+
import type { GetExternalIcon, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnCommitContextMenu, OnCommitMessageChange, OnCurrentlyHoveredGraphCommit, OnWipMessageBlur, OnWipMessageFocus } from '../../../domain/graph/GraphTypes';
|
|
7
|
+
import type { TranslationFn } from '../../../domain/language/LanguageTypes';
|
|
8
|
+
import type { WorkDirStats } from '../../../domain/workdir/WorkDirTypes';
|
|
9
|
+
type WorkDirMessageInputDefaultProps = {
|
|
10
|
+
style: Style;
|
|
11
|
+
value: string;
|
|
12
|
+
};
|
|
13
|
+
type WorkDirMessageInputProps = {
|
|
14
|
+
clearCurrentlyHoveredGraphCommit: OnClearCurrentlyHoveredGraphCommit;
|
|
15
|
+
currentlyHoveredCommitSha: Sha | null;
|
|
16
|
+
getExternalIcon: GetExternalIcon;
|
|
17
|
+
graphZoneType: GraphZoneType;
|
|
18
|
+
isCommitting: boolean;
|
|
19
|
+
isHovering: boolean;
|
|
20
|
+
isSelected: boolean;
|
|
21
|
+
onBlur: OnWipMessageBlur;
|
|
22
|
+
onClickCommit: OnClickCommit;
|
|
23
|
+
onContextMenu: OnCommitContextMenu;
|
|
24
|
+
onFocus: OnWipMessageFocus;
|
|
25
|
+
onMessageChange: OnCommitMessageChange;
|
|
26
|
+
setAsCurrentlyHoveredGraphCommit: OnCurrentlyHoveredGraphCommit;
|
|
27
|
+
sha: Sha;
|
|
28
|
+
style: Style;
|
|
29
|
+
translate: TranslationFn;
|
|
30
|
+
value: string;
|
|
31
|
+
workDirStats: WorkDirStats;
|
|
32
|
+
};
|
|
33
|
+
export default class WorkDirMessageInput extends React.Component<WorkDirMessageInputProps> {
|
|
34
|
+
textWidthRef: React.RefObject<any>;
|
|
35
|
+
wrapperRef: React.RefObject<any>;
|
|
36
|
+
static defaultProps: WorkDirMessageInputDefaultProps;
|
|
37
|
+
componentDidMount(): void;
|
|
38
|
+
componentDidUpdate(): void;
|
|
39
|
+
componentWillUnmount(): void;
|
|
40
|
+
onWipKeyDown(event: Event): void;
|
|
41
|
+
render(): ReactElement<'div'>;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { Sha } from '../../../domain/commit/CommitTypes';
|
|
4
|
-
import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, GraphRef, GraphRefGroup, OnClickRef, OnClickRefMetadata, OnDoubleClickRef, OnDoubleClickRefMetadata, OnHideRefClick, OnRefNodeHovered, OnRefZoneContextMenu, RefMetadataById, RefMetadataType } from '../../../domain/graph/GraphTypes';
|
|
3
|
+
import type { CommitType, Sha } from '../../../domain/commit/CommitTypes';
|
|
4
|
+
import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, GraphRef, GraphRefGroup, OnClickRef, OnClickRefMetadata, OnDoubleClickRef, OnDoubleClickRefMetadata, OnHideRefClick, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefZoneContextMenu, RefMetadataById, RefMetadataType } from '../../../domain/graph/GraphTypes';
|
|
5
5
|
import type { TranslationFn } from '../../../domain/language/LanguageTypes';
|
|
6
6
|
import type { OnClick, OnContextMenu, OnDoubleClick } from '../../../domain/ui/UiTypes';
|
|
7
7
|
type RefNodeProps = {
|
|
@@ -9,11 +9,19 @@ type RefNodeProps = {
|
|
|
9
9
|
groupIsHovered: boolean;
|
|
10
10
|
hasActive: boolean;
|
|
11
11
|
hasRefs: boolean;
|
|
12
|
+
isGhostRef: boolean;
|
|
12
13
|
isInUnsupportedRebase: boolean;
|
|
13
14
|
isRefGroupIncluded: boolean;
|
|
14
15
|
onClick: OnClickRef;
|
|
15
16
|
onContextMenu: OnRefZoneContextMenu;
|
|
16
17
|
onDoubleClick: OnDoubleClickRef;
|
|
18
|
+
onRefCanDrag: OnRefCanDrag;
|
|
19
|
+
onRefCanDrop: OnRefCanDrop;
|
|
20
|
+
onRefDragEnter: OnRefDragEnter;
|
|
21
|
+
onRefDragLeave: OnRefDragLeave;
|
|
22
|
+
onRefDrop: OnRefDrop;
|
|
23
|
+
onRefBeginDrag: OnRefBeginDrag;
|
|
24
|
+
onRefEndDrag: OnRefEndDrag;
|
|
17
25
|
onHovered: OnRefNodeHovered;
|
|
18
26
|
onMissingRefMetadata: GetMissingRefMetadata;
|
|
19
27
|
onHideRefClick: OnHideRefClick;
|
|
@@ -23,6 +31,7 @@ type RefNodeProps = {
|
|
|
23
31
|
sha: Sha;
|
|
24
32
|
enabledRefMetadataTypes: RefMetadataType[];
|
|
25
33
|
translate: TranslationFn;
|
|
34
|
+
type: CommitType;
|
|
26
35
|
};
|
|
27
36
|
export declare function getRefIconAndTooltipForRef(getExternalIcon: GetExternalIcon, ref: GraphRef, translate: TranslationFn, index?: number): ReactElement<any>;
|
|
28
37
|
export default class RefNode extends React.PureComponent<RefNodeProps> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import type { Sha } from '../../../domain/commit/CommitTypes';
|
|
3
|
-
import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, IncludeOnlyRefsById, IncludeOnlyRemotesByName, OnClickRef, OnDoubleClickRef, OnRefNodeHovered, OnRefZoneContextMenu, OnToggleRefNodesShown, GraphRefGroup as RefGroup, RefGroupContexts, RefMetadataById, RefMetadataType, RefTargetFunc } from '../../../domain/graph/GraphTypes';
|
|
2
|
+
import type { CommitType, Sha } from '../../../domain/commit/CommitTypes';
|
|
3
|
+
import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, IncludeOnlyRefsById, IncludeOnlyRemotesByName, OnClickRef, OnDoubleClickRef, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefZoneContextMenu, OnToggleRefNodesShown, GraphRefGroup as RefGroup, RefGroupContexts, RefMetadataById, RefMetadataType, RefTargetFunc } from '../../../domain/graph/GraphTypes';
|
|
4
4
|
import type { TranslationFn } from '../../../domain/language/LanguageTypes';
|
|
5
5
|
type RefNodesProps = {
|
|
6
6
|
onDoubleClickRef: OnDoubleClickRef;
|
|
@@ -13,6 +13,7 @@ type RefNodesProps = {
|
|
|
13
13
|
hasRefs: boolean;
|
|
14
14
|
includeOnlyRefsById: IncludeOnlyRefsById;
|
|
15
15
|
includeOnlyRemotesByName: IncludeOnlyRemotesByName;
|
|
16
|
+
isGhostRef: boolean;
|
|
16
17
|
isHovered: boolean;
|
|
17
18
|
isInUnsupportedRebase: boolean;
|
|
18
19
|
numGraphColumns: number;
|
|
@@ -23,9 +24,17 @@ type RefNodesProps = {
|
|
|
23
24
|
refMetadata: RefMetadataById | null;
|
|
24
25
|
refNodeHovered: OnRefNodeHovered;
|
|
25
26
|
onToggleRefNodesShown: OnToggleRefNodesShown;
|
|
27
|
+
onRefBeginDrag: OnRefBeginDrag;
|
|
28
|
+
onRefCanDrag: OnRefCanDrag;
|
|
29
|
+
onRefCanDrop: OnRefCanDrop;
|
|
30
|
+
onRefDragEnter: OnRefDragEnter;
|
|
31
|
+
onRefDragLeave: OnRefDragLeave;
|
|
32
|
+
onRefDrop: OnRefDrop;
|
|
33
|
+
onRefEndDrag: OnRefEndDrag;
|
|
26
34
|
sha: Sha;
|
|
27
35
|
showContextMenuForGroupedRef: OnRefZoneContextMenu;
|
|
28
36
|
translate: TranslationFn;
|
|
37
|
+
type: CommitType;
|
|
29
38
|
};
|
|
30
|
-
declare function RefNodes({ enabledRefMetadataTypes, column, context, getTargetRef, hasActive, hasRefs, getExternalIcon, includeOnlyRefsById, includeOnlyRemotesByName, isHovered, isInUnsupportedRebase, numGraphColumns, onMissingRefMetadata, refGroupContexts, refGroupsByName, refMetadata, refNodeHovered, sha, showContextMenuForGroupedRef, onClickRef, onDoubleClickRef, onToggleRefNodesShown, translate, }: RefNodesProps): ReactElement<'span' | 'div'>;
|
|
39
|
+
declare function RefNodes({ enabledRefMetadataTypes, column, context, getTargetRef, hasActive, hasRefs, getExternalIcon, includeOnlyRefsById, includeOnlyRemotesByName, isGhostRef, isHovered, isInUnsupportedRebase, numGraphColumns, onMissingRefMetadata, refGroupContexts, refGroupsByName, refMetadata, refNodeHovered, sha, showContextMenuForGroupedRef, onClickRef, onDoubleClickRef, onToggleRefNodesShown, onRefBeginDrag, onRefCanDrag, onRefCanDrop, onRefDragEnter, onRefDragLeave, onRefDrop, onRefEndDrag, translate, type, }: RefNodesProps): ReactElement<'span' | 'div'>;
|
|
31
40
|
export default RefNodes;
|
|
@@ -2,7 +2,7 @@ import type { ReactElement } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { CommitType, Sha } from '../../../domain/commit/CommitTypes';
|
|
4
4
|
import type { Style } from '../../../domain/generic/GenericTypes';
|
|
5
|
-
import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, GraphRefGroup, IncludeOnlyRefsById, IncludeOnlyRemotesByName, OnClickRef, OnDoubleClickRef, OnRefNodeHovered, OnRefNodeUnhovered, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnToggleRefNodesShown, RefGroupContexts, RefMetadataById, RefMetadataType, RefTargetFunc } from '../../../domain/graph/GraphTypes';
|
|
5
|
+
import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, GraphRefGroup, IncludeOnlyRefsById, IncludeOnlyRemotesByName, OnClickRef, OnDoubleClickRef, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnToggleRefNodesShown, RefGroupContexts, RefMetadataById, RefMetadataType, RefTargetFunc } from '../../../domain/graph/GraphTypes';
|
|
6
6
|
import type { TranslationFn } from '../../../domain/language/LanguageTypes';
|
|
7
7
|
type RefZoneDefaultProps = {
|
|
8
8
|
style: Style;
|
|
@@ -27,6 +27,13 @@ type RefZoneProps = {
|
|
|
27
27
|
onDoubleClickRef: OnDoubleClickRef;
|
|
28
28
|
onMissingRefMetadata: GetMissingRefMetadata;
|
|
29
29
|
onToggleRefNodesShown: OnToggleRefNodesShown;
|
|
30
|
+
onRefBeginDrag: OnRefBeginDrag;
|
|
31
|
+
onRefCanDrag: OnRefCanDrag;
|
|
32
|
+
onRefCanDrop: OnRefCanDrop;
|
|
33
|
+
onRefDragEnter: OnRefDragEnter;
|
|
34
|
+
onRefDragLeave: OnRefDragLeave;
|
|
35
|
+
onRefDrop: OnRefDrop;
|
|
36
|
+
onRefEndDrag: OnRefEndDrag;
|
|
30
37
|
refGroupContexts: RefGroupContexts | null;
|
|
31
38
|
refGroupsByName: GraphRefGroup[];
|
|
32
39
|
refMetadata: RefMetadataById | null;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { GridCellRenderer } from 'react-virtualized';
|
|
2
|
-
import type { CommonGraphRowDispatchProps, CommonGraphRowProps, OnCommitMessageChange } from '../../../domain/graph/GraphTypes';
|
|
2
|
+
import type { CommonGraphRowDispatchProps, CommonGraphRowProps, OnCommitMessageChange, OnWipMessageBlur, OnWipMessageFocus } from '../../../domain/graph/GraphTypes';
|
|
3
3
|
import type { GetRealKeyForCellFunc } from '../../../domain/reactvirtualized/ReactVirtualizedHelpers';
|
|
4
|
-
import type { OnBlur, OnComponentWillUnmount, OnFocus } from '../../../domain/ui/UiTypes';
|
|
5
4
|
import type { WorkDirStats } from '../../../domain/workdir/WorkDirTypes';
|
|
6
5
|
interface StateProps {
|
|
7
6
|
isCommitting: boolean;
|
|
8
7
|
pendingCommitMessageSummary: string;
|
|
9
8
|
workDirStats?: WorkDirStats;
|
|
9
|
+
wipMessageEditable: boolean;
|
|
10
10
|
}
|
|
11
11
|
interface DispatchProps {
|
|
12
|
-
onBlurWipNodeInput:
|
|
13
|
-
|
|
14
|
-
onFocusWipNodeInput: OnFocus;
|
|
12
|
+
onBlurWipNodeInput: OnWipMessageBlur;
|
|
13
|
+
onFocusWipNodeInput: OnWipMessageFocus;
|
|
15
14
|
onMessageChange: OnCommitMessageChange;
|
|
16
15
|
}
|
|
17
16
|
interface Props extends CommonGraphRowProps, CommonGraphRowDispatchProps, StateProps, DispatchProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GridCellRenderer } from 'react-virtualized';
|
|
2
2
|
import type { Sha } from '../../../domain/commit/CommitTypes';
|
|
3
|
-
import type { CommonGraphRowDispatchProps, CommonGraphRowProps, GetMissingRefMetadata, IncludeOnlyRefsById, IncludeOnlyRemotesByName, OnClickRef, OnDoubleClickRef, OnRefNodeHovered, OnRefNodeUnhovered, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnToggleRefNodesShown, RefMetadataById } from '../../../domain/graph/GraphTypes';
|
|
3
|
+
import type { CommonGraphRowDispatchProps, CommonGraphRowProps, GetMissingRefMetadata, IncludeOnlyRefsById, IncludeOnlyRemotesByName, OnClickRef, OnDoubleClickRef, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnToggleRefNodesShown, RefMetadataById } from '../../../domain/graph/GraphTypes';
|
|
4
4
|
import type { GetRealKeyForCellFunc } from '../../../domain/reactvirtualized/ReactVirtualizedHelpers';
|
|
5
5
|
interface OwnProps {
|
|
6
6
|
height: number;
|
|
@@ -18,6 +18,13 @@ interface DispatchProps {
|
|
|
18
18
|
onDoubleClickRef: OnDoubleClickRef;
|
|
19
19
|
onMissingRefMetadata: GetMissingRefMetadata;
|
|
20
20
|
onShowContextMenuForGroupedRef: OnRefZoneContextMenu;
|
|
21
|
+
onRefBeginDrag: OnRefBeginDrag;
|
|
22
|
+
onRefCanDrag: OnRefCanDrag;
|
|
23
|
+
onRefCanDrop: OnRefCanDrop;
|
|
24
|
+
onRefDragEnter: OnRefDragEnter;
|
|
25
|
+
onRefDragLeave: OnRefDragLeave;
|
|
26
|
+
onRefDrop: OnRefDrop;
|
|
27
|
+
onRefEndDrag: OnRefEndDrag;
|
|
21
28
|
onRefNodeHovered: OnRefNodeHovered;
|
|
22
29
|
onRefNodeUnhovered: OnRefNodeUnhovered;
|
|
23
30
|
onRefZoneHovered: OnRefZoneHovered;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface IEvent {
|
|
2
|
+
name: string;
|
|
3
|
+
content: any;
|
|
4
|
+
}
|
|
5
|
+
export interface ISubscription {
|
|
6
|
+
unsubscribe(): void;
|
|
7
|
+
}
|
|
8
|
+
export type EventSubscriptionCallback = (event: IEvent) => void;
|
|
9
|
+
export interface IEventService {
|
|
10
|
+
broadcast(event: IEvent): void;
|
|
11
|
+
subscribe(eventName: string, callback: EventSubscriptionCallback): ISubscription;
|
|
12
|
+
unsubscribe(subscription: ISubscription): void;
|
|
13
|
+
}
|
|
14
|
+
export declare const eventService: IEventService;
|
|
@@ -6,7 +6,7 @@ import type { CssVariables } from '../generic/GenericTypes';
|
|
|
6
6
|
import type { HostingServiceType } from '../hostingservice/HostingServiceTypes';
|
|
7
7
|
import type { TranslationFn } from '../language/LanguageTypes';
|
|
8
8
|
import type { GraphRefType } from '../ref/RefTypes';
|
|
9
|
-
import type { OnResizeFromPropChangeParams, OnResizeParams } from '../ui/UiTypes';
|
|
9
|
+
import type { OnFocus, OnResizeFromPropChangeParams, OnResizeParams } from '../ui/UiTypes';
|
|
10
10
|
import type { GraphMarkerType, GraphZone, GraphZoneType, TimelineEntry, TimelineMsgRowRenderIdType } from './GraphConstants';
|
|
11
11
|
export type RowRenderType = GraphZoneType | TimelineMsgRowRenderIdType;
|
|
12
12
|
export type RowRenderersByIds = {
|
|
@@ -368,6 +368,20 @@ export type OnDoubleClickRef = (event: React.MouseEvent<any>, refGroup: GraphRef
|
|
|
368
368
|
export type OnDoubleClickRefMetadata = (event: React.MouseEvent<any>, metadataItem: RefMetadataItem) => void;
|
|
369
369
|
export type OnRefZoneContextMenu = (event: React.MouseEvent<any>, refGroup: GraphRefGroup, sha: Sha) => void;
|
|
370
370
|
export type OnScrollForZone = (zoneType: GraphZoneType, scroll: ScrollParams, graphWidth: number, graphHeight: number, hasMoreCommits: boolean) => void;
|
|
371
|
+
export type RefDndData = {
|
|
372
|
+
commitType: CommitType;
|
|
373
|
+
isGhostRef: boolean;
|
|
374
|
+
isInUnsupportedRebase: boolean;
|
|
375
|
+
refGroup: GraphRefGroup;
|
|
376
|
+
sha: Sha;
|
|
377
|
+
};
|
|
378
|
+
export type OnRefBeginDrag = (event: React.DragEvent, sourceRefData?: RefDndData) => void;
|
|
379
|
+
export type OnRefCanDrag = (sourceRefData?: RefDndData) => boolean;
|
|
380
|
+
export type OnRefCanDrop = (event?: React.DragEvent, sourceRefData?: RefDndData, targetRefData?: RefDndData) => boolean;
|
|
381
|
+
export type OnRefDragEnter = (event: React.DragEvent, sourceRefData?: RefDndData, targetRefData?: RefDndData) => void;
|
|
382
|
+
export type OnRefDragLeave = (event: React.DragEvent, sourceRefData?: RefDndData, targetRefData?: RefDndData) => void;
|
|
383
|
+
export type OnRefEndDrag = (event: React.DragEvent, sourceRefData?: RefDndData, targetRefData?: RefDndData) => void;
|
|
384
|
+
export type OnRefDrop = (event: React.DragEvent, sourceRefData?: RefDndData, targetRefData?: RefDndData) => void;
|
|
371
385
|
export type OnCommitMessageChange = (message: string) => void;
|
|
372
386
|
export type OnGraphResized = (width: number, height: number) => void;
|
|
373
387
|
export type OnGraphVisibleRowsChanged = (topVisibleRow: GraphRow, bottomVisibleRow: GraphRow) => void;
|
|
@@ -394,3 +408,5 @@ export type OnGraphZoneResizeStart = (graphZone: GraphZone, dimensions: OnResize
|
|
|
394
408
|
export type OnGraphZoneResizeFromPropChange = (graphZone: GraphZone, dimensions: OnResizeFromPropChangeParams) => void;
|
|
395
409
|
export type OnPopupGraphHeaderContextMenu = (event: React.MouseEvent<any>, width: number) => void;
|
|
396
410
|
export type OnSettingsClick = (event: React.MouseEvent<any>, width: number) => void;
|
|
411
|
+
export type OnWipMessageBlur = (event?: React.FocusEvent<HTMLInputElement>) => void;
|
|
412
|
+
export type OnWipMessageFocus = OnFocus;
|
|
@@ -21,7 +21,6 @@ export type OnFocus = (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
|
21
21
|
export type OnKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
22
22
|
export type OnKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
23
23
|
export type OnKeyUp = (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
24
|
-
export type OnComponentWillUnmount = () => void;
|
|
25
24
|
export type OnResize = (dimensions: OnResizeParams) => void;
|
|
26
25
|
export type OnResizeEnd = (dimensions: OnResizeParams) => void;
|
|
27
26
|
export type OnResizeFromPropChange = (dimensions: OnResizeFromPropChangeParams) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import DndComponent from './components/dnd/DndComponent';
|
|
1
2
|
import GraphContainer from './components/graph/GraphContainer';
|
|
2
3
|
export * from './components/graph/GraphContainer';
|
|
4
|
+
export * from './components/dnd/DndComponent';
|
|
3
5
|
export * from './domain/commit/CommitConstants';
|
|
4
6
|
export * from './domain/generic/GenericTypes';
|
|
5
7
|
export * from './domain/commit/CommitTypes';
|
|
6
8
|
export * from './domain/graph/GraphConstants';
|
|
7
9
|
export * from './domain/graph/GraphTypes';
|
|
8
10
|
export * from './domain/hostingservice/HostingServiceTypes';
|
|
11
|
+
export * from './domain/ref/RefConstants';
|
|
9
12
|
export * from './domain/ref/RefTypes';
|
|
10
13
|
export * from './domain/workdir/WorkDirTypes';
|
|
14
|
+
export { DndComponent };
|
|
11
15
|
export default GraphContainer;
|