@industry-theme/file-city-panel 0.2.7 → 0.2.9

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;AAsBjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAYpD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAguCD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAEvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EA8BxC,CAAC"}
1
+ {"version":3,"file":"CodeCityPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CodeCityPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAsBjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAYpD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AA6sCD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAEvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EA8BxC,CAAC"}
@@ -14516,28 +14516,6 @@ function createKnipHighlightLayers(buildings, knipMetrics) {
14516
14516
  function createAlexandriaHighlightLayers(buildings, alexandriaMetrics) {
14517
14517
  return createMetricHighlightLayers(buildings, alexandriaMetrics, "alexandria");
14518
14518
  }
14519
- function isColorModeAvailable(mode, qualityData, hasGitData) {
14520
- var _a, _b, _c, _d, _e;
14521
- if (mode === "fileTypes") return true;
14522
- if (mode === "git") return hasGitData;
14523
- if (!qualityData) return false;
14524
- switch (mode) {
14525
- case "coverage":
14526
- return !!qualityData.fileCoverage && Object.keys(qualityData.fileCoverage).length > 0;
14527
- case "eslint":
14528
- return !!((_a = qualityData.fileMetrics) == null ? void 0 : _a.eslint) && qualityData.fileMetrics.eslint.length > 0;
14529
- case "typescript":
14530
- return !!((_b = qualityData.fileMetrics) == null ? void 0 : _b.typescript) && qualityData.fileMetrics.typescript.length > 0;
14531
- case "prettier":
14532
- return !!((_c = qualityData.fileMetrics) == null ? void 0 : _c.prettier) && qualityData.fileMetrics.prettier.length > 0;
14533
- case "knip":
14534
- return !!((_d = qualityData.fileMetrics) == null ? void 0 : _d.knip) && qualityData.fileMetrics.knip.length > 0;
14535
- case "alexandria":
14536
- return !!((_e = qualityData.fileMetrics) == null ? void 0 : _e.alexandria) && qualityData.fileMetrics.alexandria.length > 0;
14537
- default:
14538
- return false;
14539
- }
14540
- }
14541
14519
  function getLayersForColorMode(mode, buildings, qualityData, fileColorLayers, gitLayers) {
14542
14520
  var _a, _b, _c, _d, _e;
14543
14521
  switch (mode) {
@@ -14704,8 +14682,7 @@ const CodeCityPanelContent = ({
14704
14682
  return COLOR_MODES.filter((mode) => {
14705
14683
  if (mode.id === "fileTypes") return true;
14706
14684
  if (mode.id === "git") return hasGitData;
14707
- if (!(enabledModes == null ? void 0 : enabledModes.includes(mode.id))) return false;
14708
- return isColorModeAvailable(mode.id, qualityData, !!hasGitData);
14685
+ return (enabledModes == null ? void 0 : enabledModes.includes(mode.id)) ?? false;
14709
14686
  });
14710
14687
  }, [gitSlice == null ? void 0 : gitSlice.data, (_d = colorModesSlice == null ? void 0 : colorModesSlice.data) == null ? void 0 : _d.enabledModes, qualityData]);
14711
14688
  useEffect(() => {
@@ -15086,35 +15063,17 @@ const CodeCityPanelContent = ({
15086
15063
  }
15087
15064
  setBaseLayers(modeLayers);
15088
15065
  const activePackagePath = selectedPackagePath ?? hoveredPackagePath;
15089
- if (activePackagePath !== null && modeLayers.length > 0) {
15066
+ if (activePackagePath && activePackagePath !== "" && activePackagePath !== "/" && modeLayers.length > 0) {
15090
15067
  const packageFilteredLayers = [];
15091
15068
  modeLayers.forEach((layer) => {
15092
- const insidePackage = [];
15093
- const outsidePackage = [];
15094
- layer.items.forEach((item) => {
15095
- if (isFileInPackage(item.path, activePackagePath)) {
15096
- insidePackage.push(item);
15097
- } else {
15098
- outsidePackage.push(item);
15099
- }
15100
- });
15069
+ const insidePackage = layer.items.filter(
15070
+ (item) => isFileInPackage(item.path, activePackagePath)
15071
+ );
15101
15072
  if (insidePackage.length > 0) {
15102
15073
  packageFilteredLayers.push({
15103
15074
  ...layer,
15104
15075
  id: `${layer.id}-package-focus`,
15105
- items: insidePackage,
15106
- priority: (layer.priority || 0) + 100
15107
- // Higher priority for focused files
15108
- });
15109
- }
15110
- if (outsidePackage.length > 0) {
15111
- packageFilteredLayers.push({
15112
- ...layer,
15113
- id: `${layer.id}-dimmed`,
15114
- items: outsidePackage,
15115
- opacity: 0.15,
15116
- // Dim files outside the active package
15117
- priority: layer.priority || 0
15076
+ items: insidePackage
15118
15077
  });
15119
15078
  }
15120
15079
  });