@industry-theme/file-city-panel 0.4.6 → 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-BT9gD1MW.js";
2
- import "./init-Ccb5WXmw-BM96TnbG.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-8hJjkg2A.js.map
7
+ //# sourceMappingURL=browserAll-BWR83R0--BnLs3Hii.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browserAll-XNN46GKF-8hJjkg2A.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-8hJjkg2A.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-BChgL0D1.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, _u;
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);
@@ -238562,7 +238582,19 @@ const CodeCityPanelContent = ({
238562
238582
  if (!(summary == null ? void 0 : summary.isMonorepo) || !summary.workspacePackages) return void 0;
238563
238583
  return summary.workspacePackages.filter((pkg) => !!pkg.name).map((pkg) => ({ name: pkg.name }));
238564
238584
  }, [(_d = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _d.summary]);
238565
- const githubRepoString = (_e2 = context2.currentScope.repository) == null ? void 0 : _e2.githubRepo;
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;
238566
238598
  const [repoOwner, repoName] = (githubRepoString == null ? void 0 : githubRepoString.includes("/")) ? githubRepoString.split("/") : [void 0, void 0];
238567
238599
  const fileColorLayersRegistered = useRef(false);
238568
238600
  const gitLayersRegistered = useRef(false);
@@ -238570,7 +238602,7 @@ const CodeCityPanelContent = ({
238570
238602
  const commitFilesLayersRegistered = useRef(false);
238571
238603
  const agentLayersRegistered = useRef(false);
238572
238604
  const lastHasGitOrAgentLayers = useRef(null);
238573
- const currentRepoPath = (_f = context2.currentScope.repository) == null ? void 0 : _f.path;
238605
+ const currentRepoPath = (_g = context2.currentScope.repository) == null ? void 0 : _g.path;
238574
238606
  const lastRepoPath = useRef(currentRepoPath);
238575
238607
  useEffect(() => {
238576
238608
  if (lastRepoPath.current !== currentRepoPath) {
@@ -238626,7 +238658,7 @@ const CodeCityPanelContent = ({
238626
238658
  }
238627
238659
  };
238628
238660
  loadTour();
238629
- }, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, (_g = context2.currentScope.repository) == null ? void 0 : _g.path, context2.adapters]);
238661
+ }, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, (_h = context2.currentScope.repository) == null ? void 0 : _h.path, context2.adapters]);
238630
238662
  useEffect(() => {
238631
238663
  if (autoShowTour && tourData && !hasAutoShownTourRef.current) {
238632
238664
  setShowTourPlayer(true);
@@ -238898,7 +238930,7 @@ const CodeCityPanelContent = ({
238898
238930
  }
238899
238931
  }
238900
238932
  return layers;
238901
- }, [cityData, (_h = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _h.filesByStatus, prFilesVersion]);
238933
+ }, [cityData, (_i = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _i.filesByStatus, prFilesVersion]);
238902
238934
  const commitFilesLayers = useMemo(() => {
238903
238935
  var _a2;
238904
238936
  if (!cityData || !cityData.buildings || !((_a2 = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _a2.filesByStatus)) {
@@ -238976,7 +239008,7 @@ const CodeCityPanelContent = ({
238976
239008
  }
238977
239009
  }
238978
239010
  return layers;
238979
- }, [cityData, (_i = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _i.filesByStatus, commitFilesVersion]);
239011
+ }, [cityData, (_j = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _j.filesByStatus, commitFilesVersion]);
238980
239012
  const storyboardLayers = useMemo(() => {
238981
239013
  if (!cityData || !cityData.buildings || !(storyboardContextSlice == null ? void 0 : storyboardContextSlice.data)) {
238982
239014
  return [];
@@ -239077,7 +239109,7 @@ const CodeCityPanelContent = ({
239077
239109
  if (!((_a2 = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _a2.filesByStatus)) return 0;
239078
239110
  const { added, modified, removed, renamed } = prFilesSlice.data.filesByStatus;
239079
239111
  return added.length + modified.length + removed.length + renamed.length;
239080
- }, [(_j = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _j.filesByStatus]);
239112
+ }, [(_k = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _k.filesByStatus]);
239081
239113
  const legendAgentLayers = useMemo(() => {
239082
239114
  const agentLayers = highlightLayers.filter(
239083
239115
  (layer) => layer.id.startsWith("event-highlight")
@@ -239346,7 +239378,7 @@ const CodeCityPanelContent = ({
239346
239378
  } finally {
239347
239379
  setLoading(false);
239348
239380
  }
239349
- }, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, fileTreeSlice == null ? void 0 : fileTreeSlice.loading, (_k = context2.currentScope.repository) == null ? void 0 : _k.path]);
239381
+ }, [fileTreeSlice == null ? void 0 : fileTreeSlice.data, fileTreeSlice == null ? void 0 : fileTreeSlice.loading, (_l = context2.currentScope.repository) == null ? void 0 : _l.path]);
239350
239382
  const handleFileClick = useCallback(
239351
239383
  (filePath, type2) => {
239352
239384
  if (type2 === "file") {
@@ -239411,6 +239443,26 @@ const CodeCityPanelContent = ({
239411
239443
  });
239412
239444
  setIsEditingCover(false);
239413
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]);
239414
239466
  const handleEditCover = useCallback(() => {
239415
239467
  setIsEditingCover(true);
239416
239468
  }, []);
@@ -239548,6 +239600,20 @@ const CodeCityPanelContent = ({
239548
239600
  (item) => item.type === "directory" || isFileInPackage(item.path, hoveredPackagePath)
239549
239601
  )
239550
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
+ });
239551
239617
  }
239552
239618
  if (gitTreeHoverLayer) layers.push(gitTreeHoverLayer);
239553
239619
  if (selectedFileLayer) layers.push(selectedFileLayer);
@@ -239572,7 +239638,7 @@ const CodeCityPanelContent = ({
239572
239638
  path: tourFilePath,
239573
239639
  commitSha
239574
239640
  };
239575
- }, [tourFilePath, context2.currentScope.repository, (_m = (_l = fileTreeSlice == null ? void 0 : fileTreeSlice.data) == null ? void 0 : _l.metadata) == null ? void 0 : _m.sourceSha]);
239641
+ }, [tourFilePath, context2.currentScope.repository, (_n = (_m = fileTreeSlice == null ? void 0 : fileTreeSlice.data) == null ? void 0 : _m.metadata) == null ? void 0 : _n.sourceSha]);
239576
239642
  return /* @__PURE__ */ jsxs(
239577
239643
  "div",
239578
239644
  {
@@ -239584,7 +239650,7 @@ const CodeCityPanelContent = ({
239584
239650
  backgroundColor: theme2.colors.background
239585
239651
  },
239586
239652
  children: [
239587
- (repositoryEntrySlice == null ? void 0 : repositoryEntrySlice.loading) ? /* @__PURE__ */ jsx(ProjectHeaderSkeleton, {}) : ((_n = repositoryEntrySlice == null ? void 0 : repositoryEntrySlice.data) == null ? void 0 : _n.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(
239588
239654
  ProjectHeader,
239589
239655
  {
239590
239656
  github: repositoryEntrySlice.data.github,
@@ -239918,14 +239984,14 @@ const CodeCityPanelContent = ({
239918
239984
  fileTypes: [],
239919
239985
  gitStatus: gitSlice == null ? void 0 : gitSlice.data,
239920
239986
  panelActions: actions,
239921
- prFiles: (_o2 = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _o2.filesByStatus,
239922
- prFileStats: (_p = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _p.files,
239923
- prNumber: (_q = prFilesSlice == null ? void 0 : prFilesSlice.data) == null ? void 0 : _q.pullNumber,
239924
- commitFiles: (_r = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _r.filesByStatus,
239925
- commitHash: (_s = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _s.commitHash,
239926
- commitStats: (_t2 = commitFilesSlice == null ? void 0 : commitFilesSlice.data) == null ? void 0 : _t2.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,
239927
239993
  fileTree: fileTreeSlice == null ? void 0 : fileTreeSlice.data,
239928
- rootPath: (_u = context2.currentScope.repository) == null ? void 0 : _u.path,
239994
+ rootPath: (_v = context2.currentScope.repository) == null ? void 0 : _v.path,
239929
239995
  onGitFileClick: handleLegendFileClick,
239930
239996
  onGitNodeHover: handleGitNodeHover,
239931
239997
  onPrFileClick: handleLegendFileClick,
@@ -239982,7 +240048,9 @@ const CodeCityPanelContent = ({
239982
240048
  github: tab2.github,
239983
240049
  fileCount: computedTreeStats == null ? void 0 : computedTreeStats.fileCount,
239984
240050
  showHeader: false,
239985
- workspacePackages
240051
+ workspacePackages,
240052
+ onPackageHover: handleRepoSpritePackageHover,
240053
+ onPackageHoverEnd: handleRepoSpritePackageHoverEnd
239986
240054
  }
239987
240055
  )
239988
240056
  );
@@ -240048,7 +240116,9 @@ const CodeCityPanelContent = ({
240048
240116
  github: tab2.github,
240049
240117
  fileCount: computedTreeStats == null ? void 0 : computedTreeStats.fileCount,
240050
240118
  showHeader: true,
240051
- workspacePackages
240119
+ workspacePackages,
240120
+ onPackageHover: handleRepoSpritePackageHover,
240121
+ onPackageHoverEnd: handleRepoSpritePackageHoverEnd
240052
240122
  }
240053
240123
  ),
240054
240124
  tab2.id === "files" && /* @__PURE__ */ jsx(
@@ -241586,4 +241656,4 @@ export {
241586
241656
  resolveImageUrl as u,
241587
241657
  selectDistrictTool as v
241588
241658
  };
241589
- //# sourceMappingURL=index-BT9gD1MW.js.map
241659
+ //# sourceMappingURL=index-BegApVCq.js.map