@principal-ade/dynamic-file-tree 0.1.29 → 0.1.31
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.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +499 -10
- package/dist/src/components/DynamicFileTree.d.ts +1 -0
- package/dist/src/components/DynamicFileTree.d.ts.map +1 -1
- package/dist/src/components/FileTreeContainer.d.ts +2 -0
- package/dist/src/components/FileTreeContainer.d.ts.map +1 -1
- package/dist/src/components/GitStatusFileTree.d.ts +1 -0
- package/dist/src/components/GitStatusFileTree.d.ts.map +1 -1
- package/dist/src/components/GitStatusFileTreeContainer.d.ts +2 -0
- package/dist/src/components/GitStatusFileTreeContainer.d.ts.map +1 -1
- package/dist/src/components/MultiFileTree/MultiFileTree.d.ts.map +1 -1
- package/dist/src/components/MultiFileTree/MultiFileTreeCore.d.ts.map +1 -1
- package/dist/src/components/MultiFileTree/types.d.ts +2 -0
- package/dist/src/components/MultiFileTree/types.d.ts.map +1 -1
- package/dist/src/components/TelemetryCoverageFileTree.d.ts +67 -0
- package/dist/src/components/TelemetryCoverageFileTree.d.ts.map +1 -0
- package/dist/src/components/TelemetryCoverageFileTree.stories.d.ts +22 -0
- package/dist/src/components/TelemetryCoverageFileTree.stories.d.ts.map +1 -0
- package/dist/src/components/TelemetryCoverageFileTreeContainer.d.ts +26 -0
- package/dist/src/components/TelemetryCoverageFileTreeContainer.d.ts.map +1 -0
- package/dist/src/components/TreeNode.d.ts +2 -1
- package/dist/src/components/TreeNode.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export { GitStatusFileTreeContainer } from './src/components/GitStatusFileTreeCo
|
|
|
17
17
|
export type { GitStatusFileTreeContainerProps } from './src/components/GitStatusFileTreeContainer';
|
|
18
18
|
export { MultiFileTree, MultiFileTreeCore } from './src/components/MultiFileTree';
|
|
19
19
|
export type { MultiFileTreeProps, MultiFileTreeCoreProps } from './src/components/MultiFileTree';
|
|
20
|
+
export { TelemetryCoverageFileTree, calculateTelemetryCoverageStats, } from './src/components/TelemetryCoverageFileTree';
|
|
21
|
+
export type { TelemetryCoverageFileTreeProps, FileTelemetryCoverage, TelemetryCoverageStatus, } from './src/components/TelemetryCoverageFileTree';
|
|
22
|
+
export { TelemetryCoverageFileTreeContainer } from './src/components/TelemetryCoverageFileTreeContainer';
|
|
23
|
+
export type { TelemetryCoverageFileTreeContainerProps } from './src/components/TelemetryCoverageFileTreeContainer';
|
|
20
24
|
export { combineRepositoryTrees, filterFileTreeByPaths, parseUnifiedPath, updateTreePaths, extractNameFromPath, } from './src/utils/multiTree';
|
|
21
25
|
export type { CombineTreesOptions, ParsedPath } from './src/utils/multiTree';
|
|
22
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,YAAY,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAGxG,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG7E,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAG7E,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAGhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,YAAY,E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EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAGhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,YAAY,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAGnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,YAAY,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAGjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,YAAY,EACV,sBAAsB,EACtB,aAAa,EACb,SAAS,EACV,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,YAAY,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAGnG,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAClF,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAGjG,OAAO,EACL,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,4CAA4C,CAAC;AACpD,YAAY,EACV,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,kCAAkC,EAAE,MAAM,qDAAqD,CAAC;AACzG,YAAY,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAGnH,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -255,6 +255,7 @@ function TreeNode({
|
|
|
255
255
|
isSelectedDirectory = false,
|
|
256
256
|
nameColor,
|
|
257
257
|
horizontalNodePadding = "8px",
|
|
258
|
+
verticalNodePadding = "3px",
|
|
258
259
|
onContextMenu
|
|
259
260
|
}) {
|
|
260
261
|
const [isHovered, setIsHovered] = useState3(false);
|
|
@@ -280,8 +281,8 @@ function TreeNode({
|
|
|
280
281
|
cursor: "pointer",
|
|
281
282
|
paddingLeft: `calc(${horizontalNodePadding} + ${node.level * 16}px)`,
|
|
282
283
|
paddingRight: horizontalNodePadding,
|
|
283
|
-
paddingTop:
|
|
284
|
-
paddingBottom:
|
|
284
|
+
paddingTop: verticalNodePadding,
|
|
285
|
+
paddingBottom: verticalNodePadding,
|
|
285
286
|
display: "flex",
|
|
286
287
|
alignItems: "center",
|
|
287
288
|
justifyContent: "space-between",
|
|
@@ -388,6 +389,7 @@ var DynamicFileTree = ({
|
|
|
388
389
|
initialOpenState,
|
|
389
390
|
defaultOpen = false,
|
|
390
391
|
horizontalNodePadding,
|
|
392
|
+
verticalNodePadding,
|
|
391
393
|
onContextMenu,
|
|
392
394
|
initialHeight = 600,
|
|
393
395
|
autoHeight = false
|
|
@@ -404,6 +406,7 @@ var DynamicFileTree = ({
|
|
|
404
406
|
theme,
|
|
405
407
|
isSelectedDirectory: isSelectedOrChild,
|
|
406
408
|
horizontalNodePadding,
|
|
409
|
+
verticalNodePadding,
|
|
407
410
|
onContextMenu: (e, node) => {
|
|
408
411
|
if (onContextMenu) {
|
|
409
412
|
onContextMenu(e, node.data.id, !!node.data.children);
|
|
@@ -934,7 +937,9 @@ var FileTreeContainer = ({
|
|
|
934
937
|
theme,
|
|
935
938
|
selectedFile,
|
|
936
939
|
onFileSelect,
|
|
937
|
-
onContextMenu
|
|
940
|
+
onContextMenu,
|
|
941
|
+
horizontalNodePadding,
|
|
942
|
+
verticalNodePadding
|
|
938
943
|
}) => {
|
|
939
944
|
const [filters, setFilters] = useState4([]);
|
|
940
945
|
const selectedDirectories = useMemo4(() => {
|
|
@@ -955,7 +960,9 @@ var FileTreeContainer = ({
|
|
|
955
960
|
selectedDirectories,
|
|
956
961
|
selectedFile,
|
|
957
962
|
onFileSelect,
|
|
958
|
-
onContextMenu
|
|
963
|
+
onContextMenu,
|
|
964
|
+
horizontalNodePadding,
|
|
965
|
+
verticalNodePadding
|
|
959
966
|
})));
|
|
960
967
|
};
|
|
961
968
|
// src/components/GitStatusFileTree.tsx
|
|
@@ -1112,6 +1119,7 @@ var GitStatusFileTree = ({
|
|
|
1112
1119
|
showUnchangedFiles = true,
|
|
1113
1120
|
transparentBackground = false,
|
|
1114
1121
|
horizontalNodePadding,
|
|
1122
|
+
verticalNodePadding,
|
|
1115
1123
|
onContextMenu,
|
|
1116
1124
|
openByDefault,
|
|
1117
1125
|
initialHeight = 600,
|
|
@@ -1158,6 +1166,7 @@ var GitStatusFileTree = ({
|
|
|
1158
1166
|
rightContent,
|
|
1159
1167
|
nameColor,
|
|
1160
1168
|
horizontalNodePadding,
|
|
1169
|
+
verticalNodePadding,
|
|
1161
1170
|
onContextMenu: (e, node2) => {
|
|
1162
1171
|
if (onContextMenu) {
|
|
1163
1172
|
onContextMenu(e, node2.data.id, !!node2.data.children);
|
|
@@ -1249,7 +1258,9 @@ var GitStatusFileTreeContainer = ({
|
|
|
1249
1258
|
showControls = true,
|
|
1250
1259
|
onContextMenu,
|
|
1251
1260
|
initialHeight,
|
|
1252
|
-
autoHeight
|
|
1261
|
+
autoHeight,
|
|
1262
|
+
horizontalNodePadding,
|
|
1263
|
+
verticalNodePadding
|
|
1253
1264
|
}) => {
|
|
1254
1265
|
const [filters, setFilters] = useState5([]);
|
|
1255
1266
|
const [showUnchangedFiles, setShowUnchangedFiles] = useState5(true);
|
|
@@ -1378,7 +1389,9 @@ var GitStatusFileTreeContainer = ({
|
|
|
1378
1389
|
showUnchangedFiles,
|
|
1379
1390
|
onContextMenu,
|
|
1380
1391
|
initialHeight,
|
|
1381
|
-
autoHeight
|
|
1392
|
+
autoHeight,
|
|
1393
|
+
horizontalNodePadding,
|
|
1394
|
+
verticalNodePadding
|
|
1382
1395
|
})));
|
|
1383
1396
|
};
|
|
1384
1397
|
// src/components/MultiFileTree/MultiFileTree.tsx
|
|
@@ -1600,7 +1613,8 @@ var MultiFileTreeCore = ({
|
|
|
1600
1613
|
onFileSelect,
|
|
1601
1614
|
initialOpenState,
|
|
1602
1615
|
defaultOpen = false,
|
|
1603
|
-
horizontalNodePadding
|
|
1616
|
+
horizontalNodePadding,
|
|
1617
|
+
verticalNodePadding
|
|
1604
1618
|
}) => {
|
|
1605
1619
|
const unifiedTree = useMemo7(() => {
|
|
1606
1620
|
return combineRepositoryTrees(sources);
|
|
@@ -1628,7 +1642,8 @@ var MultiFileTreeCore = ({
|
|
|
1628
1642
|
onFileSelect: handleFileSelect,
|
|
1629
1643
|
initialOpenState,
|
|
1630
1644
|
defaultOpen,
|
|
1631
|
-
horizontalNodePadding
|
|
1645
|
+
horizontalNodePadding,
|
|
1646
|
+
verticalNodePadding
|
|
1632
1647
|
});
|
|
1633
1648
|
};
|
|
1634
1649
|
|
|
@@ -1646,7 +1661,8 @@ var MultiFileTree = ({
|
|
|
1646
1661
|
onFileSelect,
|
|
1647
1662
|
initialOpenState,
|
|
1648
1663
|
defaultOpen = false,
|
|
1649
|
-
horizontalNodePadding
|
|
1664
|
+
horizontalNodePadding,
|
|
1665
|
+
verticalNodePadding
|
|
1650
1666
|
}) => {
|
|
1651
1667
|
const [selectedFile, setSelectedFile] = useState6(null);
|
|
1652
1668
|
const [viewMode, setViewMode] = useState6(initialViewMode);
|
|
@@ -1792,7 +1808,8 @@ var MultiFileTree = ({
|
|
|
1792
1808
|
onFileSelect: handleFileSelect,
|
|
1793
1809
|
initialOpenState,
|
|
1794
1810
|
defaultOpen,
|
|
1795
|
-
horizontalNodePadding
|
|
1811
|
+
horizontalNodePadding,
|
|
1812
|
+
verticalNodePadding
|
|
1796
1813
|
}))), showSelectedFileIndicator && selectedFile && /* @__PURE__ */ React10.createElement("div", {
|
|
1797
1814
|
style: {
|
|
1798
1815
|
padding: "12px 16px",
|
|
@@ -1804,6 +1821,475 @@ var MultiFileTree = ({
|
|
|
1804
1821
|
}
|
|
1805
1822
|
}, "Selected: ", selectedFile.source.name, " / ", selectedFile.path));
|
|
1806
1823
|
};
|
|
1824
|
+
// src/components/TelemetryCoverageFileTree.tsx
|
|
1825
|
+
import {
|
|
1826
|
+
Activity,
|
|
1827
|
+
CircleDot,
|
|
1828
|
+
Circle,
|
|
1829
|
+
TestTube
|
|
1830
|
+
} from "lucide-react";
|
|
1831
|
+
import React11, { useMemo as useMemo9 } from "react";
|
|
1832
|
+
import { Tree as Tree3 } from "react-arborist";
|
|
1833
|
+
var TelemetryCoverageContext = React11.createContext(null);
|
|
1834
|
+
var DEFAULT_TEST_PATTERNS = [
|
|
1835
|
+
/\.test\.[jt]sx?$/,
|
|
1836
|
+
/\.spec\.[jt]sx?$/,
|
|
1837
|
+
/\.tests\.[jt]sx?$/,
|
|
1838
|
+
/\.specs\.[jt]sx?$/,
|
|
1839
|
+
/__tests__\/.*\.[jt]sx?$/
|
|
1840
|
+
];
|
|
1841
|
+
var isTestFile = (filename, patterns) => {
|
|
1842
|
+
return patterns.some((pattern) => pattern.test(filename));
|
|
1843
|
+
};
|
|
1844
|
+
var getCoverageStatusDisplay = (coverage, _theme) => {
|
|
1845
|
+
const { status, tracedTestCount, totalTestCount } = coverage;
|
|
1846
|
+
const percentage = totalTestCount > 0 ? Math.round(tracedTestCount / totalTestCount * 100) : 0;
|
|
1847
|
+
switch (status) {
|
|
1848
|
+
case "covered":
|
|
1849
|
+
return {
|
|
1850
|
+
icon: /* @__PURE__ */ React11.createElement(Activity, {
|
|
1851
|
+
size: 14
|
|
1852
|
+
}),
|
|
1853
|
+
color: "#22c55e",
|
|
1854
|
+
label: `${tracedTestCount}/${totalTestCount} tests traced (${percentage}%)`,
|
|
1855
|
+
badge: `${percentage}%`
|
|
1856
|
+
};
|
|
1857
|
+
case "partial":
|
|
1858
|
+
return {
|
|
1859
|
+
icon: /* @__PURE__ */ React11.createElement(CircleDot, {
|
|
1860
|
+
size: 14
|
|
1861
|
+
}),
|
|
1862
|
+
color: "#eab308",
|
|
1863
|
+
label: `${tracedTestCount}/${totalTestCount} tests traced (${percentage}%)`,
|
|
1864
|
+
badge: `${tracedTestCount}/${totalTestCount}`
|
|
1865
|
+
};
|
|
1866
|
+
case "none":
|
|
1867
|
+
return {
|
|
1868
|
+
icon: /* @__PURE__ */ React11.createElement(Circle, {
|
|
1869
|
+
size: 14
|
|
1870
|
+
}),
|
|
1871
|
+
color: "#6b7280",
|
|
1872
|
+
label: `No tests traced (0/${totalTestCount})`,
|
|
1873
|
+
badge: "0%"
|
|
1874
|
+
};
|
|
1875
|
+
}
|
|
1876
|
+
};
|
|
1877
|
+
var sortNodes2 = (a, b) => {
|
|
1878
|
+
const aIsDir = !!a.children;
|
|
1879
|
+
const bIsDir = !!b.children;
|
|
1880
|
+
if (aIsDir && !bIsDir)
|
|
1881
|
+
return -1;
|
|
1882
|
+
if (!aIsDir && bIsDir)
|
|
1883
|
+
return 1;
|
|
1884
|
+
return a.name.localeCompare(b.name, undefined, { sensitivity: "base" });
|
|
1885
|
+
};
|
|
1886
|
+
var transformTreeStructure2 = (fileTree, showOnlyTestFiles, testPatterns) => {
|
|
1887
|
+
const transformNode = (node, parentId) => {
|
|
1888
|
+
const id = parentId ? `${parentId}/${node.name}` : node.name;
|
|
1889
|
+
if ("children" in node && node.children) {
|
|
1890
|
+
const children = node.children.map((child) => transformNode(child, id)).filter((n) => n !== null).sort(sortNodes2);
|
|
1891
|
+
if (showOnlyTestFiles && children.length === 0) {
|
|
1892
|
+
return null;
|
|
1893
|
+
}
|
|
1894
|
+
return {
|
|
1895
|
+
id,
|
|
1896
|
+
name: node.name,
|
|
1897
|
+
children
|
|
1898
|
+
};
|
|
1899
|
+
} else {
|
|
1900
|
+
const isTest = isTestFile(id, testPatterns);
|
|
1901
|
+
if (showOnlyTestFiles && !isTest) {
|
|
1902
|
+
return null;
|
|
1903
|
+
}
|
|
1904
|
+
return {
|
|
1905
|
+
id,
|
|
1906
|
+
name: node.name,
|
|
1907
|
+
isTestFile: isTest
|
|
1908
|
+
};
|
|
1909
|
+
}
|
|
1910
|
+
};
|
|
1911
|
+
return fileTree.root.children.map((node) => transformNode(node, "")).filter((n) => n !== null).sort(sortNodes2);
|
|
1912
|
+
};
|
|
1913
|
+
var filterCoveredNodes = (nodes, coverageMap) => {
|
|
1914
|
+
const result = [];
|
|
1915
|
+
const hasCoverage = (node) => {
|
|
1916
|
+
if (coverageMap.has(node.id))
|
|
1917
|
+
return true;
|
|
1918
|
+
if (node.children) {
|
|
1919
|
+
return node.children.some((child) => hasCoverage(child));
|
|
1920
|
+
}
|
|
1921
|
+
return false;
|
|
1922
|
+
};
|
|
1923
|
+
for (const node of nodes) {
|
|
1924
|
+
if (node.children) {
|
|
1925
|
+
if (hasCoverage(node)) {
|
|
1926
|
+
const filteredChildren = filterCoveredNodes(node.children, coverageMap);
|
|
1927
|
+
result.push({ ...node, children: filteredChildren });
|
|
1928
|
+
}
|
|
1929
|
+
} else {
|
|
1930
|
+
if (coverageMap.has(node.id)) {
|
|
1931
|
+
result.push(node);
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
return result;
|
|
1936
|
+
};
|
|
1937
|
+
var countVisibleNodes3 = (nodes, openByDefault) => {
|
|
1938
|
+
let count = 0;
|
|
1939
|
+
const countNode = (node) => {
|
|
1940
|
+
count++;
|
|
1941
|
+
if (node.children && node.children.length > 0 && openByDefault) {
|
|
1942
|
+
node.children.forEach(countNode);
|
|
1943
|
+
}
|
|
1944
|
+
};
|
|
1945
|
+
nodes.forEach(countNode);
|
|
1946
|
+
return count;
|
|
1947
|
+
};
|
|
1948
|
+
var TelemetryCoverageFileTree = ({
|
|
1949
|
+
fileTree,
|
|
1950
|
+
theme,
|
|
1951
|
+
coverageData,
|
|
1952
|
+
selectedDirectories: _selectedDirectories = [],
|
|
1953
|
+
selectedFile,
|
|
1954
|
+
onDirectorySelect,
|
|
1955
|
+
onFileSelect,
|
|
1956
|
+
showOnlyTestFiles = true,
|
|
1957
|
+
showUncoveredFiles = true,
|
|
1958
|
+
transparentBackground = false,
|
|
1959
|
+
horizontalNodePadding,
|
|
1960
|
+
verticalNodePadding,
|
|
1961
|
+
onContextMenu,
|
|
1962
|
+
openByDefault = true,
|
|
1963
|
+
initialHeight = 600,
|
|
1964
|
+
autoHeight = false,
|
|
1965
|
+
testFilePatterns = DEFAULT_TEST_PATTERNS
|
|
1966
|
+
}) => {
|
|
1967
|
+
const coverageMap = useMemo9(() => {
|
|
1968
|
+
const map = new Map;
|
|
1969
|
+
coverageData.forEach((item) => {
|
|
1970
|
+
map.set(item.filePath, item);
|
|
1971
|
+
});
|
|
1972
|
+
return map;
|
|
1973
|
+
}, [coverageData]);
|
|
1974
|
+
const NodeRenderer = (props) => {
|
|
1975
|
+
const { node } = props;
|
|
1976
|
+
const ctx = React11.useContext(TelemetryCoverageContext);
|
|
1977
|
+
const coverage = ctx?.coverageMap.get(node.data.id);
|
|
1978
|
+
const hasTracedChildren = ctx?.hasTracedChildrenMap.get(node.data.id);
|
|
1979
|
+
const coverageDisplay = coverage ? getCoverageStatusDisplay(coverage, theme) : null;
|
|
1980
|
+
let nameColor;
|
|
1981
|
+
if (coverageDisplay) {
|
|
1982
|
+
nameColor = coverageDisplay.color;
|
|
1983
|
+
} else if (hasTracedChildren) {
|
|
1984
|
+
nameColor = "#22c55e80";
|
|
1985
|
+
} else if (node.data.isTestFile) {
|
|
1986
|
+
nameColor = "#6b728080";
|
|
1987
|
+
}
|
|
1988
|
+
const leftIcon = node.data.isTestFile && !coverage ? /* @__PURE__ */ React11.createElement(TestTube, {
|
|
1989
|
+
size: 14,
|
|
1990
|
+
style: { marginRight: 4, color: "#6b7280" }
|
|
1991
|
+
}) : null;
|
|
1992
|
+
const rightContent = coverageDisplay ? /* @__PURE__ */ React11.createElement("div", {
|
|
1993
|
+
style: {
|
|
1994
|
+
display: "flex",
|
|
1995
|
+
alignItems: "center",
|
|
1996
|
+
color: coverageDisplay.color,
|
|
1997
|
+
marginRight: "8px"
|
|
1998
|
+
},
|
|
1999
|
+
title: coverageDisplay.label
|
|
2000
|
+
}, coverageDisplay.icon, /* @__PURE__ */ React11.createElement("span", {
|
|
2001
|
+
style: {
|
|
2002
|
+
marginLeft: "4px",
|
|
2003
|
+
fontSize: "11px",
|
|
2004
|
+
fontWeight: "bold",
|
|
2005
|
+
fontFamily: "monospace"
|
|
2006
|
+
}
|
|
2007
|
+
}, coverageDisplay.badge)) : node.data.isTestFile ? /* @__PURE__ */ React11.createElement("div", {
|
|
2008
|
+
style: {
|
|
2009
|
+
display: "flex",
|
|
2010
|
+
alignItems: "center",
|
|
2011
|
+
color: "#6b7280",
|
|
2012
|
+
marginRight: "8px",
|
|
2013
|
+
opacity: 0.5
|
|
2014
|
+
},
|
|
2015
|
+
title: "No telemetry instrumentation"
|
|
2016
|
+
}, /* @__PURE__ */ React11.createElement(Circle, {
|
|
2017
|
+
size: 14
|
|
2018
|
+
})) : null;
|
|
2019
|
+
return /* @__PURE__ */ React11.createElement(TreeNode, {
|
|
2020
|
+
...props,
|
|
2021
|
+
theme,
|
|
2022
|
+
rightContent,
|
|
2023
|
+
extraContent: leftIcon,
|
|
2024
|
+
nameColor,
|
|
2025
|
+
horizontalNodePadding,
|
|
2026
|
+
verticalNodePadding,
|
|
2027
|
+
onContextMenu: (e, node2) => {
|
|
2028
|
+
if (onContextMenu) {
|
|
2029
|
+
onContextMenu(e, node2.data.id, !!node2.data.children);
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
});
|
|
2033
|
+
};
|
|
2034
|
+
const treeStructure = useMemo9(() => {
|
|
2035
|
+
return transformTreeStructure2(fileTree, showOnlyTestFiles, testFilePatterns);
|
|
2036
|
+
}, [fileTree, showOnlyTestFiles, testFilePatterns]);
|
|
2037
|
+
const treeData = useMemo9(() => {
|
|
2038
|
+
if (showUncoveredFiles) {
|
|
2039
|
+
return treeStructure;
|
|
2040
|
+
}
|
|
2041
|
+
return filterCoveredNodes(treeStructure, coverageMap);
|
|
2042
|
+
}, [treeStructure, showUncoveredFiles, coverageMap]);
|
|
2043
|
+
const hasTracedChildrenMap = useMemo9(() => {
|
|
2044
|
+
const map = new Map;
|
|
2045
|
+
const markTracedParents = (nodes) => {
|
|
2046
|
+
let hasTraced = false;
|
|
2047
|
+
for (const node of nodes) {
|
|
2048
|
+
if (node.children) {
|
|
2049
|
+
const childrenTraced = markTracedParents(node.children);
|
|
2050
|
+
if (childrenTraced) {
|
|
2051
|
+
map.set(node.id, true);
|
|
2052
|
+
hasTraced = true;
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
const coverage = coverageMap.get(node.id);
|
|
2056
|
+
if (coverage && coverage.status !== "none") {
|
|
2057
|
+
hasTraced = true;
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
return hasTraced;
|
|
2061
|
+
};
|
|
2062
|
+
markTracedParents(treeData);
|
|
2063
|
+
return map;
|
|
2064
|
+
}, [treeData, coverageMap]);
|
|
2065
|
+
const handleSelect = (selectedNodes) => {
|
|
2066
|
+
const selectedFiles = selectedNodes.filter((node) => !node.data.children).map((node) => node.data.id);
|
|
2067
|
+
const selectedDirs = selectedNodes.filter((node) => node.data.children).map((node) => node.data.id);
|
|
2068
|
+
if (onFileSelect && selectedFiles.length > 0) {
|
|
2069
|
+
onFileSelect(selectedFiles[0]);
|
|
2070
|
+
}
|
|
2071
|
+
if (onDirectorySelect) {
|
|
2072
|
+
onDirectorySelect(selectedDirs);
|
|
2073
|
+
}
|
|
2074
|
+
};
|
|
2075
|
+
const calculatedHeight = useMemo9(() => {
|
|
2076
|
+
if (autoHeight) {
|
|
2077
|
+
const visibleNodeCount = countVisibleNodes3(treeData, openByDefault);
|
|
2078
|
+
return visibleNodeCount * 28;
|
|
2079
|
+
}
|
|
2080
|
+
return initialHeight;
|
|
2081
|
+
}, [autoHeight, treeData, openByDefault, initialHeight]);
|
|
2082
|
+
const [containerRef, containerHeight] = useContainerHeight(calculatedHeight);
|
|
2083
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
2084
|
+
ref: containerRef,
|
|
2085
|
+
style: {
|
|
2086
|
+
backgroundColor: transparentBackground ? "transparent" : theme.colors.background,
|
|
2087
|
+
color: theme.colors.text,
|
|
2088
|
+
fontFamily: theme.fonts.body,
|
|
2089
|
+
...autoHeight ? {} : { height: "100%" }
|
|
2090
|
+
}
|
|
2091
|
+
}, /* @__PURE__ */ React11.createElement(TelemetryCoverageContext.Provider, {
|
|
2092
|
+
value: { coverageMap, hasTracedChildrenMap }
|
|
2093
|
+
}, /* @__PURE__ */ React11.createElement(Tree3, {
|
|
2094
|
+
data: treeData,
|
|
2095
|
+
onSelect: handleSelect,
|
|
2096
|
+
...selectedFile !== undefined && { selection: selectedFile },
|
|
2097
|
+
openByDefault,
|
|
2098
|
+
width: "100%",
|
|
2099
|
+
height: containerHeight,
|
|
2100
|
+
rowHeight: 28
|
|
2101
|
+
}, NodeRenderer)));
|
|
2102
|
+
};
|
|
2103
|
+
var calculateTelemetryCoverageStats = (coverageData) => {
|
|
2104
|
+
const testFiles = coverageData.length;
|
|
2105
|
+
const coveredFiles = coverageData.filter((c) => c.status === "covered").length;
|
|
2106
|
+
const partialFiles = coverageData.filter((c) => c.status === "partial").length;
|
|
2107
|
+
const totalTraced = coverageData.reduce((sum, c) => sum + c.tracedTestCount, 0);
|
|
2108
|
+
const totalTests = coverageData.reduce((sum, c) => sum + c.totalTestCount, 0);
|
|
2109
|
+
return {
|
|
2110
|
+
testFiles,
|
|
2111
|
+
coveredFiles,
|
|
2112
|
+
partialFiles,
|
|
2113
|
+
uncoveredFiles: testFiles - coveredFiles - partialFiles,
|
|
2114
|
+
totalTraced,
|
|
2115
|
+
totalTests,
|
|
2116
|
+
percentage: totalTests > 0 ? Math.round(totalTraced / totalTests * 100) : 0
|
|
2117
|
+
};
|
|
2118
|
+
};
|
|
2119
|
+
// src/components/TelemetryCoverageFileTreeContainer.tsx
|
|
2120
|
+
import { RefreshCw as RefreshCw2, Eye as Eye2, EyeOff as EyeOff2, AlertCircle as AlertCircle4, Activity as Activity2 } from "lucide-react";
|
|
2121
|
+
import React12, { useState as useState7, useMemo as useMemo10 } from "react";
|
|
2122
|
+
var TelemetryCoverageFileTreeContainer = ({
|
|
2123
|
+
fileTree,
|
|
2124
|
+
theme,
|
|
2125
|
+
coverageData,
|
|
2126
|
+
selectedFile,
|
|
2127
|
+
onFileSelect,
|
|
2128
|
+
onRefresh,
|
|
2129
|
+
isLoading = false,
|
|
2130
|
+
error = null,
|
|
2131
|
+
showControls = true,
|
|
2132
|
+
onContextMenu,
|
|
2133
|
+
initialHeight,
|
|
2134
|
+
autoHeight,
|
|
2135
|
+
testFilePatterns,
|
|
2136
|
+
title = "Telemetry Coverage",
|
|
2137
|
+
horizontalNodePadding,
|
|
2138
|
+
verticalNodePadding
|
|
2139
|
+
}) => {
|
|
2140
|
+
const [filters, setFilters] = useState7([]);
|
|
2141
|
+
const [showUncoveredFiles, setShowUncoveredFiles] = useState7(true);
|
|
2142
|
+
const selectedDirectories = useMemo10(() => {
|
|
2143
|
+
return filters.filter((f) => f.mode === "include").map((f) => f.path);
|
|
2144
|
+
}, [filters]);
|
|
2145
|
+
const stats = useMemo10(() => calculateTelemetryCoverageStats(coverageData), [coverageData]);
|
|
2146
|
+
const handleRefresh = () => {
|
|
2147
|
+
onRefresh?.();
|
|
2148
|
+
};
|
|
2149
|
+
const toggleShowUncoveredFiles = () => {
|
|
2150
|
+
setShowUncoveredFiles(!showUncoveredFiles);
|
|
2151
|
+
};
|
|
2152
|
+
const percentageColor = stats.percentage >= 80 ? "#22c55e" : stats.percentage >= 50 ? "#eab308" : stats.percentage > 0 ? "#f97316" : "#6b7280";
|
|
2153
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
2154
|
+
style: { display: "flex", flexDirection: "column", height: "100%" }
|
|
2155
|
+
}, showControls && /* @__PURE__ */ React12.createElement("div", {
|
|
2156
|
+
style: {
|
|
2157
|
+
padding: "12px",
|
|
2158
|
+
borderBottom: `1px solid ${theme.colors.border || "#e0e0e0"}`,
|
|
2159
|
+
backgroundColor: theme.colors.backgroundSecondary || theme.colors.background
|
|
2160
|
+
}
|
|
2161
|
+
}, /* @__PURE__ */ React12.createElement("div", {
|
|
2162
|
+
style: {
|
|
2163
|
+
display: "flex",
|
|
2164
|
+
alignItems: "center",
|
|
2165
|
+
justifyContent: "space-between",
|
|
2166
|
+
marginBottom: "8px"
|
|
2167
|
+
}
|
|
2168
|
+
}, /* @__PURE__ */ React12.createElement("div", {
|
|
2169
|
+
style: { display: "flex", alignItems: "center", gap: "8px" }
|
|
2170
|
+
}, /* @__PURE__ */ React12.createElement(Activity2, {
|
|
2171
|
+
size: 16,
|
|
2172
|
+
color: theme.colors.primary
|
|
2173
|
+
}), /* @__PURE__ */ React12.createElement("h3", {
|
|
2174
|
+
style: {
|
|
2175
|
+
margin: 0,
|
|
2176
|
+
fontSize: "14px",
|
|
2177
|
+
fontWeight: "bold",
|
|
2178
|
+
color: theme.colors.text
|
|
2179
|
+
}
|
|
2180
|
+
}, title), stats.testFiles > 0 && /* @__PURE__ */ React12.createElement("span", {
|
|
2181
|
+
style: {
|
|
2182
|
+
backgroundColor: percentageColor,
|
|
2183
|
+
color: "#ffffff",
|
|
2184
|
+
padding: "2px 8px",
|
|
2185
|
+
borderRadius: "12px",
|
|
2186
|
+
fontSize: "12px",
|
|
2187
|
+
fontWeight: "bold",
|
|
2188
|
+
fontFamily: "monospace"
|
|
2189
|
+
}
|
|
2190
|
+
}, stats.percentage, "%"), isLoading && /* @__PURE__ */ React12.createElement(RefreshCw2, {
|
|
2191
|
+
size: 16,
|
|
2192
|
+
color: theme.colors.text,
|
|
2193
|
+
className: "telemetry-coverage-spinner",
|
|
2194
|
+
style: { animation: "spin 1s linear infinite" }
|
|
2195
|
+
})), /* @__PURE__ */ React12.createElement("div", {
|
|
2196
|
+
style: { display: "flex", gap: "8px" }
|
|
2197
|
+
}, /* @__PURE__ */ React12.createElement("button", {
|
|
2198
|
+
onClick: toggleShowUncoveredFiles,
|
|
2199
|
+
style: {
|
|
2200
|
+
background: "none",
|
|
2201
|
+
border: `1px solid ${theme.colors.border || "#ccc"}`,
|
|
2202
|
+
borderRadius: "4px",
|
|
2203
|
+
padding: "4px 8px",
|
|
2204
|
+
cursor: "pointer",
|
|
2205
|
+
display: "flex",
|
|
2206
|
+
alignItems: "center",
|
|
2207
|
+
gap: "4px",
|
|
2208
|
+
fontSize: "12px",
|
|
2209
|
+
color: theme.colors.text
|
|
2210
|
+
},
|
|
2211
|
+
title: showUncoveredFiles ? "Show only covered files" : "Show all test files"
|
|
2212
|
+
}, showUncoveredFiles ? /* @__PURE__ */ React12.createElement(EyeOff2, {
|
|
2213
|
+
size: 14
|
|
2214
|
+
}) : /* @__PURE__ */ React12.createElement(Eye2, {
|
|
2215
|
+
size: 14
|
|
2216
|
+
}), showUncoveredFiles ? "Hide uncovered" : "Show all"), onRefresh && /* @__PURE__ */ React12.createElement("button", {
|
|
2217
|
+
onClick: handleRefresh,
|
|
2218
|
+
disabled: isLoading,
|
|
2219
|
+
style: {
|
|
2220
|
+
background: "none",
|
|
2221
|
+
border: `1px solid ${theme.colors.border || "#ccc"}`,
|
|
2222
|
+
borderRadius: "4px",
|
|
2223
|
+
padding: "4px 8px",
|
|
2224
|
+
cursor: isLoading ? "not-allowed" : "pointer",
|
|
2225
|
+
display: "flex",
|
|
2226
|
+
alignItems: "center",
|
|
2227
|
+
gap: "4px",
|
|
2228
|
+
fontSize: "12px",
|
|
2229
|
+
color: theme.colors.text,
|
|
2230
|
+
opacity: isLoading ? 0.6 : 1
|
|
2231
|
+
},
|
|
2232
|
+
title: "Refresh coverage data"
|
|
2233
|
+
}, /* @__PURE__ */ React12.createElement(RefreshCw2, {
|
|
2234
|
+
size: 14
|
|
2235
|
+
}), "Refresh"))), error && /* @__PURE__ */ React12.createElement("div", {
|
|
2236
|
+
style: {
|
|
2237
|
+
display: "flex",
|
|
2238
|
+
alignItems: "center",
|
|
2239
|
+
gap: "8px",
|
|
2240
|
+
padding: "8px",
|
|
2241
|
+
backgroundColor: "#fff3cd",
|
|
2242
|
+
border: "1px solid #ffeaa7",
|
|
2243
|
+
borderRadius: "4px",
|
|
2244
|
+
fontSize: "12px",
|
|
2245
|
+
color: "#856404",
|
|
2246
|
+
marginBottom: "8px"
|
|
2247
|
+
}
|
|
2248
|
+
}, /* @__PURE__ */ React12.createElement(AlertCircle4, {
|
|
2249
|
+
size: 14
|
|
2250
|
+
}), error), !error && stats.testFiles > 0 && /* @__PURE__ */ React12.createElement("div", {
|
|
2251
|
+
style: {
|
|
2252
|
+
display: "flex",
|
|
2253
|
+
gap: "16px",
|
|
2254
|
+
fontSize: "12px",
|
|
2255
|
+
color: theme.colors.textSecondary || "#666"
|
|
2256
|
+
}
|
|
2257
|
+
}, /* @__PURE__ */ React12.createElement("span", null, /* @__PURE__ */ React12.createElement("strong", {
|
|
2258
|
+
style: { color: "#22c55e" }
|
|
2259
|
+
}, stats.coveredFiles), " covered"), stats.partialFiles > 0 && /* @__PURE__ */ React12.createElement("span", null, /* @__PURE__ */ React12.createElement("strong", {
|
|
2260
|
+
style: { color: "#eab308" }
|
|
2261
|
+
}, stats.partialFiles), " partial"), /* @__PURE__ */ React12.createElement("span", null, /* @__PURE__ */ React12.createElement("strong", {
|
|
2262
|
+
style: { color: "#6b7280" }
|
|
2263
|
+
}, stats.uncoveredFiles), " uncovered"), /* @__PURE__ */ React12.createElement("span", {
|
|
2264
|
+
style: { marginLeft: "auto" }
|
|
2265
|
+
}, stats.totalTraced, "/", stats.totalTests, " tests traced")), !error && stats.testFiles === 0 && /* @__PURE__ */ React12.createElement("div", {
|
|
2266
|
+
style: {
|
|
2267
|
+
fontSize: "12px",
|
|
2268
|
+
color: theme.colors.textSecondary || "#666"
|
|
2269
|
+
}
|
|
2270
|
+
}, "No test files with coverage data found")), /* @__PURE__ */ React12.createElement(DirectoryFilterInput, {
|
|
2271
|
+
fileTree,
|
|
2272
|
+
theme,
|
|
2273
|
+
filters,
|
|
2274
|
+
onFiltersChange: setFilters
|
|
2275
|
+
}), /* @__PURE__ */ React12.createElement("div", {
|
|
2276
|
+
style: { flex: 1, marginTop: "1rem", overflow: "hidden" }
|
|
2277
|
+
}, /* @__PURE__ */ React12.createElement(TelemetryCoverageFileTree, {
|
|
2278
|
+
fileTree,
|
|
2279
|
+
theme,
|
|
2280
|
+
coverageData,
|
|
2281
|
+
selectedDirectories,
|
|
2282
|
+
selectedFile,
|
|
2283
|
+
onFileSelect,
|
|
2284
|
+
showUncoveredFiles,
|
|
2285
|
+
onContextMenu,
|
|
2286
|
+
initialHeight,
|
|
2287
|
+
autoHeight,
|
|
2288
|
+
testFilePatterns,
|
|
2289
|
+
horizontalNodePadding,
|
|
2290
|
+
verticalNodePadding
|
|
2291
|
+
})));
|
|
2292
|
+
};
|
|
1807
2293
|
export {
|
|
1808
2294
|
useContainerHeight,
|
|
1809
2295
|
updateTreePaths,
|
|
@@ -1811,7 +2297,10 @@ export {
|
|
|
1811
2297
|
filterFileTreeByPaths,
|
|
1812
2298
|
extractNameFromPath,
|
|
1813
2299
|
combineRepositoryTrees,
|
|
2300
|
+
calculateTelemetryCoverageStats,
|
|
1814
2301
|
TreeNode,
|
|
2302
|
+
TelemetryCoverageFileTreeContainer,
|
|
2303
|
+
TelemetryCoverageFileTree,
|
|
1815
2304
|
OrderedFileList,
|
|
1816
2305
|
MultiFileTreeCore,
|
|
1817
2306
|
MultiFileTree,
|
|
@@ -11,6 +11,7 @@ export interface DynamicFileTreeProps {
|
|
|
11
11
|
initialOpenState?: Record<string, boolean>;
|
|
12
12
|
defaultOpen?: boolean;
|
|
13
13
|
horizontalNodePadding?: string;
|
|
14
|
+
verticalNodePadding?: string;
|
|
14
15
|
onContextMenu?: (event: React.MouseEvent, nodePath: string, isFolder: boolean) => void;
|
|
15
16
|
initialHeight?: number;
|
|
16
17
|
autoHeight?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFileTree.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicFileTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAgB,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAkB,MAAM,OAAO,CAAC;AAgBvC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpD,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAqGD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"DynamicFileTree.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicFileTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAgB,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAkB,MAAM,OAAO,CAAC;AAgBvC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpD,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAqGD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA8G1D,CAAC"}
|
|
@@ -7,6 +7,8 @@ export interface FileTreeContainerProps {
|
|
|
7
7
|
selectedFile?: string;
|
|
8
8
|
onFileSelect?: (filePath: string) => void;
|
|
9
9
|
onContextMenu?: (event: React.MouseEvent, nodePath: string, isFolder: boolean) => void;
|
|
10
|
+
horizontalNodePadding?: string;
|
|
11
|
+
verticalNodePadding?: string;
|
|
10
12
|
}
|
|
11
13
|
export declare const FileTreeContainer: React.FC<FileTreeContainerProps>;
|
|
12
14
|
//# sourceMappingURL=FileTreeContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileTreeContainer.d.ts","sourceRoot":"","sources":["../../../src/components/FileTreeContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"FileTreeContainer.d.ts","sourceRoot":"","sources":["../../../src/components/FileTreeContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAuC9D,CAAC"}
|
|
@@ -19,6 +19,7 @@ export interface GitStatusFileTreeProps {
|
|
|
19
19
|
showUnchangedFiles?: boolean;
|
|
20
20
|
transparentBackground?: boolean;
|
|
21
21
|
horizontalNodePadding?: string;
|
|
22
|
+
verticalNodePadding?: string;
|
|
22
23
|
onContextMenu?: (event: React.MouseEvent, nodePath: string, isFolder: boolean) => void;
|
|
23
24
|
openByDefault?: boolean;
|
|
24
25
|
initialHeight?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitStatusFileTree.d.ts","sourceRoot":"","sources":["../../../src/components/GitStatusFileTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAgB,MAAM,sCAAsC,CAAC;AAS9E,OAAO,KAAkB,MAAM,OAAO,CAAC;AAQvC,MAAM,MAAM,SAAS,GACjB,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAC;AAGT,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,SAAS,CAAC;CACnB;AAmBD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpD,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,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AM,KAAK,IAAI,CAAC;IAC1C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA0JD,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAwL9D,CAAC"}
|
|
@@ -15,6 +15,8 @@ export interface GitStatusFileTreeContainerProps {
|
|
|
15
15
|
onContextMenu?: (event: React.MouseEvent, nodePath: string, isFolder: boolean) => void;
|
|
16
16
|
initialHeight?: number;
|
|
17
17
|
autoHeight?: boolean;
|
|
18
|
+
horizontalNodePadding?: string;
|
|
19
|
+
verticalNodePadding?: string;
|
|
18
20
|
}
|
|
19
21
|
export declare const GitStatusFileTreeContainer: React.FC<GitStatusFileTreeContainerProps>;
|
|
20
22
|
//# sourceMappingURL=GitStatusFileTreeContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitStatusFileTreeContainer.d.ts","sourceRoot":"","sources":["../../../src/components/GitStatusFileTreeContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhE,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAqB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGvE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,EAAE,QAA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AE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CAwLhF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiFileTree.d.ts","sourceRoot":"","sources":["../../../../src/components/MultiFileTree/MultiFileTree.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAMjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG7C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"MultiFileTree.d.ts","sourceRoot":"","sources":["../../../../src/components/MultiFileTree/MultiFileTree.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAMjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG7C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAyQtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiFileTreeCore.d.ts","sourceRoot":"","sources":["../../../../src/components/MultiFileTree/MultiFileTreeCore.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"MultiFileTreeCore.d.ts","sourceRoot":"","sources":["../../../../src/components/MultiFileTree/MultiFileTreeCore.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAmD9D,CAAC"}
|
|
@@ -24,6 +24,8 @@ export interface MultiFileTreeCoreProps {
|
|
|
24
24
|
defaultOpen?: boolean;
|
|
25
25
|
/** Horizontal padding for each node (e.g., "8px", "1rem") */
|
|
26
26
|
horizontalNodePadding?: string;
|
|
27
|
+
/** Vertical padding for each node (e.g., "3px", "0.5rem") */
|
|
28
|
+
verticalNodePadding?: string;
|
|
27
29
|
}
|
|
28
30
|
export interface MultiFileTreeProps extends Omit<MultiFileTreeCoreProps, 'filters' | 'viewMode' | 'onFiltersChange' | 'onViewModeChange'> {
|
|
29
31
|
/** Show the header with title and view mode toggle */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/MultiFileTree/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAEjG,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,sBAAsB;IACrC,mDAAmD;IACnD,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAEhC,sCAAsC;IACtC,KAAK,EAAE,KAAK,CAAC;IAEb,yCAAyC;IACzC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B,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,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAElE,6CAA6C;IAC7C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;IAEvD,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,GAAG,UAAU,KAAK,IAAI,CAAC;IAEtD,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE3C,6DAA6D;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,6DAA6D;IAC7D,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,6DAA6D;IAC7D,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,UAAU,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;IACvI,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,sCAAsC;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,wCAAwC;IACxC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,uCAAuC;IACvC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC,wBAAwB;IACxB,eAAe,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC;IAErC,2DAA2D;IAC3D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAIhB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Theme } from '@principal-ade/industry-theme';
|
|
2
|
+
import { FileTree } from '@principal-ai/repository-abstraction';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Telemetry coverage status for a test file
|
|
6
|
+
* - 'covered': All tests in file have telemetry instrumentation
|
|
7
|
+
* - 'partial': Some tests have telemetry
|
|
8
|
+
* - 'none': No tests have telemetry
|
|
9
|
+
*/
|
|
10
|
+
export type TelemetryCoverageStatus = 'covered' | 'partial' | 'none';
|
|
11
|
+
/**
|
|
12
|
+
* Coverage information for a single test file
|
|
13
|
+
*/
|
|
14
|
+
export interface FileTelemetryCoverage {
|
|
15
|
+
/** Path to the test file */
|
|
16
|
+
filePath: string;
|
|
17
|
+
/** Coverage status */
|
|
18
|
+
status: TelemetryCoverageStatus;
|
|
19
|
+
/** Number of tests with telemetry */
|
|
20
|
+
tracedTestCount: number;
|
|
21
|
+
/** Total number of tests in file */
|
|
22
|
+
totalTestCount: number;
|
|
23
|
+
/** List of test names that have telemetry */
|
|
24
|
+
tracedTests?: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface TelemetryCoverageFileTreeProps {
|
|
27
|
+
fileTree: FileTree;
|
|
28
|
+
theme: Theme;
|
|
29
|
+
coverageData: FileTelemetryCoverage[];
|
|
30
|
+
selectedDirectories?: string[];
|
|
31
|
+
selectedFile?: string;
|
|
32
|
+
onDirectorySelect?: (directories: string[]) => void;
|
|
33
|
+
onFileSelect?: (filePath: string) => void;
|
|
34
|
+
/** Show only test files (default: true) */
|
|
35
|
+
showOnlyTestFiles?: boolean;
|
|
36
|
+
/** Show files without coverage (default: true) */
|
|
37
|
+
showUncoveredFiles?: boolean;
|
|
38
|
+
transparentBackground?: boolean;
|
|
39
|
+
horizontalNodePadding?: string;
|
|
40
|
+
verticalNodePadding?: string;
|
|
41
|
+
onContextMenu?: (event: React.MouseEvent, nodePath: string, isFolder: boolean) => void;
|
|
42
|
+
openByDefault?: boolean;
|
|
43
|
+
initialHeight?: number;
|
|
44
|
+
autoHeight?: boolean;
|
|
45
|
+
/** Test file patterns (default: common test patterns) */
|
|
46
|
+
testFilePatterns?: RegExp[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* TelemetryCoverageFileTree Component
|
|
50
|
+
*
|
|
51
|
+
* Displays a file tree showing test files and their telemetry coverage status.
|
|
52
|
+
* Similar to GitStatusFileTree but for OpenTelemetry instrumentation coverage.
|
|
53
|
+
*/
|
|
54
|
+
export declare const TelemetryCoverageFileTree: React.FC<TelemetryCoverageFileTreeProps>;
|
|
55
|
+
/**
|
|
56
|
+
* Export stats calculation for use in containers
|
|
57
|
+
*/
|
|
58
|
+
export declare const calculateTelemetryCoverageStats: (coverageData: FileTelemetryCoverage[]) => {
|
|
59
|
+
testFiles: number;
|
|
60
|
+
coveredFiles: number;
|
|
61
|
+
partialFiles: number;
|
|
62
|
+
uncoveredFiles: number;
|
|
63
|
+
totalTraced: number;
|
|
64
|
+
totalTests: number;
|
|
65
|
+
percentage: number;
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=TelemetryCoverageFileTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelemetryCoverageFileTree.d.ts","sourceRoot":"","sources":["../../../src/components/TelemetryCoverageFileTree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAgB,MAAM,sCAAsC,CAAC;AAO9E,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,MAAM,EAAE,uBAAuB,CAAC;IAChC,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAoBD,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,qBAAqB,EAAE,CAAC;IACtC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpD,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,2CAA2C;IAC3C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AA6KD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CA4M9E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,GAAI,cAAc,qBAAqB,EAAE;;;;;;;;CAgBpF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { TelemetryCoverageFileTree } from './TelemetryCoverageFileTree';
|
|
3
|
+
import { TelemetryCoverageFileTreeContainer } from './TelemetryCoverageFileTreeContainer';
|
|
4
|
+
declare const meta: Meta<typeof TelemetryCoverageFileTree>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof TelemetryCoverageFileTree>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const OnlyCoveredFiles: Story;
|
|
9
|
+
export declare const AllFilesView: Story;
|
|
10
|
+
export declare const FullCoverage: Story;
|
|
11
|
+
export declare const NoCoverage: Story;
|
|
12
|
+
export declare const EmptyState: Story;
|
|
13
|
+
export declare const RegalTheme: Story;
|
|
14
|
+
export declare const TerminalTheme: Story;
|
|
15
|
+
export declare const MatrixTheme: Story;
|
|
16
|
+
export declare const SlateTheme: Story;
|
|
17
|
+
export declare const WithContainer: StoryObj<typeof TelemetryCoverageFileTreeContainer>;
|
|
18
|
+
export declare const ContainerWithError: StoryObj<typeof TelemetryCoverageFileTreeContainer>;
|
|
19
|
+
export declare const ContainerLoading: StoryObj<typeof TelemetryCoverageFileTreeContainer>;
|
|
20
|
+
export declare const ContainerHighCoverage: StoryObj<typeof TelemetryCoverageFileTreeContainer>;
|
|
21
|
+
export declare const ContainerLowCoverage: StoryObj<typeof TelemetryCoverageFileTreeContainer>;
|
|
22
|
+
//# sourceMappingURL=TelemetryCoverageFileTree.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelemetryCoverageFileTree.stories.d.ts","sourceRoot":"","sources":["../../../src/components/TelemetryCoverageFileTree.stories.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EACL,yBAAyB,EAE1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAoQ1F,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,yBAAyB,CAUhD,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAExD,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAgB9B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAgB1B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAoB1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAoBxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAgBxB,CAAC;AAIF,eAAO,MAAM,UAAU,EAAE,KASxB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAS3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KASzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KASxB,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,OAAO,kCAAkC,CAmB7E,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,OAAO,kCAAkC,CAkBlF,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,OAAO,kCAAkC,CAmBhF,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,OAAO,kCAAkC,CAqBrF,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,OAAO,kCAAkC,CAqBpF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Theme } from '@principal-ade/industry-theme';
|
|
2
|
+
import { FileTree } from '@principal-ai/repository-abstraction';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { FileTelemetryCoverage } from './TelemetryCoverageFileTree';
|
|
5
|
+
export interface TelemetryCoverageFileTreeContainerProps {
|
|
6
|
+
fileTree: FileTree;
|
|
7
|
+
theme: Theme;
|
|
8
|
+
coverageData: FileTelemetryCoverage[];
|
|
9
|
+
selectedFile?: string;
|
|
10
|
+
onFileSelect?: (filePath: string) => void;
|
|
11
|
+
onRefresh?: () => void;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
error?: string | null;
|
|
14
|
+
showControls?: boolean;
|
|
15
|
+
onContextMenu?: (event: React.MouseEvent, nodePath: string, isFolder: boolean) => void;
|
|
16
|
+
initialHeight?: number;
|
|
17
|
+
autoHeight?: boolean;
|
|
18
|
+
/** Custom test file patterns */
|
|
19
|
+
testFilePatterns?: RegExp[];
|
|
20
|
+
/** Title for the header (default: "Telemetry Coverage") */
|
|
21
|
+
title?: string;
|
|
22
|
+
horizontalNodePadding?: string;
|
|
23
|
+
verticalNodePadding?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const TelemetryCoverageFileTreeContainer: React.FC<TelemetryCoverageFileTreeContainerProps>;
|
|
26
|
+
//# sourceMappingURL=TelemetryCoverageFileTreeContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TelemetryCoverageFileTreeContainer.d.ts","sourceRoot":"","sources":["../../../src/components/TelemetryCoverageFileTreeContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhE,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,EAEL,qBAAqB,EAEtB,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,uCAAuC;IACtD,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,qBAAqB,EAAE,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gCAAgC;IAChC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,kCAAkC,EAAE,KAAK,CAAC,EAAE,CAAC,uCAAuC,CAiOhG,CAAC"}
|
|
@@ -14,7 +14,8 @@ export interface TreeNodeProps<T extends TreeNodeData> extends NodeRendererProps
|
|
|
14
14
|
isSelectedDirectory?: boolean;
|
|
15
15
|
nameColor?: string;
|
|
16
16
|
horizontalNodePadding?: string;
|
|
17
|
+
verticalNodePadding?: string;
|
|
17
18
|
onContextMenu?: (event: React.MouseEvent, node: NodeRendererProps<T>['node']) => void;
|
|
18
19
|
}
|
|
19
|
-
export declare function TreeNode<T extends TreeNodeData>({ node, style, dragHandle, theme, rightContent, extraContent, isSelectedDirectory, nameColor, horizontalNodePadding, onContextMenu, }: TreeNodeProps<T>): React.JSX.Element;
|
|
20
|
+
export declare function TreeNode<T extends TreeNodeData>({ node, style, dragHandle, theme, rightContent, extraContent, isSelectedDirectory, nameColor, horizontalNodePadding, verticalNodePadding, onContextMenu, }: TreeNodeProps<T>): React.JSX.Element;
|
|
20
21
|
//# sourceMappingURL=TreeNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNode.d.ts","sourceRoot":"","sources":["../../../src/components/TreeNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,EAAE,EAAY,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAA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