codebase-onboarder 0.5.0 → 0.7.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/README.md +196 -47
- package/bin/build-if-source.js +23 -0
- package/cli/commands.d.ts +26 -0
- package/cli/commands.js +836 -811
- package/cli/commands.js.map +1 -0
- package/cli/explorer/advanced.d.ts +14 -0
- package/cli/explorer/advanced.js +449 -0
- package/cli/explorer/advanced.js.map +1 -0
- package/cli/explorer/app.d.ts +1 -0
- package/cli/explorer/app.js +396 -229
- package/cli/explorer/app.js.map +1 -0
- package/cli/explorer/assistant.d.ts +9 -0
- package/cli/explorer/assistant.js +58 -0
- package/cli/explorer/assistant.js.map +1 -0
- package/cli/explorer/commands.d.ts +17 -0
- package/cli/explorer/commands.js +400 -162
- package/cli/explorer/commands.js.map +1 -0
- package/cli/explorer/featureViews.d.ts +124 -0
- package/cli/explorer/featureViews.js +179 -0
- package/cli/explorer/featureViews.js.map +1 -0
- package/cli/explorer/github.d.ts +21 -0
- package/cli/explorer/github.js +73 -0
- package/cli/explorer/github.js.map +1 -0
- package/cli/explorer/graphs.d.ts +7 -0
- package/cli/explorer/graphs.js +173 -0
- package/cli/explorer/graphs.js.map +1 -0
- package/cli/explorer/picker.d.ts +22 -0
- package/cli/explorer/picker.js +150 -0
- package/cli/explorer/picker.js.map +1 -0
- package/cli/explorer/report.d.ts +85 -0
- package/cli/explorer/report.js +60 -0
- package/cli/explorer/report.js.map +1 -0
- package/cli/explorer/session.d.ts +449 -0
- package/cli/explorer/session.js +184 -95
- package/cli/explorer/session.js.map +1 -0
- package/cli/explorer/views.d.ts +19 -0
- package/cli/explorer/views.js +496 -412
- package/cli/explorer/views.js.map +1 -0
- package/cli/explorer/wrap.d.ts +1 -0
- package/cli/explorer/wrap.js +33 -0
- package/cli/explorer/wrap.js.map +1 -0
- package/cli/main.d.ts +1 -0
- package/cli/main.js +235 -138
- package/cli/main.js.map +1 -0
- package/cli/prompt.d.ts +5 -0
- package/cli/prompt.js +84 -80
- package/cli/prompt.js.map +1 -0
- package/cli/scanOptions.d.ts +2 -0
- package/cli/scanOptions.js +11 -0
- package/cli/scanOptions.js.map +1 -0
- package/cli/ui.d.ts +33 -0
- package/cli/ui.js +55 -35
- package/cli/ui.js.map +1 -0
- package/cli/wizard.d.ts +187 -0
- package/cli/wizard.js +304 -284
- package/cli/wizard.js.map +1 -0
- package/package.json +15 -4
- package/public/app.d.ts +1 -0
- package/public/app.js +1057 -1009
- package/public/app.js.map +1 -0
- package/public/browser.d.ts +68 -0
- package/public/browser.js +2 -0
- package/public/browser.js.map +1 -0
- package/public/index.html +30 -13
- package/public/js/about.d.ts +6 -0
- package/public/js/about.js +165 -172
- package/public/js/about.js.map +1 -0
- package/public/js/aiDraft.d.ts +3 -0
- package/public/js/aiDraft.js +116 -124
- package/public/js/aiDraft.js.map +1 -0
- package/public/js/analysisPanel.d.ts +7 -0
- package/public/js/analysisPanel.js +166 -166
- package/public/js/analysisPanel.js.map +1 -0
- package/public/js/analysisReport.d.ts +38 -0
- package/public/js/analysisReport.js +105 -110
- package/public/js/analysisReport.js.map +1 -0
- package/public/js/api.d.ts +26 -0
- package/public/js/api.js +176 -167
- package/public/js/api.js.map +1 -0
- package/public/js/atlas.d.ts +6 -0
- package/public/js/atlas.js +50 -58
- package/public/js/atlas.js.map +1 -0
- package/public/js/blameView.d.ts +2 -0
- package/public/js/blameView.js +36 -37
- package/public/js/blameView.js.map +1 -0
- package/public/js/codeTab.d.ts +3 -0
- package/public/js/codeTab.js +175 -180
- package/public/js/codeTab.js.map +1 -0
- package/public/js/codeViewer.d.ts +5 -0
- package/public/js/codeViewer.js +162 -150
- package/public/js/codeViewer.js.map +1 -0
- package/public/js/components/FileChip.d.ts +9 -0
- package/public/js/components/FileChip.js +45 -49
- package/public/js/components/FileChip.js.map +1 -0
- package/public/js/components/MetricSparkline.d.ts +7 -0
- package/public/js/components/MetricSparkline.js +35 -44
- package/public/js/components/MetricSparkline.js.map +1 -0
- package/public/js/components/RiskBadge.d.ts +9 -0
- package/public/js/components/RiskBadge.js +55 -63
- package/public/js/components/RiskBadge.js.map +1 -0
- package/public/js/deepAnalysisView.d.ts +99 -0
- package/public/js/deepAnalysisView.js +282 -302
- package/public/js/deepAnalysisView.js.map +1 -0
- package/public/js/diagramPane.d.ts +8 -0
- package/public/js/diagramPane.js +133 -135
- package/public/js/diagramPane.js.map +1 -0
- package/public/js/diffView.d.ts +6 -0
- package/public/js/diffView.js +222 -209
- package/public/js/diffView.js.map +1 -0
- package/public/js/docsView.d.ts +2 -0
- package/public/js/docsView.js +441 -442
- package/public/js/docsView.js.map +1 -0
- package/public/js/dom.d.ts +189 -0
- package/public/js/dom.js +5 -0
- package/public/js/dom.js.map +1 -0
- package/public/js/fileSourceBrowser.d.ts +5 -0
- package/public/js/fileSourceBrowser.js +33 -41
- package/public/js/fileSourceBrowser.js.map +1 -0
- package/public/js/flameGraph.d.ts +5 -0
- package/public/js/flameGraph.js +62 -72
- package/public/js/flameGraph.js.map +1 -0
- package/public/js/forceGraph.d.ts +10 -0
- package/public/js/forceGraph.js +581 -556
- package/public/js/forceGraph.js.map +1 -0
- package/public/js/heatmap.d.ts +4 -0
- package/public/js/heatmap.js +142 -164
- package/public/js/heatmap.js.map +1 -0
- package/public/js/highlight.d.ts +2 -0
- package/public/js/highlight.js +116 -107
- package/public/js/highlight.js.map +1 -0
- package/public/js/html.d.ts +2 -0
- package/public/js/html.js +14 -44
- package/public/js/html.js.map +1 -0
- package/public/js/insightsView.d.ts +5 -0
- package/public/js/insightsView.js +93 -111
- package/public/js/insightsView.js.map +1 -0
- package/public/js/inspector.d.ts +37 -0
- package/public/js/inspector.js +416 -445
- package/public/js/inspector.js.map +1 -0
- package/public/js/llm.d.ts +113 -0
- package/public/js/llm.js +233 -272
- package/public/js/llm.js.map +1 -0
- package/public/js/mapView.d.ts +3 -0
- package/public/js/mapView.js +121 -120
- package/public/js/mapView.js.map +1 -0
- package/public/js/markdown.d.ts +3 -0
- package/public/js/markdown.js +84 -91
- package/public/js/markdown.js.map +1 -0
- package/public/js/mindmap.d.ts +32 -0
- package/public/js/mindmap.js +244 -259
- package/public/js/mindmap.js.map +1 -0
- package/public/js/mobilePanels.d.ts +5 -0
- package/public/js/mobilePanels.js +50 -0
- package/public/js/mobilePanels.js.map +1 -0
- package/public/js/repoFiles.d.ts +12 -0
- package/public/js/repoFiles.js +28 -27
- package/public/js/repoFiles.js.map +1 -0
- package/public/js/reviewView.d.ts +28 -0
- package/public/js/reviewView.js +256 -0
- package/public/js/reviewView.js.map +1 -0
- package/public/js/sbomView.d.ts +3 -0
- package/public/js/sbomView.js +59 -67
- package/public/js/sbomView.js.map +1 -0
- package/public/js/scanCache.d.ts +16 -0
- package/public/js/scanCache.js +67 -65
- package/public/js/scanCache.js.map +1 -0
- package/public/js/search.d.ts +7 -0
- package/public/js/search.js +868 -800
- package/public/js/search.js.map +1 -0
- package/public/js/searchLocal.d.ts +42 -0
- package/public/js/searchLocal.js +87 -0
- package/public/js/searchLocal.js.map +1 -0
- package/public/js/serverSettings.d.ts +5 -0
- package/public/js/serverSettings.js +153 -164
- package/public/js/serverSettings.js.map +1 -0
- package/public/js/state.d.ts +798 -0
- package/public/js/state.js +114 -122
- package/public/js/state.js.map +1 -0
- package/public/js/tour.d.ts +6 -0
- package/public/js/tour.js +5 -7
- package/public/js/tour.js.map +1 -0
- package/public/js/transitions.d.ts +2 -0
- package/public/js/transitions.js +9 -10
- package/public/js/transitions.js.map +1 -0
- package/public/js/tree.d.ts +12 -0
- package/public/js/tree.js +157 -154
- package/public/js/tree.js.map +1 -0
- package/public/js/workflowsView.d.ts +3 -0
- package/public/js/workflowsView.js +15 -22
- package/public/js/workflowsView.js.map +1 -0
- package/public/search.css +495 -0
- package/public/styles.css +163 -346
- package/public/workbench.css +166 -0
- package/server/apiAuth.d.ts +3 -0
- package/server/apiAuth.js +18 -20
- package/server/apiAuth.js.map +1 -0
- package/server/apiDiff.d.ts +2 -0
- package/server/apiDiff.js +20 -18
- package/server/apiDiff.js.map +1 -0
- package/server/apiDocs.d.ts +2 -0
- package/server/apiDocs.js +38 -40
- package/server/apiDocs.js.map +1 -0
- package/server/apiFile.d.ts +1 -0
- package/server/apiFile.js +14 -17
- package/server/apiFile.js.map +1 -0
- package/server/apiGitBlame.d.ts +2 -0
- package/server/apiGitBlame.js +50 -51
- package/server/apiGitBlame.js.map +1 -0
- package/server/apiMcp.d.ts +4 -0
- package/server/apiMcp.js +64 -66
- package/server/apiMcp.js.map +1 -0
- package/server/apiReview.d.ts +2 -0
- package/server/apiReview.js +45 -0
- package/server/apiReview.js.map +1 -0
- package/server/apiScan.d.ts +5 -0
- package/server/apiScan.js +90 -71
- package/server/apiScan.js.map +1 -0
- package/server/apiSearch.d.ts +33 -0
- package/server/apiSearch.js +184 -200
- package/server/apiSearch.js.map +1 -0
- package/server/apiSettings.d.ts +4 -0
- package/server/apiSettings.js +84 -85
- package/server/apiSettings.js.map +1 -0
- package/server/apiTools.d.ts +3 -0
- package/server/apiTools.js +55 -56
- package/server/apiTools.js.map +1 -0
- package/server/auth.d.ts +5 -0
- package/server/auth.js +54 -51
- package/server/auth.js.map +1 -0
- package/server/config.d.ts +42 -0
- package/server/config.js +189 -194
- package/server/config.js.map +1 -0
- package/server/daemon.d.ts +12 -0
- package/server/daemon.js +124 -114
- package/server/daemon.js.map +1 -0
- package/server/fileSourceNode.d.ts +2 -0
- package/server/fileSourceNode.js +34 -36
- package/server/fileSourceNode.js.map +1 -0
- package/server/gitClone.d.ts +9 -0
- package/server/gitClone.js +59 -61
- package/server/gitClone.js.map +1 -0
- package/server/gitDiff.d.ts +36 -0
- package/server/gitDiff.js +271 -169
- package/server/gitDiff.js.map +1 -0
- package/server/gitHistory.d.ts +12 -0
- package/server/gitHistory.js +80 -80
- package/server/gitHistory.js.map +1 -0
- package/server/gitRemote.d.ts +12 -0
- package/server/gitRemote.js +60 -0
- package/server/gitRemote.js.map +1 -0
- package/server/htmlText.d.ts +4 -0
- package/server/htmlText.js +16 -23
- package/server/htmlText.js.map +1 -0
- package/server/http.d.ts +5 -0
- package/server/http.js +27 -30
- package/server/http.js.map +1 -0
- package/server/httpGuards.d.ts +2 -0
- package/server/httpGuards.js +47 -43
- package/server/httpGuards.js.map +1 -0
- package/server/https.d.ts +34 -0
- package/server/https.js +121 -111
- package/server/https.js.map +1 -0
- package/server/index.d.ts +40 -0
- package/server/index.js +139 -147
- package/server/index.js.map +1 -0
- package/server/layout.d.ts +26 -0
- package/server/layout.js +59 -37
- package/server/layout.js.map +1 -0
- package/server/llmProxy.d.ts +3 -0
- package/server/llmProxy.js +137 -135
- package/server/llmProxy.js.map +1 -0
- package/server/logger.d.ts +38 -0
- package/server/logger.js +198 -211
- package/server/logger.js.map +1 -0
- package/server/mcp/analysis.d.ts +29 -0
- package/server/mcp/analysis.js +99 -120
- package/server/mcp/analysis.js.map +1 -0
- package/server/mcp/http.d.ts +9 -0
- package/server/mcp/http.js +128 -137
- package/server/mcp/http.js.map +1 -0
- package/server/mcp/runner.d.ts +68 -0
- package/server/mcp/runner.js +208 -218
- package/server/mcp/runner.js.map +1 -0
- package/server/mcp/server.d.ts +29 -0
- package/server/mcp/server.js +166 -179
- package/server/mcp/server.js.map +1 -0
- package/server/mcp/standalone.d.ts +1 -0
- package/server/mcp/standalone.js +8 -10
- package/server/mcp/standalone.js.map +1 -0
- package/server/mcp/tools.d.ts +2020 -0
- package/server/mcp/tools.js +523 -574
- package/server/mcp/tools.js.map +1 -0
- package/server/paths.d.ts +3 -0
- package/server/paths.js +17 -15
- package/server/paths.js.map +1 -0
- package/server/pidfile.d.ts +9 -0
- package/server/pidfile.js +43 -45
- package/server/pidfile.js.map +1 -0
- package/server/review.d.ts +5 -0
- package/server/review.js +35 -0
- package/server/review.js.map +1 -0
- package/server/router.d.ts +33 -0
- package/server/router.js +191 -197
- package/server/router.js.map +1 -0
- package/server/scanRequest.d.ts +3 -0
- package/server/scanRequest.js +36 -0
- package/server/scanRequest.js.map +1 -0
- package/server/searchIndex.d.ts +17 -0
- package/server/searchIndex.js +83 -80
- package/server/searchIndex.js.map +1 -0
- package/server/sessions.d.ts +14 -0
- package/server/sessions.js +62 -70
- package/server/sessions.js.map +1 -0
- package/server/startup.d.ts +118 -0
- package/server/startup.js +143 -148
- package/server/startup.js.map +1 -0
- package/server/static.d.ts +6 -0
- package/server/static.js +28 -31
- package/server/static.js.map +1 -0
- package/server/tools/install.d.ts +4 -0
- package/server/tools/install.js +176 -185
- package/server/tools/install.js.map +1 -0
- package/server/tools/parse.d.ts +8 -0
- package/server/tools/parse.js +112 -114
- package/server/tools/parse.js.map +1 -0
- package/server/tools/platform.d.ts +9 -0
- package/server/tools/platform.js +49 -47
- package/server/tools/platform.js.map +1 -0
- package/server/tools/registry.d.ts +137 -0
- package/server/tools/registry.js +173 -172
- package/server/tools/registry.js.map +1 -0
- package/server/tools/scan.d.ts +34 -0
- package/server/tools/scan.js +89 -98
- package/server/tools/scan.js.map +1 -0
- package/server/tools.d.ts +34 -0
- package/server/tools.js +94 -107
- package/server/tools.js.map +1 -0
- package/server/tunnel.d.ts +29 -0
- package/server/tunnel.js +61 -66
- package/server/tunnel.js.map +1 -0
- package/shared/analyzer/docs.d.ts +16 -0
- package/shared/analyzer/docs.js +99 -93
- package/shared/analyzer/docs.js.map +1 -0
- package/shared/analyzer/explainLocal.d.ts +4 -0
- package/shared/analyzer/explainLocal.js +122 -142
- package/shared/analyzer/explainLocal.js.map +1 -0
- package/shared/analyzer/github.d.ts +37 -0
- package/shared/analyzer/github.js +79 -0
- package/shared/analyzer/github.js.map +1 -0
- package/shared/analyzer/graph.d.ts +41 -0
- package/shared/analyzer/graph.js +393 -400
- package/shared/analyzer/graph.js.map +1 -0
- package/shared/analyzer/health.d.ts +33 -0
- package/shared/analyzer/health.js +197 -193
- package/shared/analyzer/health.js.map +1 -0
- package/shared/analyzer/history.d.ts +29 -0
- package/shared/analyzer/history.js +110 -111
- package/shared/analyzer/history.js.map +1 -0
- package/shared/analyzer/jsonConfig.d.ts +2 -0
- package/shared/analyzer/jsonConfig.js +61 -0
- package/shared/analyzer/jsonConfig.js.map +1 -0
- package/shared/analyzer/languages/csharp.d.ts +26 -0
- package/shared/analyzer/languages/csharp.js +83 -88
- package/shared/analyzer/languages/csharp.js.map +1 -0
- package/shared/analyzer/languages/generic.d.ts +23 -0
- package/shared/analyzer/languages/generic.js +94 -105
- package/shared/analyzer/languages/generic.js.map +1 -0
- package/shared/analyzer/languages/go.d.ts +24 -0
- package/shared/analyzer/languages/go.js +45 -54
- package/shared/analyzer/languages/go.js.map +1 -0
- package/shared/analyzer/languages/index.d.ts +6 -0
- package/shared/analyzer/languages/index.js +19 -20
- package/shared/analyzer/languages/index.js.map +1 -0
- package/shared/analyzer/languages/java.d.ts +20 -0
- package/shared/analyzer/languages/java.js +73 -78
- package/shared/analyzer/languages/java.js.map +1 -0
- package/shared/analyzer/languages/javascript.d.ts +12 -0
- package/shared/analyzer/languages/javascript.js +258 -209
- package/shared/analyzer/languages/javascript.js.map +1 -0
- package/shared/analyzer/languages/python.d.ts +23 -0
- package/shared/analyzer/languages/python.js +92 -100
- package/shared/analyzer/languages/python.js.map +1 -0
- package/shared/analyzer/languages/rust.d.ts +17 -0
- package/shared/analyzer/languages/rust.js +96 -98
- package/shared/analyzer/languages/rust.js.map +1 -0
- package/shared/analyzer/languages/typescript.d.ts +11 -0
- package/shared/analyzer/languages/typescript.js +117 -116
- package/shared/analyzer/languages/typescript.js.map +1 -0
- package/shared/analyzer/licenses.d.ts +18 -0
- package/shared/analyzer/licenses.js +130 -133
- package/shared/analyzer/licenses.js.map +1 -0
- package/shared/analyzer/metrics.d.ts +20 -0
- package/shared/analyzer/metrics.js +112 -104
- package/shared/analyzer/metrics.js.map +1 -0
- package/shared/analyzer/pathUtil.d.ts +10 -0
- package/shared/analyzer/pathUtil.js +29 -35
- package/shared/analyzer/pathUtil.js.map +1 -0
- package/shared/analyzer/patterns.d.ts +11 -0
- package/shared/analyzer/patterns.js +231 -253
- package/shared/analyzer/patterns.js.map +1 -0
- package/shared/analyzer/scan.d.ts +62 -0
- package/shared/analyzer/scan.js +451 -442
- package/shared/analyzer/scan.js.map +1 -0
- package/shared/analyzer/scanControl.d.ts +11 -0
- package/shared/analyzer/scanControl.js +62 -0
- package/shared/analyzer/scanControl.js.map +1 -0
- package/shared/analyzer/security.d.ts +18 -0
- package/shared/analyzer/security.js +159 -159
- package/shared/analyzer/security.js.map +1 -0
- package/shared/analyzer/services.d.ts +5 -0
- package/shared/analyzer/services.js +141 -138
- package/shared/analyzer/services.js.map +1 -0
- package/shared/analyzer/stack.d.ts +6 -0
- package/shared/analyzer/stack.js +134 -141
- package/shared/analyzer/stack.js.map +1 -0
- package/shared/analyzer/tour.d.ts +2 -0
- package/shared/analyzer/tour.js +45 -53
- package/shared/analyzer/tour.js.map +1 -0
- package/shared/analyzer/util.d.ts +8 -0
- package/shared/analyzer/util.js +130 -76
- package/shared/analyzer/util.js.map +1 -0
- package/shared/analyzer/workflows.d.ts +8 -0
- package/shared/analyzer/workflows.js +139 -134
- package/shared/analyzer/workflows.js.map +1 -0
- package/shared/contracts.d.ts +250 -0
- package/shared/contracts.js +2 -0
- package/shared/contracts.js.map +1 -0
- package/shared/diagram/aiFacts.d.ts +35 -0
- package/shared/diagram/aiFacts.js +102 -105
- package/shared/diagram/aiFacts.js.map +1 -0
- package/shared/diagram/aiMermaid.d.ts +5 -0
- package/shared/diagram/aiMermaid.js +46 -45
- package/shared/diagram/aiMermaid.js.map +1 -0
- package/shared/diagram/atlas.d.ts +16 -0
- package/shared/diagram/atlas.js +51 -60
- package/shared/diagram/atlas.js.map +1 -0
- package/shared/diagram/mermaid.d.ts +43 -0
- package/shared/diagram/mermaid.js +348 -370
- package/shared/diagram/mermaid.js.map +1 -0
- package/shared/review/contracts.d.ts +95 -0
- package/shared/review/contracts.js +2 -0
- package/shared/review/contracts.js.map +1 -0
- package/shared/review/review.d.ts +10 -0
- package/shared/review/review.js +184 -0
- package/shared/review/review.js.map +1 -0
- package/shared/search/query.d.ts +32 -0
- package/shared/search/query.js +395 -388
- package/shared/search/query.js.map +1 -0
package/public/js/state.js
CHANGED
|
@@ -9,149 +9,141 @@
|
|
|
9
9
|
// place that can be tested.
|
|
10
10
|
//
|
|
11
11
|
// No DOM, no imports from the view layer: importable in Node.
|
|
12
|
-
|
|
13
12
|
// The views that share the Explorer tab and its canvas.
|
|
14
13
|
export const EXPLORER_VIEWS = ['map', 'files', 'patterns', 'health', 'security', 'history', 'services', 'tour', 'atlas'];
|
|
15
|
-
|
|
16
14
|
// Views whose default inspector panel is their own, rather than the overview.
|
|
17
15
|
const PANEL_VIEWS = { patterns: 'patterns', health: 'health', security: 'security', history: 'history' };
|
|
18
|
-
|
|
19
16
|
// Per-repo state, rebuilt by `loadRepo`. Split out from the rest so "what has
|
|
20
17
|
// to be reset when a new repo arrives" is a list in one place rather than a
|
|
21
18
|
// thing you remember — forgetting an entry here is how a new repo inherits the
|
|
22
19
|
// previous one's open tabs.
|
|
23
20
|
function perRepo() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
21
|
+
return {
|
|
22
|
+
scan: null,
|
|
23
|
+
facts: null,
|
|
24
|
+
manifest: null,
|
|
25
|
+
stack: null,
|
|
26
|
+
health: null,
|
|
27
|
+
security: null,
|
|
28
|
+
history: null,
|
|
29
|
+
patterns: null,
|
|
30
|
+
treeData: null,
|
|
31
|
+
scanId: null,
|
|
32
|
+
cloneId: null,
|
|
33
|
+
browserSource: null,
|
|
34
|
+
view: 'map',
|
|
35
|
+
lastExplorer: 'map',
|
|
36
|
+
folder: '',
|
|
37
|
+
detail: null, // file open in deep-dive, if any
|
|
38
|
+
selected: null, // the focused FILE (the inspector's current subject)
|
|
39
|
+
focusedFolder: null, // the focused FOLDER subject, when it's a folder
|
|
40
|
+
tour: { stops: [], idx: 0 },
|
|
41
|
+
currentDiagram: { source: '', nodes: {} },
|
|
42
|
+
aiDiagrams: {}, // viewKey -> { body, caption } — unthemed, composed at render
|
|
43
|
+
aiActiveKey: null, // which viewKey is currently showing its AI draft
|
|
44
|
+
docs: { rendered: false, writing: false, tabs: new Map(), active: 'overview', tabsEl: null, wrapEl: null, railEl: null, bar: null, pageEl: null },
|
|
45
|
+
about: { rendered: false },
|
|
46
|
+
mm: { expanded: new Set(['dir:']) }, // tree map: open folder/file cells
|
|
47
|
+
filters: { text: '', showTests: true, depth: 0 },
|
|
48
|
+
atlas: { built: false, items: [] },
|
|
49
|
+
atlasOpen: null, // an atlas card currently open on the canvas
|
|
50
|
+
code: { path: null, history: [], idx: -1, cache: {} }, // the Code tab
|
|
51
|
+
// Deep-analysis engines (semgrep, gitleaks, knip…). `status` is which are
|
|
52
|
+
// installed; `report` is the last run; `findings` merge into the security
|
|
53
|
+
// view. Only ever filled for a server-side scan — a browser-picked folder
|
|
54
|
+
// has no server-visible root for a tool to read.
|
|
55
|
+
//
|
|
56
|
+
// `install` is per-engine GUI install state ({ running, log, ok, error });
|
|
57
|
+
// `options` is the per-engine form values the Configure panel edits.
|
|
58
|
+
tools: {
|
|
59
|
+
status: null, report: null, running: false, loading: false,
|
|
60
|
+
findings: [], merged: 0, error: null,
|
|
61
|
+
install: {}, options: {},
|
|
62
|
+
},
|
|
63
|
+
// The Deep Analysis view's own controls: which findings are on screen, and
|
|
64
|
+
// whatever the AI has said about the report so far. Per-repo, so a new scan
|
|
65
|
+
// does not inherit the previous repo's filters or its explanation.
|
|
66
|
+
analysis: {
|
|
67
|
+
severity: 'all', tool: 'all', q: '',
|
|
68
|
+
ai: { text: '', error: '', running: false, question: '' },
|
|
69
|
+
},
|
|
70
|
+
review: { report: null, mode: 'working', base: 'HEAD', head: 'HEAD', profile: '', severity: 'all', query: '', showAcknowledged: false, aiText: '', error: '' },
|
|
71
|
+
};
|
|
75
72
|
}
|
|
76
|
-
|
|
77
73
|
export const state = perRepo();
|
|
78
|
-
|
|
79
74
|
// Replaces the per-repo state wholesale. Anything not listed in `perRepo()`
|
|
80
75
|
// survives, which is what you want for preferences like the theme.
|
|
81
76
|
export function loadRepo({ scan, facts, manifest, history, scanId, cloneId }, extra = {}) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
77
|
+
Object.assign(state, perRepo(), {
|
|
78
|
+
scan,
|
|
79
|
+
facts,
|
|
80
|
+
manifest: manifest || { services: [] },
|
|
81
|
+
history: history || null,
|
|
82
|
+
scanId: scanId || null,
|
|
83
|
+
cloneId: cloneId || null,
|
|
84
|
+
}, extra);
|
|
85
|
+
return state;
|
|
91
86
|
}
|
|
92
|
-
|
|
93
87
|
export function unloadRepo() {
|
|
94
|
-
|
|
88
|
+
Object.assign(state, perRepo());
|
|
95
89
|
}
|
|
96
|
-
|
|
97
90
|
// Focus: a file and a folder are alternatives, never both. Every selection path
|
|
98
91
|
// in the app funnels through these, so the inspector can trust that reading
|
|
99
92
|
// `selected` first and `focusedFolder` second gives an unambiguous subject.
|
|
100
93
|
export function focusFile(path) {
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
state.selected = path;
|
|
95
|
+
state.focusedFolder = null;
|
|
103
96
|
}
|
|
104
|
-
|
|
105
97
|
export function focusFolder(path) {
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
state.focusedFolder = path;
|
|
99
|
+
state.selected = null;
|
|
108
100
|
}
|
|
109
|
-
|
|
110
101
|
export function clearFocus() {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
102
|
+
state.selected = null;
|
|
103
|
+
state.focusedFolder = null;
|
|
104
|
+
state.detail = null;
|
|
114
105
|
}
|
|
115
|
-
|
|
116
106
|
// Which subject the inspector should show, and the label for the "back" control
|
|
117
107
|
// that returns to the view's own panel. Pure function of state, so the panel
|
|
118
108
|
// and the canvas can never disagree about what is focused.
|
|
119
109
|
export function inspectorSubject(s = state) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
110
|
+
const backLabel = inspectorBackLabel(s);
|
|
111
|
+
if (s.selected && s.facts && s.facts.fanIn[s.selected] !== undefined) {
|
|
112
|
+
return { kind: 'file', path: s.selected, backLabel };
|
|
113
|
+
}
|
|
114
|
+
if (s.focusedFolder !== null && s.focusedFolder !== undefined) {
|
|
115
|
+
return { kind: 'folder', path: s.focusedFolder, backLabel };
|
|
116
|
+
}
|
|
117
|
+
if (PANEL_VIEWS[s.view])
|
|
118
|
+
return { kind: s.view, backLabel: null };
|
|
119
|
+
if (s.view === 'files')
|
|
120
|
+
return { kind: 'folder', path: s.folder, backLabel };
|
|
121
|
+
return { kind: 'overview', backLabel: null };
|
|
130
122
|
}
|
|
131
|
-
|
|
132
123
|
export function inspectorBackLabel(s = state) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
124
|
+
if (s.view === 'tour')
|
|
125
|
+
return null; // the tour drives its own focus
|
|
126
|
+
if (s.view === 'files')
|
|
127
|
+
return s.folder ? 'the folder' : 'the overview';
|
|
128
|
+
if (PANEL_VIEWS[s.view])
|
|
129
|
+
return PANEL_VIEWS[s.view];
|
|
130
|
+
return 'the overview';
|
|
137
131
|
}
|
|
138
|
-
|
|
139
132
|
export function isExplorerView(view) {
|
|
140
|
-
|
|
133
|
+
return EXPLORER_VIEWS.includes(view);
|
|
141
134
|
}
|
|
142
|
-
|
|
143
135
|
// Which slot in `aiDiagrams` the current view's AI draft belongs to. Two views
|
|
144
136
|
// that show different pictures must never share a key, or one's draft appears
|
|
145
137
|
// over the other's diagram.
|
|
146
138
|
export function aiViewKey(s = state) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
139
|
+
// A tour draft belongs to the stop, not to whatever file was last selected.
|
|
140
|
+
if (s.view === 'tour')
|
|
141
|
+
return `tour:${s.tour.idx}`;
|
|
142
|
+
if (s.view === 'atlas') {
|
|
143
|
+
return s.atlasOpen ? `atlas:${s.atlasOpen.kind}:${s.atlasOpen.path}` : 'atlas:';
|
|
144
|
+
}
|
|
145
|
+
return `${s.view}:${s.detail || s.folder || ''}`;
|
|
153
146
|
}
|
|
154
|
-
|
|
155
147
|
// ---- the Code tab's history ------------------------------------------------
|
|
156
148
|
//
|
|
157
149
|
// A browser-style back/forward stack over the files opened in the Code tab.
|
|
@@ -159,34 +151,34 @@ export function aiViewKey(s = state) {
|
|
|
159
151
|
// opening a new file has to discard the entries in front of the cursor, exactly
|
|
160
152
|
// as a browser drops the forward stack. That rule is the whole reason this lives
|
|
161
153
|
// here with a test rather than inline in a render function.
|
|
162
|
-
|
|
163
154
|
// Which file the Code tab should show when it is asked to render. The chain is
|
|
164
155
|
// most-specific-first: what the tab already had, then whatever the rest of the
|
|
165
156
|
// app is looking at, then the repo's own front door, then anything at all.
|
|
166
157
|
export function defaultCodePath(s = state) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
158
|
+
const { scan, facts, code } = s;
|
|
159
|
+
// `facts.entries` holds plain path strings — `graph.js` builds it by mapping
|
|
160
|
+
// files to `f.path`. (`facts.hubs`, confusingly, holds objects.) An earlier
|
|
161
|
+
// version of this accepted either shape for `entries`; nothing has ever
|
|
162
|
+
// produced the object one, and pretending otherwise hid the asymmetry.
|
|
163
|
+
return code.path || s.detail || s.selected || facts?.entries?.[0]
|
|
164
|
+
|| scan?.files?.[0]?.path || scan?.allFiles?.[0] || null;
|
|
174
165
|
}
|
|
175
|
-
|
|
176
166
|
export function pushCodeHistory(path, s = state) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
167
|
+
const h = s.code.history;
|
|
168
|
+
if (h[s.code.idx] === path)
|
|
169
|
+
return; // re-opening the current file is not a move
|
|
170
|
+
h.length = s.code.idx + 1; // drop any forward entries
|
|
171
|
+
h.push(path);
|
|
172
|
+
s.code.idx = h.length - 1;
|
|
182
173
|
}
|
|
183
|
-
|
|
184
174
|
// Moves the cursor by `delta` and reports where it landed, or null if that would
|
|
185
175
|
// step off either end. The caller opens the returned path; refusing to move and
|
|
186
176
|
// returning null is how the disabled arrow buttons stay honest.
|
|
187
177
|
export function codeHistoryTarget(delta, s = state) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
178
|
+
const next = s.code.idx + delta;
|
|
179
|
+
if (next < 0 || next >= s.code.history.length)
|
|
180
|
+
return null;
|
|
181
|
+
s.code.idx = next;
|
|
182
|
+
return s.code.history[next];
|
|
192
183
|
}
|
|
184
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/public/js/state.ts"],"names":[],"mappings":"AACA,yCAAyC;AACzC,EAAE;AACF,gFAAgF;AAChF,yEAAyE;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G,IAAI,CAAC;IAClB,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { ReviewReport } from '../../shared/review/contracts.js';\n// The application's state, in one place.\n//\n// This is a plain mutable object, not a reactive store, and that is deliberate.\n// Rendering here is expensive and stateful — the canvas holds a pan/zoom\n// transform, the code tab holds a Monaco editor — so \"every mutation triggers a\n// re-render\" would be both slow and destructive. Callers still decide what to\n// redraw. What this module does own is the state's *invariants*, which used to\n// be maintained by convention in a 2,400-line file and are now enforced in one\n// place that can be tested.\n//\n// No DOM, no imports from the view layer: importable in Node.\n\n// The views that share the Explorer tab and its canvas.\nexport const EXPLORER_VIEWS = ['map', 'files', 'patterns', 'health', 'security', 'history', 'services', 'tour', 'atlas'];\n\n// Views whose default inspector panel is their own, rather than the overview.\nconst PANEL_VIEWS = { patterns: 'patterns', health: 'health', security: 'security', history: 'history' };\n\n// Per-repo state, rebuilt by `loadRepo`. Split out from the rest so \"what has\n// to be reset when a new repo arrives\" is a list in one place rather than a\n// thing you remember — forgetting an entry here is how a new repo inherits the\n// previous one's open tabs.\nfunction perRepo() {\n return {\n scan: null,\n facts: null,\n manifest: null,\n stack: null,\n health: null,\n security: null,\n history: null,\n patterns: null,\n treeData: null,\n scanId: null,\n cloneId: null,\n browserSource: null,\n view: 'map',\n lastExplorer: 'map',\n folder: '',\n detail: null, // file open in deep-dive, if any\n selected: null, // the focused FILE (the inspector's current subject)\n focusedFolder: null, // the focused FOLDER subject, when it's a folder\n tour: { stops: [], idx: 0 },\n currentDiagram: { source: '', nodes: {} },\n aiDiagrams: {}, // viewKey -> { body, caption } — unthemed, composed at render\n aiActiveKey: null, // which viewKey is currently showing its AI draft\n docs: { rendered: false, writing: false, tabs: new Map(), active: 'overview', tabsEl: null as HTMLElement | null, wrapEl: null as HTMLElement | null, railEl: null as HTMLElement | null, bar: null as HTMLElement | null, pageEl: null as HTMLElement | null },\n about: { rendered: false },\n mm: { expanded: new Set(['dir:']) }, // tree map: open folder/file cells\n filters: { text: '', showTests: true, depth: 0 },\n atlas: { built: false, items: [] },\n atlasOpen: null, // an atlas card currently open on the canvas\n code: { path: null, history: [], idx: -1, cache: {} }, // the Code tab\n // Deep-analysis engines (semgrep, gitleaks, knip…). `status` is which are\n // installed; `report` is the last run; `findings` merge into the security\n // view. Only ever filled for a server-side scan — a browser-picked folder\n // has no server-visible root for a tool to read.\n //\n // `install` is per-engine GUI install state ({ running, log, ok, error });\n // `options` is the per-engine form values the Configure panel edits.\n tools: {\n status: null, report: null, running: false, loading: false,\n findings: [], merged: 0, error: null,\n install: {}, options: {},\n },\n // The Deep Analysis view's own controls: which findings are on screen, and\n // whatever the AI has said about the report so far. Per-repo, so a new scan\n // does not inherit the previous repo's filters or its explanation.\n analysis: {\n severity: 'all', tool: 'all', q: '',\n ai: { text: '', error: '', running: false, question: '' },\n },\n review: { report: null as ReviewReport | null, mode: 'working', base: 'HEAD', head: 'HEAD', profile: '', severity: 'all', query: '', showAcknowledged: false, aiText: '', error: '' },\n };\n}\n\nexport const state = perRepo();\n\n// Replaces the per-repo state wholesale. Anything not listed in `perRepo()`\n// survives, which is what you want for preferences like the theme.\nexport function loadRepo({ scan, facts, manifest, history, scanId, cloneId }, extra: Record<string, any> = {}) {\n Object.assign(state, perRepo(), {\n scan,\n facts,\n manifest: manifest || { services: [] },\n history: history || null,\n scanId: scanId || null,\n cloneId: cloneId || null,\n }, extra);\n return state;\n}\n\nexport function unloadRepo() {\n Object.assign(state, perRepo());\n}\n\n// Focus: a file and a folder are alternatives, never both. Every selection path\n// in the app funnels through these, so the inspector can trust that reading\n// `selected` first and `focusedFolder` second gives an unambiguous subject.\nexport function focusFile(path) {\n state.selected = path;\n state.focusedFolder = null;\n}\n\nexport function focusFolder(path) {\n state.focusedFolder = path;\n state.selected = null;\n}\n\nexport function clearFocus() {\n state.selected = null;\n state.focusedFolder = null;\n state.detail = null;\n}\n\n// Which subject the inspector should show, and the label for the \"back\" control\n// that returns to the view's own panel. Pure function of state, so the panel\n// and the canvas can never disagree about what is focused.\nexport function inspectorSubject(s = state) {\n const backLabel = inspectorBackLabel(s);\n if (s.selected && s.facts && s.facts.fanIn[s.selected] !== undefined) {\n return { kind: 'file', path: s.selected, backLabel };\n }\n if (s.focusedFolder !== null && s.focusedFolder !== undefined) {\n return { kind: 'folder', path: s.focusedFolder, backLabel };\n }\n if (PANEL_VIEWS[s.view]) return { kind: s.view, backLabel: null };\n if (s.view === 'files') return { kind: 'folder', path: s.folder, backLabel };\n return { kind: 'overview', backLabel: null };\n}\n\nexport function inspectorBackLabel(s = state) {\n if (s.view === 'tour') return null; // the tour drives its own focus\n if (s.view === 'files') return s.folder ? 'the folder' : 'the overview';\n if (PANEL_VIEWS[s.view]) return PANEL_VIEWS[s.view];\n return 'the overview';\n}\n\nexport function isExplorerView(view) {\n return EXPLORER_VIEWS.includes(view);\n}\n\n// Which slot in `aiDiagrams` the current view's AI draft belongs to. Two views\n// that show different pictures must never share a key, or one's draft appears\n// over the other's diagram.\nexport function aiViewKey(s = state) {\n // A tour draft belongs to the stop, not to whatever file was last selected.\n if (s.view === 'tour') return `tour:${s.tour.idx}`;\n if (s.view === 'atlas') {\n return s.atlasOpen ? `atlas:${s.atlasOpen.kind}:${s.atlasOpen.path}` : 'atlas:';\n }\n return `${s.view}:${s.detail || s.folder || ''}`;\n}\n\n// ---- the Code tab's history ------------------------------------------------\n//\n// A browser-style back/forward stack over the files opened in the Code tab.\n// `idx` is a cursor into `history`, not always its last entry: after going back,\n// opening a new file has to discard the entries in front of the cursor, exactly\n// as a browser drops the forward stack. That rule is the whole reason this lives\n// here with a test rather than inline in a render function.\n\n// Which file the Code tab should show when it is asked to render. The chain is\n// most-specific-first: what the tab already had, then whatever the rest of the\n// app is looking at, then the repo's own front door, then anything at all.\nexport function defaultCodePath(s = state) {\n const { scan, facts, code } = s;\n // `facts.entries` holds plain path strings — `graph.js` builds it by mapping\n // files to `f.path`. (`facts.hubs`, confusingly, holds objects.) An earlier\n // version of this accepted either shape for `entries`; nothing has ever\n // produced the object one, and pretending otherwise hid the asymmetry.\n return code.path || s.detail || s.selected || facts?.entries?.[0]\n || scan?.files?.[0]?.path || scan?.allFiles?.[0] || null;\n}\n\nexport function pushCodeHistory(path, s = state) {\n const h = s.code.history;\n if (h[s.code.idx] === path) return; // re-opening the current file is not a move\n h.length = s.code.idx + 1; // drop any forward entries\n h.push(path);\n s.code.idx = h.length - 1;\n}\n\n// Moves the cursor by `delta` and reports where it landed, or null if that would\n// step off either end. The caller opens the returned path; refusing to move and\n// returning null is how the disabled arrow buttons stay honest.\nexport function codeHistoryTarget(delta, s = state) {\n const next = s.code.idx + delta;\n if (next < 0 || next >= s.code.history.length) return null;\n s.code.idx = next;\n return s.code.history[next];\n}\n"]}
|
package/public/js/tour.js
CHANGED
|
@@ -4,14 +4,12 @@
|
|
|
4
4
|
// same list to an agent, and two copies of "which eight files should a newcomer
|
|
5
5
|
// read first" would eventually disagree. This module keeps only what is genuinely
|
|
6
6
|
// the view's — the label the tour bar draws.
|
|
7
|
-
|
|
8
7
|
import { buildTourStops, tourStopTitle } from '/shared/analyzer/tour.js';
|
|
9
|
-
|
|
10
8
|
export { buildTourStops };
|
|
11
|
-
|
|
12
9
|
export function describeStop(stop, index, total) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
return {
|
|
11
|
+
title: tourStopTitle(stop),
|
|
12
|
+
count: `${index + 1} / ${total}`,
|
|
13
|
+
};
|
|
17
14
|
}
|
|
15
|
+
//# sourceMappingURL=tour.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tour.js","sourceRoot":"","sources":["../../src/public/js/tour.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,EAAE;AACF,mFAAmF;AACnF,gFAAgF;AAChF,kFAAkF;AAClF,6CAA6C;AAE7C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,MAAM,UAAU,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK;IAC7C,OAAO;QACL,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC;QAC1B,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,MAAM,KAAK,EAAE;KACjC,CAAC;AACJ,CAAC","sourcesContent":["// The guided walk, as the browser sees it.\n//\n// The ordering itself moved to `shared/analyzer/tour.js`: the MCP server hands the\n// same list to an agent, and two copies of \"which eight files should a newcomer\n// read first\" would eventually disagree. This module keeps only what is genuinely\n// the view's — the label the tour bar draws.\n\nimport { buildTourStops, tourStopTitle } from '/shared/analyzer/tour.js';\n\nexport { buildTourStops };\n\nexport function describeStop(stop, index, total) {\n return {\n title: tourStopTitle(stop),\n count: `${index + 1} / ${total}`,\n };\n}\n"]}
|
package/public/js/transitions.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
export function withTransition(callback) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} else {
|
|
2
|
+
// Switching a workbench view should not snapshot and animate the entire page.
|
|
3
|
+
// That retains both heavy views during a transition and delays rapid tab changes.
|
|
5
4
|
callback();
|
|
6
|
-
}
|
|
7
5
|
}
|
|
8
|
-
|
|
9
6
|
export function setupViewTransitionNames(elements) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
// Utility for adding transition names if needed
|
|
8
|
+
Object.entries(elements).forEach(([id, name]) => {
|
|
9
|
+
const el = document.getElementById(id);
|
|
10
|
+
if (el)
|
|
11
|
+
el.style.viewTransitionName = name;
|
|
12
|
+
});
|
|
15
13
|
}
|
|
14
|
+
//# sourceMappingURL=transitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitions.js","sourceRoot":"","sources":["../../src/public/js/transitions.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,QAAQ;IACrC,8EAA8E;IAC9E,kFAAkF;IAClF,QAAQ,EAAE,CAAC;AACb,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,QAAgC;IACvE,gDAAgD;IAChD,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE;QAC9C,MAAM,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QACvC,IAAI,EAAE;YAAE,EAAE,CAAC,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["export function withTransition(callback) {\n // Switching a workbench view should not snapshot and animate the entire page.\n // That retains both heavy views during a transition and delays rapid tab changes.\n callback();\n}\n\nexport function setupViewTransitionNames(elements: Record<string, string>) {\n // Utility for adding transition names if needed\n Object.entries(elements).forEach(([id, name]) => {\n const el = document.getElementById(id);\n if (el) el.style.viewTransitionName = name;\n });\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function buildTree(allFiles: any): {
|
|
2
|
+
name: string;
|
|
3
|
+
path: string;
|
|
4
|
+
dirs: Map<any, any>;
|
|
5
|
+
files: any[];
|
|
6
|
+
};
|
|
7
|
+
export declare function findNode(root: any, path: any): any;
|
|
8
|
+
export declare function countFiles(node: any): any;
|
|
9
|
+
export declare function pruneTree(root: any, include: any, matchesFolder?: any): any;
|
|
10
|
+
export declare function expandedToDepth(root: any, maxDepth: any): Set<string>;
|
|
11
|
+
export declare function resetOpenState(): void;
|
|
12
|
+
export declare function renderTree(container: any, tree: any, ctx: any): void;
|