-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from alirezamirian/2024-02
2024 02
- Loading branch information
Showing
153 changed files
with
4,617 additions
and
1,266 deletions.
There are no files selected for viewing
14 changes: 0 additions & 14 deletions
14
.yarn/patches/@react-stately-layout-npm-3.4.4-75ff8d9e5d.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,9 +40,8 @@ | |
"packageManager": "[email protected]", | ||
"resolutions": { | ||
"styled-components": "5.3.5", | ||
"typescript": "4.7.4", | ||
"[email protected]": "patch:cypress-plugin-snapshots@npm:1.4.4#.yarn/patches/cypress-plugin-snapshots-npm-1.4.4-a6166116fb.patch", | ||
"@react-aria/[email protected]": "patch:@react-aria/overlays@npm:3.7.5#.yarn/patches/@react-aria-overlays-npm-3.7.5-7d05242971.patch", | ||
"@react-stately/[email protected]": "patch:@react-stately/layout@npm:3.4.4#.yarn/patches/@react-stately-layout-npm-3.4.4-75ff8d9e5d.patch", | ||
"@parcel/[email protected]": "patch:@parcel/transformer-js@npm:2.6.0#.yarn/patches/@parcel-transformer-js-npm-2.6.0-6caf2205a6.patch" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("../../babel.config"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ref: refs/heads/master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[core] | ||
repositoryformatversion = 0 | ||
filemode = true | ||
bare = true | ||
logallrefupdates = true | ||
ignorecase = true | ||
precomposeunicode = true |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
0000000000000000000000000000000000000000 39adfc50dabeea269ae5ac793bdf83317f841e17 Alireza <[email protected]> 1710443455 +0100 commit (initial): initial state | ||
39adfc50dabeea269ae5ac793bdf83317f841e17 e99d0fad1a864fa41d6d89bfabb5e0f1c0361987 Alireza <[email protected]> 1710443674 +0100 commit (amend): initial state | ||
e99d0fad1a864fa41d6d89bfabb5e0f1c0361987 4f2658865baff125a1c9fa98efdf12895105ac6e Alireza <[email protected]> 1710443879 +0100 commit: changed | ||
4f2658865baff125a1c9fa98efdf12895105ac6e 4f2658865baff125a1c9fa98efdf12895105ac6e Alireza <[email protected]> 1710446181 +0100 checkout: moving from master to master | ||
4f2658865baff125a1c9fa98efdf12895105ac6e e99d0fad1a864fa41d6d89bfabb5e0f1c0361987 Alireza <[email protected]> 1710446337 +0100 reset: moving to e99d0fad1a864fa41d6d89bfabb5e0f1c0361987 | ||
e99d0fad1a864fa41d6d89bfabb5e0f1c0361987 21d19576802af30b349e49ce09ff3201755a2457 Alireza <[email protected]> 1710446428 +0100 commit (amend): initial state | ||
21d19576802af30b349e49ce09ff3201755a2457 7a4535a30be43ee6a9099ab3f625a3483934de35 Alireza <[email protected]> 1710446846 +0100 commit: changes: 2 new | 2 renamed | 2 deleted |
6 changes: 6 additions & 0 deletions
6
packages/example-app/fixture/git/diff-example.git/logs/refs/heads/master
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
0000000000000000000000000000000000000000 39adfc50dabeea269ae5ac793bdf83317f841e17 Alireza <[email protected]> 1710443455 +0100 commit (initial): initial state | ||
39adfc50dabeea269ae5ac793bdf83317f841e17 e99d0fad1a864fa41d6d89bfabb5e0f1c0361987 Alireza <[email protected]> 1710443674 +0100 commit (amend): initial state | ||
e99d0fad1a864fa41d6d89bfabb5e0f1c0361987 4f2658865baff125a1c9fa98efdf12895105ac6e Alireza <[email protected]> 1710443879 +0100 commit: changed | ||
4f2658865baff125a1c9fa98efdf12895105ac6e e99d0fad1a864fa41d6d89bfabb5e0f1c0361987 Alireza <[email protected]> 1710446337 +0100 reset: moving to e99d0fad1a864fa41d6d89bfabb5e0f1c0361987 | ||
e99d0fad1a864fa41d6d89bfabb5e0f1c0361987 21d19576802af30b349e49ce09ff3201755a2457 Alireza <[email protected]> 1710446428 +0100 commit (amend): initial state | ||
21d19576802af30b349e49ce09ff3201755a2457 7a4535a30be43ee6a9099ab3f625a3483934de35 Alireza <[email protected]> 1710446846 +0100 commit: changes: 2 new | 2 renamed | 2 deleted |
2 changes: 2 additions & 0 deletions
2
packages/example-app/fixture/git/diff-example.git/objects/info/packs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
P pack-12a63299528292ad7bedaf4a7127ee5b8a2b6d3f.pack | ||
|
Binary file added
BIN
+1.95 KB
...xture/git/diff-example.git/objects/pack/pack-12a63299528292ad7bedaf4a7127ee5b8a2b6d3f.idx
Binary file not shown.
Binary file added
BIN
+17.4 KB
...ture/git/diff-example.git/objects/pack/pack-12a63299528292ad7bedaf4a7127ee5b8a2b6d3f.pack
Binary file not shown.
1 change: 1 addition & 0 deletions
1
packages/example-app/fixture/git/diff-example.git/refs/heads/master
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7a4535a30be43ee6a9099ab3f625a3483934de35 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ref: refs/heads/master |
Binary file added
BIN
+4.36 KB
...e/git/example-branches.git/objects/pack/pack-6bc9e1611d6306d1c302bf85b10ac35fcd2b45b0.idx
Binary file not shown.
Binary file added
BIN
+436 KB
.../git/example-branches.git/objects/pack/pack-6bc9e1611d6306d1c302bf85b10ac35fcd2b45b0.pack
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
packages/example-app/fixture/git/example-branches.git/packed-refs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# pack-refs with: peeled fully-peeled sorted | ||
5b1b99986a0096c774f26a4917dbad0ac31d2d26 refs/heads/RC1.0 | ||
8dbd80de7185d12e6b6e58fcab18900a7c88d3af refs/heads/enhancement | ||
9d037db880dc2e11ac4aa1d80c322aed65269089 refs/heads/featureGreen | ||
7be5c69bb17c73d37af6f076a9a9442b22c76a13 refs/heads/featureRed | ||
dd6d5a5085d7bec5850eef36b7e0b7059fc68be1 refs/heads/gh-pages | ||
14d63f8c757e52f7e60e13765031a7fdf0768195 refs/heads/master | ||
5086927860395c3a173df36eabe9f2525c357bc2 refs/heads/topic1 | ||
d5ed0e6a098710ad9dfe08bc7039fc6e61d00fa3 refs/heads/topic2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// eslint-disable-next-line no-undef | ||
module.exports = { | ||
moduleNameMapper: { | ||
"@intellij-platform/core(.*)$": "<rootDir>/../jui/src/$1", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 38 additions & 22 deletions
60
packages/example-app/src/StatusBar/BranchPopupTrigger.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,60 @@ | ||
import { | ||
ActionTooltip, | ||
PlatformIcon, | ||
PopupTrigger, | ||
StatusBarWidget, | ||
TooltipTrigger, | ||
} from "@intellij-platform/core"; | ||
import React from "react"; | ||
|
||
import { activeFileRepoHeadState } from "../VersionControl/active-file.state"; | ||
import { useLatestRecoilValue } from "../recoil-utils"; | ||
import { BranchesPopup } from "../VersionControl/Branches/BranchesPopup"; | ||
import { useShowGitTipIfNeeded } from "../VersionControl/useShowGitTipIfNeeded"; | ||
|
||
export function BranchPopupTrigger() { | ||
const gitRepoHead = useLatestRecoilValue(activeFileRepoHeadState); | ||
const [gitRepoHead] = useLatestRecoilValue(activeFileRepoHeadState); | ||
const maybeShowGitCloneTip = useShowGitTipIfNeeded(); | ||
|
||
return ( | ||
gitRepoHead && ( | ||
<TooltipTrigger | ||
tooltip={ | ||
<ActionTooltip | ||
actionName={ | ||
gitRepoHead.detached | ||
? "Git: Detached HEAD doesn't point to any branch" | ||
: `Git Branch: ${gitRepoHead.head}` | ||
} | ||
/> | ||
} | ||
<PopupTrigger | ||
placement="top" | ||
onOpenChange={(isOpen) => { | ||
if (!isOpen) { | ||
setTimeout(maybeShowGitCloneTip, 500); | ||
} | ||
}} | ||
popup={({ close }) => <BranchesPopup onClose={close} />} | ||
> | ||
<StatusBarWidget | ||
icon={ | ||
<PlatformIcon | ||
icon={ | ||
gitRepoHead.detached ? "general/warning.svg" : "vcs/branch.svg" | ||
<TooltipTrigger | ||
tooltip={ | ||
<ActionTooltip | ||
actionName={ | ||
gitRepoHead.detached | ||
? "Git: Detached HEAD doesn't point to any branch" | ||
: `Git Branch: ${gitRepoHead.head}` | ||
} | ||
/> | ||
} | ||
label={gitRepoHead.head.slice( | ||
0, | ||
gitRepoHead.detached ? 8 : undefined | ||
)} | ||
/> | ||
</TooltipTrigger> | ||
> | ||
<StatusBarWidget | ||
icon={ | ||
<PlatformIcon | ||
icon={ | ||
gitRepoHead.detached | ||
? "general/warning.svg" | ||
: "vcs/branch.svg" | ||
} | ||
/> | ||
} | ||
label={gitRepoHead.head.slice( | ||
0, | ||
gitRepoHead.detached ? 8 : undefined | ||
)} | ||
/> | ||
</TooltipTrigger> | ||
</PopupTrigger> | ||
) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { FileStatus } from "../file-status"; | ||
|
||
export type Revision = { | ||
path: string; | ||
isDir: boolean; | ||
content(): Promise<string>; | ||
}; | ||
|
||
export interface Change { | ||
before?: Revision; | ||
after?: Revision; | ||
} | ||
export type ModificationChange = Required<Change>; | ||
export type DeletionChange = { | ||
before: Revision; | ||
after: undefined; | ||
}; | ||
export type AdditionChange = { | ||
before: undefined; | ||
after: Revision; | ||
}; | ||
|
||
/** | ||
* Experimenting a pattern of exporting both a type and a value under the same name, to collocate behavior and interface | ||
* while still using plain objects, to avoid caveats of using class. | ||
*/ | ||
export class Change { | ||
static path(change: Change): string { | ||
return (change.after ?? change.before)?.path ?? ""; | ||
} | ||
static type( | ||
change: Change | ||
): // Making sure the return value is a subset of FileStatus | ||
Extract<FileStatus, "MODIFIED" | "ADDED" | "DELETED"> { | ||
if (change.after) { | ||
if (change.before) { | ||
return "MODIFIED"; | ||
} | ||
return "ADDED"; | ||
} | ||
return "DELETED"; | ||
} | ||
static isAddition(change: Change): change is AdditionChange { | ||
return Change.type(change) === "ADDED"; | ||
} | ||
static isModification(change: Change): change is ModificationChange { | ||
return Change.type(change) === "MODIFIED"; | ||
} | ||
static isDeletion(change: Change): change is DeletionChange { | ||
return Change.type(change) === "DELETED"; | ||
} | ||
static isRename(change: Change): change is ModificationChange { | ||
return ( | ||
Change.isModification(change) && | ||
change.before?.path !== change.after?.path | ||
); | ||
} | ||
} |
Oops, something went wrong.