@principal-ade/dynamic-file-tree 0.2.3 → 0.2.4

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.
package/dist/index.mjs CHANGED
@@ -1951,7 +1951,7 @@ var MultiFileTree = ({
1951
1951
  }, "Selected: ", selectedFile.source.name, " / ", selectedFile.path));
1952
1952
  };
1953
1953
  // src/components/StoryboardWorkflowsTree/StoryboardWorkflowsTreeCore.tsx
1954
- import { Package, FolderKanban, LayoutDashboard, Workflow, BookOpen, FolderOpen, GitCommit, CircleDot, Circle } from "lucide-react";
1954
+ import { Package, FolderKanban, LayoutDashboard, Workflow, BookOpen, FolderOpen, GitCommit, ExternalLink } from "lucide-react";
1955
1955
  import React13, { useMemo as useMemo9, useRef as useRef5, useState as useState7, useEffect as useEffect3 } from "react";
1956
1956
  import { Tree as Tree3 } from "react-arborist";
1957
1957
 
@@ -2262,6 +2262,11 @@ var buildTreeDataFromStoryboards = (storyboards, workflowCoverageMap, traceWorkf
2262
2262
  };
2263
2263
  var buildTreeDataFromVersions = (versionSnapshots, workflowCoverageMap, filterMode, traceWorkflowsSet, gitStatusMap, scenarioStatusMap, canvasNodeStatusMap) => {
2264
2264
  const result = [];
2265
+ const repoCountMap = new Map;
2266
+ for (const snapshot of versionSnapshots) {
2267
+ const count = repoCountMap.get(snapshot.repositoryUrl) || 0;
2268
+ repoCountMap.set(snapshot.repositoryUrl, count + 1);
2269
+ }
2265
2270
  for (const snapshot of versionSnapshots) {
2266
2271
  const versionKey = `${snapshot.repositoryUrl}@${snapshot.commitSha}`;
2267
2272
  const versionHasTracedWorkflows = snapshot.storyboards.some((storyboard) => storyboard.workflows.some((workflow) => traceWorkflowsSet?.has(workflow.id) ?? false));
@@ -2278,9 +2283,10 @@ var buildTreeDataFromVersions = (versionSnapshots, workflowCoverageMap, filterMo
2278
2283
  }
2279
2284
  const repoName = snapshot.repositoryUrl.replace("https://github.com/", "");
2280
2285
  const shortSha = snapshot.commitSha.substring(0, 8);
2286
+ const hasMultipleVersions = (repoCountMap.get(snapshot.repositoryUrl) || 0) > 1;
2281
2287
  result.push({
2282
2288
  id: `version:${versionKey}`,
2283
- name: `${repoName}@${shortSha}`,
2289
+ name: hasMultipleVersions ? `${repoName}@${shortSha}` : repoName,
2284
2290
  type: "version",
2285
2291
  versionSnapshot: snapshot,
2286
2292
  repositoryUrl: snapshot.repositoryUrl,
@@ -2425,7 +2431,8 @@ var StoryboardWorkflowsTreeCore = ({
2425
2431
  getDragConfig,
2426
2432
  scenarioStatusMap,
2427
2433
  canvasNodeStatusMap,
2428
- statusBarDisplay = "both"
2434
+ statusBarDisplay = "both",
2435
+ onVersionOpen
2429
2436
  }) => {
2430
2437
  const dndProps = getDndProps(enableDragAndDrop);
2431
2438
  const parentDndManager = useParentDndManager();
@@ -2552,16 +2559,37 @@ var StoryboardWorkflowsTreeCore = ({
2552
2559
  }, gitDisplay.icon));
2553
2560
  }
2554
2561
  }
2555
- if (data.type === "version" && data.hasTraces !== undefined) {
2556
- indicators.push(data.hasTraces ? /* @__PURE__ */ React13.createElement(CircleDot, {
2557
- key: "traces",
2558
- size: 14,
2559
- style: { color: "#10b981", marginLeft: "6px" }
2560
- }) : /* @__PURE__ */ React13.createElement(Circle, {
2561
- key: "traces",
2562
- size: 14,
2563
- style: { color: theme.colors.textMuted, marginLeft: "6px" }
2564
- }));
2562
+ if (data.type === "version" && data.versionSnapshot && onVersionOpen) {
2563
+ indicators.push(/* @__PURE__ */ React13.createElement("button", {
2564
+ key: "open",
2565
+ onClick: (e) => {
2566
+ e.stopPropagation();
2567
+ onVersionOpen(data.versionSnapshot);
2568
+ },
2569
+ style: {
2570
+ display: "flex",
2571
+ alignItems: "center",
2572
+ justifyContent: "center",
2573
+ marginLeft: "6px",
2574
+ padding: "2px",
2575
+ background: "transparent",
2576
+ border: "none",
2577
+ cursor: "pointer",
2578
+ color: theme.colors.textMuted,
2579
+ borderRadius: "4px"
2580
+ },
2581
+ onMouseEnter: (e) => {
2582
+ e.currentTarget.style.color = theme.colors.text;
2583
+ e.currentTarget.style.background = theme.colors.backgroundHover || "rgba(255,255,255,0.1)";
2584
+ },
2585
+ onMouseLeave: (e) => {
2586
+ e.currentTarget.style.color = theme.colors.textMuted;
2587
+ e.currentTarget.style.background = "transparent";
2588
+ },
2589
+ title: "Open version"
2590
+ }, /* @__PURE__ */ React13.createElement(ExternalLink, {
2591
+ size: 14
2592
+ })));
2565
2593
  }
2566
2594
  return indicators.length > 0 ? /* @__PURE__ */ React13.createElement("div", {
2567
2595
  style: { display: "flex", alignItems: "center" }
@@ -3370,8 +3398,8 @@ var RepositoryTreeCore = ({
3370
3398
  // src/components/TelemetryCoverageFileTree.tsx
3371
3399
  import {
3372
3400
  Activity,
3373
- CircleDot as CircleDot2,
3374
- Circle as Circle2,
3401
+ CircleDot,
3402
+ Circle,
3375
3403
  TestTube
3376
3404
  } from "lucide-react";
3377
3405
  import React17, { useMemo as useMemo13, useRef as useRef7 } from "react";
@@ -3402,7 +3430,7 @@ var getCoverageStatusDisplay = (coverage, _theme) => {
3402
3430
  };
3403
3431
  case "partial":
3404
3432
  return {
3405
- icon: /* @__PURE__ */ React17.createElement(CircleDot2, {
3433
+ icon: /* @__PURE__ */ React17.createElement(CircleDot, {
3406
3434
  size: 14
3407
3435
  }),
3408
3436
  color: "#eab308",
@@ -3411,7 +3439,7 @@ var getCoverageStatusDisplay = (coverage, _theme) => {
3411
3439
  };
3412
3440
  case "none":
3413
3441
  return {
3414
- icon: /* @__PURE__ */ React17.createElement(Circle2, {
3442
+ icon: /* @__PURE__ */ React17.createElement(Circle, {
3415
3443
  size: 14
3416
3444
  }),
3417
3445
  color: "#6b7280",
@@ -3563,7 +3591,7 @@ var TelemetryCoverageFileTree = ({
3563
3591
  opacity: 0.5
3564
3592
  },
3565
3593
  title: "No telemetry instrumentation"
3566
- }, /* @__PURE__ */ React17.createElement(Circle2, {
3594
+ }, /* @__PURE__ */ React17.createElement(Circle, {
3567
3595
  size: 14
3568
3596
  })) : null;
3569
3597
  return /* @__PURE__ */ React17.createElement(TreeNode, {
@@ -1 +1 @@
1
- {"version":3,"file":"StoryboardWorkflowsTreeCore.d.ts","sourceRoot":"","sources":["../../../../src/components/StoryboardWorkflowsTree/StoryboardWorkflowsTreeCore.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+C,MAAM,OAAO,CAAC;AASpE,OAAO,KAAK,EAEV,4BAA4B,EAO7B,MAAM,SAAS,CAAC;AAwYjB,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAoW9E,CAAC"}
1
+ {"version":3,"file":"StoryboardWorkflowsTreeCore.d.ts","sourceRoot":"","sources":["../../../../src/components/StoryboardWorkflowsTree/StoryboardWorkflowsTreeCore.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+C,MAAM,OAAO,CAAC;AASpE,OAAO,KAAK,EAEV,4BAA4B,EAO7B,MAAM,SAAS,CAAC;AAgZjB,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CA6X9E,CAAC"}
@@ -112,5 +112,10 @@ export interface StoryboardWorkflowsTreeProps {
112
112
  * Return undefined to disable dragging for a specific node.
113
113
  */
114
114
  getDragConfig?: (node: StoryboardWorkflowNodeData) => DragConfig | undefined;
115
+ /**
116
+ * Callback fired when the open button is clicked on a version node.
117
+ * @param versionSnapshot - The version snapshot data for the clicked node
118
+ */
119
+ onVersionOpen?: (versionSnapshot: VersionSnapshot) => void;
115
120
  }
116
121
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/StoryboardWorkflowsTree/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,eA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A6F;IAC7F,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACvD,4FAA4F;IAC5F,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAGpC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,0BAA0B,KAAK,UAAU,GAAG,SAAS,CAAC;IAE7E;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,eAAe,EAAE,eAAe,KAAK,IAAI,CAAC;CAC5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principal-ade/dynamic-file-tree",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "React component for selective directory filtering and file tree visualization",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",