@industry-theme/file-city-panel 0.2.54 → 0.2.56
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/panels/CodeCityPanel.d.ts +0 -9
- package/dist/panels/CodeCityPanel.d.ts.map +1 -1
- package/dist/panels/components/GitChangesTree.d.ts +4 -10
- package/dist/panels/components/GitChangesTree.d.ts.map +1 -1
- package/dist/panels/components/GitChangesTree.stories.d.ts.map +1 -1
- package/dist/panels/components/Legend.d.ts +3 -3
- package/dist/panels/components/Legend.d.ts.map +1 -1
- package/dist/panels.bundle.js +38 -31
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PanelComponentProps } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Git status data - categorized file paths
|
|
5
|
-
*/
|
|
6
|
-
export interface GitStatus {
|
|
7
|
-
staged: string[];
|
|
8
|
-
unstaged: string[];
|
|
9
|
-
untracked: string[];
|
|
10
|
-
deleted: string[];
|
|
11
|
-
}
|
|
12
3
|
/**
|
|
13
4
|
* PR files data - files changed in a selected pull request
|
|
14
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeCityPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CodeCityPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAuBjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeCityPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CodeCityPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAuBjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAgBpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;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from 'react';
|
|
2
|
-
import { type FileTree } from '@principal-ai/repository-abstraction';
|
|
3
|
-
/**
|
|
4
|
-
export
|
|
5
|
-
staged: string[];
|
|
6
|
-
unstaged: string[];
|
|
7
|
-
untracked: string[];
|
|
8
|
-
deleted: string[];
|
|
9
|
-
}
|
|
2
|
+
import { type FileTree, type GitStatusWithFiles } from '@principal-ai/repository-abstraction';
|
|
3
|
+
/** Re-export GitStatusWithFiles for consumers */
|
|
4
|
+
export type { GitStatusWithFiles };
|
|
10
5
|
/** Git status category for selection callbacks */
|
|
11
6
|
export type GitChangeSelectionStatus = 'staged' | 'unstaged' | 'untracked' | 'deleted';
|
|
12
7
|
interface GitChangesTreeProps {
|
|
13
8
|
/** Git status data with categorized file paths */
|
|
14
|
-
gitStatus:
|
|
9
|
+
gitStatus: GitStatusWithFiles;
|
|
15
10
|
/** Optional file tree for "Full Tree" view mode */
|
|
16
11
|
fileTree?: FileTree | null;
|
|
17
12
|
/** Root path for the repository (used for building file trees) */
|
|
@@ -28,5 +23,4 @@ interface GitChangesTreeProps {
|
|
|
28
23
|
* Uses GitStatusFileTree from @principal-ade/dynamic-file-tree for rendering.
|
|
29
24
|
*/
|
|
30
25
|
export declare const GitChangesTree: React.FC<GitChangesTreeProps>;
|
|
31
|
-
export {};
|
|
32
26
|
//# sourceMappingURL=GitChangesTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitChangesTree.d.ts","sourceRoot":"","sources":["../../../src/panels/components/GitChangesTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAwB,KAAK,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"GitChangesTree.d.ts","sourceRoot":"","sources":["../../../src/panels/components/GitChangesTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAwB,KAAK,QAAQ,EAAE,KAAK,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAEpH,iDAAiD;AACjD,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEnC,kDAAkD;AAClD,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;AAEvF,UAAU,mBAAmB;IAC3B,kDAAkD;IAClD,SAAS,EAAE,kBAAkB,CAAC;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sCAAsC;IACtC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAC5E,sCAAsC;IACtC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CACpE;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA6KxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitChangesTree.stories.d.ts","sourceRoot":"","sources":["../../../src/panels/components/GitChangesTree.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"GitChangesTree.stories.d.ts","sourceRoot":"","sources":["../../../src/panels/components/GitChangesTree.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAA2B,MAAM,kBAAkB,CAAC;AAE3E,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CA0BrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAC;AAgC7C;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAyBxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAyB1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAwB3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAwBzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,KAoB5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,KAoBnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAuCzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KA+B7B,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FileTree } from '@principal-ai/repository-abstraction';
|
|
3
3
|
import type { ColorMode } from '../utils/qualityLayers';
|
|
4
|
-
import { type
|
|
4
|
+
import { type GitStatusWithFiles, type GitChangeSelectionStatus } from './GitChangesTree';
|
|
5
5
|
import { type PrFilesStatus, type PrChangeSelectionStatus } from './PrChangesTree';
|
|
6
6
|
import { type CommitFilesStatus, type CommitChangeSelectionStatus } from './CommitChangesTree';
|
|
7
|
-
export type {
|
|
7
|
+
export type { GitStatusWithFiles, GitChangeSelectionStatus } from './GitChangesTree';
|
|
8
8
|
export type { PrFilesStatus, PrChangeSelectionStatus } from './PrChangesTree';
|
|
9
9
|
export type { CommitFilesStatus, CommitChangeSelectionStatus } from './CommitChangesTree';
|
|
10
10
|
export interface LegendFileType {
|
|
@@ -45,7 +45,7 @@ export interface LegendQualityMetric {
|
|
|
45
45
|
interface LegendProps {
|
|
46
46
|
fileTypes: LegendFileType[];
|
|
47
47
|
/** Raw git status data with file path arrays */
|
|
48
|
-
gitStatus?:
|
|
48
|
+
gitStatus?: GitStatusWithFiles | null;
|
|
49
49
|
/** PR files data with categorized file paths */
|
|
50
50
|
prFiles?: PrFilesStatus | null;
|
|
51
51
|
/** PR number for display */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../../src/panels/components/Legend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAkB,KAAK,
|
|
1
|
+
{"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../../src/panels/components/Legend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAkB,KAAK,kBAAkB,EAAE,KAAK,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC1G,OAAO,EAAiB,KAAK,aAAa,EAAE,KAAK,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAqB,KAAK,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAGlH,YAAY,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACrF,YAAY,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,YAAY,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAE1F,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,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CAAC;CAC/B;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsexC,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -2498,21 +2498,21 @@ const GitChangesTree = ({
|
|
|
2498
2498
|
}) => {
|
|
2499
2499
|
const { theme: theme2 } = useTheme();
|
|
2500
2500
|
const hasChanges = useMemo(
|
|
2501
|
-
() => gitStatus.
|
|
2502
|
-
[gitStatus.
|
|
2501
|
+
() => gitStatus.stagedFiles.length > 0 || gitStatus.modifiedFiles.length > 0 || gitStatus.untrackedFiles.length > 0 || gitStatus.deletedFiles.length > 0,
|
|
2502
|
+
[gitStatus.stagedFiles.length, gitStatus.modifiedFiles.length, gitStatus.untrackedFiles.length, gitStatus.deletedFiles.length]
|
|
2503
2503
|
);
|
|
2504
2504
|
const getFileStatus = useCallback(
|
|
2505
2505
|
(filePath) => {
|
|
2506
|
-
if (gitStatus.
|
|
2506
|
+
if (gitStatus.stagedFiles.includes(filePath)) {
|
|
2507
2507
|
return "staged";
|
|
2508
2508
|
}
|
|
2509
|
-
if (gitStatus.
|
|
2509
|
+
if (gitStatus.deletedFiles.includes(filePath)) {
|
|
2510
2510
|
return "deleted";
|
|
2511
2511
|
}
|
|
2512
|
-
if (gitStatus.
|
|
2512
|
+
if (gitStatus.untrackedFiles.includes(filePath)) {
|
|
2513
2513
|
return "untracked";
|
|
2514
2514
|
}
|
|
2515
|
-
if (gitStatus.
|
|
2515
|
+
if (gitStatus.modifiedFiles.includes(filePath)) {
|
|
2516
2516
|
return "unstaged";
|
|
2517
2517
|
}
|
|
2518
2518
|
return void 0;
|
|
@@ -2546,21 +2546,21 @@ const GitChangesTree = ({
|
|
|
2546
2546
|
}
|
|
2547
2547
|
return expandedPaths;
|
|
2548
2548
|
};
|
|
2549
|
-
const expandedUntracked = expandDirectories(gitStatus.
|
|
2549
|
+
const expandedUntracked = expandDirectories(gitStatus.untrackedFiles);
|
|
2550
2550
|
const statusData = [
|
|
2551
|
-
...gitStatus.
|
|
2551
|
+
...gitStatus.stagedFiles.map((filePath) => ({
|
|
2552
2552
|
filePath,
|
|
2553
2553
|
indexStatus: "A",
|
|
2554
2554
|
workingTreeStatus: " ",
|
|
2555
2555
|
status: "A"
|
|
2556
2556
|
})),
|
|
2557
|
-
...gitStatus.
|
|
2557
|
+
...gitStatus.modifiedFiles.map((filePath) => ({
|
|
2558
2558
|
filePath,
|
|
2559
2559
|
indexStatus: " ",
|
|
2560
2560
|
workingTreeStatus: "M",
|
|
2561
2561
|
status: "M"
|
|
2562
2562
|
})),
|
|
2563
|
-
...gitStatus.
|
|
2563
|
+
...gitStatus.deletedFiles.map((filePath) => ({
|
|
2564
2564
|
filePath,
|
|
2565
2565
|
indexStatus: " ",
|
|
2566
2566
|
workingTreeStatus: "D",
|
|
@@ -2574,13 +2574,20 @@ const GitChangesTree = ({
|
|
|
2574
2574
|
}))
|
|
2575
2575
|
];
|
|
2576
2576
|
const allChangedFiles = [
|
|
2577
|
-
...gitStatus.
|
|
2578
|
-
...gitStatus.
|
|
2577
|
+
...gitStatus.stagedFiles,
|
|
2578
|
+
...gitStatus.modifiedFiles,
|
|
2579
2579
|
...expandedUntracked,
|
|
2580
|
-
...gitStatus.
|
|
2581
|
-
].sort((a, b) => a.localeCompare(b));
|
|
2580
|
+
...gitStatus.deletedFiles
|
|
2581
|
+
].filter((path) => path && path.trim().length > 0).sort((a, b) => a.localeCompare(b));
|
|
2582
|
+
if (allChangedFiles.length === 0) {
|
|
2583
|
+
return null;
|
|
2584
|
+
}
|
|
2582
2585
|
const builder = new N();
|
|
2583
2586
|
const tree = builder.build({ files: allChangedFiles, rootPath: rootPath ?? "" });
|
|
2587
|
+
if (!tree || !tree.root || !tree.root.children || tree.root.children.length === 0) {
|
|
2588
|
+
console.warn("GitChangesTree: FileTree has no children", { tree, allChangedFiles });
|
|
2589
|
+
return null;
|
|
2590
|
+
}
|
|
2584
2591
|
return { tree, statusData };
|
|
2585
2592
|
}, [hasChanges, fileTree, gitStatus, rootPath]);
|
|
2586
2593
|
if (!hasChanges) {
|
|
@@ -2872,7 +2879,7 @@ const Legend = ({
|
|
|
2872
2879
|
position = "bottom"
|
|
2873
2880
|
}) => {
|
|
2874
2881
|
const { theme: theme2 } = useTheme();
|
|
2875
|
-
const hasGitStatus = gitStatus != null && (gitStatus.
|
|
2882
|
+
const hasGitStatus = gitStatus != null && (gitStatus.stagedFiles.length > 0 || gitStatus.modifiedFiles.length > 0 || gitStatus.untrackedFiles.length > 0 || gitStatus.deletedFiles.length > 0);
|
|
2876
2883
|
const hasPrFiles = prFiles != null && (prFiles.added.length > 0 || prFiles.modified.length > 0 || prFiles.removed.length > 0 || prFiles.renamed.length > 0);
|
|
2877
2884
|
const hasCommitFiles = commitFiles != null && (commitFiles.added.length > 0 || commitFiles.modified.length > 0 || commitFiles.removed.length > 0 || commitFiles.renamed.length > 0);
|
|
2878
2885
|
const hasAgentLayers = agentLayers && agentLayers.length > 0;
|
|
@@ -17506,7 +17513,7 @@ const CodeCityPanelContent = ({
|
|
|
17506
17513
|
}
|
|
17507
17514
|
}, [containerSize]);
|
|
17508
17515
|
const fileTreeSlice = context.getSlice("fileTree");
|
|
17509
|
-
const gitSlice = context.getSlice("
|
|
17516
|
+
const gitSlice = context.getSlice("gitStatusWithFiles");
|
|
17510
17517
|
const prFilesSlice = context.getSlice("prFiles");
|
|
17511
17518
|
const commitFilesSlice = context.getSlice("commitFiles");
|
|
17512
17519
|
const agentHighlightLayersSlice = context.getSlice("agentHighlightLayers");
|
|
@@ -17720,8 +17727,8 @@ const CodeCityPanelContent = ({
|
|
|
17720
17727
|
return items;
|
|
17721
17728
|
};
|
|
17722
17729
|
const layers = [];
|
|
17723
|
-
if (gitStatus.
|
|
17724
|
-
const stagedBuildings = gitStatus.
|
|
17730
|
+
if (gitStatus.stagedFiles.length > 0) {
|
|
17731
|
+
const stagedBuildings = gitStatus.stagedFiles.map((path) => buildingsByPath.get(path)).filter((b) => b !== void 0);
|
|
17725
17732
|
if (stagedBuildings.length > 0) {
|
|
17726
17733
|
const suffixLayers = distExports.createFileColorHighlightLayers(stagedBuildings);
|
|
17727
17734
|
suffixLayers.forEach((suffixLayer, idx) => {
|
|
@@ -17734,7 +17741,7 @@ const CodeCityPanelContent = ({
|
|
|
17734
17741
|
});
|
|
17735
17742
|
}
|
|
17736
17743
|
const items = [];
|
|
17737
|
-
for (const path of gitStatus.
|
|
17744
|
+
for (const path of gitStatus.stagedFiles) {
|
|
17738
17745
|
const building = buildingsByPath.get(path);
|
|
17739
17746
|
if (building) {
|
|
17740
17747
|
items.push({
|
|
@@ -17758,8 +17765,8 @@ const CodeCityPanelContent = ({
|
|
|
17758
17765
|
});
|
|
17759
17766
|
}
|
|
17760
17767
|
}
|
|
17761
|
-
if (gitStatus.
|
|
17762
|
-
const items = createLayerItems(gitStatus.
|
|
17768
|
+
if (gitStatus.modifiedFiles.length > 0) {
|
|
17769
|
+
const items = createLayerItems(gitStatus.modifiedFiles);
|
|
17763
17770
|
if (items.length > 0) {
|
|
17764
17771
|
layers.push({
|
|
17765
17772
|
id: "git-highlight-unstaged",
|
|
@@ -17771,8 +17778,8 @@ const CodeCityPanelContent = ({
|
|
|
17771
17778
|
});
|
|
17772
17779
|
}
|
|
17773
17780
|
}
|
|
17774
|
-
if (gitStatus.
|
|
17775
|
-
const items = createLayerItems(gitStatus.
|
|
17781
|
+
if (gitStatus.untrackedFiles.length > 0) {
|
|
17782
|
+
const items = createLayerItems(gitStatus.untrackedFiles);
|
|
17776
17783
|
if (items.length > 0) {
|
|
17777
17784
|
layers.push({
|
|
17778
17785
|
id: "git-highlight-untracked",
|
|
@@ -17784,8 +17791,8 @@ const CodeCityPanelContent = ({
|
|
|
17784
17791
|
});
|
|
17785
17792
|
}
|
|
17786
17793
|
}
|
|
17787
|
-
if (gitStatus.
|
|
17788
|
-
const items = createLayerItems(gitStatus.
|
|
17794
|
+
if (gitStatus.deletedFiles.length > 0) {
|
|
17795
|
+
const items = createLayerItems(gitStatus.deletedFiles);
|
|
17789
17796
|
if (items.length > 0) {
|
|
17790
17797
|
layers.push({
|
|
17791
17798
|
id: "git-highlight-deleted",
|
|
@@ -18013,8 +18020,8 @@ const CodeCityPanelContent = ({
|
|
|
18013
18020
|
}, [baseLayers, highlightLayers]);
|
|
18014
18021
|
const gitChangesCount = useMemo(() => {
|
|
18015
18022
|
if (!(gitSlice == null ? void 0 : gitSlice.data)) return 0;
|
|
18016
|
-
const {
|
|
18017
|
-
return
|
|
18023
|
+
const { stagedFiles, modifiedFiles, untrackedFiles, deletedFiles } = gitSlice.data;
|
|
18024
|
+
return stagedFiles.length + modifiedFiles.length + untrackedFiles.length + deletedFiles.length;
|
|
18018
18025
|
}, [gitSlice == null ? void 0 : gitSlice.data]);
|
|
18019
18026
|
useMemo(() => {
|
|
18020
18027
|
var _a2;
|
|
@@ -18287,13 +18294,13 @@ const CodeCityPanelContent = ({
|
|
|
18287
18294
|
(filePath) => {
|
|
18288
18295
|
let gitStatus;
|
|
18289
18296
|
if (gitSlice == null ? void 0 : gitSlice.data) {
|
|
18290
|
-
if (gitSlice.data.
|
|
18297
|
+
if (gitSlice.data.stagedFiles.includes(filePath)) {
|
|
18291
18298
|
gitStatus = "staged";
|
|
18292
|
-
} else if (gitSlice.data.
|
|
18299
|
+
} else if (gitSlice.data.modifiedFiles.includes(filePath)) {
|
|
18293
18300
|
gitStatus = "unstaged";
|
|
18294
|
-
} else if (gitSlice.data.
|
|
18301
|
+
} else if (gitSlice.data.untrackedFiles.includes(filePath)) {
|
|
18295
18302
|
gitStatus = "untracked";
|
|
18296
|
-
} else if (gitSlice.data.
|
|
18303
|
+
} else if (gitSlice.data.deletedFiles.includes(filePath)) {
|
|
18297
18304
|
gitStatus = "deleted";
|
|
18298
18305
|
}
|
|
18299
18306
|
}
|