@gitkraken/gitkraken-components 13.0.0-vnext.0 → 13.0.0-vnext.10
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/CHANGELOG.md +11 -8
- package/README.md +2 -0
- package/dist/components/graph/GraphContainer.d.ts +27 -4
- package/dist/components/graph/refzone/RefPopover.d.ts +3 -2
- package/dist/components/resizable/Resizable.d.ts +0 -1
- package/dist/domain/graph/GraphConstants.d.ts +1 -1
- package/dist/domain/graph/GraphHelpers.d.ts +2 -2
- package/dist/domain/graph/GraphTypes.d.ts +3 -2
- package/dist/domain/hostingservice/HostingServiceTypes.d.ts +3 -1
- package/dist/domain/ref/RefConstants.d.ts +4 -1
- package/dist/domain/ref/RefTypes.d.ts +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +22 -2
- package/package.json +45 -42
- package/dist/types.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
3
|
## 11.0.2
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
|
|
5
|
+
- Fixed an issue with ref labels sometimes not rendering properly when hovered/unhovered. ([#367](https://github.com/gitkraken/GitKrakenComponents/pull/367))
|
|
6
|
+
- Added some data-test-classes for automated UI tests to find DOM nodes. ([#369](https://github.com/gitkraken/GitKrakenComponents/pull/369))
|
|
6
7
|
|
|
7
8
|
## 11.0.1
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
- Fixed tooltip css so that tooltips on the commit notes and ref label icons are no longer 0 opacity. (CSS classes were modified by previous `react-bootstrap` bump.) ([#366](https://github.com/gitkraken/GitKrakenComponents/pull/366))
|
|
9
11
|
|
|
10
12
|
## 11.0.0
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
13
|
+
|
|
14
|
+
- **BREAKING CHANGE:** Upgraded from `react`/`react-dom` 16 to 17. ([#365](https://github.com/gitkraken/GitKrakenComponents/pull/365))
|
|
15
|
+
- **BREAKING CHANGE:** Upgraded `react-bootstrap` from 0.32.4 to 2.10.7 ([#365](https://github.com/gitkraken/GitKrakenComponents/pull/365))
|
|
16
|
+
- The full consequences of this on your project's CSS cannot be fully predicted, so you should test thoroughly. Known concerns which affected at least one project are listed below.
|
|
17
|
+
- The DIV wrapping the ref-creation text input no longer receives the `has-error` class, and the input no longer receives the `is-valid` class. Instead, the input receives the `is-invalid` class.
|
|
18
|
+
- Added `AzureDevopsIssueTrackerType` (in addition to the existing `AzureDevopsIssueTrackerType`) ([262cbf8e](https://github.com/gitkraken/GitKrakenComponents/commit/262cbf8e81c8497676e93fde0d32fdf537fec706))
|
package/README.md
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
This is a shared module between the GitKraken app and GitLens to share React components.
|
|
4
4
|
|
|
5
5
|
## Requires resolution to React 17
|
|
6
|
+
|
|
6
7
|
> [!WARNING]
|
|
7
8
|
> In order for this package to work properly, you must resolve React to version 17 in your own project.
|
|
8
9
|
> The reason for this is because this library's react-bootstrap dependency lists React 16 as a dependency, and npm/yarn 1 do not provide a way for dependencies to lock sub-dependencies. Therefore it is up to your project to force this library's react-bootstrap to use react 17.
|
|
9
10
|
> The following is an example of what to put into your package.json:
|
|
11
|
+
|
|
10
12
|
```
|
|
11
13
|
"resolutions": {
|
|
12
14
|
"react": "17.0.2",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { Alignment, ScrollParams } from 'react-virtualized';
|
|
3
2
|
import type { ReactElement } from 'react';
|
|
4
3
|
import React from 'react';
|
|
@@ -173,7 +172,8 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
|
|
|
173
172
|
isRefContextMenuShown: boolean;
|
|
174
173
|
isMounted: boolean;
|
|
175
174
|
selectedShas: Set<Sha>;
|
|
176
|
-
|
|
175
|
+
selectionAnchorSha?: Sha;
|
|
176
|
+
selectionFocusSha?: Sha;
|
|
177
177
|
processedGraphRowBySha: ProcessedGraphRowBySha;
|
|
178
178
|
shaByRefId: ShaByRefId;
|
|
179
179
|
childrenBySha: ChildrenBySha;
|
|
@@ -247,7 +247,21 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
|
|
|
247
247
|
onRefDrop: OnRefDrop;
|
|
248
248
|
onRefEndDrag: OnRefEndDrag;
|
|
249
249
|
onZoneRowClick(event: React.MouseEvent<any>, graphZoneType: GraphZoneType, sha: Sha): void;
|
|
250
|
-
getShiftSelectRange(currentSha: Sha): Sha[];
|
|
250
|
+
getShiftSelectRange(currentSha: Sha, shiftSelectMode: ShiftSelectMode): Sha[] | undefined;
|
|
251
|
+
private getTopologicalPathBetween;
|
|
252
|
+
private getDirectTopologicalPathBetween;
|
|
253
|
+
/**
|
|
254
|
+
* Finds the nearest commit that is topologically reachable from the anchor commit.
|
|
255
|
+
* Searches in the appropriate direction based on whether the anchor is ahead or behind the target.
|
|
256
|
+
* This is used as a fallback when the clicked commit is not directly topologically reachable.
|
|
257
|
+
*/
|
|
258
|
+
private findNearestTopologicallyReachableCommit;
|
|
259
|
+
/**
|
|
260
|
+
* Validates that a path has only 2 endpoints - the start and end commits.
|
|
261
|
+
* An endpoint is a commit that has no children or parents within the selected path
|
|
262
|
+
* (excluding the explicit start and end points).
|
|
263
|
+
*/
|
|
264
|
+
private hasOnlyTwoEndpoints;
|
|
251
265
|
onClickRef: OnClickRef;
|
|
252
266
|
onClickCommit: OnClickCommit;
|
|
253
267
|
onDoubleClickCommit: OnDoubleClickCommit;
|
|
@@ -269,6 +283,15 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
|
|
|
269
283
|
onScrollToRowCausedUpdateForFirstColumn: OnScrollForZone;
|
|
270
284
|
onCommitContextMenu: OnCommitContextMenu;
|
|
271
285
|
onRefContextMenu: OnRefZoneContextMenu;
|
|
286
|
+
/**
|
|
287
|
+
* Check if an object has any keys (more efficient than Object.keys().length > 0)
|
|
288
|
+
*/
|
|
289
|
+
private hasAnyKey;
|
|
290
|
+
/**
|
|
291
|
+
* Deep equality check for isSelectedBySha objects to avoid unnecessary scroll-to-selection
|
|
292
|
+
* when object reference changes but content is the same (e.g., after postMessage serialization)
|
|
293
|
+
*/
|
|
294
|
+
private isSelectedByShaEqual;
|
|
272
295
|
selectCommits(shas: Sha[], includeToPrevSel: boolean, isAutoOrKeyScroll: boolean): void;
|
|
273
296
|
getCommitZoneContentWidthBetweenGutters(): number;
|
|
274
297
|
getSelectedShas(): Sha[];
|
|
@@ -367,7 +390,7 @@ declare class GraphContainer extends React.Component<Props, ComponentState> impl
|
|
|
367
390
|
isMacOSPlatform(): boolean;
|
|
368
391
|
isCommitListFiltered(): boolean;
|
|
369
392
|
getGraphColumnSettingFromZoneType(graphZone: GraphZone): GraphColumnSetting;
|
|
370
|
-
decorateWithHelmet: (container: ReactElement<
|
|
393
|
+
decorateWithHelmet: (container: ReactElement<"div">, cssVariables: CssVariables, nonce?: string) => React.JSX.Element;
|
|
371
394
|
render(): React.JSX.Element;
|
|
372
395
|
}
|
|
373
396
|
export default GraphContainer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
1
|
+
import type { ReactElement, ReactNode, RefObject } from 'react';
|
|
2
2
|
import type { OnMouseEnter, OnMouseLeave } from '../../../domain/ui/UiTypes';
|
|
3
3
|
type RefPopoverStyle = {
|
|
4
4
|
top: number;
|
|
@@ -10,6 +10,7 @@ type Props = {
|
|
|
10
10
|
onMouseEnter?: OnMouseEnter;
|
|
11
11
|
onMouseLeave?: OnMouseLeave;
|
|
12
12
|
style?: RefPopoverStyle;
|
|
13
|
+
ref?: RefObject<HTMLDivElement>;
|
|
13
14
|
};
|
|
14
|
-
declare function RefPopover({ style, children, column, numGraphColumns, onMouseEnter, onMouseLeave, ...props }: Props): ReactElement<'div'>;
|
|
15
|
+
declare function RefPopover({ style, children, column, numGraphColumns, onMouseEnter, onMouseLeave, ref, ...props }: Props): ReactElement<'div'>;
|
|
15
16
|
export default RefPopover;
|
|
@@ -154,5 +154,5 @@ export declare enum graphCommitDescDisplayModes {
|
|
|
154
154
|
NEVER = "NEVER"
|
|
155
155
|
}
|
|
156
156
|
export type GraphCommitDescDisplayMode = graphCommitDescDisplayModes.ALWAYS | graphCommitDescDisplayModes.ON_HOVER | graphCommitDescDisplayModes.NEVER;
|
|
157
|
-
export type ShiftSelectMode = 'simple';
|
|
157
|
+
export type ShiftSelectMode = 'simple' | 'topological';
|
|
158
158
|
export type GraphSearchMode = 'normal' | 'filter';
|
|
@@ -6,7 +6,7 @@ import type { GraphRefType } from '../ref/RefTypes';
|
|
|
6
6
|
import type { WorkDirStats } from '../workdir/WorkDirTypes';
|
|
7
7
|
import type { GraphMarkerType, GraphZone, GraphZoneType, TimelineEntriesByPeriod } 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
12
|
export declare const debounceFrame: (func: DebouncableFn) => DebouncedFn;
|
|
@@ -53,7 +53,7 @@ export declare function workDirStatsHaveChanges(workDirStats?: WorkDirStats): bo
|
|
|
53
53
|
export declare function hasSingleSelectedSha(selectedShas: Set<Sha>): boolean;
|
|
54
54
|
export declare function isSingleSelected(selectedShas: Set<Sha>, sha: Sha): boolean;
|
|
55
55
|
export declare function getScrollToAlignment(rowHeight: number, clientHeight: number, scrollTop: number, scrollToIndex: number): Alignment;
|
|
56
|
-
export declare function getGraphZoneIconByType(zoneType: GraphZoneType):
|
|
56
|
+
export declare function getGraphZoneIconByType(zoneType: GraphZoneType): ExternalIconKeys | undefined;
|
|
57
57
|
export declare function isHeadActive(head: Head): boolean;
|
|
58
58
|
export declare function isGraphRefActive(ref: GraphRef): boolean;
|
|
59
59
|
export interface GraphRowHelperProps {
|
|
@@ -147,7 +147,7 @@ export type ReserverInfoBySha = {
|
|
|
147
147
|
};
|
|
148
148
|
export type RefTargetFunc = () => Element | null | undefined;
|
|
149
149
|
export type ColumnContentGenerator = () => ReactElement<any>;
|
|
150
|
-
export type GraphItemContext = string |
|
|
150
|
+
export type GraphItemContext = string | object;
|
|
151
151
|
export type RefGroupContexts = {
|
|
152
152
|
[name: string]: GraphItemContext;
|
|
153
153
|
};
|
|
@@ -396,7 +396,8 @@ export type DownstreamsByUpstream = {
|
|
|
396
396
|
[upstreamName: string]: string[];
|
|
397
397
|
};
|
|
398
398
|
export type GraphPlatform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin';
|
|
399
|
-
export type
|
|
399
|
+
export type ExternalIconKeys = 'added' | 'author' | 'branch' | 'changes' | 'check' | 'commit' | 'datetime' | 'deleted' | 'files' | 'filter' | 'graph' | 'head' | 'hide' | `issue-${IssueTrackerType}` | 'loading' | 'message' | 'modified' | 'pull-request' | 'remote' | `remote-${HostingServiceType}` | 'renamed' | 'resolved' | 'settings' | 'show' | 'stash' | 'tag' | 'upstream-ahead' | 'upstream-behind' | 'warning' | 'worktree';
|
|
400
|
+
export type GetExternalIcon = (key: ExternalIconKeys) => ReactElement<any>;
|
|
400
401
|
export type GetMissingAvatar = (email: string, sha: string) => void;
|
|
401
402
|
export type GetMissingRefMetadata = (id: string, types: RefMetadataType[]) => void;
|
|
402
403
|
export type FormatRefShorthand = (shorthand: RefShorthand, sha: Sha, refType: GraphRefType, data?: any | null) => RefShorthand;
|
|
@@ -14,5 +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
|
|
17
|
+
export type LinearIssueTrackerType = 'linear';
|
|
18
|
+
export type BitbucketIssueTrackerType = 'bitbucket';
|
|
19
|
+
export type IssueTrackerType = GitHubIssueTrackerType | GithubEnterpriseIssueTrackerType | GitLabIssueTrackerType | GitLabSelfHostedIssueTrackerType | JiraCloudIssueTrackerType | JiraServerIssueTrackerType | TrelloIssueTrackerType | LinearIssueTrackerType | AzureDevopsIssueTrackerType | BitbucketIssueTrackerType;
|
|
18
20
|
export declare function getHostingServiceName(hostingServiceType: HostingServiceType): string;
|
|
@@ -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 = {
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,20 @@ 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/hostingservice/HostingServiceTypes';
|
|
12
|
+
export * from './domain/ref/RefConstants';
|
|
13
|
+
export * from './domain/ref/RefTypes';
|
|
14
|
+
export * from './domain/workdir/WorkDirTypes';
|
|
15
|
+
export * from './domain/ui/UiTypes';
|
|
16
|
+
export * from './domain/language/LanguageTypes';
|
|
17
|
+
export * from './domain/language/LanguageConstants';
|
|
18
|
+
export * from './domain/cssvariable/CssVariableConstants';
|
|
19
|
+
export * from './domain/diff/DiffTypes';
|
|
20
|
+
export * from './domain/diff/DiffConstants';
|
|
7
21
|
export { DndComponent, ScrollbarContainer };
|
|
8
22
|
export default GraphContainer;
|