@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,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Blame Manager
|
|
3
|
+
*
|
|
4
|
+
* Provides inline git blame information for the editor.
|
|
5
|
+
* Shows commit info, author, and timestamps per line.
|
|
6
|
+
*/
|
|
7
|
+
const DEFAULT_CONFIG = {
|
|
8
|
+
colorMode: 'age',
|
|
9
|
+
showAuthor: true,
|
|
10
|
+
showTimestamp: true,
|
|
11
|
+
dateFormat: 'relative',
|
|
12
|
+
authorColors: [
|
|
13
|
+
'#22c55e', // green
|
|
14
|
+
'#3b82f6', // blue
|
|
15
|
+
'#f59e0b', // amber
|
|
16
|
+
'#ec4899', // pink
|
|
17
|
+
'#8b5cf6', // violet
|
|
18
|
+
'#14b8a6', // teal
|
|
19
|
+
'#f97316', // orange
|
|
20
|
+
'#6366f1', // indigo
|
|
21
|
+
'#ef4444', // red
|
|
22
|
+
'#84cc16' // lime
|
|
23
|
+
],
|
|
24
|
+
ageColors: ['#22c55e', '#6b7280'] // green (new) to gray (old)
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Git Blame Manager
|
|
28
|
+
*/
|
|
29
|
+
export class GitBlameManager {
|
|
30
|
+
config;
|
|
31
|
+
state;
|
|
32
|
+
listeners = new Set();
|
|
33
|
+
authorColorMap = new Map();
|
|
34
|
+
colorIndex = 0;
|
|
35
|
+
constructor(config = {}) {
|
|
36
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
37
|
+
this.state = {
|
|
38
|
+
enabled: false,
|
|
39
|
+
lineBlame: new Map(),
|
|
40
|
+
loading: false,
|
|
41
|
+
error: null,
|
|
42
|
+
lastUpdated: null
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Enable blame display
|
|
47
|
+
*/
|
|
48
|
+
enable() {
|
|
49
|
+
this.state.enabled = true;
|
|
50
|
+
this.notify();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Disable blame display
|
|
54
|
+
*/
|
|
55
|
+
disable() {
|
|
56
|
+
this.state.enabled = false;
|
|
57
|
+
this.notify();
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Toggle blame display
|
|
61
|
+
*/
|
|
62
|
+
toggle() {
|
|
63
|
+
this.state.enabled = !this.state.enabled;
|
|
64
|
+
this.notify();
|
|
65
|
+
return this.state.enabled;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Check if blame is enabled
|
|
69
|
+
*/
|
|
70
|
+
isEnabled() {
|
|
71
|
+
return this.state.enabled;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Set blame data for lines
|
|
75
|
+
* This would typically be called after fetching blame from git
|
|
76
|
+
*/
|
|
77
|
+
setBlameData(data) {
|
|
78
|
+
this.state.lineBlame = new Map();
|
|
79
|
+
this.state.loading = false;
|
|
80
|
+
this.state.error = null;
|
|
81
|
+
this.state.lastUpdated = new Date();
|
|
82
|
+
for (const info of data) {
|
|
83
|
+
// Assign color based on config
|
|
84
|
+
if (this.config.colorMode === 'author') {
|
|
85
|
+
info.color = this.getAuthorColor(info.author);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
info.color = this.getAgeColor(info.timestamp);
|
|
89
|
+
}
|
|
90
|
+
this.state.lineBlame.set(info.line, info);
|
|
91
|
+
}
|
|
92
|
+
this.notify();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Set loading state
|
|
96
|
+
*/
|
|
97
|
+
setLoading(loading) {
|
|
98
|
+
this.state.loading = loading;
|
|
99
|
+
if (loading) {
|
|
100
|
+
this.state.error = null;
|
|
101
|
+
}
|
|
102
|
+
this.notify();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Set error state
|
|
106
|
+
*/
|
|
107
|
+
setError(error) {
|
|
108
|
+
this.state.error = error;
|
|
109
|
+
this.state.loading = false;
|
|
110
|
+
this.notify();
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Clear all blame data
|
|
114
|
+
*/
|
|
115
|
+
clear() {
|
|
116
|
+
this.state.lineBlame = new Map();
|
|
117
|
+
this.state.error = null;
|
|
118
|
+
this.state.lastUpdated = null;
|
|
119
|
+
this.notify();
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get blame info for a specific line
|
|
123
|
+
*/
|
|
124
|
+
getLineBlame(line) {
|
|
125
|
+
return this.state.lineBlame.get(line);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get all blame info
|
|
129
|
+
*/
|
|
130
|
+
getAllBlame() {
|
|
131
|
+
return Array.from(this.state.lineBlame.values());
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Get current state
|
|
135
|
+
*/
|
|
136
|
+
getState() {
|
|
137
|
+
return { ...this.state };
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get configuration
|
|
141
|
+
*/
|
|
142
|
+
getConfig() {
|
|
143
|
+
return { ...this.config };
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Update configuration
|
|
147
|
+
*/
|
|
148
|
+
setConfig(config) {
|
|
149
|
+
this.config = { ...this.config, ...config };
|
|
150
|
+
// Recompute colors if mode changed
|
|
151
|
+
if (config.colorMode) {
|
|
152
|
+
for (const [line, info] of this.state.lineBlame) {
|
|
153
|
+
if (this.config.colorMode === 'author') {
|
|
154
|
+
info.color = this.getAuthorColor(info.author);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
info.color = this.getAgeColor(info.timestamp);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
this.notify();
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Get color for an author
|
|
165
|
+
*/
|
|
166
|
+
getAuthorColor(author) {
|
|
167
|
+
if (!this.authorColorMap.has(author)) {
|
|
168
|
+
const color = this.config.authorColors[this.colorIndex % this.config.authorColors.length];
|
|
169
|
+
this.authorColorMap.set(author, color);
|
|
170
|
+
this.colorIndex++;
|
|
171
|
+
}
|
|
172
|
+
return this.authorColorMap.get(author);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Get color based on age (newer = greener, older = grayer)
|
|
176
|
+
*/
|
|
177
|
+
getAgeColor(timestamp) {
|
|
178
|
+
const now = Date.now();
|
|
179
|
+
const age = now - timestamp.getTime();
|
|
180
|
+
// Age ranges in milliseconds
|
|
181
|
+
const oneDay = 24 * 60 * 60 * 1000;
|
|
182
|
+
const oneWeek = 7 * oneDay;
|
|
183
|
+
const oneMonth = 30 * oneDay;
|
|
184
|
+
const sixMonths = 6 * oneMonth;
|
|
185
|
+
const oneYear = 365 * oneDay;
|
|
186
|
+
// Return color based on age
|
|
187
|
+
if (age < oneDay)
|
|
188
|
+
return '#22c55e'; // Today - bright green
|
|
189
|
+
if (age < oneWeek)
|
|
190
|
+
return '#4ade80'; // This week - green
|
|
191
|
+
if (age < oneMonth)
|
|
192
|
+
return '#86efac'; // This month - light green
|
|
193
|
+
if (age < sixMonths)
|
|
194
|
+
return '#9ca3af'; // Recent - gray
|
|
195
|
+
if (age < oneYear)
|
|
196
|
+
return '#6b7280'; // Old - darker gray
|
|
197
|
+
return '#4b5563'; // Ancient - darkest gray
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Format timestamp for display
|
|
201
|
+
*/
|
|
202
|
+
formatTimestamp(date) {
|
|
203
|
+
if (this.config.dateFormat === 'relative') {
|
|
204
|
+
return this.formatRelativeTime(date);
|
|
205
|
+
}
|
|
206
|
+
return date.toLocaleDateString(undefined, {
|
|
207
|
+
year: 'numeric',
|
|
208
|
+
month: 'short',
|
|
209
|
+
day: 'numeric'
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Format relative time (e.g., "2 days ago")
|
|
214
|
+
*/
|
|
215
|
+
formatRelativeTime(date) {
|
|
216
|
+
const now = Date.now();
|
|
217
|
+
const diff = now - date.getTime();
|
|
218
|
+
const seconds = Math.floor(diff / 1000);
|
|
219
|
+
const minutes = Math.floor(seconds / 60);
|
|
220
|
+
const hours = Math.floor(minutes / 60);
|
|
221
|
+
const days = Math.floor(hours / 24);
|
|
222
|
+
const weeks = Math.floor(days / 7);
|
|
223
|
+
const months = Math.floor(days / 30);
|
|
224
|
+
const years = Math.floor(days / 365);
|
|
225
|
+
if (years > 0)
|
|
226
|
+
return `${years}y ago`;
|
|
227
|
+
if (months > 0)
|
|
228
|
+
return `${months}mo ago`;
|
|
229
|
+
if (weeks > 0)
|
|
230
|
+
return `${weeks}w ago`;
|
|
231
|
+
if (days > 0)
|
|
232
|
+
return `${days}d ago`;
|
|
233
|
+
if (hours > 0)
|
|
234
|
+
return `${hours}h ago`;
|
|
235
|
+
if (minutes > 0)
|
|
236
|
+
return `${minutes}m ago`;
|
|
237
|
+
return 'just now';
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Subscribe to state changes
|
|
241
|
+
*/
|
|
242
|
+
subscribe(listener) {
|
|
243
|
+
this.listeners.add(listener);
|
|
244
|
+
return () => this.listeners.delete(listener);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Notify listeners
|
|
248
|
+
*/
|
|
249
|
+
notify() {
|
|
250
|
+
const state = this.getState();
|
|
251
|
+
for (const listener of this.listeners) {
|
|
252
|
+
try {
|
|
253
|
+
listener(state);
|
|
254
|
+
}
|
|
255
|
+
catch (e) {
|
|
256
|
+
console.error('[GitBlameManager] Listener error:', e);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Create a git blame manager
|
|
263
|
+
*/
|
|
264
|
+
export function createGitBlameManager(config) {
|
|
265
|
+
return new GitBlameManager(config);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Generate mock blame data for testing/demo
|
|
269
|
+
*/
|
|
270
|
+
export function generateMockBlameData(lineCount) {
|
|
271
|
+
const authors = [
|
|
272
|
+
{ name: 'Alice Chen', email: 'alice@example.com' },
|
|
273
|
+
{ name: 'Bob Smith', email: 'bob@example.com' },
|
|
274
|
+
{ name: 'Carol White', email: 'carol@example.com' },
|
|
275
|
+
{ name: 'David Lee', email: 'david@example.com' }
|
|
276
|
+
];
|
|
277
|
+
const messages = [
|
|
278
|
+
'Initial commit',
|
|
279
|
+
'Add feature X',
|
|
280
|
+
'Fix bug in Y',
|
|
281
|
+
'Refactor Z module',
|
|
282
|
+
'Update dependencies',
|
|
283
|
+
'Improve performance',
|
|
284
|
+
'Add tests',
|
|
285
|
+
'Fix typo',
|
|
286
|
+
'Clean up code',
|
|
287
|
+
'Add documentation'
|
|
288
|
+
];
|
|
289
|
+
const now = Date.now();
|
|
290
|
+
const blameData = [];
|
|
291
|
+
// Generate commits
|
|
292
|
+
const commits = [];
|
|
293
|
+
for (let i = 0; i < 10; i++) {
|
|
294
|
+
const daysAgo = Math.floor(Math.random() * 365);
|
|
295
|
+
commits.push({
|
|
296
|
+
sha: Math.random().toString(16).substr(2, 7),
|
|
297
|
+
author: authors[Math.floor(Math.random() * authors.length)],
|
|
298
|
+
timestamp: new Date(now - daysAgo * 24 * 60 * 60 * 1000),
|
|
299
|
+
message: messages[Math.floor(Math.random() * messages.length)]
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
// Assign commits to lines (consecutive lines often share commits)
|
|
303
|
+
let currentCommit = commits[0];
|
|
304
|
+
let runLength = 0;
|
|
305
|
+
for (let line = 0; line < lineCount; line++) {
|
|
306
|
+
// Switch commit occasionally
|
|
307
|
+
if (runLength > 3 + Math.random() * 10) {
|
|
308
|
+
currentCommit = commits[Math.floor(Math.random() * commits.length)];
|
|
309
|
+
runLength = 0;
|
|
310
|
+
}
|
|
311
|
+
blameData.push({
|
|
312
|
+
line,
|
|
313
|
+
commitSha: currentCommit.sha,
|
|
314
|
+
fullSha: currentCommit.sha + 'abcdef1234567890',
|
|
315
|
+
author: currentCommit.author.name,
|
|
316
|
+
authorEmail: currentCommit.author.email,
|
|
317
|
+
timestamp: currentCommit.timestamp,
|
|
318
|
+
message: currentCommit.message,
|
|
319
|
+
uncommitted: Math.random() < 0.05 // 5% chance of uncommitted line
|
|
320
|
+
});
|
|
321
|
+
runLength++;
|
|
322
|
+
}
|
|
323
|
+
return blameData;
|
|
324
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core editor module exports
|
|
3
|
+
*/
|
|
4
|
+
export * from './state';
|
|
5
|
+
export * from './navigation';
|
|
6
|
+
export * from './keybindings';
|
|
7
|
+
export * from './crdt-binding';
|
|
8
|
+
export * from './search';
|
|
9
|
+
export * from './folding';
|
|
10
|
+
export * from './multi-cursor';
|
|
11
|
+
export * from './complexity-analyzer';
|
|
12
|
+
export * from './ai-awareness';
|
|
13
|
+
export * from './ghost-pair';
|
|
14
|
+
export * from './semantic-analyzer';
|
|
15
|
+
export * from './commands';
|
|
16
|
+
export * from './timeline';
|
|
17
|
+
export * from './conflict-predictor';
|
|
18
|
+
export * from './echo-cursor';
|
|
19
|
+
export * from './bracket-healer';
|
|
20
|
+
export * from './git-blame';
|
|
21
|
+
export * from './snippet-manager';
|
|
22
|
+
export * from './quick-actions';
|
|
23
|
+
export * from './diagnostics';
|
|
24
|
+
export * from './breakpoints';
|
|
25
|
+
export type { Position } from './state';
|
|
26
|
+
export type { Diagnostic, Range } from './quick-actions';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core editor module exports
|
|
3
|
+
*/
|
|
4
|
+
export * from './state';
|
|
5
|
+
export * from './navigation';
|
|
6
|
+
export * from './keybindings';
|
|
7
|
+
export * from './crdt-binding';
|
|
8
|
+
export * from './search';
|
|
9
|
+
export * from './folding';
|
|
10
|
+
export * from './multi-cursor';
|
|
11
|
+
export * from './complexity-analyzer';
|
|
12
|
+
export * from './ai-awareness';
|
|
13
|
+
export * from './ghost-pair';
|
|
14
|
+
export * from './semantic-analyzer';
|
|
15
|
+
export * from './commands';
|
|
16
|
+
export * from './timeline';
|
|
17
|
+
export * from './conflict-predictor';
|
|
18
|
+
export * from './echo-cursor';
|
|
19
|
+
export * from './bracket-healer';
|
|
20
|
+
export * from './git-blame';
|
|
21
|
+
export * from './snippet-manager';
|
|
22
|
+
export * from './quick-actions';
|
|
23
|
+
export * from './diagnostics';
|
|
24
|
+
export * from './breakpoints';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyboard handling for the custom editor
|
|
3
|
+
*
|
|
4
|
+
* This module provides keybinding management and keyboard event handling.
|
|
5
|
+
*/
|
|
6
|
+
import type { EditorState } from './state';
|
|
7
|
+
import type { Navigation } from './navigation';
|
|
8
|
+
/**
|
|
9
|
+
* Modifier keys
|
|
10
|
+
*/
|
|
11
|
+
export interface Modifiers {
|
|
12
|
+
ctrl?: boolean;
|
|
13
|
+
shift?: boolean;
|
|
14
|
+
alt?: boolean;
|
|
15
|
+
meta?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Keybinding definition
|
|
19
|
+
*/
|
|
20
|
+
export interface Keybinding {
|
|
21
|
+
/** Key name (e.g., 'a', 'Enter', 'ArrowLeft') */
|
|
22
|
+
key: string;
|
|
23
|
+
/** Required modifiers */
|
|
24
|
+
modifiers?: Modifiers;
|
|
25
|
+
/** Handler function */
|
|
26
|
+
handler: () => boolean | void;
|
|
27
|
+
/** Description for help/documentation */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** Whether binding works in readonly mode */
|
|
30
|
+
readonly?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create default keybindings for the editor
|
|
34
|
+
*/
|
|
35
|
+
export declare function createDefaultKeybindings(state: EditorState, nav: Navigation, options?: {
|
|
36
|
+
onSave?: () => void;
|
|
37
|
+
readonly?: boolean;
|
|
38
|
+
pageSize?: number;
|
|
39
|
+
}): Keybinding[];
|
|
40
|
+
/**
|
|
41
|
+
* Keyboard handler class
|
|
42
|
+
*/
|
|
43
|
+
export declare class KeyboardHandler {
|
|
44
|
+
private keybindings;
|
|
45
|
+
private enabled;
|
|
46
|
+
/**
|
|
47
|
+
* Set keybindings
|
|
48
|
+
*/
|
|
49
|
+
setKeybindings(keybindings: Keybinding[]): void;
|
|
50
|
+
/**
|
|
51
|
+
* Add a keybinding
|
|
52
|
+
*/
|
|
53
|
+
addKeybinding(keybinding: Keybinding): void;
|
|
54
|
+
/**
|
|
55
|
+
* Remove a keybinding
|
|
56
|
+
*/
|
|
57
|
+
removeKeybinding(key: string, modifiers?: Modifiers): void;
|
|
58
|
+
/**
|
|
59
|
+
* Enable/disable keyboard handling
|
|
60
|
+
*/
|
|
61
|
+
setEnabled(enabled: boolean): void;
|
|
62
|
+
/**
|
|
63
|
+
* Handle a keyboard event
|
|
64
|
+
* Returns true if the event was handled
|
|
65
|
+
*/
|
|
66
|
+
handleKeyDown(e: KeyboardEvent, readonly?: boolean): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Check if modifiers are equal
|
|
69
|
+
*/
|
|
70
|
+
private modifiersEqual;
|
|
71
|
+
/**
|
|
72
|
+
* Get all keybindings for documentation
|
|
73
|
+
*/
|
|
74
|
+
getKeybindings(): Keybinding[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Create keyboard handler
|
|
78
|
+
*/
|
|
79
|
+
export declare function createKeyboardHandler(): KeyboardHandler;
|