@nocturnium/svelte-ide 1.0.0-rc.1
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/LICENSE +21 -0
- package/README.md +251 -0
- package/dist/components/agents/AgentActivityPanel.svelte +565 -0
- package/dist/components/agents/AgentActivityPanel.svelte.d.ts +24 -0
- package/dist/components/agents/AgentAvatar.svelte +417 -0
- package/dist/components/agents/AgentAvatar.svelte.d.ts +23 -0
- package/dist/components/agents/AgentCursor.svelte +224 -0
- package/dist/components/agents/AgentCursor.svelte.d.ts +35 -0
- package/dist/components/agents/AgentPresenceBar.svelte +261 -0
- package/dist/components/agents/AgentPresenceBar.svelte.d.ts +20 -0
- package/dist/components/agents/index.d.ts +4 -0
- package/dist/components/agents/index.js +5 -0
- package/dist/components/ai/AIConversationList.svelte +524 -0
- package/dist/components/ai/AIConversationList.svelte.d.ts +17 -0
- package/dist/components/ai/AIEditPreview.svelte +132 -0
- package/dist/components/ai/AIEditPreview.svelte.d.ts +8 -0
- package/dist/components/ai/AIInlineEdit.svelte +155 -0
- package/dist/components/ai/AIInlineEdit.svelte.d.ts +10 -0
- package/dist/components/ai/AIMessage.svelte +239 -0
- package/dist/components/ai/AIMessage.svelte.d.ts +13 -0
- package/dist/components/ai/AIMessageActions.svelte +176 -0
- package/dist/components/ai/AIMessageActions.svelte.d.ts +12 -0
- package/dist/components/ai/AIMessageContent.svelte +355 -0
- package/dist/components/ai/AIMessageContent.svelte.d.ts +7 -0
- package/dist/components/ai/AIPanel.svelte +561 -0
- package/dist/components/ai/AIPanel.svelte.d.ts +7 -0
- package/dist/components/ai/AISuggestionWidget.svelte +132 -0
- package/dist/components/ai/AISuggestionWidget.svelte.d.ts +10 -0
- package/dist/components/ai/AIToolCallDisplay.svelte +317 -0
- package/dist/components/ai/AIToolCallDisplay.svelte.d.ts +12 -0
- package/dist/components/ai/index.d.ts +9 -0
- package/dist/components/ai/index.js +10 -0
- package/dist/components/core/Avatar.svelte +110 -0
- package/dist/components/core/Avatar.svelte.d.ts +12 -0
- package/dist/components/core/Badge.svelte +98 -0
- package/dist/components/core/Badge.svelte.d.ts +11 -0
- package/dist/components/core/Button.svelte +175 -0
- package/dist/components/core/Button.svelte.d.ts +18 -0
- package/dist/components/core/ConnectionStatus.svelte +294 -0
- package/dist/components/core/ConnectionStatus.svelte.d.ts +20 -0
- package/dist/components/core/ContextMenu.svelte +176 -0
- package/dist/components/core/ContextMenu.svelte.d.ts +19 -0
- package/dist/components/core/ErrorBoundary.svelte +277 -0
- package/dist/components/core/ErrorBoundary.svelte.d.ts +23 -0
- package/dist/components/core/Icon.svelte +107 -0
- package/dist/components/core/Icon.svelte.d.ts +8 -0
- package/dist/components/core/Input.svelte +138 -0
- package/dist/components/core/Input.svelte.d.ts +20 -0
- package/dist/components/core/Kbd.svelte +34 -0
- package/dist/components/core/Kbd.svelte.d.ts +7 -0
- package/dist/components/core/ResizeHandle.svelte +200 -0
- package/dist/components/core/ResizeHandle.svelte.d.ts +23 -0
- package/dist/components/core/Spinner.svelte +35 -0
- package/dist/components/core/Spinner.svelte.d.ts +7 -0
- package/dist/components/core/Textarea.svelte +112 -0
- package/dist/components/core/Textarea.svelte.d.ts +18 -0
- package/dist/components/core/Tooltip.svelte +103 -0
- package/dist/components/core/Tooltip.svelte.d.ts +11 -0
- package/dist/components/core/index.d.ts +13 -0
- package/dist/components/core/index.js +14 -0
- package/dist/components/editor/AIFocusLayer.svelte +430 -0
- package/dist/components/editor/AIFocusLayer.svelte.d.ts +32 -0
- package/dist/components/editor/Breadcrumbs.svelte +435 -0
- package/dist/components/editor/Breadcrumbs.svelte.d.ts +33 -0
- package/dist/components/editor/BreakpointLayer.svelte +642 -0
- package/dist/components/editor/BreakpointLayer.svelte.d.ts +20 -0
- package/dist/components/editor/CognitiveLoadMeter.svelte +324 -0
- package/dist/components/editor/CognitiveLoadMeter.svelte.d.ts +18 -0
- package/dist/components/editor/CollaborativeEditor.svelte +218 -0
- package/dist/components/editor/CollaborativeEditor.svelte.d.ts +32 -0
- package/dist/components/editor/CommandPalette.svelte +434 -0
- package/dist/components/editor/CommandPalette.svelte.d.ts +11 -0
- package/dist/components/editor/ComplexityLayer.svelte +293 -0
- package/dist/components/editor/ComplexityLayer.svelte.d.ts +23 -0
- package/dist/components/editor/ConflictZoneLayer.svelte +441 -0
- package/dist/components/editor/ConflictZoneLayer.svelte.d.ts +25 -0
- package/dist/components/editor/ContextLens.svelte +262 -0
- package/dist/components/editor/ContextLens.svelte.d.ts +27 -0
- package/dist/components/editor/CustomEditor.svelte +1242 -0
- package/dist/components/editor/CustomEditor.svelte.d.ts +37 -0
- package/dist/components/editor/DebugConsole.svelte +646 -0
- package/dist/components/editor/DebugConsole.svelte.d.ts +41 -0
- package/dist/components/editor/EchoCursorLayer.svelte +363 -0
- package/dist/components/editor/EchoCursorLayer.svelte.d.ts +24 -0
- package/dist/components/editor/Editor.svelte +61 -0
- package/dist/components/editor/Editor.svelte.d.ts +22 -0
- package/dist/components/editor/EditorGutter.svelte +119 -0
- package/dist/components/editor/EditorGutter.svelte.d.ts +19 -0
- package/dist/components/editor/EditorLines.svelte +182 -0
- package/dist/components/editor/EditorLines.svelte.d.ts +43 -0
- package/dist/components/editor/EditorPane.svelte +134 -0
- package/dist/components/editor/EditorPane.svelte.d.ts +9 -0
- package/dist/components/editor/EditorSelections.svelte +186 -0
- package/dist/components/editor/EditorSelections.svelte.d.ts +25 -0
- package/dist/components/editor/EditorTabs.svelte +170 -0
- package/dist/components/editor/EditorTabs.svelte.d.ts +12 -0
- package/dist/components/editor/FileExplorer.svelte +811 -0
- package/dist/components/editor/FileExplorer.svelte.d.ts +67 -0
- package/dist/components/editor/FileIcon.svelte +110 -0
- package/dist/components/editor/FileIcon.svelte.d.ts +10 -0
- package/dist/components/editor/FindReplace.svelte +448 -0
- package/dist/components/editor/FindReplace.svelte.d.ts +40 -0
- package/dist/components/editor/GhostBracketLayer.svelte +391 -0
- package/dist/components/editor/GhostBracketLayer.svelte.d.ts +24 -0
- package/dist/components/editor/GitBlameLayer.svelte +436 -0
- package/dist/components/editor/GitBlameLayer.svelte.d.ts +18 -0
- package/dist/components/editor/InlineDiagnosticsLayer.svelte +540 -0
- package/dist/components/editor/InlineDiagnosticsLayer.svelte.d.ts +35 -0
- package/dist/components/editor/InlineDiffLayer.svelte +337 -0
- package/dist/components/editor/InlineDiffLayer.svelte.d.ts +31 -0
- package/dist/components/editor/MinimalEditor.svelte +75 -0
- package/dist/components/editor/MinimalEditor.svelte.d.ts +6 -0
- package/dist/components/editor/MinimalEditor2.svelte +84 -0
- package/dist/components/editor/MinimalEditor2.svelte.d.ts +6 -0
- package/dist/components/editor/Minimap.svelte +327 -0
- package/dist/components/editor/Minimap.svelte.d.ts +34 -0
- package/dist/components/editor/PluginPreviewSandbox.svelte +793 -0
- package/dist/components/editor/PluginPreviewSandbox.svelte.d.ts +49 -0
- package/dist/components/editor/ProblemsPanel.svelte +628 -0
- package/dist/components/editor/ProblemsPanel.svelte.d.ts +25 -0
- package/dist/components/editor/QuickActionsMenu.svelte +403 -0
- package/dist/components/editor/QuickActionsMenu.svelte.d.ts +18 -0
- package/dist/components/editor/SnippetPalette.svelte +530 -0
- package/dist/components/editor/SnippetPalette.svelte.d.ts +16 -0
- package/dist/components/editor/StructureMap.svelte +431 -0
- package/dist/components/editor/StructureMap.svelte.d.ts +37 -0
- package/dist/components/editor/SymbolOutline.svelte +722 -0
- package/dist/components/editor/SymbolOutline.svelte.d.ts +44 -0
- package/dist/components/editor/TimelineScrubber.svelte +470 -0
- package/dist/components/editor/TimelineScrubber.svelte.d.ts +40 -0
- package/dist/components/editor/TokenRenderer.svelte +69 -0
- package/dist/components/editor/TokenRenderer.svelte.d.ts +15 -0
- package/dist/components/editor/constants.d.ts +32 -0
- package/dist/components/editor/constants.js +36 -0
- package/dist/components/editor/core/ai-awareness.d.ts +176 -0
- package/dist/components/editor/core/ai-awareness.js +210 -0
- package/dist/components/editor/core/bracket-healer.d.ts +189 -0
- package/dist/components/editor/core/bracket-healer.js +406 -0
- package/dist/components/editor/core/breakpoints.d.ts +203 -0
- package/dist/components/editor/core/breakpoints.js +414 -0
- package/dist/components/editor/core/commands.d.ts +108 -0
- package/dist/components/editor/core/commands.js +246 -0
- package/dist/components/editor/core/complexity-analyzer.d.ts +123 -0
- package/dist/components/editor/core/complexity-analyzer.js +376 -0
- package/dist/components/editor/core/conflict-predictor.d.ts +135 -0
- package/dist/components/editor/core/conflict-predictor.js +316 -0
- package/dist/components/editor/core/crdt-binding.d.ts +118 -0
- package/dist/components/editor/core/crdt-binding.js +286 -0
- package/dist/components/editor/core/diagnostics.d.ts +210 -0
- package/dist/components/editor/core/diagnostics.js +335 -0
- package/dist/components/editor/core/echo-cursor.d.ts +201 -0
- package/dist/components/editor/core/echo-cursor.js +267 -0
- package/dist/components/editor/core/folding.d.ts +124 -0
- package/dist/components/editor/core/folding.js +672 -0
- package/dist/components/editor/core/ghost-pair.d.ts +122 -0
- package/dist/components/editor/core/ghost-pair.js +221 -0
- package/dist/components/editor/core/git-blame.d.ts +170 -0
- package/dist/components/editor/core/git-blame.js +324 -0
- package/dist/components/editor/core/index.d.ts +26 -0
- package/dist/components/editor/core/index.js +24 -0
- package/dist/components/editor/core/keybindings.d.ts +79 -0
- package/dist/components/editor/core/keybindings.js +357 -0
- package/dist/components/editor/core/multi-cursor.d.ts +196 -0
- package/dist/components/editor/core/multi-cursor.js +521 -0
- package/dist/components/editor/core/navigation.d.ts +107 -0
- package/dist/components/editor/core/navigation.js +408 -0
- package/dist/components/editor/core/quick-actions.d.ts +189 -0
- package/dist/components/editor/core/quick-actions.js +427 -0
- package/dist/components/editor/core/search.d.ts +88 -0
- package/dist/components/editor/core/search.js +192 -0
- package/dist/components/editor/core/semantic-analyzer.d.ts +77 -0
- package/dist/components/editor/core/semantic-analyzer.js +424 -0
- package/dist/components/editor/core/snippet-manager.d.ts +202 -0
- package/dist/components/editor/core/snippet-manager.js +565 -0
- package/dist/components/editor/core/state.d.ts +367 -0
- package/dist/components/editor/core/state.js +900 -0
- package/dist/components/editor/core/timeline.d.ts +204 -0
- package/dist/components/editor/core/timeline.js +349 -0
- package/dist/components/editor/editor-find.d.ts +56 -0
- package/dist/components/editor/editor-find.js +148 -0
- package/dist/components/editor/editor-input.d.ts +77 -0
- package/dist/components/editor/editor-input.js +445 -0
- package/dist/components/editor/editor-multicursor.d.ts +21 -0
- package/dist/components/editor/editor-multicursor.js +196 -0
- package/dist/components/editor/editor-scroll.d.ts +14 -0
- package/dist/components/editor/editor-scroll.js +34 -0
- package/dist/components/editor/index.d.ts +15 -0
- package/dist/components/editor/index.js +21 -0
- package/dist/components/editor/languages.d.ts +62 -0
- package/dist/components/editor/languages.js +285 -0
- package/dist/components/editor/theme.d.ts +88 -0
- package/dist/components/editor/theme.js +139 -0
- package/dist/components/editor/tokenizer/base.d.ts +40 -0
- package/dist/components/editor/tokenizer/base.js +203 -0
- package/dist/components/editor/tokenizer/index.d.ts +56 -0
- package/dist/components/editor/tokenizer/index.js +215 -0
- package/dist/components/editor/tokenizer/languages/css.d.ts +17 -0
- package/dist/components/editor/tokenizer/languages/css.js +194 -0
- package/dist/components/editor/tokenizer/languages/go.d.ts +17 -0
- package/dist/components/editor/tokenizer/languages/go.js +220 -0
- package/dist/components/editor/tokenizer/languages/html.d.ts +24 -0
- package/dist/components/editor/tokenizer/languages/html.js +145 -0
- package/dist/components/editor/tokenizer/languages/javascript.d.ts +56 -0
- package/dist/components/editor/tokenizer/languages/javascript.js +452 -0
- package/dist/components/editor/tokenizer/languages/json.d.ts +12 -0
- package/dist/components/editor/tokenizer/languages/json.js +91 -0
- package/dist/components/editor/tokenizer/languages/markdown.d.ts +16 -0
- package/dist/components/editor/tokenizer/languages/markdown.js +156 -0
- package/dist/components/editor/tokenizer/languages/python.d.ts +20 -0
- package/dist/components/editor/tokenizer/languages/python.js +227 -0
- package/dist/components/editor/tokenizer/languages/svelte.d.ts +40 -0
- package/dist/components/editor/tokenizer/languages/svelte.js +326 -0
- package/dist/components/editor/tokenizer/types.d.ts +86 -0
- package/dist/components/editor/tokenizer/types.js +4 -0
- package/dist/components/layout/IDELayout.svelte +274 -0
- package/dist/components/layout/IDELayout.svelte.d.ts +29 -0
- package/dist/components/layout/StatusBar.svelte +511 -0
- package/dist/components/layout/StatusBar.svelte.d.ts +47 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.js +3 -0
- package/dist/components/lsp/AutocompleteWidget.svelte +364 -0
- package/dist/components/lsp/AutocompleteWidget.svelte.d.ts +33 -0
- package/dist/components/lsp/DiagnosticMarker.svelte +166 -0
- package/dist/components/lsp/DiagnosticMarker.svelte.d.ts +19 -0
- package/dist/components/lsp/DiagnosticsPanel.svelte +388 -0
- package/dist/components/lsp/DiagnosticsPanel.svelte.d.ts +21 -0
- package/dist/components/lsp/HoverTooltip.svelte +274 -0
- package/dist/components/lsp/HoverTooltip.svelte.d.ts +24 -0
- package/dist/components/lsp/LSPEditor.svelte +486 -0
- package/dist/components/lsp/LSPEditor.svelte.d.ts +39 -0
- package/dist/components/lsp/SignatureHelpWidget.svelte +216 -0
- package/dist/components/lsp/SignatureHelpWidget.svelte.d.ts +22 -0
- package/dist/components/lsp/index.d.ts +6 -0
- package/dist/components/lsp/index.js +7 -0
- package/dist/components/plugins/PluginCard.svelte +153 -0
- package/dist/components/plugins/PluginCard.svelte.d.ts +19 -0
- package/dist/components/plugins/PluginPanel.svelte +280 -0
- package/dist/components/plugins/PluginPanel.svelte.d.ts +8 -0
- package/dist/components/plugins/PluginProposalForm.svelte +250 -0
- package/dist/components/plugins/PluginProposalForm.svelte.d.ts +6 -0
- package/dist/components/plugins/PluginStatusBadge.svelte +14 -0
- package/dist/components/plugins/PluginStatusBadge.svelte.d.ts +8 -0
- package/dist/components/plugins/index.d.ts +4 -0
- package/dist/components/plugins/index.js +5 -0
- package/dist/components/vfs/LockConflictDialog.svelte +705 -0
- package/dist/components/vfs/LockConflictDialog.svelte.d.ts +21 -0
- package/dist/components/vfs/LockIndicator.svelte +194 -0
- package/dist/components/vfs/LockIndicator.svelte.d.ts +29 -0
- package/dist/components/vfs/LockOverlay.svelte +344 -0
- package/dist/components/vfs/LockOverlay.svelte.d.ts +17 -0
- package/dist/components/vfs/VersionConflictDialog.svelte +549 -0
- package/dist/components/vfs/VersionConflictDialog.svelte.d.ts +24 -0
- package/dist/components/vfs/index.d.ts +4 -0
- package/dist/components/vfs/index.js +5 -0
- package/dist/crdt/awareness.d.ts +42 -0
- package/dist/crdt/awareness.js +109 -0
- package/dist/crdt/document.d.ts +101 -0
- package/dist/crdt/document.js +187 -0
- package/dist/crdt/index.d.ts +9 -0
- package/dist/crdt/index.js +8 -0
- package/dist/crdt/provider.d.ts +85 -0
- package/dist/crdt/provider.js +150 -0
- package/dist/crdt/types.d.ts +61 -0
- package/dist/crdt/types.js +4 -0
- package/dist/crdt/undo.d.ts +34 -0
- package/dist/crdt/undo.js +70 -0
- package/dist/index.d.ts +277 -0
- package/dist/index.js +280 -0
- package/dist/plugins/index.d.ts +103 -0
- package/dist/plugins/index.js +153 -0
- package/dist/services/error-handling.d.ts +95 -0
- package/dist/services/error-handling.js +413 -0
- package/dist/services/ide-integration.d.ts +83 -0
- package/dist/services/ide-integration.js +367 -0
- package/dist/services/lsp-client.d.ts +69 -0
- package/dist/services/lsp-client.js +667 -0
- package/dist/services/mock-ai.d.ts +37 -0
- package/dist/services/mock-ai.js +318 -0
- package/dist/services/optimistic.d.ts +141 -0
- package/dist/services/optimistic.js +367 -0
- package/dist/services/vfs-client.d.ts +81 -0
- package/dist/services/vfs-client.js +348 -0
- package/dist/stores/agents.svelte.d.ts +85 -0
- package/dist/stores/agents.svelte.js +459 -0
- package/dist/stores/ai-persistence.svelte.d.ts +76 -0
- package/dist/stores/ai-persistence.svelte.js +334 -0
- package/dist/stores/ai.svelte.d.ts +140 -0
- package/dist/stores/ai.svelte.js +383 -0
- package/dist/stores/collaboration.svelte.d.ts +164 -0
- package/dist/stores/collaboration.svelte.js +334 -0
- package/dist/stores/editor.svelte.d.ts +131 -0
- package/dist/stores/editor.svelte.js +250 -0
- package/dist/stores/index.d.ts +10 -0
- package/dist/stores/index.js +29 -0
- package/dist/stores/layout.svelte.d.ts +171 -0
- package/dist/stores/layout.svelte.js +351 -0
- package/dist/stores/plugin.svelte.d.ts +121 -0
- package/dist/stores/plugin.svelte.js +410 -0
- package/dist/stores/vfs.svelte.d.ts +123 -0
- package/dist/stores/vfs.svelte.js +680 -0
- package/dist/styles/theme.css +623 -0
- package/dist/types/agents.d.ts +127 -0
- package/dist/types/agents.js +5 -0
- package/dist/types/ai.d.ts +137 -0
- package/dist/types/ai.js +4 -0
- package/dist/types/crdt.d.ts +222 -0
- package/dist/types/crdt.js +5 -0
- package/dist/types/editor.d.ts +52 -0
- package/dist/types/editor.js +18 -0
- package/dist/types/events.d.ts +133 -0
- package/dist/types/events.js +4 -0
- package/dist/types/filesystem.d.ts +77 -0
- package/dist/types/filesystem.js +4 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.js +12 -0
- package/dist/types/lsp.d.ts +691 -0
- package/dist/types/lsp.js +108 -0
- package/dist/types/plugin.d.ts +239 -0
- package/dist/types/plugin.js +5 -0
- package/dist/types/vfs.d.ts +191 -0
- package/dist/types/vfs.js +18 -0
- package/dist/utils/format.d.ts +55 -0
- package/dist/utils/format.js +152 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/keybindings.d.ts +33 -0
- package/dist/utils/keybindings.js +171 -0
- package/dist/utils/language.d.ts +27 -0
- package/dist/utils/language.js +222 -0
- package/package.json +178 -0
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
export interface BreadcrumbSymbol {
|
|
3
|
+
/** Unique identifier */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Display name */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Symbol type */
|
|
8
|
+
type: 'file' | 'module' | 'namespace' | 'class' | 'interface' | 'function' | 'method' | 'property' | 'variable' | 'constant' | 'enum' | 'block';
|
|
9
|
+
/** Line number (0-based) */
|
|
10
|
+
line: number;
|
|
11
|
+
/** Column number */
|
|
12
|
+
column?: number;
|
|
13
|
+
/** Sibling symbols at same level */
|
|
14
|
+
siblings?: BreadcrumbSymbol[];
|
|
15
|
+
/** Detail text (e.g., function signature) */
|
|
16
|
+
detail?: string;
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
/**
|
|
22
|
+
* Breadcrumbs Navigation
|
|
23
|
+
*
|
|
24
|
+
* Shows the current location in code structure hierarchy:
|
|
25
|
+
* File > Module > Class > Method > Block
|
|
26
|
+
*
|
|
27
|
+
* Features:
|
|
28
|
+
* - Click to navigate to symbol
|
|
29
|
+
* - Dropdown for sibling symbols
|
|
30
|
+
* - Icons for different symbol types
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import { onMount } from 'svelte';
|
|
34
|
+
|
|
35
|
+
interface Props {
|
|
36
|
+
/** Current breadcrumb path */
|
|
37
|
+
path: BreadcrumbSymbol[];
|
|
38
|
+
/** File name/path to show as root */
|
|
39
|
+
fileName?: string;
|
|
40
|
+
/** Whether breadcrumbs are enabled */
|
|
41
|
+
enabled?: boolean;
|
|
42
|
+
/** Callback when symbol is clicked */
|
|
43
|
+
onNavigate?: (symbol: BreadcrumbSymbol) => void;
|
|
44
|
+
/** Whether to show file icon */
|
|
45
|
+
showFileIcon?: boolean;
|
|
46
|
+
/** Maximum width before truncation */
|
|
47
|
+
maxWidth?: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let {
|
|
51
|
+
path = [],
|
|
52
|
+
fileName = 'untitled',
|
|
53
|
+
enabled = true,
|
|
54
|
+
onNavigate,
|
|
55
|
+
showFileIcon = true,
|
|
56
|
+
maxWidth
|
|
57
|
+
}: Props = $props();
|
|
58
|
+
|
|
59
|
+
let activeDropdown = $state<string | null>(null);
|
|
60
|
+
let dropdownPosition = $state({ top: 0, left: 0 });
|
|
61
|
+
|
|
62
|
+
// Symbol type icons
|
|
63
|
+
const typeIcons: Record<BreadcrumbSymbol['type'], string> = {
|
|
64
|
+
file: '📄',
|
|
65
|
+
module: '📦',
|
|
66
|
+
namespace: '◈',
|
|
67
|
+
class: '◆',
|
|
68
|
+
interface: '◇',
|
|
69
|
+
function: 'ƒ',
|
|
70
|
+
method: '⚙',
|
|
71
|
+
property: '●',
|
|
72
|
+
variable: '○',
|
|
73
|
+
constant: '◉',
|
|
74
|
+
enum: '▤',
|
|
75
|
+
block: '▢'
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Symbol type colors
|
|
79
|
+
const typeColors: Record<BreadcrumbSymbol['type'], string> = {
|
|
80
|
+
file: '#e8e8f0',
|
|
81
|
+
module: '#4ec9b0',
|
|
82
|
+
namespace: '#4ec9b0',
|
|
83
|
+
class: '#4ec9b0',
|
|
84
|
+
interface: '#4ec9b0',
|
|
85
|
+
function: '#dcdcaa',
|
|
86
|
+
method: '#dcdcaa',
|
|
87
|
+
property: '#9cdcfe',
|
|
88
|
+
variable: '#9cdcfe',
|
|
89
|
+
constant: '#4fc1ff',
|
|
90
|
+
enum: '#4ec9b0',
|
|
91
|
+
block: '#c586c0'
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Get file extension for icon
|
|
96
|
+
*/
|
|
97
|
+
function getFileExtension(name: string): string {
|
|
98
|
+
const ext = name.split('.').pop()?.toLowerCase() || '';
|
|
99
|
+
return ext;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Get file icon based on extension
|
|
104
|
+
*/
|
|
105
|
+
function getFileIcon(name: string): string {
|
|
106
|
+
const ext = getFileExtension(name);
|
|
107
|
+
switch (ext) {
|
|
108
|
+
case 'ts':
|
|
109
|
+
case 'tsx':
|
|
110
|
+
return '🔷';
|
|
111
|
+
case 'js':
|
|
112
|
+
case 'jsx':
|
|
113
|
+
return '🟨';
|
|
114
|
+
case 'svelte':
|
|
115
|
+
return '🔶';
|
|
116
|
+
case 'css':
|
|
117
|
+
case 'scss':
|
|
118
|
+
return '🎨';
|
|
119
|
+
case 'html':
|
|
120
|
+
return '🌐';
|
|
121
|
+
case 'json':
|
|
122
|
+
return '📋';
|
|
123
|
+
case 'md':
|
|
124
|
+
return '📝';
|
|
125
|
+
default:
|
|
126
|
+
return '📄';
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Handle breadcrumb click
|
|
132
|
+
*/
|
|
133
|
+
function handleClick(symbol: BreadcrumbSymbol, event: MouseEvent) {
|
|
134
|
+
if (symbol.siblings && symbol.siblings.length > 0) {
|
|
135
|
+
// Toggle dropdown
|
|
136
|
+
if (activeDropdown === symbol.id) {
|
|
137
|
+
activeDropdown = null;
|
|
138
|
+
} else {
|
|
139
|
+
const rect = (event.currentTarget as HTMLElement).getBoundingClientRect();
|
|
140
|
+
dropdownPosition = {
|
|
141
|
+
top: rect.bottom + 2,
|
|
142
|
+
left: rect.left
|
|
143
|
+
};
|
|
144
|
+
activeDropdown = symbol.id;
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
onNavigate?.(symbol);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Handle sibling selection from dropdown
|
|
153
|
+
*/
|
|
154
|
+
function handleSiblingSelect(symbol: BreadcrumbSymbol) {
|
|
155
|
+
activeDropdown = null;
|
|
156
|
+
onNavigate?.(symbol);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Close dropdown when clicking outside
|
|
161
|
+
*/
|
|
162
|
+
function handleOutsideClick(event: MouseEvent) {
|
|
163
|
+
const target = event.target as HTMLElement;
|
|
164
|
+
if (!target.closest('.breadcrumb-dropdown') && !target.closest('.breadcrumb-item')) {
|
|
165
|
+
activeDropdown = null;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
onMount(() => {
|
|
170
|
+
document.addEventListener('click', handleOutsideClick);
|
|
171
|
+
return () => {
|
|
172
|
+
document.removeEventListener('click', handleOutsideClick);
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
</script>
|
|
176
|
+
|
|
177
|
+
{#if enabled}
|
|
178
|
+
<nav
|
|
179
|
+
class="breadcrumbs"
|
|
180
|
+
style={maxWidth ? `max-width: ${maxWidth}px;` : ''}
|
|
181
|
+
aria-label="Code navigation breadcrumbs"
|
|
182
|
+
>
|
|
183
|
+
<!-- File root -->
|
|
184
|
+
<button
|
|
185
|
+
class="breadcrumb-item breadcrumb-item--file"
|
|
186
|
+
onclick={() => onNavigate?.({ id: 'file', name: fileName, type: 'file', line: 0 })}
|
|
187
|
+
title={fileName}
|
|
188
|
+
>
|
|
189
|
+
{#if showFileIcon}
|
|
190
|
+
<span class="breadcrumb-icon">{getFileIcon(fileName)}</span>
|
|
191
|
+
{/if}
|
|
192
|
+
<span class="breadcrumb-label">{fileName.split('/').pop()}</span>
|
|
193
|
+
</button>
|
|
194
|
+
|
|
195
|
+
<!-- Path segments -->
|
|
196
|
+
{#each path as symbol, index (symbol.id)}
|
|
197
|
+
<span class="breadcrumb-separator">›</span>
|
|
198
|
+
|
|
199
|
+
<button
|
|
200
|
+
class="breadcrumb-item"
|
|
201
|
+
class:breadcrumb-item--has-siblings={symbol.siblings && symbol.siblings.length > 0}
|
|
202
|
+
class:breadcrumb-item--active={index === path.length - 1}
|
|
203
|
+
onclick={(e) => handleClick(symbol, e)}
|
|
204
|
+
title="{symbol.type}: {symbol.name}{symbol.detail ? ` - ${symbol.detail}` : ''}"
|
|
205
|
+
>
|
|
206
|
+
<span
|
|
207
|
+
class="breadcrumb-icon breadcrumb-icon--type"
|
|
208
|
+
style="color: {typeColors[symbol.type]};"
|
|
209
|
+
>
|
|
210
|
+
{typeIcons[symbol.type]}
|
|
211
|
+
</span>
|
|
212
|
+
<span class="breadcrumb-label">{symbol.name}</span>
|
|
213
|
+
{#if symbol.siblings && symbol.siblings.length > 0}
|
|
214
|
+
<span class="breadcrumb-chevron" class:breadcrumb-chevron--open={activeDropdown === symbol.id}>
|
|
215
|
+
▾
|
|
216
|
+
</span>
|
|
217
|
+
{/if}
|
|
218
|
+
</button>
|
|
219
|
+
|
|
220
|
+
<!-- Dropdown for siblings -->
|
|
221
|
+
{#if activeDropdown === symbol.id && symbol.siblings}
|
|
222
|
+
<div
|
|
223
|
+
class="breadcrumb-dropdown"
|
|
224
|
+
style="top: {dropdownPosition.top}px; left: {dropdownPosition.left}px;"
|
|
225
|
+
>
|
|
226
|
+
<div class="dropdown-header">
|
|
227
|
+
{symbol.type}s in scope
|
|
228
|
+
</div>
|
|
229
|
+
<div class="dropdown-list">
|
|
230
|
+
{#each symbol.siblings as sibling (sibling.id)}
|
|
231
|
+
<button
|
|
232
|
+
class="dropdown-item"
|
|
233
|
+
class:dropdown-item--current={sibling.id === symbol.id}
|
|
234
|
+
onclick={() => handleSiblingSelect(sibling)}
|
|
235
|
+
>
|
|
236
|
+
<span
|
|
237
|
+
class="dropdown-icon"
|
|
238
|
+
style="color: {typeColors[sibling.type]};"
|
|
239
|
+
>
|
|
240
|
+
{typeIcons[sibling.type]}
|
|
241
|
+
</span>
|
|
242
|
+
<span class="dropdown-label">{sibling.name}</span>
|
|
243
|
+
{#if sibling.detail}
|
|
244
|
+
<span class="dropdown-detail">{sibling.detail}</span>
|
|
245
|
+
{/if}
|
|
246
|
+
<span class="dropdown-line">:{sibling.line + 1}</span>
|
|
247
|
+
</button>
|
|
248
|
+
{/each}
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
{/if}
|
|
252
|
+
{/each}
|
|
253
|
+
|
|
254
|
+
<!-- Current position indicator -->
|
|
255
|
+
{#if path.length > 0}
|
|
256
|
+
{@const current = path[path.length - 1]}
|
|
257
|
+
<span class="breadcrumb-position">
|
|
258
|
+
Ln {current.line + 1}{current.column !== undefined ? `, Col ${current.column + 1}` : ''}
|
|
259
|
+
</span>
|
|
260
|
+
{/if}
|
|
261
|
+
</nav>
|
|
262
|
+
{/if}
|
|
263
|
+
|
|
264
|
+
<style>
|
|
265
|
+
.breadcrumbs {
|
|
266
|
+
display: flex;
|
|
267
|
+
align-items: center;
|
|
268
|
+
gap: 2px;
|
|
269
|
+
padding: 4px 12px;
|
|
270
|
+
background: var(--ide-bg-secondary, #1e1e2e);
|
|
271
|
+
border-bottom: 1px solid var(--ide-border, #333);
|
|
272
|
+
font-size: 12px;
|
|
273
|
+
overflow-x: auto;
|
|
274
|
+
white-space: nowrap;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.breadcrumbs::-webkit-scrollbar {
|
|
278
|
+
height: 4px;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.breadcrumbs::-webkit-scrollbar-thumb {
|
|
282
|
+
background: var(--ide-border, #444);
|
|
283
|
+
border-radius: 2px;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.breadcrumb-item {
|
|
287
|
+
display: flex;
|
|
288
|
+
align-items: center;
|
|
289
|
+
gap: 4px;
|
|
290
|
+
padding: 3px 6px;
|
|
291
|
+
background: transparent;
|
|
292
|
+
border: none;
|
|
293
|
+
border-radius: 4px;
|
|
294
|
+
color: var(--ide-text-secondary, #aaa);
|
|
295
|
+
font-size: 12px;
|
|
296
|
+
cursor: pointer;
|
|
297
|
+
transition: all 0.1s ease;
|
|
298
|
+
max-width: 180px;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.breadcrumb-item:hover {
|
|
302
|
+
background: rgba(255, 255, 255, 0.08);
|
|
303
|
+
color: var(--ide-text-primary, #e8e8f0);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.breadcrumb-item--active {
|
|
307
|
+
color: var(--ide-text-primary, #e8e8f0);
|
|
308
|
+
font-weight: 500;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.breadcrumb-item--has-siblings {
|
|
312
|
+
padding-right: 4px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.breadcrumb-icon {
|
|
316
|
+
flex-shrink: 0;
|
|
317
|
+
font-size: 11px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.breadcrumb-icon--type {
|
|
321
|
+
font-family: monospace;
|
|
322
|
+
font-weight: 600;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.breadcrumb-label {
|
|
326
|
+
overflow: hidden;
|
|
327
|
+
text-overflow: ellipsis;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.breadcrumb-chevron {
|
|
331
|
+
font-size: 10px;
|
|
332
|
+
opacity: 0.6;
|
|
333
|
+
transition: transform 0.15s ease;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.breadcrumb-chevron--open {
|
|
337
|
+
transform: rotate(180deg);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.breadcrumb-separator {
|
|
341
|
+
color: var(--ide-text-muted, #666);
|
|
342
|
+
font-size: 11px;
|
|
343
|
+
margin: 0 2px;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.breadcrumb-position {
|
|
347
|
+
margin-left: auto;
|
|
348
|
+
padding-left: 12px;
|
|
349
|
+
font-size: 11px;
|
|
350
|
+
color: var(--ide-text-muted, #666);
|
|
351
|
+
font-family: monospace;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/* Dropdown */
|
|
355
|
+
.breadcrumb-dropdown {
|
|
356
|
+
position: fixed;
|
|
357
|
+
z-index: 1000;
|
|
358
|
+
min-width: 200px;
|
|
359
|
+
max-width: 350px;
|
|
360
|
+
max-height: 300px;
|
|
361
|
+
background: var(--ide-bg-elevated, #252536);
|
|
362
|
+
border: 1px solid var(--ide-border, #333);
|
|
363
|
+
border-radius: 6px;
|
|
364
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
|
365
|
+
overflow: hidden;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.dropdown-header {
|
|
369
|
+
padding: 6px 10px;
|
|
370
|
+
font-size: 10px;
|
|
371
|
+
text-transform: uppercase;
|
|
372
|
+
letter-spacing: 0.5px;
|
|
373
|
+
color: var(--ide-text-muted, #666);
|
|
374
|
+
background: rgba(0, 0, 0, 0.2);
|
|
375
|
+
border-bottom: 1px solid var(--ide-border, #333);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.dropdown-list {
|
|
379
|
+
overflow-y: auto;
|
|
380
|
+
max-height: 250px;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.dropdown-item {
|
|
384
|
+
display: flex;
|
|
385
|
+
align-items: center;
|
|
386
|
+
gap: 8px;
|
|
387
|
+
width: 100%;
|
|
388
|
+
padding: 6px 10px;
|
|
389
|
+
background: transparent;
|
|
390
|
+
border: none;
|
|
391
|
+
color: var(--ide-text-secondary, #aaa);
|
|
392
|
+
font-size: 12px;
|
|
393
|
+
text-align: left;
|
|
394
|
+
cursor: pointer;
|
|
395
|
+
transition: background 0.1s ease;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.dropdown-item:hover {
|
|
399
|
+
background: rgba(255, 255, 255, 0.08);
|
|
400
|
+
color: var(--ide-text-primary, #e8e8f0);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.dropdown-item--current {
|
|
404
|
+
background: rgba(168, 85, 247, 0.15);
|
|
405
|
+
color: var(--ide-text-primary, #e8e8f0);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.dropdown-icon {
|
|
409
|
+
flex-shrink: 0;
|
|
410
|
+
font-family: monospace;
|
|
411
|
+
font-weight: 600;
|
|
412
|
+
font-size: 11px;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.dropdown-label {
|
|
416
|
+
flex: 1;
|
|
417
|
+
overflow: hidden;
|
|
418
|
+
text-overflow: ellipsis;
|
|
419
|
+
white-space: nowrap;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.dropdown-detail {
|
|
423
|
+
font-size: 10px;
|
|
424
|
+
color: var(--ide-text-muted, #666);
|
|
425
|
+
overflow: hidden;
|
|
426
|
+
text-overflow: ellipsis;
|
|
427
|
+
max-width: 100px;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.dropdown-line {
|
|
431
|
+
font-family: monospace;
|
|
432
|
+
font-size: 10px;
|
|
433
|
+
color: var(--ide-text-muted, #666);
|
|
434
|
+
}
|
|
435
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface BreadcrumbSymbol {
|
|
2
|
+
/** Unique identifier */
|
|
3
|
+
id: string;
|
|
4
|
+
/** Display name */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Symbol type */
|
|
7
|
+
type: 'file' | 'module' | 'namespace' | 'class' | 'interface' | 'function' | 'method' | 'property' | 'variable' | 'constant' | 'enum' | 'block';
|
|
8
|
+
/** Line number (0-based) */
|
|
9
|
+
line: number;
|
|
10
|
+
/** Column number */
|
|
11
|
+
column?: number;
|
|
12
|
+
/** Sibling symbols at same level */
|
|
13
|
+
siblings?: BreadcrumbSymbol[];
|
|
14
|
+
/** Detail text (e.g., function signature) */
|
|
15
|
+
detail?: string;
|
|
16
|
+
}
|
|
17
|
+
interface Props {
|
|
18
|
+
/** Current breadcrumb path */
|
|
19
|
+
path: BreadcrumbSymbol[];
|
|
20
|
+
/** File name/path to show as root */
|
|
21
|
+
fileName?: string;
|
|
22
|
+
/** Whether breadcrumbs are enabled */
|
|
23
|
+
enabled?: boolean;
|
|
24
|
+
/** Callback when symbol is clicked */
|
|
25
|
+
onNavigate?: (symbol: BreadcrumbSymbol) => void;
|
|
26
|
+
/** Whether to show file icon */
|
|
27
|
+
showFileIcon?: boolean;
|
|
28
|
+
/** Maximum width before truncation */
|
|
29
|
+
maxWidth?: number;
|
|
30
|
+
}
|
|
31
|
+
declare const Breadcrumbs: import("svelte").Component<Props, {}, "">;
|
|
32
|
+
type Breadcrumbs = ReturnType<typeof Breadcrumbs>;
|
|
33
|
+
export default Breadcrumbs;
|