@principal-ade/dynamic-file-tree 0.1.72 → 0.1.74
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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +240 -49
- package/dist/src/components/RepositoryTree/RepositoryTree.stories.d.ts +13 -0
- package/dist/src/components/RepositoryTree/RepositoryTree.stories.d.ts.map +1 -0
- package/dist/src/components/RepositoryTree/RepositoryTreeCore.d.ts +9 -0
- package/dist/src/components/RepositoryTree/RepositoryTreeCore.d.ts.map +1 -0
- package/dist/src/components/RepositoryTree/index.d.ts +3 -0
- package/dist/src/components/RepositoryTree/index.d.ts.map +1 -0
- package/dist/src/components/RepositoryTree/types.d.ts +40 -0
- package/dist/src/components/RepositoryTree/types.d.ts.map +1 -0
- package/package.json +7 -2
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export { WorkflowScenarioTreeCore } from './src/components/WorkflowScenarioTree'
|
|
|
25
25
|
export type { WorkflowScenarioTreeProps, WorkflowScenarioNodeData, WorkflowScenarioNodeType, WorkflowWithScenarios, WorkflowFilterMode, } from './src/components/WorkflowScenarioTree';
|
|
26
26
|
export { CanvasListTreeCore } from './src/components/CanvasListTree/CanvasListTreeCore';
|
|
27
27
|
export type { CanvasListTreeProps, CanvasListNodeData, CanvasListNodeType, DiscoveredCanvas, } from './src/components/CanvasListTree/types';
|
|
28
|
+
export { RepositoryTreeCore } from './src/components/RepositoryTree';
|
|
29
|
+
export type { RepositoryTreeProps, RepositoryNodeData, RepositoryNodeType, } from './src/components/RepositoryTree';
|
|
28
30
|
export { TelemetryCoverageFileTree, calculateTelemetryCoverageStats, } from './src/components/TelemetryCoverageFileTree';
|
|
29
31
|
export type { TelemetryCoverageFileTreeProps, FileTelemetryCoverage, TelemetryCoverageStatus, } from './src/components/TelemetryCoverageFileTree';
|
|
30
32
|
export { TelemetryCoverageFileTreeContainer } from './src/components/Telemet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/dist/index.mjs
CHANGED
|
@@ -2983,6 +2983,196 @@ var CanvasListTreeCore = ({
|
|
|
2983
2983
|
...dndProps
|
|
2984
2984
|
}, NodeRenderer));
|
|
2985
2985
|
};
|
|
2986
|
+
// src/components/RepositoryTree/RepositoryTreeCore.tsx
|
|
2987
|
+
import { Folder as Folder2, FolderGit2 } from "lucide-react";
|
|
2988
|
+
import React15, { useMemo as useMemo12 } from "react";
|
|
2989
|
+
import { Tree as Tree6 } from "react-arborist";
|
|
2990
|
+
var buildRepositoryTree = (repositories) => {
|
|
2991
|
+
if (repositories.length === 0)
|
|
2992
|
+
return [];
|
|
2993
|
+
const paths = repositories.map((r) => r.path);
|
|
2994
|
+
const commonPrefix = findCommonPrefix(paths);
|
|
2995
|
+
return buildTreeFromRepos(repositories, commonPrefix);
|
|
2996
|
+
};
|
|
2997
|
+
var findCommonPrefix = (paths) => {
|
|
2998
|
+
if (paths.length === 0)
|
|
2999
|
+
return "";
|
|
3000
|
+
if (paths.length === 1) {
|
|
3001
|
+
const parts = paths[0].split("/");
|
|
3002
|
+
parts.pop();
|
|
3003
|
+
return parts.join("/") + "/";
|
|
3004
|
+
}
|
|
3005
|
+
const splitPaths = paths.map((p) => p.split("/"));
|
|
3006
|
+
const minLength = Math.min(...splitPaths.map((p) => p.length));
|
|
3007
|
+
const commonParts = [];
|
|
3008
|
+
for (let i = 0;i < minLength - 1; i++) {
|
|
3009
|
+
const segment = splitPaths[0][i];
|
|
3010
|
+
if (splitPaths.every((p) => p[i] === segment)) {
|
|
3011
|
+
commonParts.push(segment);
|
|
3012
|
+
} else {
|
|
3013
|
+
break;
|
|
3014
|
+
}
|
|
3015
|
+
}
|
|
3016
|
+
return commonParts.length > 0 ? commonParts.join("/") + "/" : "";
|
|
3017
|
+
};
|
|
3018
|
+
var buildTreeFromRepos = (repositories, commonPrefix) => {
|
|
3019
|
+
const tree = {};
|
|
3020
|
+
for (const repo of repositories) {
|
|
3021
|
+
const relativePath = repo.path.startsWith(commonPrefix) ? repo.path.slice(commonPrefix.length) : repo.path;
|
|
3022
|
+
const segments = relativePath.split("/").filter(Boolean);
|
|
3023
|
+
let current = tree;
|
|
3024
|
+
for (let i = 0;i < segments.length - 1; i++) {
|
|
3025
|
+
const segment = segments[i];
|
|
3026
|
+
if (!current[segment] || current[segment] instanceof Object && "path" in current[segment]) {
|
|
3027
|
+
current[segment] = {};
|
|
3028
|
+
}
|
|
3029
|
+
current = current[segment];
|
|
3030
|
+
}
|
|
3031
|
+
const repoName = segments[segments.length - 1] || repo.name;
|
|
3032
|
+
current[repoName] = repo;
|
|
3033
|
+
}
|
|
3034
|
+
const convertToNodes = (obj, pathPrefix) => {
|
|
3035
|
+
const nodes = [];
|
|
3036
|
+
for (const [name, value] of Object.entries(obj)) {
|
|
3037
|
+
const currentPath = pathPrefix ? `${pathPrefix}/${name}` : name;
|
|
3038
|
+
if ("path" in value && "name" in value) {
|
|
3039
|
+
nodes.push({
|
|
3040
|
+
id: `repo:${value.path}`,
|
|
3041
|
+
name,
|
|
3042
|
+
type: "repository",
|
|
3043
|
+
entry: value
|
|
3044
|
+
});
|
|
3045
|
+
} else {
|
|
3046
|
+
const children = convertToNodes(value, currentPath);
|
|
3047
|
+
const repoCount = countRepositories(children);
|
|
3048
|
+
nodes.push({
|
|
3049
|
+
id: `dir:${currentPath}`,
|
|
3050
|
+
name,
|
|
3051
|
+
type: "directory",
|
|
3052
|
+
children,
|
|
3053
|
+
repositoryCount: repoCount
|
|
3054
|
+
});
|
|
3055
|
+
}
|
|
3056
|
+
}
|
|
3057
|
+
return nodes.sort((a, b) => {
|
|
3058
|
+
if (a.type === "directory" && b.type !== "directory")
|
|
3059
|
+
return -1;
|
|
3060
|
+
if (a.type !== "directory" && b.type === "directory")
|
|
3061
|
+
return 1;
|
|
3062
|
+
return a.name.localeCompare(b.name, undefined, { sensitivity: "base" });
|
|
3063
|
+
});
|
|
3064
|
+
};
|
|
3065
|
+
return convertToNodes(tree, "");
|
|
3066
|
+
};
|
|
3067
|
+
var countRepositories = (nodes) => {
|
|
3068
|
+
let count = 0;
|
|
3069
|
+
for (const node of nodes) {
|
|
3070
|
+
if (node.type === "repository") {
|
|
3071
|
+
count++;
|
|
3072
|
+
} else if (node.children) {
|
|
3073
|
+
count += countRepositories(node.children);
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
return count;
|
|
3077
|
+
};
|
|
3078
|
+
var RepositoryTreeCore = ({
|
|
3079
|
+
repositories,
|
|
3080
|
+
theme,
|
|
3081
|
+
onSelect,
|
|
3082
|
+
selectedRepositoryPath,
|
|
3083
|
+
defaultOpen = true,
|
|
3084
|
+
initialOpenState,
|
|
3085
|
+
horizontalNodePadding = "16px",
|
|
3086
|
+
verticalNodePadding = "6px",
|
|
3087
|
+
verticalPadding = "8px"
|
|
3088
|
+
}) => {
|
|
3089
|
+
const rowHeight = useMemo12(() => {
|
|
3090
|
+
const paddingValue = parseFloat(verticalNodePadding);
|
|
3091
|
+
const contentLineHeight = 20;
|
|
3092
|
+
const borderHeight = 2;
|
|
3093
|
+
return contentLineHeight + paddingValue * 2 + borderHeight;
|
|
3094
|
+
}, [verticalNodePadding]);
|
|
3095
|
+
const treeData = useMemo12(() => {
|
|
3096
|
+
return buildRepositoryTree(repositories);
|
|
3097
|
+
}, [repositories]);
|
|
3098
|
+
const NodeRenderer = (props) => {
|
|
3099
|
+
const { node } = props;
|
|
3100
|
+
const data = node.data;
|
|
3101
|
+
const icon = data.type === "directory" ? /* @__PURE__ */ React15.createElement(Folder2, {
|
|
3102
|
+
size: 16
|
|
3103
|
+
}) : /* @__PURE__ */ React15.createElement(FolderGit2, {
|
|
3104
|
+
size: 16
|
|
3105
|
+
});
|
|
3106
|
+
const nameColor = data.type === "directory" ? theme.colors.textSecondary : theme.colors.text;
|
|
3107
|
+
let rightContent = undefined;
|
|
3108
|
+
if (data.type === "directory" && data.repositoryCount !== undefined) {
|
|
3109
|
+
rightContent = /* @__PURE__ */ React15.createElement("span", {
|
|
3110
|
+
style: {
|
|
3111
|
+
marginLeft: "8px",
|
|
3112
|
+
fontSize: "12px",
|
|
3113
|
+
color: theme.colors.textMuted,
|
|
3114
|
+
fontWeight: 500
|
|
3115
|
+
}
|
|
3116
|
+
}, data.repositoryCount);
|
|
3117
|
+
} else if (data.type === "repository" && data.entry?.github?.owner) {
|
|
3118
|
+
const { owner, name } = data.entry.github;
|
|
3119
|
+
const avatarUrl = `https://github.com/${owner}.png?size=32`;
|
|
3120
|
+
const repoFullName = `${owner}/${name}`;
|
|
3121
|
+
rightContent = /* @__PURE__ */ React15.createElement("img", {
|
|
3122
|
+
src: avatarUrl,
|
|
3123
|
+
alt: owner,
|
|
3124
|
+
title: repoFullName,
|
|
3125
|
+
style: {
|
|
3126
|
+
width: 16,
|
|
3127
|
+
height: 16,
|
|
3128
|
+
borderRadius: "50%",
|
|
3129
|
+
marginLeft: "8px",
|
|
3130
|
+
cursor: "help"
|
|
3131
|
+
}
|
|
3132
|
+
});
|
|
3133
|
+
}
|
|
3134
|
+
return /* @__PURE__ */ React15.createElement(TreeNode, {
|
|
3135
|
+
...props,
|
|
3136
|
+
theme,
|
|
3137
|
+
nameColor,
|
|
3138
|
+
leftIcon: icon,
|
|
3139
|
+
rightContent,
|
|
3140
|
+
horizontalNodePadding,
|
|
3141
|
+
verticalNodePadding
|
|
3142
|
+
});
|
|
3143
|
+
};
|
|
3144
|
+
const handleSelect = (selectedNodes) => {
|
|
3145
|
+
if (selectedNodes.length === 0)
|
|
3146
|
+
return;
|
|
3147
|
+
const node = selectedNodes[0];
|
|
3148
|
+
const nodeData = node.data;
|
|
3149
|
+
if (nodeData.type === "repository" && nodeData.entry && onSelect) {
|
|
3150
|
+
onSelect(nodeData.entry);
|
|
3151
|
+
}
|
|
3152
|
+
};
|
|
3153
|
+
const initialHeight = 600;
|
|
3154
|
+
const [containerRef, containerHeight] = useContainerHeight(initialHeight);
|
|
3155
|
+
const selection = selectedRepositoryPath ? `repo:${selectedRepositoryPath}` : undefined;
|
|
3156
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
3157
|
+
ref: containerRef,
|
|
3158
|
+
style: {
|
|
3159
|
+
backgroundColor: theme.colors.background,
|
|
3160
|
+
color: theme.colors.text,
|
|
3161
|
+
fontFamily: theme.fonts.body,
|
|
3162
|
+
height: "100%",
|
|
3163
|
+
...verticalPadding ? { paddingTop: verticalPadding, paddingBottom: verticalPadding } : {}
|
|
3164
|
+
}
|
|
3165
|
+
}, /* @__PURE__ */ React15.createElement(Tree6, {
|
|
3166
|
+
data: treeData,
|
|
3167
|
+
onSelect: handleSelect,
|
|
3168
|
+
openByDefault: defaultOpen,
|
|
3169
|
+
...initialOpenState !== undefined && { initialOpenState },
|
|
3170
|
+
...selection !== undefined && { selection },
|
|
3171
|
+
width: "100%",
|
|
3172
|
+
height: containerHeight,
|
|
3173
|
+
rowHeight
|
|
3174
|
+
}, NodeRenderer));
|
|
3175
|
+
};
|
|
2986
3176
|
// src/components/TelemetryCoverageFileTree.tsx
|
|
2987
3177
|
import {
|
|
2988
3178
|
Activity,
|
|
@@ -2990,9 +3180,9 @@ import {
|
|
|
2990
3180
|
Circle as Circle2,
|
|
2991
3181
|
TestTube
|
|
2992
3182
|
} from "lucide-react";
|
|
2993
|
-
import
|
|
2994
|
-
import { Tree as
|
|
2995
|
-
var TelemetryCoverageContext =
|
|
3183
|
+
import React16, { useMemo as useMemo13, useRef as useRef7 } from "react";
|
|
3184
|
+
import { Tree as Tree7 } from "react-arborist";
|
|
3185
|
+
var TelemetryCoverageContext = React16.createContext(null);
|
|
2996
3186
|
var DEFAULT_TEST_PATTERNS = [
|
|
2997
3187
|
/\.test\.[jt]sx?$/,
|
|
2998
3188
|
/\.spec\.[jt]sx?$/,
|
|
@@ -3009,7 +3199,7 @@ var getCoverageStatusDisplay = (coverage, _theme) => {
|
|
|
3009
3199
|
switch (status) {
|
|
3010
3200
|
case "covered":
|
|
3011
3201
|
return {
|
|
3012
|
-
icon: /* @__PURE__ */
|
|
3202
|
+
icon: /* @__PURE__ */ React16.createElement(Activity, {
|
|
3013
3203
|
size: 14
|
|
3014
3204
|
}),
|
|
3015
3205
|
color: "#22c55e",
|
|
@@ -3018,7 +3208,7 @@ var getCoverageStatusDisplay = (coverage, _theme) => {
|
|
|
3018
3208
|
};
|
|
3019
3209
|
case "partial":
|
|
3020
3210
|
return {
|
|
3021
|
-
icon: /* @__PURE__ */
|
|
3211
|
+
icon: /* @__PURE__ */ React16.createElement(CircleDot2, {
|
|
3022
3212
|
size: 14
|
|
3023
3213
|
}),
|
|
3024
3214
|
color: "#eab308",
|
|
@@ -3027,7 +3217,7 @@ var getCoverageStatusDisplay = (coverage, _theme) => {
|
|
|
3027
3217
|
};
|
|
3028
3218
|
case "none":
|
|
3029
3219
|
return {
|
|
3030
|
-
icon: /* @__PURE__ */
|
|
3220
|
+
icon: /* @__PURE__ */ React16.createElement(Circle2, {
|
|
3031
3221
|
size: 14
|
|
3032
3222
|
}),
|
|
3033
3223
|
color: "#6b7280",
|
|
@@ -3129,7 +3319,7 @@ var TelemetryCoverageFileTree = ({
|
|
|
3129
3319
|
enableDragAndDrop = false
|
|
3130
3320
|
}) => {
|
|
3131
3321
|
const dndProps = getDndProps(enableDragAndDrop);
|
|
3132
|
-
const coverageMap =
|
|
3322
|
+
const coverageMap = useMemo13(() => {
|
|
3133
3323
|
const map = new Map;
|
|
3134
3324
|
coverageData.forEach((item) => {
|
|
3135
3325
|
map.set(item.filePath, item);
|
|
@@ -3138,7 +3328,7 @@ var TelemetryCoverageFileTree = ({
|
|
|
3138
3328
|
}, [coverageData]);
|
|
3139
3329
|
const NodeRenderer = (props) => {
|
|
3140
3330
|
const { node } = props;
|
|
3141
|
-
const ctx =
|
|
3331
|
+
const ctx = React16.useContext(TelemetryCoverageContext);
|
|
3142
3332
|
const coverage = ctx?.coverageMap.get(node.data.id);
|
|
3143
3333
|
const hasTracedChildren = ctx?.hasTracedChildrenMap.get(node.data.id);
|
|
3144
3334
|
const coverageDisplay = coverage ? getCoverageStatusDisplay(coverage, theme) : null;
|
|
@@ -3150,11 +3340,11 @@ var TelemetryCoverageFileTree = ({
|
|
|
3150
3340
|
} else if (node.data.isTestFile) {
|
|
3151
3341
|
nameColor = "#6b728080";
|
|
3152
3342
|
}
|
|
3153
|
-
const leftIcon = node.data.isTestFile && !coverage ? /* @__PURE__ */
|
|
3343
|
+
const leftIcon = node.data.isTestFile && !coverage ? /* @__PURE__ */ React16.createElement(TestTube, {
|
|
3154
3344
|
size: 14,
|
|
3155
3345
|
style: { marginRight: 4, color: "#6b7280" }
|
|
3156
3346
|
}) : null;
|
|
3157
|
-
const rightContent = coverageDisplay ? /* @__PURE__ */
|
|
3347
|
+
const rightContent = coverageDisplay ? /* @__PURE__ */ React16.createElement("div", {
|
|
3158
3348
|
style: {
|
|
3159
3349
|
display: "flex",
|
|
3160
3350
|
alignItems: "center",
|
|
@@ -3162,14 +3352,14 @@ var TelemetryCoverageFileTree = ({
|
|
|
3162
3352
|
marginRight: "8px"
|
|
3163
3353
|
},
|
|
3164
3354
|
title: coverageDisplay.label
|
|
3165
|
-
}, coverageDisplay.icon, /* @__PURE__ */
|
|
3355
|
+
}, coverageDisplay.icon, /* @__PURE__ */ React16.createElement("span", {
|
|
3166
3356
|
style: {
|
|
3167
3357
|
marginLeft: "4px",
|
|
3168
3358
|
fontSize: theme.fontSizes[0],
|
|
3169
3359
|
fontWeight: "bold",
|
|
3170
3360
|
fontFamily: "monospace"
|
|
3171
3361
|
}
|
|
3172
|
-
}, coverageDisplay.badge)) : node.data.isTestFile ? /* @__PURE__ */
|
|
3362
|
+
}, coverageDisplay.badge)) : node.data.isTestFile ? /* @__PURE__ */ React16.createElement("div", {
|
|
3173
3363
|
style: {
|
|
3174
3364
|
display: "flex",
|
|
3175
3365
|
alignItems: "center",
|
|
@@ -3178,10 +3368,10 @@ var TelemetryCoverageFileTree = ({
|
|
|
3178
3368
|
opacity: 0.5
|
|
3179
3369
|
},
|
|
3180
3370
|
title: "No telemetry instrumentation"
|
|
3181
|
-
}, /* @__PURE__ */
|
|
3371
|
+
}, /* @__PURE__ */ React16.createElement(Circle2, {
|
|
3182
3372
|
size: 14
|
|
3183
3373
|
})) : null;
|
|
3184
|
-
return /* @__PURE__ */
|
|
3374
|
+
return /* @__PURE__ */ React16.createElement(TreeNode, {
|
|
3185
3375
|
...props,
|
|
3186
3376
|
theme,
|
|
3187
3377
|
rightContent,
|
|
@@ -3196,16 +3386,16 @@ var TelemetryCoverageFileTree = ({
|
|
|
3196
3386
|
}
|
|
3197
3387
|
});
|
|
3198
3388
|
};
|
|
3199
|
-
const treeStructure =
|
|
3389
|
+
const treeStructure = useMemo13(() => {
|
|
3200
3390
|
return transformTreeStructure2(fileTree, showOnlyTestFiles, testFilePatterns);
|
|
3201
3391
|
}, [fileTree, showOnlyTestFiles, testFilePatterns]);
|
|
3202
|
-
const treeData =
|
|
3392
|
+
const treeData = useMemo13(() => {
|
|
3203
3393
|
if (showUncoveredFiles) {
|
|
3204
3394
|
return treeStructure;
|
|
3205
3395
|
}
|
|
3206
3396
|
return filterCoveredNodes(treeStructure, coverageMap);
|
|
3207
3397
|
}, [treeStructure, showUncoveredFiles, coverageMap]);
|
|
3208
|
-
const hasTracedChildrenMap =
|
|
3398
|
+
const hasTracedChildrenMap = useMemo13(() => {
|
|
3209
3399
|
const map = new Map;
|
|
3210
3400
|
const markTracedParents = (nodes) => {
|
|
3211
3401
|
let hasTraced = false;
|
|
@@ -3246,7 +3436,7 @@ var TelemetryCoverageFileTree = ({
|
|
|
3246
3436
|
onDirectorySelect(selectedDirs);
|
|
3247
3437
|
}
|
|
3248
3438
|
};
|
|
3249
|
-
const calculatedHeight =
|
|
3439
|
+
const calculatedHeight = useMemo13(() => {
|
|
3250
3440
|
if (autoHeight) {
|
|
3251
3441
|
const visibleNodeCount = countVisibleNodes3(treeData, openByDefault);
|
|
3252
3442
|
return visibleNodeCount * 28;
|
|
@@ -3254,7 +3444,7 @@ var TelemetryCoverageFileTree = ({
|
|
|
3254
3444
|
return initialHeight;
|
|
3255
3445
|
}, [autoHeight, treeData, openByDefault, initialHeight]);
|
|
3256
3446
|
const [containerRef, containerHeight] = useContainerHeight(calculatedHeight);
|
|
3257
|
-
return /* @__PURE__ */
|
|
3447
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
3258
3448
|
ref: containerRef,
|
|
3259
3449
|
style: {
|
|
3260
3450
|
backgroundColor: transparentBackground ? "transparent" : theme.colors.background,
|
|
@@ -3263,9 +3453,9 @@ var TelemetryCoverageFileTree = ({
|
|
|
3263
3453
|
...autoHeight ? {} : { height: "100%" },
|
|
3264
3454
|
...verticalPadding ? { paddingTop: verticalPadding, paddingBottom: verticalPadding } : {}
|
|
3265
3455
|
}
|
|
3266
|
-
}, /* @__PURE__ */
|
|
3456
|
+
}, /* @__PURE__ */ React16.createElement(TelemetryCoverageContext.Provider, {
|
|
3267
3457
|
value: { coverageMap, hasTracedChildrenMap }
|
|
3268
|
-
}, /* @__PURE__ */
|
|
3458
|
+
}, /* @__PURE__ */ React16.createElement(Tree7, {
|
|
3269
3459
|
data: treeData,
|
|
3270
3460
|
onSelect: handleSelect,
|
|
3271
3461
|
...selectedFile !== undefined && { selection: selectedFile },
|
|
@@ -3294,7 +3484,7 @@ var calculateTelemetryCoverageStats = (coverageData) => {
|
|
|
3294
3484
|
};
|
|
3295
3485
|
// src/components/TelemetryCoverageFileTreeContainer.tsx
|
|
3296
3486
|
import { RefreshCw as RefreshCw2, Eye as Eye2, EyeOff as EyeOff2, AlertCircle as AlertCircle5, Activity as Activity2 } from "lucide-react";
|
|
3297
|
-
import
|
|
3487
|
+
import React17, { useState as useState7, useMemo as useMemo14 } from "react";
|
|
3298
3488
|
var TelemetryCoverageFileTreeContainer = ({
|
|
3299
3489
|
fileTree,
|
|
3300
3490
|
theme,
|
|
@@ -3316,10 +3506,10 @@ var TelemetryCoverageFileTreeContainer = ({
|
|
|
3316
3506
|
}) => {
|
|
3317
3507
|
const [filters, setFilters] = useState7([]);
|
|
3318
3508
|
const [showUncoveredFiles, setShowUncoveredFiles] = useState7(true);
|
|
3319
|
-
const selectedDirectories =
|
|
3509
|
+
const selectedDirectories = useMemo14(() => {
|
|
3320
3510
|
return filters.filter((f) => f.mode === "include").map((f) => f.path);
|
|
3321
3511
|
}, [filters]);
|
|
3322
|
-
const stats =
|
|
3512
|
+
const stats = useMemo14(() => calculateTelemetryCoverageStats(coverageData), [coverageData]);
|
|
3323
3513
|
const handleRefresh = () => {
|
|
3324
3514
|
onRefresh?.();
|
|
3325
3515
|
};
|
|
@@ -3327,34 +3517,34 @@ var TelemetryCoverageFileTreeContainer = ({
|
|
|
3327
3517
|
setShowUncoveredFiles(!showUncoveredFiles);
|
|
3328
3518
|
};
|
|
3329
3519
|
const percentageColor = stats.percentage >= 80 ? "#22c55e" : stats.percentage >= 50 ? "#eab308" : stats.percentage > 0 ? "#f97316" : "#6b7280";
|
|
3330
|
-
return /* @__PURE__ */
|
|
3520
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
3331
3521
|
style: { display: "flex", flexDirection: "column", height: "100%" }
|
|
3332
|
-
}, showControls && /* @__PURE__ */
|
|
3522
|
+
}, showControls && /* @__PURE__ */ React17.createElement("div", {
|
|
3333
3523
|
style: {
|
|
3334
3524
|
padding: "12px",
|
|
3335
3525
|
borderBottom: `1px solid ${theme.colors.border || "#e0e0e0"}`,
|
|
3336
3526
|
backgroundColor: theme.colors.backgroundSecondary || theme.colors.background
|
|
3337
3527
|
}
|
|
3338
|
-
}, /* @__PURE__ */
|
|
3528
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
3339
3529
|
style: {
|
|
3340
3530
|
display: "flex",
|
|
3341
3531
|
alignItems: "center",
|
|
3342
3532
|
justifyContent: "space-between",
|
|
3343
3533
|
marginBottom: "8px"
|
|
3344
3534
|
}
|
|
3345
|
-
}, /* @__PURE__ */
|
|
3535
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
3346
3536
|
style: { display: "flex", alignItems: "center", gap: "8px" }
|
|
3347
|
-
}, /* @__PURE__ */
|
|
3537
|
+
}, /* @__PURE__ */ React17.createElement(Activity2, {
|
|
3348
3538
|
size: 16,
|
|
3349
3539
|
color: theme.colors.primary
|
|
3350
|
-
}), /* @__PURE__ */
|
|
3540
|
+
}), /* @__PURE__ */ React17.createElement("h3", {
|
|
3351
3541
|
style: {
|
|
3352
3542
|
margin: 0,
|
|
3353
3543
|
fontSize: theme.fontSizes[1],
|
|
3354
3544
|
fontWeight: "bold",
|
|
3355
3545
|
color: theme.colors.text
|
|
3356
3546
|
}
|
|
3357
|
-
}, title), stats.testFiles > 0 && /* @__PURE__ */
|
|
3547
|
+
}, title), stats.testFiles > 0 && /* @__PURE__ */ React17.createElement("span", {
|
|
3358
3548
|
style: {
|
|
3359
3549
|
backgroundColor: percentageColor,
|
|
3360
3550
|
color: "#ffffff",
|
|
@@ -3364,14 +3554,14 @@ var TelemetryCoverageFileTreeContainer = ({
|
|
|
3364
3554
|
fontWeight: "bold",
|
|
3365
3555
|
fontFamily: "monospace"
|
|
3366
3556
|
}
|
|
3367
|
-
}, stats.percentage, "%"), isLoading && /* @__PURE__ */
|
|
3557
|
+
}, stats.percentage, "%"), isLoading && /* @__PURE__ */ React17.createElement(RefreshCw2, {
|
|
3368
3558
|
size: 16,
|
|
3369
3559
|
color: theme.colors.text,
|
|
3370
3560
|
className: "telemetry-coverage-spinner",
|
|
3371
3561
|
style: { animation: "spin 1s linear infinite" }
|
|
3372
|
-
})), /* @__PURE__ */
|
|
3562
|
+
})), /* @__PURE__ */ React17.createElement("div", {
|
|
3373
3563
|
style: { display: "flex", gap: "8px" }
|
|
3374
|
-
}, /* @__PURE__ */
|
|
3564
|
+
}, /* @__PURE__ */ React17.createElement("button", {
|
|
3375
3565
|
onClick: toggleShowUncoveredFiles,
|
|
3376
3566
|
style: {
|
|
3377
3567
|
background: "none",
|
|
@@ -3386,11 +3576,11 @@ var TelemetryCoverageFileTreeContainer = ({
|
|
|
3386
3576
|
color: theme.colors.text
|
|
3387
3577
|
},
|
|
3388
3578
|
title: showUncoveredFiles ? "Show only covered files" : "Show all test files"
|
|
3389
|
-
}, showUncoveredFiles ? /* @__PURE__ */
|
|
3579
|
+
}, showUncoveredFiles ? /* @__PURE__ */ React17.createElement(EyeOff2, {
|
|
3390
3580
|
size: 14
|
|
3391
|
-
}) : /* @__PURE__ */
|
|
3581
|
+
}) : /* @__PURE__ */ React17.createElement(Eye2, {
|
|
3392
3582
|
size: 14
|
|
3393
|
-
}), showUncoveredFiles ? "Hide uncovered" : "Show all"), onRefresh && /* @__PURE__ */
|
|
3583
|
+
}), showUncoveredFiles ? "Hide uncovered" : "Show all"), onRefresh && /* @__PURE__ */ React17.createElement("button", {
|
|
3394
3584
|
onClick: handleRefresh,
|
|
3395
3585
|
disabled: isLoading,
|
|
3396
3586
|
style: {
|
|
@@ -3407,9 +3597,9 @@ var TelemetryCoverageFileTreeContainer = ({
|
|
|
3407
3597
|
opacity: isLoading ? 0.6 : 1
|
|
3408
3598
|
},
|
|
3409
3599
|
title: "Refresh coverage data"
|
|
3410
|
-
}, /* @__PURE__ */
|
|
3600
|
+
}, /* @__PURE__ */ React17.createElement(RefreshCw2, {
|
|
3411
3601
|
size: 14
|
|
3412
|
-
}), "Refresh"))), error && /* @__PURE__ */
|
|
3602
|
+
}), "Refresh"))), error && /* @__PURE__ */ React17.createElement("div", {
|
|
3413
3603
|
style: {
|
|
3414
3604
|
display: "flex",
|
|
3415
3605
|
alignItems: "center",
|
|
@@ -3422,36 +3612,36 @@ var TelemetryCoverageFileTreeContainer = ({
|
|
|
3422
3612
|
color: "#856404",
|
|
3423
3613
|
marginBottom: "8px"
|
|
3424
3614
|
}
|
|
3425
|
-
}, /* @__PURE__ */
|
|
3615
|
+
}, /* @__PURE__ */ React17.createElement(AlertCircle5, {
|
|
3426
3616
|
size: 14
|
|
3427
|
-
}), error), !error && stats.testFiles > 0 && /* @__PURE__ */
|
|
3617
|
+
}), error), !error && stats.testFiles > 0 && /* @__PURE__ */ React17.createElement("div", {
|
|
3428
3618
|
style: {
|
|
3429
3619
|
display: "flex",
|
|
3430
3620
|
gap: "16px",
|
|
3431
3621
|
fontSize: theme.fontSizes[0],
|
|
3432
3622
|
color: theme.colors.textSecondary || "#666"
|
|
3433
3623
|
}
|
|
3434
|
-
}, /* @__PURE__ */
|
|
3624
|
+
}, /* @__PURE__ */ React17.createElement("span", null, /* @__PURE__ */ React17.createElement("strong", {
|
|
3435
3625
|
style: { color: "#22c55e" }
|
|
3436
|
-
}, stats.coveredFiles), " covered"), stats.partialFiles > 0 && /* @__PURE__ */
|
|
3626
|
+
}, stats.coveredFiles), " covered"), stats.partialFiles > 0 && /* @__PURE__ */ React17.createElement("span", null, /* @__PURE__ */ React17.createElement("strong", {
|
|
3437
3627
|
style: { color: "#eab308" }
|
|
3438
|
-
}, stats.partialFiles), " partial"), /* @__PURE__ */
|
|
3628
|
+
}, stats.partialFiles), " partial"), /* @__PURE__ */ React17.createElement("span", null, /* @__PURE__ */ React17.createElement("strong", {
|
|
3439
3629
|
style: { color: "#6b7280" }
|
|
3440
|
-
}, stats.uncoveredFiles), " uncovered"), /* @__PURE__ */
|
|
3630
|
+
}, stats.uncoveredFiles), " uncovered"), /* @__PURE__ */ React17.createElement("span", {
|
|
3441
3631
|
style: { marginLeft: "auto" }
|
|
3442
|
-
}, stats.totalTraced, "/", stats.totalTests, " tests traced")), !error && stats.testFiles === 0 && /* @__PURE__ */
|
|
3632
|
+
}, stats.totalTraced, "/", stats.totalTests, " tests traced")), !error && stats.testFiles === 0 && /* @__PURE__ */ React17.createElement("div", {
|
|
3443
3633
|
style: {
|
|
3444
3634
|
fontSize: theme.fontSizes[0],
|
|
3445
3635
|
color: theme.colors.textSecondary || "#666"
|
|
3446
3636
|
}
|
|
3447
|
-
}, "No test files with coverage data found")), /* @__PURE__ */
|
|
3637
|
+
}, "No test files with coverage data found")), /* @__PURE__ */ React17.createElement(DirectoryFilterInput, {
|
|
3448
3638
|
fileTree,
|
|
3449
3639
|
theme,
|
|
3450
3640
|
filters,
|
|
3451
3641
|
onFiltersChange: setFilters
|
|
3452
|
-
}), /* @__PURE__ */
|
|
3642
|
+
}), /* @__PURE__ */ React17.createElement("div", {
|
|
3453
3643
|
style: { flex: 1, marginTop: "1rem", overflow: "hidden" }
|
|
3454
|
-
}, /* @__PURE__ */
|
|
3644
|
+
}, /* @__PURE__ */ React17.createElement(TelemetryCoverageFileTree, {
|
|
3455
3645
|
fileTree,
|
|
3456
3646
|
theme,
|
|
3457
3647
|
coverageData,
|
|
@@ -3486,6 +3676,7 @@ export {
|
|
|
3486
3676
|
TelemetryCoverageFileTreeContainer,
|
|
3487
3677
|
TelemetryCoverageFileTree,
|
|
3488
3678
|
StoryboardWorkflowsTreeCore,
|
|
3679
|
+
RepositoryTreeCore,
|
|
3489
3680
|
OrderedFileList,
|
|
3490
3681
|
MultiFileTreeCore,
|
|
3491
3682
|
MultiFileTree,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { RepositoryTreeCore } from './RepositoryTreeCore';
|
|
3
|
+
declare const meta: Meta<typeof RepositoryTreeCore>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof RepositoryTreeCore>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const SingleDirectory: Story;
|
|
8
|
+
export declare const Collapsed: Story;
|
|
9
|
+
export declare const Empty: Story;
|
|
10
|
+
export declare const TerminalTheme: Story;
|
|
11
|
+
export declare const MatrixTheme: Story;
|
|
12
|
+
export declare const SlateTheme: Story;
|
|
13
|
+
//# sourceMappingURL=RepositoryTree.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepositoryTree.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/RepositoryTree/RepositoryTree.stories.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAqG1D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAkCzC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAyBjD,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAU7B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAUnB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAU3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAUzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAUxB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RepositoryTreeProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* RepositoryTreeCore component
|
|
5
|
+
*
|
|
6
|
+
* Displays repositories organized by their filesystem paths in a tree structure.
|
|
7
|
+
*/
|
|
8
|
+
export declare const RepositoryTreeCore: React.FC<RepositoryTreeProps>;
|
|
9
|
+
//# sourceMappingURL=RepositoryTreeCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RepositoryTreeCore.d.ts","sourceRoot":"","sources":["../../../../src/components/RepositoryTree/RepositoryTreeCore.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAAsB,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA+IvE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAuI5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/RepositoryTree/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Theme } from '@principal-ade/industry-theme';
|
|
2
|
+
import type { AlexandriaEntry } from '@principal-ai/alexandria-core-library';
|
|
3
|
+
import type { TreeNodeData } from '../TreeNode';
|
|
4
|
+
/**
|
|
5
|
+
* Node types in the repository tree
|
|
6
|
+
*/
|
|
7
|
+
export type RepositoryNodeType = 'directory' | 'repository';
|
|
8
|
+
/**
|
|
9
|
+
* Node data for repository tree
|
|
10
|
+
*/
|
|
11
|
+
export interface RepositoryNodeData extends TreeNodeData {
|
|
12
|
+
type: RepositoryNodeType;
|
|
13
|
+
children?: RepositoryNodeData[];
|
|
14
|
+
entry?: AlexandriaEntry;
|
|
15
|
+
repositoryCount?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Props for RepositoryTreeCore component
|
|
19
|
+
*/
|
|
20
|
+
export interface RepositoryTreeProps {
|
|
21
|
+
/** Array of repositories to display in the tree */
|
|
22
|
+
repositories: AlexandriaEntry[];
|
|
23
|
+
/** Theme for styling */
|
|
24
|
+
theme: Theme;
|
|
25
|
+
/** Callback when a repository is selected */
|
|
26
|
+
onSelect?: (entry: AlexandriaEntry) => void;
|
|
27
|
+
/** Path of the currently selected repository */
|
|
28
|
+
selectedRepositoryPath?: string;
|
|
29
|
+
/** Default open state for all nodes */
|
|
30
|
+
defaultOpen?: boolean;
|
|
31
|
+
/** Initial open state for specific nodes by id */
|
|
32
|
+
initialOpenState?: Record<string, boolean>;
|
|
33
|
+
/** Horizontal padding for nodes */
|
|
34
|
+
horizontalNodePadding?: string;
|
|
35
|
+
/** Vertical padding for nodes */
|
|
36
|
+
verticalNodePadding?: string;
|
|
37
|
+
/** Vertical padding for the container */
|
|
38
|
+
verticalPadding?: string;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/RepositoryTree/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,YAAY,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAGhC,KAAK,CAAC,EAAE,eAAe,CAAC;IAGxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,wBAAwB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5C,gDAAgD;IAChD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,mCAAmC;IACnC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iCAAiC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,yCAAyC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principal-ade/dynamic-file-tree",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.74",
|
|
4
4
|
"description": "React component for selective directory filtering and file tree visualization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "bun run clean && bun run build:esm && bun run build:types",
|
|
20
|
-
"build:esm": "bun build ./index.ts --outfile ./dist/index.mjs --format esm --target browser --external react --external react-dom --external lucide-react --external react-arborist --external @principal-ade/industry-theme --external @principal-ade/panel-framework-core --external @principal-ai/repository-abstraction --external @principal-ai/principal-view-core",
|
|
20
|
+
"build:esm": "bun build ./index.ts --outfile ./dist/index.mjs --format esm --target browser --external react --external react-dom --external lucide-react --external react-arborist --external @principal-ade/industry-theme --external @principal-ade/panel-framework-core --external @principal-ai/repository-abstraction --external @principal-ai/principal-view-core --external @principal-ai/alexandria-core-library",
|
|
21
21
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationMap",
|
|
22
22
|
"dev": "bun run build --watch",
|
|
23
23
|
"test": "bun test",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@principal-ade/industry-theme": ">=0.1.0",
|
|
51
51
|
"@principal-ade/panel-framework-core": ">=0.4.0",
|
|
52
|
+
"@principal-ai/alexandria-core-library": ">=0.3.0",
|
|
52
53
|
"@principal-ai/principal-view-core": "^0.24.8",
|
|
53
54
|
"@principal-ai/repository-abstraction": "^0.5.7",
|
|
54
55
|
"lucide-react": ">=0.263.0",
|
|
@@ -62,6 +63,9 @@
|
|
|
62
63
|
"@principal-ade/panel-framework-core": {
|
|
63
64
|
"optional": true
|
|
64
65
|
},
|
|
66
|
+
"@principal-ai/alexandria-core-library": {
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
65
69
|
"react": {
|
|
66
70
|
"optional": true
|
|
67
71
|
},
|
|
@@ -76,6 +80,7 @@
|
|
|
76
80
|
"@eslint/js": "^9.32.0",
|
|
77
81
|
"@principal-ade/industry-theme": "^0.1.0",
|
|
78
82
|
"@principal-ade/panel-framework-core": "^0.4.2",
|
|
83
|
+
"@principal-ai/alexandria-core-library": "^0.3.3",
|
|
79
84
|
"@principal-ai/principal-view-core": "^0.24.8",
|
|
80
85
|
"@principal-ai/repository-abstraction": "^0.5.7",
|
|
81
86
|
"@storybook/addon-docs": "^10.0.0",
|