@principal-ai/file-city-react 0.5.40 → 0.5.41
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/components/FileCity3D/FileCity3D.d.ts +8 -2
- package/dist/components/FileCity3D/FileCity3D.d.ts.map +1 -1
- package/dist/components/FileCity3D/FileCity3D.js +129 -40
- package/dist/components/FileCityExplorer/AddToAreaModal.d.ts +14 -0
- package/dist/components/FileCityExplorer/AddToAreaModal.d.ts.map +1 -0
- package/dist/components/FileCityExplorer/AddToAreaModal.js +140 -0
- package/dist/components/FileCityExplorer/AddToScopeModal.d.ts +14 -0
- package/dist/components/FileCityExplorer/AddToScopeModal.d.ts.map +1 -0
- package/dist/components/FileCityExplorer/AddToScopeModal.js +176 -0
- package/dist/components/FileCityExplorer/FileCityExplorer.d.ts +30 -0
- package/dist/components/FileCityExplorer/FileCityExplorer.d.ts.map +1 -0
- package/dist/components/FileCityExplorer/FileCityExplorer.js +1045 -0
- package/dist/components/FileCityExplorer/ScopeInfoOverlay.d.ts +10 -0
- package/dist/components/FileCityExplorer/ScopeInfoOverlay.d.ts.map +1 -0
- package/dist/components/FileCityExplorer/ScopeInfoOverlay.js +73 -0
- package/dist/components/FileCityExplorer/index.d.ts +3 -0
- package/dist/components/FileCityExplorer/index.d.ts.map +1 -0
- package/dist/components/FileCityExplorer/index.js +1 -0
- package/dist/components/FileCityExplorer/layers.d.ts +16 -0
- package/dist/components/FileCityExplorer/layers.d.ts.map +1 -0
- package/dist/components/FileCityExplorer/layers.js +61 -0
- package/dist/components/FileCityExplorer/model.d.ts +32 -0
- package/dist/components/FileCityExplorer/model.d.ts.map +1 -0
- package/dist/components/FileCityExplorer/model.js +14 -0
- package/dist/components/FileCityExplorer/pathConversion.d.ts +19 -0
- package/dist/components/FileCityExplorer/pathConversion.d.ts.map +1 -0
- package/dist/components/FileCityExplorer/pathConversion.js +26 -0
- package/dist/components/FileCityExplorer/scopeTreePaths.d.ts +21 -0
- package/dist/components/FileCityExplorer/scopeTreePaths.d.ts.map +1 -0
- package/dist/components/FileCityExplorer/scopeTreePaths.js +42 -0
- package/dist/components/FileCityExplorer/styles.d.ts +9 -0
- package/dist/components/FileCityExplorer/styles.d.ts.map +1 -0
- package/dist/components/FileCityExplorer/styles.js +28 -0
- package/dist/utils/folderElevatedPanels.d.ts +3 -1
- package/dist/utils/folderElevatedPanels.d.ts.map +1 -1
- package/dist/utils/folderElevatedPanels.js +5 -2
- package/package.json +2 -1
- package/src/components/FileCity3D/FileCity3D.tsx +200 -52
- package/src/components/FileCityExplorer/AddToAreaModal.tsx +273 -0
- package/src/components/FileCityExplorer/AddToScopeModal.tsx +320 -0
- package/src/components/FileCityExplorer/FileCityExplorer.tsx +1457 -0
- package/src/components/FileCityExplorer/ScopeInfoOverlay.tsx +229 -0
- package/src/components/FileCityExplorer/index.ts +2 -0
- package/src/components/FileCityExplorer/layers.ts +72 -0
- package/src/components/FileCityExplorer/model.ts +35 -0
- package/src/components/FileCityExplorer/pathConversion.ts +32 -0
- package/src/components/FileCityExplorer/scopeTreePaths.ts +52 -0
- package/src/components/FileCityExplorer/styles.ts +34 -0
- package/src/stories/2D3DComparison.stories.tsx +13 -2
- package/src/stories/ElevatedScopePanels.stories.tsx +295 -0
- package/src/stories/FileCity3D.stories.tsx +24 -3
- package/src/stories/FileCityExplorer.stories.tsx +2474 -0
- package/src/stories/FileCityExplorerComponent.stories.tsx +59 -0
- package/src/utils/folderElevatedPanels.ts +8 -2
- package/src/stories/ScopeOverlay.stories.tsx +0 -1610
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { FileCityExplorer, type ProjectArea } from '../components/FileCityExplorer';
|
|
4
|
+
import type { CityData } from '../components/FileCity3D';
|
|
5
|
+
|
|
6
|
+
import electronAppCityData from '../../../../assets/electron-app-city-data.json';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Side-by-side test of the extracted `<FileCityExplorer>` component against
|
|
10
|
+
* the original story-template implementation in
|
|
11
|
+
* `FileCityExplorer.stories.tsx`. The two should look and behave identically;
|
|
12
|
+
* differences indicate regressions in the extraction.
|
|
13
|
+
*
|
|
14
|
+
* Persistence is intentionally namespaced to a separate `localStorage` key
|
|
15
|
+
* (`file-city.scope-overlay-component`) so the two stories don't fight over
|
|
16
|
+
* the same scopes/areas state.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const meta: Meta<typeof FileCityExplorer> = {
|
|
20
|
+
title: 'Experiments/FileCityExplorer (Component)',
|
|
21
|
+
component: FileCityExplorer,
|
|
22
|
+
parameters: { layout: 'fullscreen' },
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof FileCityExplorer>;
|
|
27
|
+
|
|
28
|
+
const DEFAULT_AREAS: ProjectArea[] = [
|
|
29
|
+
{
|
|
30
|
+
name: 'Documentation',
|
|
31
|
+
description: 'Project docs, READMEs, and design notes — not OTEL-instrumented.',
|
|
32
|
+
paths: ['docs'],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'Build & tooling',
|
|
36
|
+
description: 'Build scripts, bundler config, and developer tooling.',
|
|
37
|
+
paths: ['scripts', 'build'],
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
export const Default: Story = {
|
|
42
|
+
render: () => (
|
|
43
|
+
<FileCityExplorer
|
|
44
|
+
cityData={electronAppCityData as CityData}
|
|
45
|
+
packageRoot="electron-app/"
|
|
46
|
+
initialAreas={DEFAULT_AREAS}
|
|
47
|
+
persistKey="file-city.scope-overlay-component"
|
|
48
|
+
/>
|
|
49
|
+
),
|
|
50
|
+
parameters: {
|
|
51
|
+
docs: {
|
|
52
|
+
description: {
|
|
53
|
+
story:
|
|
54
|
+
'Extracted `<FileCityExplorer>` component over the electron-app city. ' +
|
|
55
|
+
'Should behave identically to the original story (FileCityExplorer / Default).',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
@@ -105,7 +105,9 @@ export interface BuildFolderElevatedPanelsOptions {
|
|
|
105
105
|
*/
|
|
106
106
|
expandedFolders: ReadonlySet<string>;
|
|
107
107
|
/** Toggle handler invoked when an umbrella tile is clicked. */
|
|
108
|
-
onToggleFolder?: (folderPath: string) => void;
|
|
108
|
+
onToggleFolder?: (folderPath: string, event: MouseEvent) => void;
|
|
109
|
+
/** Double-click handler for an umbrella tile. */
|
|
110
|
+
onDoubleClickFolder?: (folderPath: string, event: MouseEvent) => void;
|
|
109
111
|
/**
|
|
110
112
|
* Scale label font size by descendant file count. Default true. When false,
|
|
111
113
|
* the renderer's auto-sized label is used (size derived from tile footprint).
|
|
@@ -134,6 +136,7 @@ export function buildFolderElevatedPanels(
|
|
|
134
136
|
cityData,
|
|
135
137
|
expandedFolders,
|
|
136
138
|
onToggleFolder,
|
|
139
|
+
onDoubleClickFolder,
|
|
137
140
|
scaleLabelByFileCount = true,
|
|
138
141
|
} = options;
|
|
139
142
|
const index = options.index ?? buildFolderIndex(cityData);
|
|
@@ -161,7 +164,10 @@ export function buildFolderElevatedPanels(
|
|
|
161
164
|
bounds,
|
|
162
165
|
label,
|
|
163
166
|
labelSize,
|
|
164
|
-
onClick: onToggleFolder ? () => onToggleFolder(folderPath) : undefined,
|
|
167
|
+
onClick: onToggleFolder ? (event: MouseEvent) => onToggleFolder(folderPath, event) : undefined,
|
|
168
|
+
onDoubleClick: onDoubleClickFolder
|
|
169
|
+
? (event: MouseEvent) => onDoubleClickFolder(folderPath, event)
|
|
170
|
+
: undefined,
|
|
165
171
|
});
|
|
166
172
|
};
|
|
167
173
|
|