@gitkraken/gitkraken-components 13.0.0-vnext.1 → 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 CHANGED
@@ -1,15 +1,18 @@
1
1
  # CHANGELOG
2
2
 
3
3
  ## 11.0.2
4
- - Fixed an issue with ref labels sometimes not rendering properly when hovered/unhovered. ([#367](https://github.com/gitkraken/GitKrakenComponents/pull/367))
5
- - Added some data-test-classes for automated UI tests to find DOM nodes. ([#369](https://github.com/gitkraken/GitKrakenComponents/pull/369))
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
- - 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
+
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
- - **BREAKING CHANGE:** Upgraded from `react`/`react-dom` 16 to 17. ([#365](https://github.com/gitkraken/GitKrakenComponents/pull/365))
12
- - **BREAKING CHANGE:** Upgraded `react-bootstrap` from 0.32.4 to 2.10.7 ([#365](https://github.com/gitkraken/GitKrakenComponents/pull/365))
13
- - 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.
14
- - 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.
15
- - Added `AzureDevopsIssueTrackerType` (in addition to the existing `AzureDevopsIssueTrackerType`) ([262cbf8e](https://github.com/gitkraken/GitKrakenComponents/commit/262cbf8e81c8497676e93fde0d32fdf537fec706))
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
- lastFocusedSha?: Sha;
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<'div'>, cssVariables: CssVariables, nonce?: string) => React.JSX.Element;
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,3 @@
1
- /// <reference types="node" />
2
1
  import type { HandleStyles, ResizeCallback, ResizeStartCallback } from 're-resizable';
3
2
  import type { ReactElement, ReactNode } from 'react';
4
3
  import React from 'react';
@@ -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): string;
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 | Object;
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 GetExternalIcon = (key: string) => ReactElement<any>;
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 IssueTrackerType = GitHubIssueTrackerType | GithubEnterpriseIssueTrackerType | GitLabIssueTrackerType | GitLabSelfHostedIssueTrackerType | JiraCloudIssueTrackerType | JiraServerIssueTrackerType | TrelloIssueTrackerType | AzureDevopsIssueTrackerType;
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,5 +1,8 @@
1
1
  export declare const refTypes: {
2
- [key: string]: string;
2
+ readonly HEAD: "head";
3
+ readonly REMOTE: "remote";
4
+ readonly TAG: "tag";
5
+ readonly WORKTREE: "worktree";
3
6
  };
4
7
  export declare enum refIconsPositions {
5
8
  LEFT = "LEFT",
@@ -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 './types';
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;