@industry-theme/file-city-panel 0.4.5 → 0.4.7

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,7 +1,7 @@
1
- import { e as extensions, A as AccessibilitySystem, C as Container, a as accessibilityTarget, E as EventSystem, F as FederatedContainer } from "./index-_kq9SOpa.js";
2
- import "./init-Ccb5WXmw-C4UxmFuK.js";
1
+ import { e as extensions, A as AccessibilitySystem, C as Container, a as accessibilityTarget, E as EventSystem, F as FederatedContainer } from "./index-BegApVCq.js";
2
+ import "./init-BViSvzO2-DhbwrY0a.js";
3
3
  extensions.add(AccessibilitySystem);
4
4
  extensions.mixin(Container, accessibilityTarget);
5
5
  extensions.add(EventSystem);
6
6
  extensions.mixin(Container, FederatedContainer);
7
- //# sourceMappingURL=browserAll-XNN46GKF-DWjsfUOg.js.map
7
+ //# sourceMappingURL=browserAll-BWR83R0--BnLs3Hii.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browserAll-XNN46GKF-DWjsfUOg.js","sources":["../node_modules/@industry-theme/repository-composition-panels/dist/browserAll-XNN46GKF.js"],"sourcesContent":["import { e as extensions, A as AccessibilitySystem, C as Container, b as accessibilityTarget, E as EventSystem, c as FederatedContainer } from \"./index-Bt-XsLNt.js\";\nimport \"./init-Ccb5WXmw.js\";\nextensions.add(AccessibilitySystem);\nextensions.mixin(Container, accessibilityTarget);\nextensions.add(EventSystem);\nextensions.mixin(Container, FederatedContainer);\n//# sourceMappingURL=browserAll-XNN46GKF.js.map\n"],"names":[],"mappings":";;AAEA,WAAW,IAAI,mBAAmB;AAClC,WAAW,MAAM,WAAW,mBAAmB;AAC/C,WAAW,IAAI,WAAW;AAC1B,WAAW,MAAM,WAAW,kBAAkB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"browserAll-BWR83R0--BnLs3Hii.js","sources":["../node_modules/@industry-theme/repository-composition-panels/dist/browserAll-BWR83R0-.js"],"sourcesContent":["import { e as extensions, A as AccessibilitySystem, C as Container, b as accessibilityTarget, E as EventSystem, c as FederatedContainer } from \"./index-BsDrFty7.js\";\nimport \"./init-BViSvzO2.js\";\nextensions.add(AccessibilitySystem);\nextensions.mixin(Container, accessibilityTarget);\nextensions.add(EventSystem);\nextensions.mixin(Container, FederatedContainer);\n//# sourceMappingURL=browserAll-BWR83R0-.js.map\n"],"names":[],"mappings":";;AAEA,WAAW,IAAI,mBAAmB;AAClC,WAAW,MAAM,WAAW,mBAAmB;AAC/C,WAAW,IAAI,WAAW;AAC1B,WAAW,MAAM,WAAW,kBAAkB;","x_google_ignoreList":[0]}
@@ -149621,7 +149621,7 @@ const browserExt = {
149621
149621
  },
149622
149622
  test: () => true,
149623
149623
  load: async () => {
149624
- await import("./browserAll-XNN46GKF-DWjsfUOg.js");
149624
+ await import("./browserAll-BWR83R0--BnLs3Hii.js");
149625
149625
  }
149626
149626
  };
149627
149627
  const webworkerExt = {
@@ -149632,7 +149632,7 @@ const webworkerExt = {
149632
149632
  },
149633
149633
  test: () => typeof self !== "undefined" && self.WorkerGlobalScope !== void 0,
149634
149634
  load: async () => {
149635
- await import("./webworkerAll-Ez5pUZRt-CJkJ04SM.js");
149635
+ await import("./webworkerAll-DkB5mV_6-CnQVn1z6.js");
149636
149636
  }
149637
149637
  };
149638
149638
  class ObservablePoint {
@@ -189459,7 +189459,7 @@ function generateMITFlowerArch(config) {
189459
189459
  fontFamily: "Arial",
189460
189460
  fontWeight: "bold"
189461
189461
  },
189462
- resolution: 2
189462
+ resolution: 16
189463
189463
  });
189464
189464
  mitText.anchor.set(0.5, 0.5);
189465
189465
  mitText.y = flagTop + flagHeight * 0.5;
@@ -189494,7 +189494,7 @@ function generateMITFlowerArch(config) {
189494
189494
  fontFamily: "Arial",
189495
189495
  fontWeight: "600"
189496
189496
  },
189497
- resolution: 2
189497
+ resolution: 16
189498
189498
  });
189499
189499
  nameText.anchor.set(0.5, 0.5);
189500
189500
  nameText.y = signBoardY + signHeight / 2;
@@ -189674,7 +189674,7 @@ function generateApacheSign(config) {
189674
189674
  fontFamily: "Arial",
189675
189675
  fontWeight: "600"
189676
189676
  },
189677
- resolution: 2
189677
+ resolution: 16
189678
189678
  });
189679
189679
  nameText.anchor.set(0.5, 0.5);
189680
189680
  nameText.y = signBoardY + signBoardHeight / 2;
@@ -189807,7 +189807,7 @@ function generateGPLSign(config) {
189807
189807
  fontFamily: "Arial",
189808
189808
  fontWeight: "bold"
189809
189809
  },
189810
- resolution: 2
189810
+ resolution: 16
189811
189811
  });
189812
189812
  gplText.anchor.set(0.5, 0.5);
189813
189813
  gplText.y = flagTop + flagHeight * 0.5;
@@ -189851,7 +189851,7 @@ function generateGPLSign(config) {
189851
189851
  fontFamily: "Arial",
189852
189852
  fontWeight: "600"
189853
189853
  },
189854
- resolution: 2
189854
+ resolution: 16
189855
189855
  });
189856
189856
  nameText.anchor.set(0.5, 0.5);
189857
189857
  nameText.y = signBoardY + signBoardHeight / 2;
@@ -190166,7 +190166,9 @@ const RepoSprite = ({
190166
190166
  backgroundColor,
190167
190167
  showBoundary = true,
190168
190168
  boundaryColor = 16776960,
190169
- debug = false
190169
+ debug = false,
190170
+ onPackageHover,
190171
+ onPackageHoverEnd
190170
190172
  }) => {
190171
190173
  const { theme: theme2 } = useTheme();
190172
190174
  const containerRef = useRef(null);
@@ -190237,6 +190239,18 @@ const RepoSprite = ({
190237
190239
  });
190238
190240
  buildingGraphics.x = pos.x;
190239
190241
  buildingGraphics.y = pos.y;
190242
+ buildingGraphics.eventMode = "static";
190243
+ buildingGraphics.cursor = "pointer";
190244
+ const originalTint = buildingGraphics.tint;
190245
+ const packageName = pkg.name;
190246
+ buildingGraphics.on("pointerover", () => {
190247
+ buildingGraphics.tint = 8965375;
190248
+ onPackageHover == null ? void 0 : onPackageHover(packageName);
190249
+ });
190250
+ buildingGraphics.on("pointerout", () => {
190251
+ buildingGraphics.tint = originalTint;
190252
+ onPackageHoverEnd == null ? void 0 : onPackageHoverEnd(packageName);
190253
+ });
190240
190254
  mainContainer.addChild(buildingGraphics);
190241
190255
  }
190242
190256
  } else {
@@ -190334,7 +190348,9 @@ const RepoSprite = ({
190334
190348
  backgroundColor,
190335
190349
  showBoundary,
190336
190350
  boundaryColor,
190337
- debug
190351
+ debug,
190352
+ onPackageHover,
190353
+ onPackageHoverEnd
190338
190354
  ]);
190339
190355
  if (variant === "card") {
190340
190356
  return /* @__PURE__ */ jsxs(
@@ -190539,7 +190555,9 @@ const RepoSpriteView = ({
190539
190555
  github,
190540
190556
  fileCount,
190541
190557
  showHeader = true,
190542
- workspacePackages
190558
+ workspacePackages,
190559
+ onPackageHover,
190560
+ onPackageHoverEnd
190543
190561
  }) => {
190544
190562
  const { theme: theme2 } = useTheme$1();
190545
190563
  const containerRef = useRef(null);
@@ -190636,7 +190654,9 @@ const RepoSpriteView = ({
190636
190654
  packages: isMonorepo ? workspacePackages : void 0,
190637
190655
  size: spriteDimensions.size,
190638
190656
  width: spriteDimensions.width,
190639
- height: spriteDimensions.height
190657
+ height: spriteDimensions.height,
190658
+ onPackageHover,
190659
+ onPackageHoverEnd
190640
190660
  },
190641
190661
  `${github.name}-${spriteDimensions.width}-${spriteDimensions.height}`
190642
190662
  )
@@ -238487,7 +238507,7 @@ const CodeCityPanelContent = ({
238487
238507
  actions,
238488
238508
  events
238489
238509
  }) => {
238490
- var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o2, _p, _q, _r, _s, _t2;
238510
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o2, _p, _q, _r, _s, _t2, _u, _v;
238491
238511
  const autoShowTour = ("autoShowTour" in context2 ? context2.autoShowTour : false) ?? false;
238492
238512
  const { theme: theme2 } = useTheme$1();
238493
238513
  const [cityData, setCityData] = useState(null);
@@ -238554,8 +238574,27 @@ const CodeCityPanelContent = ({
238554
238574
  const agentHighlightLayersSlice = context2.agentHighlightLayers;
238555
238575
  const colorModesSlice = context2.fileCityColorModes;
238556
238576
  const repositoryEntrySlice = context2.repositoryEntry;
238577
+ const packagesSlice = context2.packages;
238557
238578
  const qualityData = (_c = colorModesSlice == null ? void 0 : colorModesSlice.data) == null ? void 0 : _c.qualityData;
238558
- const githubRepoString = (_d = context2.currentScope.repository) == null ? void 0 : _d.githubRepo;
238579
+ const workspacePackages = useMemo(() => {
238580
+ var _a2;
238581
+ const summary = (_a2 = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a2.summary;
238582
+ if (!(summary == null ? void 0 : summary.isMonorepo) || !summary.workspacePackages) return void 0;
238583
+ return summary.workspacePackages.filter((pkg) => !!pkg.name).map((pkg) => ({ name: pkg.name }));
238584
+ }, [(_d = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _d.summary]);
238585
+ const packageNameToPath = useMemo(() => {
238586
+ var _a2;
238587
+ const summary = (_a2 = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a2.summary;
238588
+ if (!(summary == null ? void 0 : summary.isMonorepo) || !summary.workspacePackages) return /* @__PURE__ */ new Map();
238589
+ const map2 = /* @__PURE__ */ new Map();
238590
+ for (const pkg of summary.workspacePackages) {
238591
+ if (pkg.name && pkg.path) {
238592
+ map2.set(pkg.name, pkg.path);
238593
+ }
238594
+ }
238595
+ return map2;
238596
+ }, [(_e2 = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _e2.summary]);
238597
+ const githubRepoString = (_f = context2.currentScope.repository) == null ? void 0 : _f.githubRepo;
238559
238598
  const [repoOwner, repoName] = (githubRepoString == null ? void 0 : githubRepoString.includes("/")) ? githubRepoString.split("/") : [void 0, void 0];
238560
238599
  const fileColorLayersRegistered = useRef(false);
238561
238600
  const gitLayersRegistered = useRef(false);
@@ -238563,7 +238602,7 @@ const CodeCityPanelContent = ({
238563
238602
  const commitFilesLayersRegistered = useRef(false);
238564
238603
  const agentLayersRegistered = useRef(false);
238565
238604
  const lastHasGitOrAgentLayers = useRef(null);
238566
- const currentRepoPath = (_e2 = context2.currentScope.repository) == null ? void 0 : _e2.path;
238605
+ const currentRepoPath = (_g = context2.currentScope.repository) == null ? void 0 : _g.path;
238567
238606
  const lastRepoPath = useRef(currentRepoPath);
238568
238607
  useEffect(() => {
238569
238608
  if (lastRepoPath.current !== currentRepoPath) {
@@ -238619,7 +238658,7 @@ const CodeCityPanelContent = ({
238619
238658
  }
238620
238659
  };
238621
238660
  loadTour();
238622
- }, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, (_f = context2.currentScope.repository) == null ? void 0 : _f.path, context2.adapters]);
238661
+ }, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, (_h = context2.currentScope.repository) == null ? void 0 : _h.path, context2.adapters]);
238623
238662
  useEffect(() => {
238624
238663
  if (autoShowTour && tourData && !hasAutoShownTourRef.current) {
238625
238664
  setShowTourPlayer(true);
@@ -238891,7 +238930,7 @@ const CodeCityPanelContent = ({
238891
238930
  }
238892
238931
  }
238893
238932
  return layers;
238894
- }, [cityData, (_g = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _g.filesByStatus, prFilesVersion]);
238933
+ }, [cityData, (_i = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _i.filesByStatus, prFilesVersion]);
238895
238934
  const commitFilesLayers = useMemo(() => {
238896
238935
  var _a2;
238897
238936
  if (!cityData || !cityData.buildings || !((_a2 = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _a2.filesByStatus)) {
@@ -238969,7 +239008,7 @@ const CodeCityPanelContent = ({
238969
239008
  }
238970
239009
  }
238971
239010
  return layers;
238972
- }, [cityData, (_h = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _h.filesByStatus, commitFilesVersion]);
239011
+ }, [cityData, (_j = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _j.filesByStatus, commitFilesVersion]);
238973
239012
  const storyboardLayers = useMemo(() => {
238974
239013
  if (!cityData || !cityData.buildings || !(storyboardContextSlice == null ? void 0 : storyboardContextSlice.data)) {
238975
239014
  return [];
@@ -239070,7 +239109,7 @@ const CodeCityPanelContent = ({
239070
239109
  if (!((_a2 = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _a2.filesByStatus)) return 0;
239071
239110
  const { added, modified, removed, renamed } = prFilesSlice.data.filesByStatus;
239072
239111
  return added.length + modified.length + removed.length + renamed.length;
239073
- }, [(_i = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _i.filesByStatus]);
239112
+ }, [(_k = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _k.filesByStatus]);
239074
239113
  const legendAgentLayers = useMemo(() => {
239075
239114
  const agentLayers = highlightLayers.filter(
239076
239115
  (layer) => layer.id.startsWith("event-highlight")
@@ -239339,7 +239378,7 @@ const CodeCityPanelContent = ({
239339
239378
  } finally {
239340
239379
  setLoading(false);
239341
239380
  }
239342
- }, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, fileTreeSlice == null ? void 0 : fileTreeSlice.loading, (_j = context2.currentScope.repository) == null ? void 0 : _j.path]);
239381
+ }, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, fileTreeSlice == null ? void 0 : fileTreeSlice.loading, (_l = context2.currentScope.repository) == null ? void 0 : _l.path]);
239343
239382
  const handleFileClick = useCallback(
239344
239383
  (filePath, type2) => {
239345
239384
  if (type2 === "file") {
@@ -239404,6 +239443,26 @@ const CodeCityPanelContent = ({
239404
239443
  });
239405
239444
  setIsEditingCover(false);
239406
239445
  }, [events]);
239446
+ const handleRepoSpritePackageHover = useCallback(
239447
+ (packageName) => {
239448
+ const packagePath = packageNameToPath.get(packageName) ?? packageName;
239449
+ events.emit({
239450
+ type: "package:hover",
239451
+ source: "repo-sprite",
239452
+ timestamp: Date.now(),
239453
+ payload: { packagePath, packageName }
239454
+ });
239455
+ },
239456
+ [events, packageNameToPath]
239457
+ );
239458
+ const handleRepoSpritePackageHoverEnd = useCallback(() => {
239459
+ events.emit({
239460
+ type: "package:hover",
239461
+ source: "repo-sprite",
239462
+ timestamp: Date.now(),
239463
+ payload: null
239464
+ });
239465
+ }, [events]);
239407
239466
  const handleEditCover = useCallback(() => {
239408
239467
  setIsEditingCover(true);
239409
239468
  }, []);
@@ -239541,6 +239600,20 @@ const CodeCityPanelContent = ({
239541
239600
  (item) => item.type === "directory" || isFileInPackage(item.path, hoveredPackagePath)
239542
239601
  )
239543
239602
  })).filter((layer) => layer.items.length > 0);
239603
+ layers.push({
239604
+ id: "hovered-package-highlight",
239605
+ name: "Hovered Package",
239606
+ enabled: true,
239607
+ color: "#3b82f6",
239608
+ // Blue highlight
239609
+ priority: 150,
239610
+ // Below selected package (200)
239611
+ items: [{
239612
+ path: hoveredPackagePath,
239613
+ type: "directory",
239614
+ renderStrategy: "border"
239615
+ }]
239616
+ });
239544
239617
  }
239545
239618
  if (gitTreeHoverLayer) layers.push(gitTreeHoverLayer);
239546
239619
  if (selectedFileLayer) layers.push(selectedFileLayer);
@@ -239565,7 +239638,7 @@ const CodeCityPanelContent = ({
239565
239638
  path: tourFilePath,
239566
239639
  commitSha
239567
239640
  };
239568
- }, [tourFilePath, context2.currentScope.repository, (_l = (_k = fileTreeSlice == null ? void 0 : fileTreeSlice.data) == null ? void 0 : _k.metadata) == null ? void 0 : _l.sourceSha]);
239641
+ }, [tourFilePath, context2.currentScope.repository, (_n = (_m = fileTreeSlice == null ? void 0 : fileTreeSlice.data) == null ? void 0 : _m.metadata) == null ? void 0 : _n.sourceSha]);
239569
239642
  return /* @__PURE__ */ jsxs(
239570
239643
  "div",
239571
239644
  {
@@ -239577,7 +239650,7 @@ const CodeCityPanelContent = ({
239577
239650
  backgroundColor: theme2.colors.background
239578
239651
  },
239579
239652
  children: [
239580
- (repositoryEntrySlice == null ? void 0 : repositoryEntrySlice.loading) ? /* @__PURE__ */ jsx(ProjectHeaderSkeleton, {}) : ((_m = repositoryEntrySlice == null ? void 0 : repositoryEntrySlice.data) == null ? void 0 : _m.github) ? /* @__PURE__ */ jsx(
239653
+ (repositoryEntrySlice == null ? void 0 : repositoryEntrySlice.loading) ? /* @__PURE__ */ jsx(ProjectHeaderSkeleton, {}) : ((_o2 = repositoryEntrySlice == null ? void 0 : repositoryEntrySlice.data) == null ? void 0 : _o2.github) ? /* @__PURE__ */ jsx(
239581
239654
  ProjectHeader,
239582
239655
  {
239583
239656
  github: repositoryEntrySlice.data.github,
@@ -239911,14 +239984,14 @@ const CodeCityPanelContent = ({
239911
239984
  fileTypes: [],
239912
239985
  gitStatus: gitSlice == null ? void 0 : gitSlice.data,
239913
239986
  panelActions: actions,
239914
- prFiles: (_n = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _n.filesByStatus,
239915
- prFileStats: (_o2 = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _o2.files,
239916
- prNumber: (_p = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _p.pullNumber,
239917
- commitFiles: (_q = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _q.filesByStatus,
239918
- commitHash: (_r = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _r.commitHash,
239919
- commitStats: (_s = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _s.stats,
239987
+ prFiles: (_p = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _p.filesByStatus,
239988
+ prFileStats: (_q = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _q.files,
239989
+ prNumber: (_r = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _r.pullNumber,
239990
+ commitFiles: (_s = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _s.filesByStatus,
239991
+ commitHash: (_t2 = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _t2.commitHash,
239992
+ commitStats: (_u = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _u.stats,
239920
239993
  fileTree: fileTreeSlice == null ? void 0 : fileTreeSlice.data,
239921
- rootPath: (_t2 = context2.currentScope.repository) == null ? void 0 : _t2.path,
239994
+ rootPath: (_v = context2.currentScope.repository) == null ? void 0 : _v.path,
239922
239995
  onGitFileClick: handleLegendFileClick,
239923
239996
  onGitNodeHover: handleGitNodeHover,
239924
239997
  onPrFileClick: handleLegendFileClick,
@@ -239974,7 +240047,10 @@ const CodeCityPanelContent = ({
239974
240047
  {
239975
240048
  github: tab2.github,
239976
240049
  fileCount: computedTreeStats == null ? void 0 : computedTreeStats.fileCount,
239977
- showHeader: false
240050
+ showHeader: false,
240051
+ workspacePackages,
240052
+ onPackageHover: handleRepoSpritePackageHover,
240053
+ onPackageHoverEnd: handleRepoSpritePackageHoverEnd
239978
240054
  }
239979
240055
  )
239980
240056
  );
@@ -240039,7 +240115,10 @@ const CodeCityPanelContent = ({
240039
240115
  {
240040
240116
  github: tab2.github,
240041
240117
  fileCount: computedTreeStats == null ? void 0 : computedTreeStats.fileCount,
240042
- showHeader: true
240118
+ showHeader: true,
240119
+ workspacePackages,
240120
+ onPackageHover: handleRepoSpritePackageHover,
240121
+ onPackageHoverEnd: handleRepoSpritePackageHoverEnd
240043
240122
  }
240044
240123
  ),
240045
240124
  tab2.id === "files" && /* @__PURE__ */ jsx(
@@ -241577,4 +241656,4 @@ export {
241577
241656
  resolveImageUrl as u,
241578
241657
  selectDistrictTool as v
241579
241658
  };
241580
- //# sourceMappingURL=index-_kq9SOpa.js.map
241659
+ //# sourceMappingURL=index-BegApVCq.js.map