@industry-theme/file-city-panel 0.2.56 → 0.2.58

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;AAuBjF,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,CAAC;KACnB,CAAC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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,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;AAwoDD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAEvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EA8BxC,CAAC"}
@@ -17480,6 +17480,7 @@ const CodeCityPanelContent = ({
17480
17480
  const [zoomToPath, setZoomToPath] = useState(null);
17481
17481
  const [isZoomAnimating, setIsZoomAnimating] = useState(false);
17482
17482
  const [gitTreeHoveredPath, setGitTreeHoveredPath] = useState(null);
17483
+ const [selectedFilePath, setSelectedFilePath] = useState(null);
17483
17484
  useEffect(() => {
17484
17485
  const container = contentContainerRef.current;
17485
17486
  if (!container) return;
@@ -17567,6 +17568,12 @@ const CodeCityPanelContent = ({
17567
17568
  console.log("[CodeCityPanel] Commit files cleared, triggering re-render");
17568
17569
  setCommitFilesVersion((v) => v + 1);
17569
17570
  });
17571
+ const cleanupFileOpen = events.on("file:open", (event) => {
17572
+ const payload = event.payload;
17573
+ if (payload == null ? void 0 : payload.path) {
17574
+ setSelectedFilePath(payload.path);
17575
+ }
17576
+ });
17570
17577
  return () => {
17571
17578
  cleanupHover == null ? void 0 : cleanupHover();
17572
17579
  cleanupSelect == null ? void 0 : cleanupSelect();
@@ -17574,6 +17581,7 @@ const CodeCityPanelContent = ({
17574
17581
  cleanupPrFilesCleared == null ? void 0 : cleanupPrFilesCleared();
17575
17582
  cleanupCommitFiles == null ? void 0 : cleanupCommitFiles();
17576
17583
  cleanupCommitFilesCleared == null ? void 0 : cleanupCommitFilesCleared();
17584
+ cleanupFileOpen == null ? void 0 : cleanupFileOpen();
17577
17585
  };
17578
17586
  }, [events]);
17579
17587
  useEffect(() => {
@@ -18292,6 +18300,7 @@ const CodeCityPanelContent = ({
18292
18300
  }, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, fileTreeSlice == null ? void 0 : fileTreeSlice.loading, (_i = context.currentScope.repository) == null ? void 0 : _i.path]);
18293
18301
  const handleFileClick = useCallback(
18294
18302
  (filePath) => {
18303
+ setSelectedFilePath(filePath);
18295
18304
  let gitStatus;
18296
18305
  if (gitSlice == null ? void 0 : gitSlice.data) {
18297
18306
  if (gitSlice.data.stagedFiles.includes(filePath)) {
@@ -18356,6 +18365,28 @@ const CodeCityPanelContent = ({
18356
18365
  }
18357
18366
  return null;
18358
18367
  }, [gitTreeHoveredPath, cityData]);
18368
+ const selectedFileLayer = useMemo(() => {
18369
+ var _a2;
18370
+ if (!selectedFilePath || !cityData) return null;
18371
+ const building = (_a2 = cityData.buildings) == null ? void 0 : _a2.find((b) => b.path === selectedFilePath);
18372
+ if (building) {
18373
+ return {
18374
+ id: "selected-file",
18375
+ name: "Selected File",
18376
+ enabled: true,
18377
+ color: theme2.colors.primary,
18378
+ opacity: 0.5,
18379
+ borderWidth: 4,
18380
+ priority: 300,
18381
+ // Higher priority than hover
18382
+ items: [{
18383
+ path: building.path,
18384
+ type: "file"
18385
+ }]
18386
+ };
18387
+ }
18388
+ return null;
18389
+ }, [selectedFilePath, cityData, theme2.colors.primary]);
18359
18390
  const finalHighlightLayers = useMemo(() => {
18360
18391
  let layers = [...highlightLayers];
18361
18392
  if (hoveredPackagePath && !selectedPackagePath) {
@@ -18367,8 +18398,9 @@ const CodeCityPanelContent = ({
18367
18398
  })).filter((layer) => layer.items.length > 0);
18368
18399
  }
18369
18400
  if (gitTreeHoverLayer) layers.push(gitTreeHoverLayer);
18401
+ if (selectedFileLayer) layers.push(selectedFileLayer);
18370
18402
  return layers;
18371
- }, [highlightLayers, gitTreeHoverLayer, hoveredPackagePath, selectedPackagePath, isFileInPackage]);
18403
+ }, [highlightLayers, gitTreeHoverLayer, selectedFileLayer, hoveredPackagePath, selectedPackagePath, isFileInPackage]);
18372
18404
  return /* @__PURE__ */ jsxs(
18373
18405
  "div",
18374
18406
  {