@industry-theme/file-city-panel 0.2.72 → 0.2.74
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeCityPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CodeCityPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AA8BjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAgBpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;QACX,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;QAC1F,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,OAAO,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC7D,CAAC;IACF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,OAAO,EAAE,MAAM,EAAE,CAA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H,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IACF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAGD,YAAY,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAmCpF;;GAEG;AACH,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAmiEvD,CAAC;AAEF;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAEhC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAEvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EA8BxC,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -53264,22 +53264,14 @@ function parseTour(jsonString) {
|
|
|
53264
53264
|
};
|
|
53265
53265
|
}
|
|
53266
53266
|
}
|
|
53267
|
-
function
|
|
53268
|
-
const
|
|
53269
|
-
|
|
53270
|
-
return
|
|
53271
|
-
}
|
|
53272
|
-
|
|
53273
|
-
|
|
53274
|
-
|
|
53275
|
-
const tourContent = findTourInFileTree(fileTree);
|
|
53276
|
-
if (!tourContent) {
|
|
53277
|
-
return {
|
|
53278
|
-
success: false,
|
|
53279
|
-
errors: [new TourValidationError("No tour.json file found in repository root")]
|
|
53280
|
-
};
|
|
53281
|
-
}
|
|
53282
|
-
return parseTour(tourContent);
|
|
53267
|
+
function findTourFilePathInFileTree(fileTree) {
|
|
53268
|
+
const tourFiles = fileTree.allFiles.filter((file) => {
|
|
53269
|
+
const path = file.path;
|
|
53270
|
+
return path.endsWith(".tour.json") && !path.includes("/");
|
|
53271
|
+
});
|
|
53272
|
+
tourFiles.sort((a, b) => a.path.localeCompare(b.path));
|
|
53273
|
+
const tourFile = tourFiles[0];
|
|
53274
|
+
return tourFile ? tourFile.path : null;
|
|
53283
53275
|
}
|
|
53284
53276
|
const GIT_STATUS_COLORS = {
|
|
53285
53277
|
staged: "#22c55e",
|
|
@@ -53306,7 +53298,7 @@ const CodeCityPanelContent = ({
|
|
|
53306
53298
|
actions: _actions,
|
|
53307
53299
|
events
|
|
53308
53300
|
}) => {
|
|
53309
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
|
|
53301
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
|
|
53310
53302
|
const { theme: theme2 } = useTheme();
|
|
53311
53303
|
const [cityData, setCityData] = useState(null);
|
|
53312
53304
|
const [hoverInfo, setHoverInfo] = useState(null);
|
|
@@ -53392,24 +53384,44 @@ const CodeCityPanelContent = ({
|
|
|
53392
53384
|
}
|
|
53393
53385
|
}, [currentRepoPath]);
|
|
53394
53386
|
useEffect(() => {
|
|
53395
|
-
|
|
53387
|
+
var _a2;
|
|
53388
|
+
if (!(fileTreeSlice == null ? void 0 : fileTreeSlice.data) || !((_a2 = context.currentScope.repository) == null ? void 0 : _a2.path)) {
|
|
53396
53389
|
setTourData(null);
|
|
53397
53390
|
return;
|
|
53398
53391
|
}
|
|
53399
|
-
const
|
|
53400
|
-
|
|
53401
|
-
|
|
53402
|
-
|
|
53403
|
-
|
|
53404
|
-
|
|
53405
|
-
|
|
53406
|
-
|
|
53407
|
-
|
|
53392
|
+
const loadTour = async () => {
|
|
53393
|
+
var _a3;
|
|
53394
|
+
const tourFilePath = findTourFilePathInFileTree(fileTreeSlice.data);
|
|
53395
|
+
if (!tourFilePath) {
|
|
53396
|
+
setTourData(null);
|
|
53397
|
+
return;
|
|
53398
|
+
}
|
|
53399
|
+
if (!((_a3 = context.adapters) == null ? void 0 : _a3.readFile)) {
|
|
53400
|
+
console.warn("[Tour] No readFile adapter available - cannot load tour file");
|
|
53401
|
+
setTourData(null);
|
|
53402
|
+
return;
|
|
53403
|
+
}
|
|
53404
|
+
const repoPath = context.currentScope.repository.path;
|
|
53405
|
+
const fullPath = `${repoPath}/${tourFilePath}`;
|
|
53406
|
+
try {
|
|
53407
|
+
const tourContent = await context.adapters.readFile(fullPath);
|
|
53408
|
+
const tourResult = parseTour(tourContent);
|
|
53409
|
+
if (tourResult.success && tourResult.tour) {
|
|
53410
|
+
console.log("[Tour] Found and parsed tour file:", tourResult.tour.title, `(${tourFilePath})`);
|
|
53411
|
+
setTourData(tourResult.tour);
|
|
53412
|
+
} else {
|
|
53413
|
+
if (tourResult.errors && tourResult.errors.length > 0) {
|
|
53414
|
+
console.warn("[Tour] Tour validation failed:", tourResult.errors.map((e) => e.message).join(", "));
|
|
53415
|
+
}
|
|
53416
|
+
setTourData(null);
|
|
53408
53417
|
}
|
|
53418
|
+
} catch (error) {
|
|
53419
|
+
console.warn("[Tour] Failed to read tour file:", error instanceof Error ? error.message : "Unknown error");
|
|
53420
|
+
setTourData(null);
|
|
53409
53421
|
}
|
|
53410
|
-
|
|
53411
|
-
|
|
53412
|
-
}, [fileTreeSlice == null ? void 0 : fileTreeSlice.data]);
|
|
53422
|
+
};
|
|
53423
|
+
loadTour();
|
|
53424
|
+
}, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, (_e = context.currentScope.repository) == null ? void 0 : _e.path, context.adapters]);
|
|
53413
53425
|
const [prFilesVersion, setPrFilesVersion] = useState(0);
|
|
53414
53426
|
const [commitFilesVersion, setCommitFilesVersion] = useState(0);
|
|
53415
53427
|
useEffect(() => {
|
|
@@ -53538,7 +53550,7 @@ const CodeCityPanelContent = ({
|
|
|
53538
53550
|
default:
|
|
53539
53551
|
return null;
|
|
53540
53552
|
}
|
|
53541
|
-
}, [(
|
|
53553
|
+
}, [(_f = hoverInfo == null ? void 0 : hoverInfo.hoveredBuilding) == null ? void 0 : _f.path, colorMode, qualityData]);
|
|
53542
53554
|
const computedTreeStats = useMemo(() => {
|
|
53543
53555
|
var _a2, _b2, _c2;
|
|
53544
53556
|
if (!cityData) {
|
|
@@ -53755,7 +53767,7 @@ const CodeCityPanelContent = ({
|
|
|
53755
53767
|
}
|
|
53756
53768
|
}
|
|
53757
53769
|
return layers;
|
|
53758
|
-
}, [cityData, (
|
|
53770
|
+
}, [cityData, (_g = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _g.filesByStatus, prFilesVersion]);
|
|
53759
53771
|
const commitFilesLayers = useMemo(() => {
|
|
53760
53772
|
var _a2;
|
|
53761
53773
|
if (!cityData || !cityData.buildings || !((_a2 = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _a2.filesByStatus)) {
|
|
@@ -53833,7 +53845,7 @@ const CodeCityPanelContent = ({
|
|
|
53833
53845
|
}
|
|
53834
53846
|
}
|
|
53835
53847
|
return layers;
|
|
53836
|
-
}, [cityData, (
|
|
53848
|
+
}, [cityData, (_h = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _h.filesByStatus, commitFilesVersion]);
|
|
53837
53849
|
const storyboardLayers = useMemo(() => {
|
|
53838
53850
|
if (!cityData || !cityData.buildings || !(storyboardContextSlice == null ? void 0 : storyboardContextSlice.data)) {
|
|
53839
53851
|
return [];
|
|
@@ -53934,7 +53946,7 @@ const CodeCityPanelContent = ({
|
|
|
53934
53946
|
if (!((_a2 = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _a2.filesByStatus)) return 0;
|
|
53935
53947
|
const { added, modified, removed, renamed } = prFilesSlice.data.filesByStatus;
|
|
53936
53948
|
return added.length + modified.length + removed.length + renamed.length;
|
|
53937
|
-
}, [(
|
|
53949
|
+
}, [(_i = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _i.filesByStatus]);
|
|
53938
53950
|
const legendAgentLayers = useMemo(() => {
|
|
53939
53951
|
const agentLayers = highlightLayers.filter(
|
|
53940
53952
|
(layer) => layer.id.startsWith("event-highlight")
|
|
@@ -54198,7 +54210,7 @@ const CodeCityPanelContent = ({
|
|
|
54198
54210
|
} finally {
|
|
54199
54211
|
setLoading(false);
|
|
54200
54212
|
}
|
|
54201
|
-
}, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, fileTreeSlice == null ? void 0 : fileTreeSlice.loading, (
|
|
54213
|
+
}, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, fileTreeSlice == null ? void 0 : fileTreeSlice.loading, (_j = context.currentScope.repository) == null ? void 0 : _j.path]);
|
|
54202
54214
|
const handleFileClick = useCallback(
|
|
54203
54215
|
(filePath, type) => {
|
|
54204
54216
|
if (type === "file") {
|
|
@@ -54708,7 +54720,7 @@ const CodeCityPanelContent = ({
|
|
|
54708
54720
|
textOverflow: "ellipsis",
|
|
54709
54721
|
whiteSpace: "nowrap"
|
|
54710
54722
|
},
|
|
54711
|
-
children: ((
|
|
54723
|
+
children: ((_k = hoverInfo.fileTooltip) == null ? void 0 : _k.text) || ((_m = (_l = hoverInfo.hoveredDistrict) == null ? void 0 : _l.path) == null ? void 0 : _m.split("/").pop()) || ((_n = hoverInfo.hoveredDistrict) == null ? void 0 : _n.path) || "Unknown"
|
|
54712
54724
|
}
|
|
54713
54725
|
),
|
|
54714
54726
|
/* @__PURE__ */ jsx(
|
|
@@ -54722,7 +54734,7 @@ const CodeCityPanelContent = ({
|
|
|
54722
54734
|
textOverflow: "ellipsis",
|
|
54723
54735
|
whiteSpace: "nowrap"
|
|
54724
54736
|
},
|
|
54725
|
-
children: ((
|
|
54737
|
+
children: ((_o = hoverInfo.hoveredBuilding) == null ? void 0 : _o.path) || ((_p = hoverInfo.hoveredDistrict) == null ? void 0 : _p.path) || "/"
|
|
54726
54738
|
}
|
|
54727
54739
|
)
|
|
54728
54740
|
]
|
|
@@ -54954,14 +54966,14 @@ const CodeCityPanelContent = ({
|
|
|
54954
54966
|
{
|
|
54955
54967
|
fileTypes: [],
|
|
54956
54968
|
gitStatus: gitSlice == null ? void 0 : gitSlice.data,
|
|
54957
|
-
prFiles: (
|
|
54958
|
-
prFileStats: (
|
|
54959
|
-
prNumber: (
|
|
54960
|
-
commitFiles: (
|
|
54961
|
-
commitHash: (
|
|
54962
|
-
commitStats: (
|
|
54969
|
+
prFiles: (_q = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _q.filesByStatus,
|
|
54970
|
+
prFileStats: (_r = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _r.files,
|
|
54971
|
+
prNumber: (_s = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _s.pullNumber,
|
|
54972
|
+
commitFiles: (_t = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _t.filesByStatus,
|
|
54973
|
+
commitHash: (_u = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _u.commitHash,
|
|
54974
|
+
commitStats: (_v = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _v.stats,
|
|
54963
54975
|
fileTree: fileTreeSlice == null ? void 0 : fileTreeSlice.data,
|
|
54964
|
-
rootPath: (
|
|
54976
|
+
rootPath: (_w = context.currentScope.repository) == null ? void 0 : _w.path,
|
|
54965
54977
|
onGitFileClick: handleLegendFileClick,
|
|
54966
54978
|
onGitNodeHover: handleGitNodeHover,
|
|
54967
54979
|
onPrFileClick: handleLegendFileClick,
|
|
@@ -54984,14 +54996,14 @@ const CodeCityPanelContent = ({
|
|
|
54984
54996
|
{
|
|
54985
54997
|
fileTypes: legendFileTypes,
|
|
54986
54998
|
gitStatus: gitSlice == null ? void 0 : gitSlice.data,
|
|
54987
|
-
prFiles: (
|
|
54988
|
-
prFileStats: (
|
|
54989
|
-
prNumber: (
|
|
54990
|
-
commitFiles: (
|
|
54991
|
-
commitHash: (
|
|
54992
|
-
commitStats: (
|
|
54999
|
+
prFiles: (_x = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _x.filesByStatus,
|
|
55000
|
+
prFileStats: (_y = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _y.files,
|
|
55001
|
+
prNumber: (_z = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _z.pullNumber,
|
|
55002
|
+
commitFiles: (_A = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _A.filesByStatus,
|
|
55003
|
+
commitHash: (_B = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _B.commitHash,
|
|
55004
|
+
commitStats: (_C = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _C.stats,
|
|
54993
55005
|
fileTree: fileTreeSlice == null ? void 0 : fileTreeSlice.data,
|
|
54994
|
-
rootPath: (
|
|
55006
|
+
rootPath: (_D = context.currentScope.repository) == null ? void 0 : _D.path,
|
|
54995
55007
|
agentLayers: legendAgentLayers,
|
|
54996
55008
|
qualityMetrics: legendQualityMetrics,
|
|
54997
55009
|
colorMode,
|