@principal-ai/file-city-react 0.3.0
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/builder/cityDataUtils.d.ts +15 -0
- package/dist/builder/cityDataUtils.d.ts.map +1 -0
- package/dist/builder/cityDataUtils.js +348 -0
- package/dist/components/ArchitectureMapHighlightLayers.d.ts +63 -0
- package/dist/components/ArchitectureMapHighlightLayers.d.ts.map +1 -0
- package/dist/components/ArchitectureMapHighlightLayers.js +1040 -0
- package/dist/components/CityViewWithReactFlow.d.ts +14 -0
- package/dist/components/CityViewWithReactFlow.d.ts.map +1 -0
- package/dist/components/CityViewWithReactFlow.js +266 -0
- package/dist/config/files.json +996 -0
- package/dist/hooks/useCodeCityData.d.ts +21 -0
- package/dist/hooks/useCodeCityData.d.ts.map +1 -0
- package/dist/hooks/useCodeCityData.js +57 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/render/client/drawLayeredBuildings.d.ts +51 -0
- package/dist/render/client/drawLayeredBuildings.d.ts.map +1 -0
- package/dist/render/client/drawLayeredBuildings.js +650 -0
- package/dist/stories/ArchitectureMapGridLayout.stories.d.ts +73 -0
- package/dist/stories/ArchitectureMapGridLayout.stories.d.ts.map +1 -0
- package/dist/stories/ArchitectureMapGridLayout.stories.js +345 -0
- package/dist/stories/ArchitectureMapHighlightLayers.stories.d.ts +78 -0
- package/dist/stories/ArchitectureMapHighlightLayers.stories.d.ts.map +1 -0
- package/dist/stories/ArchitectureMapHighlightLayers.stories.js +270 -0
- package/dist/stories/CityViewWithReactFlow.stories.d.ts +24 -0
- package/dist/stories/CityViewWithReactFlow.stories.d.ts.map +1 -0
- package/dist/stories/CityViewWithReactFlow.stories.js +778 -0
- package/dist/stories/sample-data.d.ts +4 -0
- package/dist/stories/sample-data.d.ts.map +1 -0
- package/dist/stories/sample-data.js +268 -0
- package/dist/types/react-types.d.ts +17 -0
- package/dist/types/react-types.d.ts.map +1 -0
- package/dist/types/react-types.js +4 -0
- package/dist/utils/fileColorHighlightLayers.d.ts +86 -0
- package/dist/utils/fileColorHighlightLayers.d.ts.map +1 -0
- package/dist/utils/fileColorHighlightLayers.js +283 -0
- package/package.json +49 -0
- package/src/builder/cityDataUtils.ts +430 -0
- package/src/components/ArchitectureMapHighlightLayers.tsx +1518 -0
- package/src/components/CityViewWithReactFlow.tsx +365 -0
- package/src/config/files.json +996 -0
- package/src/hooks/useCodeCityData.ts +82 -0
- package/src/index.ts +64 -0
- package/src/render/client/drawLayeredBuildings.ts +946 -0
- package/src/stories/ArchitectureMapGridLayout.stories.tsx +410 -0
- package/src/stories/ArchitectureMapHighlightLayers.stories.tsx +312 -0
- package/src/stories/CityViewWithReactFlow.stories.tsx +787 -0
- package/src/stories/sample-data.ts +301 -0
- package/src/types/react-types.ts +18 -0
- package/src/utils/fileColorHighlightLayers.ts +378 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CityData } from '@principal-ai/file-city-builder';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ cityData, highlightLayers, onLayerToggle, focusDirectory, rootDirectoryName, onDirectorySelect, onFileClick, enableZoom, fullSize, showGrid, showFileNames, className, selectiveRender, canvasBackgroundColor, hoverBorderColor, disableOpacityDimming, defaultDirectoryColor, defaultBuildingColor, subdirectoryMode, showLayerControls, showFileTypeIcons, showDirectoryLabels, transform, onHover, buildingBorderRadius, districtBorderRadius, }: import("../components/ArchitectureMapHighlightLayers").ArchitectureMapHighlightLayersProps) => import("react").JSX.Element;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
10
|
+
cityData?: CityData | undefined;
|
|
11
|
+
highlightLayers?: import("..").HighlightLayer[] | undefined;
|
|
12
|
+
onLayerToggle?: ((layerId: string, enabled: boolean) => void) | undefined;
|
|
13
|
+
showLayerControls?: boolean | undefined;
|
|
14
|
+
defaultBuildingColor?: string | undefined;
|
|
15
|
+
focusDirectory?: string | null | undefined;
|
|
16
|
+
rootDirectoryName?: string | undefined;
|
|
17
|
+
onDirectorySelect?: ((directory: string | null) => void) | undefined;
|
|
18
|
+
onFileClick?: ((path: string, type: "file" | "directory") => void) | undefined;
|
|
19
|
+
enableZoom?: boolean | undefined;
|
|
20
|
+
fullSize?: boolean | undefined;
|
|
21
|
+
showGrid?: boolean | undefined;
|
|
22
|
+
showFileNames?: boolean | undefined;
|
|
23
|
+
className?: string | undefined;
|
|
24
|
+
selectiveRender?: import("@principal-ai/file-city-builder").SelectiveRenderOptions | undefined;
|
|
25
|
+
canvasBackgroundColor?: string | undefined;
|
|
26
|
+
hoverBorderColor?: string | undefined;
|
|
27
|
+
disableOpacityDimming?: boolean | undefined;
|
|
28
|
+
defaultDirectoryColor?: string | undefined;
|
|
29
|
+
subdirectoryMode?: {
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
rootPath?: string;
|
|
32
|
+
autoCenter?: boolean;
|
|
33
|
+
filters?: Array<{
|
|
34
|
+
path: string;
|
|
35
|
+
mode: "include" | "exclude";
|
|
36
|
+
}>;
|
|
37
|
+
combineMode?: "union" | "intersection";
|
|
38
|
+
} | null | undefined;
|
|
39
|
+
showFileTypeIcons?: boolean | undefined;
|
|
40
|
+
showDirectoryLabels?: boolean | undefined;
|
|
41
|
+
transform?: {
|
|
42
|
+
rotation?: 0 | 90 | 180 | 270;
|
|
43
|
+
flipHorizontal?: boolean;
|
|
44
|
+
flipVertical?: boolean;
|
|
45
|
+
} | undefined;
|
|
46
|
+
onHover?: ((info: {
|
|
47
|
+
hoveredDistrict: import("@principal-ai/file-city-builder").CityDistrict | null;
|
|
48
|
+
hoveredBuilding: import("@principal-ai/file-city-builder").CityBuilding | null;
|
|
49
|
+
mousePos: {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
};
|
|
53
|
+
fileTooltip: {
|
|
54
|
+
text: string;
|
|
55
|
+
} | null;
|
|
56
|
+
directoryTooltip: {
|
|
57
|
+
text: string;
|
|
58
|
+
} | null;
|
|
59
|
+
fileCount: number | null;
|
|
60
|
+
}) => void) | undefined;
|
|
61
|
+
buildingBorderRadius?: number | undefined;
|
|
62
|
+
districtBorderRadius?: number | undefined;
|
|
63
|
+
}>) => import("react").JSX.Element)[];
|
|
64
|
+
};
|
|
65
|
+
export default meta;
|
|
66
|
+
type Story = StoryObj<typeof meta>;
|
|
67
|
+
export declare const DefaultsTest: Story;
|
|
68
|
+
export declare const TwoByTwoGrid: Story;
|
|
69
|
+
export declare const ThreeByThreeGrid: Story;
|
|
70
|
+
export declare const SparseGrid: Story;
|
|
71
|
+
export declare const GridWithHighlights: Story;
|
|
72
|
+
export declare const LargeGrid: Story;
|
|
73
|
+
//# sourceMappingURL=ArchitectureMapGridLayout.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArchitectureMapGridLayout.stories.d.ts","sourceRoot":"","sources":["../../src/stories/ArchitectureMapGridLayout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAGL,QAAQ,EACT,MAAM,iCAAiC,CAAC;AAuCzC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA8BG,CAAC;oBACE,CAAC;sBACD,CAAC;mBACZ,CAAC;;;;uBAIF,CAAF;;;;;oBAUc,CAAC;0BAGJ,CAAC;wBAGA,CAAC;;;;;;;;;;;;;;;;;;;;CAxCwC,CAAC;AAExD,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA8EnC,eAAO,MAAM,YAAY,EAAE,KAkC1B,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,KA2C1B,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,KAmD9B,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,KA+BxB,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,KAqDhC,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,KA4CvB,CAAC"}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LargeGrid = exports.GridWithHighlights = exports.SparseGrid = exports.ThreeByThreeGrid = exports.TwoByTwoGrid = exports.DefaultsTest = void 0;
|
|
4
|
+
const file_city_builder_1 = require("@principal-ai/file-city-builder");
|
|
5
|
+
const ArchitectureMapHighlightLayers_1 = require("../components/ArchitectureMapHighlightLayers");
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/ArchitectureMapHighlightLayers/Grid Layout',
|
|
8
|
+
component: ArchitectureMapHighlightLayers_1.ArchitectureMapHighlightLayers,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'fullscreen',
|
|
11
|
+
},
|
|
12
|
+
decorators: [
|
|
13
|
+
Story => (React.createElement("div", { style: { width: '100vw', height: '100vh' } },
|
|
14
|
+
React.createElement(Story, null))),
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
exports.default = meta;
|
|
18
|
+
// Helper function to create city data with grid layout
|
|
19
|
+
function createGridLayoutCityData(config, customFilePaths) {
|
|
20
|
+
// Create a mock file tree with typical monorepo structure
|
|
21
|
+
const filePaths = customFilePaths || [
|
|
22
|
+
// Core source files
|
|
23
|
+
'src/index.ts',
|
|
24
|
+
'src/components/App.tsx',
|
|
25
|
+
'src/components/Header.tsx',
|
|
26
|
+
'src/utils/helpers.ts',
|
|
27
|
+
'lib/core.ts',
|
|
28
|
+
'lib/utils.ts',
|
|
29
|
+
// Configuration
|
|
30
|
+
'.a24z/config.json',
|
|
31
|
+
'.principleMD/settings.json',
|
|
32
|
+
'config/webpack.config.js',
|
|
33
|
+
// Documentation
|
|
34
|
+
'docs/README.md',
|
|
35
|
+
'docs/API.md',
|
|
36
|
+
'examples/basic.ts',
|
|
37
|
+
'examples/advanced.ts',
|
|
38
|
+
// Testing
|
|
39
|
+
'tests/unit/app.test.ts',
|
|
40
|
+
'tests/integration/api.test.ts',
|
|
41
|
+
'__tests__/components.test.tsx',
|
|
42
|
+
'test-utils/helpers.ts',
|
|
43
|
+
// Build outputs
|
|
44
|
+
'dist/bundle.js',
|
|
45
|
+
'build/index.html',
|
|
46
|
+
'.next/static/chunks/pages.js',
|
|
47
|
+
// Dependencies
|
|
48
|
+
'node_modules/react/index.js',
|
|
49
|
+
'node_modules/typescript/lib/typescript.js',
|
|
50
|
+
'packages/shared/index.ts',
|
|
51
|
+
'packages/ui/components.tsx',
|
|
52
|
+
// Assets
|
|
53
|
+
'public/index.html',
|
|
54
|
+
'public/favicon.ico',
|
|
55
|
+
'static/logo.svg',
|
|
56
|
+
'assets/styles.css',
|
|
57
|
+
// Root files
|
|
58
|
+
'package.json',
|
|
59
|
+
'README.md',
|
|
60
|
+
'.gitignore',
|
|
61
|
+
'tsconfig.json',
|
|
62
|
+
];
|
|
63
|
+
// Convert file paths to FileInfo objects
|
|
64
|
+
const fileInfos = filePaths.map(path => ({
|
|
65
|
+
name: path.split('/').pop() || path,
|
|
66
|
+
path: path,
|
|
67
|
+
relativePath: path,
|
|
68
|
+
size: Math.random() * 10000, // Random size for demo
|
|
69
|
+
extension: path.includes('.') ? '.' + (path.split('.').pop() || '') : '',
|
|
70
|
+
lastModified: new Date(),
|
|
71
|
+
isDirectory: false,
|
|
72
|
+
}));
|
|
73
|
+
// Build a proper file tree with hierarchy
|
|
74
|
+
const fileTree = (0, file_city_builder_1.buildFileSystemTreeFromFileInfoList)(fileInfos, 'demo-sha');
|
|
75
|
+
const cityBuilder = new file_city_builder_1.CodeCityBuilderWithGrid();
|
|
76
|
+
// Use the new integrated grid layout builder with adaptive sizing
|
|
77
|
+
// This allows the grid to calculate its own optimal dimensions
|
|
78
|
+
return cityBuilder.buildCityFromFileSystem(fileTree, '', {
|
|
79
|
+
gridLayout: config,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// Minimal config - tests default UI metadata
|
|
83
|
+
exports.DefaultsTest = {
|
|
84
|
+
args: {
|
|
85
|
+
cityData: createGridLayoutCityData({
|
|
86
|
+
id: 'defaults-test',
|
|
87
|
+
version: '1.0.0',
|
|
88
|
+
name: 'Test Default UI Settings',
|
|
89
|
+
description: 'Tests default UI metadata settings when none are provided',
|
|
90
|
+
overviewPath: 'README.md',
|
|
91
|
+
cells: {
|
|
92
|
+
Source: {
|
|
93
|
+
files: ['src', 'lib'],
|
|
94
|
+
coordinates: [0, 0],
|
|
95
|
+
},
|
|
96
|
+
Config: {
|
|
97
|
+
files: ['config', '.*'],
|
|
98
|
+
coordinates: [0, 1],
|
|
99
|
+
},
|
|
100
|
+
Tests: {
|
|
101
|
+
files: ['test*', '__tests__'],
|
|
102
|
+
coordinates: [1, 0],
|
|
103
|
+
},
|
|
104
|
+
Build: {
|
|
105
|
+
files: ['dist', 'build', 'node_modules'],
|
|
106
|
+
coordinates: [1, 1],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
// No metadata.ui provided - should use defaults
|
|
110
|
+
}),
|
|
111
|
+
showGrid: true,
|
|
112
|
+
showFileNames: false,
|
|
113
|
+
showDirectoryLabels: true,
|
|
114
|
+
fullSize: true,
|
|
115
|
+
enableZoom: true,
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
// 2x2 Grid Layout with Labels
|
|
119
|
+
exports.TwoByTwoGrid = {
|
|
120
|
+
args: {
|
|
121
|
+
cityData: createGridLayoutCityData({
|
|
122
|
+
id: 'two-by-two-grid',
|
|
123
|
+
version: '1.0.0',
|
|
124
|
+
name: 'Two by Two Grid Layout',
|
|
125
|
+
description: 'A 2x2 grid layout organizing code into four quadrants',
|
|
126
|
+
overviewPath: 'README.md',
|
|
127
|
+
cells: {
|
|
128
|
+
Source: {
|
|
129
|
+
files: ['src', 'lib'],
|
|
130
|
+
coordinates: [0, 0],
|
|
131
|
+
},
|
|
132
|
+
Configuration: {
|
|
133
|
+
files: ['config', '.a24z', '.principleMD', 'tsconfig.json', 'package.json'],
|
|
134
|
+
coordinates: [1, 0],
|
|
135
|
+
},
|
|
136
|
+
Testing: {
|
|
137
|
+
files: ['tests', '__tests__', 'test-utils'],
|
|
138
|
+
coordinates: [0, 1],
|
|
139
|
+
},
|
|
140
|
+
Documentation: {
|
|
141
|
+
files: ['docs', 'examples', 'README.md'],
|
|
142
|
+
coordinates: [1, 1],
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
metadata: {
|
|
146
|
+
ui: {
|
|
147
|
+
paddingTop: 10,
|
|
148
|
+
paddingBottom: 10,
|
|
149
|
+
paddingLeft: 15,
|
|
150
|
+
paddingRight: 15,
|
|
151
|
+
paddingInner: 8,
|
|
152
|
+
paddingOuter: 20,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
}),
|
|
156
|
+
showGrid: true,
|
|
157
|
+
showFileNames: false,
|
|
158
|
+
showDirectoryLabels: true,
|
|
159
|
+
fullSize: true,
|
|
160
|
+
enableZoom: true,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
// 3x3 Grid Layout
|
|
164
|
+
exports.ThreeByThreeGrid = {
|
|
165
|
+
args: {
|
|
166
|
+
cityData: createGridLayoutCityData({
|
|
167
|
+
id: 'three-by-three-grid',
|
|
168
|
+
version: '1.0.0',
|
|
169
|
+
name: 'Three by Three Grid Layout',
|
|
170
|
+
description: 'A 3x3 grid layout for more granular organization',
|
|
171
|
+
overviewPath: 'README.md',
|
|
172
|
+
cells: {
|
|
173
|
+
Source: {
|
|
174
|
+
files: ['src'],
|
|
175
|
+
coordinates: [0, 0],
|
|
176
|
+
},
|
|
177
|
+
Libraries: {
|
|
178
|
+
files: ['lib'],
|
|
179
|
+
coordinates: [1, 0],
|
|
180
|
+
},
|
|
181
|
+
Packages: {
|
|
182
|
+
files: ['packages'],
|
|
183
|
+
coordinates: [2, 0],
|
|
184
|
+
},
|
|
185
|
+
Tests: {
|
|
186
|
+
files: ['tests', '__tests__'],
|
|
187
|
+
coordinates: [0, 1],
|
|
188
|
+
},
|
|
189
|
+
Configuration: {
|
|
190
|
+
files: ['config', '.*', 'tsconfig.json', 'package.json'],
|
|
191
|
+
coordinates: [1, 1],
|
|
192
|
+
},
|
|
193
|
+
Documentation: {
|
|
194
|
+
files: ['docs', 'README.md'],
|
|
195
|
+
coordinates: [2, 1],
|
|
196
|
+
},
|
|
197
|
+
'Test Utils': {
|
|
198
|
+
files: ['test-utils'],
|
|
199
|
+
coordinates: [0, 2],
|
|
200
|
+
},
|
|
201
|
+
Build: {
|
|
202
|
+
files: ['dist', 'build', '.next'],
|
|
203
|
+
coordinates: [1, 2],
|
|
204
|
+
},
|
|
205
|
+
Assets: {
|
|
206
|
+
files: ['public', 'static', 'assets'],
|
|
207
|
+
coordinates: [2, 2],
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
}),
|
|
211
|
+
showGrid: true,
|
|
212
|
+
fullSize: true,
|
|
213
|
+
enableZoom: true,
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
// Sparse Grid Layout (gaps in grid)
|
|
217
|
+
exports.SparseGrid = {
|
|
218
|
+
args: {
|
|
219
|
+
cityData: createGridLayoutCityData({
|
|
220
|
+
id: 'sparse-grid',
|
|
221
|
+
version: '1.0.0',
|
|
222
|
+
name: 'Sparse Grid Layout',
|
|
223
|
+
description: 'A grid with intentional gaps for visual organization',
|
|
224
|
+
overviewPath: 'README.md',
|
|
225
|
+
cells: {
|
|
226
|
+
Source: {
|
|
227
|
+
files: ['src', 'lib'],
|
|
228
|
+
coordinates: [0, 0],
|
|
229
|
+
},
|
|
230
|
+
Tests: {
|
|
231
|
+
files: ['tests', '__tests__', 'test-utils'],
|
|
232
|
+
coordinates: [2, 0],
|
|
233
|
+
},
|
|
234
|
+
Documentation: {
|
|
235
|
+
files: ['docs', 'examples', 'README.md'],
|
|
236
|
+
coordinates: [0, 2],
|
|
237
|
+
},
|
|
238
|
+
Build: {
|
|
239
|
+
files: ['dist', 'build', '.next', 'node_modules'],
|
|
240
|
+
coordinates: [2, 2],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
}),
|
|
244
|
+
showGrid: true,
|
|
245
|
+
fullSize: true,
|
|
246
|
+
enableZoom: true,
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
// Custom colored grid with highlight layers
|
|
250
|
+
exports.GridWithHighlights = {
|
|
251
|
+
args: {
|
|
252
|
+
cityData: createGridLayoutCityData({
|
|
253
|
+
id: 'grid-with-highlights',
|
|
254
|
+
version: '1.0.0',
|
|
255
|
+
name: 'Grid with Highlights',
|
|
256
|
+
description: 'Grid layout with custom highlight layers',
|
|
257
|
+
overviewPath: 'README.md',
|
|
258
|
+
cells: {
|
|
259
|
+
Source: {
|
|
260
|
+
files: ['src', 'lib'],
|
|
261
|
+
coordinates: [0, 0],
|
|
262
|
+
},
|
|
263
|
+
Tests: {
|
|
264
|
+
files: ['tests', '__tests__'],
|
|
265
|
+
coordinates: [1, 0],
|
|
266
|
+
},
|
|
267
|
+
Config: {
|
|
268
|
+
files: ['config', '.*'],
|
|
269
|
+
coordinates: [0, 1],
|
|
270
|
+
},
|
|
271
|
+
Build: {
|
|
272
|
+
files: ['dist', 'build'],
|
|
273
|
+
coordinates: [1, 1],
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
}),
|
|
277
|
+
highlightLayers: [
|
|
278
|
+
{
|
|
279
|
+
id: 'modified-files',
|
|
280
|
+
name: 'Modified Files',
|
|
281
|
+
enabled: true,
|
|
282
|
+
color: '#3b82f6',
|
|
283
|
+
priority: 1,
|
|
284
|
+
items: [
|
|
285
|
+
{ path: 'src/components/App.tsx', type: 'file' },
|
|
286
|
+
{ path: 'src/utils/helpers.ts', type: 'file' },
|
|
287
|
+
],
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
id: 'test-coverage',
|
|
291
|
+
name: 'Test Coverage',
|
|
292
|
+
enabled: true,
|
|
293
|
+
color: '#10b981',
|
|
294
|
+
priority: 2,
|
|
295
|
+
items: [{ path: 'tests', type: 'directory' }],
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
showLayerControls: true,
|
|
299
|
+
showGrid: true,
|
|
300
|
+
fullSize: true,
|
|
301
|
+
enableZoom: true,
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
// Large grid (5x5)
|
|
305
|
+
exports.LargeGrid = {
|
|
306
|
+
args: {
|
|
307
|
+
cityData: createGridLayoutCityData({
|
|
308
|
+
id: 'large-grid',
|
|
309
|
+
version: '1.0.0',
|
|
310
|
+
name: 'Large 5x5 Grid',
|
|
311
|
+
description: 'A large grid for complex projects',
|
|
312
|
+
overviewPath: 'README.md',
|
|
313
|
+
cells: {
|
|
314
|
+
'Core Source': { files: ['src/core'], coordinates: [0, 0] },
|
|
315
|
+
Components: { files: ['src/components'], coordinates: [1, 0] },
|
|
316
|
+
Utils: { files: ['src/utils'], coordinates: [2, 0] },
|
|
317
|
+
Hooks: { files: ['src/hooks'], coordinates: [3, 0] },
|
|
318
|
+
Types: { files: ['src/types'], coordinates: [4, 0] },
|
|
319
|
+
'Unit Tests': { files: ['tests/unit'], coordinates: [0, 1] },
|
|
320
|
+
Integration: { files: ['tests/integration'], coordinates: [1, 1] },
|
|
321
|
+
E2E: { files: ['tests/e2e'], coordinates: [2, 1] },
|
|
322
|
+
'Test Utils': { files: ['test-utils'], coordinates: [3, 1] },
|
|
323
|
+
Fixtures: { files: ['fixtures'], coordinates: [4, 1] },
|
|
324
|
+
Config: { files: ['config'], coordinates: [0, 2] },
|
|
325
|
+
Scripts: { files: ['scripts'], coordinates: [1, 2] },
|
|
326
|
+
Tools: { files: ['tools'], coordinates: [2, 2] },
|
|
327
|
+
'CI/CD': { files: ['.github', '.gitlab'], coordinates: [3, 2] },
|
|
328
|
+
Docker: { files: ['docker', 'Dockerfile'], coordinates: [4, 2] },
|
|
329
|
+
Docs: { files: ['docs'], coordinates: [0, 3] },
|
|
330
|
+
Examples: { files: ['examples'], coordinates: [1, 3] },
|
|
331
|
+
API: { files: ['api'], coordinates: [2, 3] },
|
|
332
|
+
Packages: { files: ['packages'], coordinates: [3, 3] },
|
|
333
|
+
Libs: { files: ['lib'], coordinates: [4, 3] },
|
|
334
|
+
Build: { files: ['dist'], coordinates: [0, 4] },
|
|
335
|
+
Public: { files: ['public'], coordinates: [1, 4] },
|
|
336
|
+
Assets: { files: ['assets'], coordinates: [2, 4] },
|
|
337
|
+
Static: { files: ['static'], coordinates: [3, 4] },
|
|
338
|
+
'Node Modules': { files: ['node_modules'], coordinates: [4, 4] },
|
|
339
|
+
},
|
|
340
|
+
}),
|
|
341
|
+
showGrid: true,
|
|
342
|
+
fullSize: true,
|
|
343
|
+
enableZoom: true,
|
|
344
|
+
},
|
|
345
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { HighlightLayer } from '../render/client/drawLayeredBuildings';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ cityData, highlightLayers, onLayerToggle, focusDirectory, rootDirectoryName, onDirectorySelect, onFileClick, enableZoom, fullSize, showGrid, showFileNames, className, selectiveRender, canvasBackgroundColor, hoverBorderColor, disableOpacityDimming, defaultDirectoryColor, defaultBuildingColor, subdirectoryMode, showLayerControls, showFileTypeIcons, showDirectoryLabels, transform, onHover, buildingBorderRadius, districtBorderRadius, }: import("../components/ArchitectureMapHighlightLayers").ArchitectureMapHighlightLayersProps) => import("react").JSX.Element;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
10
|
+
cityData?: import("@principal-ai/file-city-builder").CityData | undefined;
|
|
11
|
+
highlightLayers?: HighlightLayer[] | undefined;
|
|
12
|
+
onLayerToggle?: ((layerId: string, enabled: boolean) => void) | undefined;
|
|
13
|
+
showLayerControls?: boolean | undefined;
|
|
14
|
+
defaultBuildingColor?: string | undefined;
|
|
15
|
+
focusDirectory?: string | null | undefined;
|
|
16
|
+
rootDirectoryName?: string | undefined;
|
|
17
|
+
onDirectorySelect?: ((directory: string | null) => void) | undefined;
|
|
18
|
+
onFileClick?: ((path: string, type: "file" | "directory") => void) | undefined;
|
|
19
|
+
enableZoom?: boolean | undefined;
|
|
20
|
+
fullSize?: boolean | undefined;
|
|
21
|
+
showGrid?: boolean | undefined;
|
|
22
|
+
showFileNames?: boolean | undefined;
|
|
23
|
+
className?: string | undefined;
|
|
24
|
+
selectiveRender?: import("@principal-ai/file-city-builder").SelectiveRenderOptions | undefined;
|
|
25
|
+
canvasBackgroundColor?: string | undefined;
|
|
26
|
+
hoverBorderColor?: string | undefined;
|
|
27
|
+
disableOpacityDimming?: boolean | undefined;
|
|
28
|
+
defaultDirectoryColor?: string | undefined;
|
|
29
|
+
subdirectoryMode?: {
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
rootPath?: string;
|
|
32
|
+
autoCenter?: boolean;
|
|
33
|
+
filters?: Array<{
|
|
34
|
+
path: string;
|
|
35
|
+
mode: "include" | "exclude";
|
|
36
|
+
}>;
|
|
37
|
+
combineMode?: "union" | "intersection";
|
|
38
|
+
} | null | undefined;
|
|
39
|
+
showFileTypeIcons?: boolean | undefined;
|
|
40
|
+
showDirectoryLabels?: boolean | undefined;
|
|
41
|
+
transform?: {
|
|
42
|
+
rotation?: 0 | 90 | 180 | 270;
|
|
43
|
+
flipHorizontal?: boolean;
|
|
44
|
+
flipVertical?: boolean;
|
|
45
|
+
} | undefined;
|
|
46
|
+
onHover?: ((info: {
|
|
47
|
+
hoveredDistrict: import("@principal-ai/file-city-builder").CityDistrict | null;
|
|
48
|
+
hoveredBuilding: import("@principal-ai/file-city-builder").CityBuilding | null;
|
|
49
|
+
mousePos: {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
};
|
|
53
|
+
fileTooltip: {
|
|
54
|
+
text: string;
|
|
55
|
+
} | null;
|
|
56
|
+
directoryTooltip: {
|
|
57
|
+
text: string;
|
|
58
|
+
} | null;
|
|
59
|
+
fileCount: number | null;
|
|
60
|
+
}) => void) | undefined;
|
|
61
|
+
buildingBorderRadius?: number | undefined;
|
|
62
|
+
districtBorderRadius?: number | undefined;
|
|
63
|
+
}>) => import("react").JSX.Element)[];
|
|
64
|
+
};
|
|
65
|
+
export default meta;
|
|
66
|
+
type Story = StoryObj<typeof meta>;
|
|
67
|
+
export declare const Default: Story;
|
|
68
|
+
export declare const WithHighlightLayers: Story;
|
|
69
|
+
export declare const DirectoryHighlighting: Story;
|
|
70
|
+
export declare const SelectiveRendering: Story;
|
|
71
|
+
export declare const SubdirectoryMode: Story;
|
|
72
|
+
export declare const Interactive: Story;
|
|
73
|
+
export declare const WithAbstractionLayer: Story;
|
|
74
|
+
export declare const CustomRenderStrategies: Story;
|
|
75
|
+
export declare const WithGrid: Story;
|
|
76
|
+
export declare const WithTransformations: Story;
|
|
77
|
+
export declare const WithBorderRadius: Story;
|
|
78
|
+
//# sourceMappingURL=ArchitectureMapHighlightLayers.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArchitectureMapHighlightLayers.stories.d.ts","sourceRoot":"","sources":["../../src/stories/ArchitectureMapHighlightLayers.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAsDqC,CAAA;oBACrC,CAAF;sBAAwB,CAAC;mBAAsB,CAAC;;;;uBAKhD,CAAD;;;;;oBAQyC,CAAA;0BACR,CAAC;wBAAyD,CAAC;;;;;;;;;;;;;;;;;;;;CAxD5C,CAAC;AAExD,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,KAsDjC,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,KAoBnC,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,KAUhC,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,KAW9B,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,KA0CzB,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,KAwBlC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,KAyDpC,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,KAQtB,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,KAWjC,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,KAQ9B,CAAC"}
|