@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,549 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* VersionConflictDialog Component
|
|
4
|
+
*
|
|
5
|
+
* Displays when a file version conflict is detected, allowing the user
|
|
6
|
+
* to choose how to resolve the conflict (merge, overwrite, or discard).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
interface ConflictDetails {
|
|
10
|
+
path: string;
|
|
11
|
+
localVersion: number;
|
|
12
|
+
serverVersion: number;
|
|
13
|
+
localContent: string;
|
|
14
|
+
serverContent: string;
|
|
15
|
+
baseContent?: string;
|
|
16
|
+
lastModifiedBy?: string;
|
|
17
|
+
lastModifiedAt?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface Props {
|
|
21
|
+
conflict: ConflictDetails;
|
|
22
|
+
onResolve: (resolution: 'merge' | 'overwrite' | 'discard', mergedContent?: string) => void;
|
|
23
|
+
onCancel: () => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let { conflict, onResolve, onCancel }: Props = $props();
|
|
27
|
+
|
|
28
|
+
// View state
|
|
29
|
+
let activeView = $state<'side-by-side' | 'unified' | 'local' | 'server'>('side-by-side');
|
|
30
|
+
let mergedContent = $state(conflict.localContent);
|
|
31
|
+
let showMergeEditor = $state(false);
|
|
32
|
+
|
|
33
|
+
// Computed
|
|
34
|
+
let fileName = $derived(conflict.path.split('/').pop() ?? conflict.path);
|
|
35
|
+
let hasChanges = $derived(mergedContent !== conflict.localContent);
|
|
36
|
+
|
|
37
|
+
// Line diff (simplified)
|
|
38
|
+
let localLines = $derived(conflict.localContent.split('\n'));
|
|
39
|
+
let serverLines = $derived(conflict.serverContent.split('\n'));
|
|
40
|
+
|
|
41
|
+
function handleOverwrite() {
|
|
42
|
+
onResolve('overwrite', conflict.localContent);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function handleDiscard() {
|
|
46
|
+
onResolve('discard');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function handleMerge() {
|
|
50
|
+
if (showMergeEditor) {
|
|
51
|
+
onResolve('merge', mergedContent);
|
|
52
|
+
} else {
|
|
53
|
+
showMergeEditor = true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
58
|
+
if (event.key === 'Escape') {
|
|
59
|
+
onCancel();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<svelte:window onkeydown={handleKeydown} />
|
|
65
|
+
|
|
66
|
+
<div class="conflict-overlay" role="dialog" aria-modal="true" aria-labelledby="conflict-title">
|
|
67
|
+
<div class="conflict-dialog">
|
|
68
|
+
<header class="conflict-header">
|
|
69
|
+
<div class="conflict-title-row">
|
|
70
|
+
<svg
|
|
71
|
+
class="conflict-icon"
|
|
72
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
73
|
+
width="24"
|
|
74
|
+
height="24"
|
|
75
|
+
viewBox="0 0 24 24"
|
|
76
|
+
fill="none"
|
|
77
|
+
stroke="currentColor"
|
|
78
|
+
stroke-width="2"
|
|
79
|
+
stroke-linecap="round"
|
|
80
|
+
stroke-linejoin="round"
|
|
81
|
+
>
|
|
82
|
+
<path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
|
|
83
|
+
<line x1="12" y1="9" x2="12" y2="13" />
|
|
84
|
+
<line x1="12" y1="17" x2="12.01" y2="17" />
|
|
85
|
+
</svg>
|
|
86
|
+
<h2 id="conflict-title">Version Conflict</h2>
|
|
87
|
+
</div>
|
|
88
|
+
<button class="close-btn" onclick={onCancel} aria-label="Close">
|
|
89
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
90
|
+
<path d="M18 6 6 18M6 6l12 12" />
|
|
91
|
+
</svg>
|
|
92
|
+
</button>
|
|
93
|
+
</header>
|
|
94
|
+
|
|
95
|
+
<div class="conflict-info">
|
|
96
|
+
<p class="conflict-message">
|
|
97
|
+
<strong>{fileName}</strong> was modified by someone else while you were editing.
|
|
98
|
+
</p>
|
|
99
|
+
<div class="version-badges">
|
|
100
|
+
<span class="version-badge local">
|
|
101
|
+
Your version: v{conflict.localVersion}
|
|
102
|
+
</span>
|
|
103
|
+
<span class="version-badge server">
|
|
104
|
+
Server version: v{conflict.serverVersion}
|
|
105
|
+
{#if conflict.lastModifiedBy}
|
|
106
|
+
<span class="modified-by">by {conflict.lastModifiedBy}</span>
|
|
107
|
+
{/if}
|
|
108
|
+
</span>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div class="view-controls">
|
|
113
|
+
<div class="view-tabs" role="tablist">
|
|
114
|
+
<button
|
|
115
|
+
class="view-tab"
|
|
116
|
+
class:active={activeView === 'side-by-side'}
|
|
117
|
+
onclick={() => (activeView = 'side-by-side')}
|
|
118
|
+
role="tab"
|
|
119
|
+
aria-selected={activeView === 'side-by-side'}
|
|
120
|
+
>
|
|
121
|
+
Side by Side
|
|
122
|
+
</button>
|
|
123
|
+
<button
|
|
124
|
+
class="view-tab"
|
|
125
|
+
class:active={activeView === 'local'}
|
|
126
|
+
onclick={() => (activeView = 'local')}
|
|
127
|
+
role="tab"
|
|
128
|
+
aria-selected={activeView === 'local'}
|
|
129
|
+
>
|
|
130
|
+
Your Version
|
|
131
|
+
</button>
|
|
132
|
+
<button
|
|
133
|
+
class="view-tab"
|
|
134
|
+
class:active={activeView === 'server'}
|
|
135
|
+
onclick={() => (activeView = 'server')}
|
|
136
|
+
role="tab"
|
|
137
|
+
aria-selected={activeView === 'server'}
|
|
138
|
+
>
|
|
139
|
+
Server Version
|
|
140
|
+
</button>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<div class="diff-container">
|
|
145
|
+
{#if activeView === 'side-by-side'}
|
|
146
|
+
<div class="side-by-side">
|
|
147
|
+
<div class="diff-pane local">
|
|
148
|
+
<div class="pane-header">
|
|
149
|
+
<span class="pane-label">Your Changes</span>
|
|
150
|
+
<span class="line-count">{localLines.length} lines</span>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="pane-content">
|
|
153
|
+
<pre><code>{conflict.localContent}</code></pre>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
<div class="diff-pane server">
|
|
157
|
+
<div class="pane-header">
|
|
158
|
+
<span class="pane-label">Server Version</span>
|
|
159
|
+
<span class="line-count">{serverLines.length} lines</span>
|
|
160
|
+
</div>
|
|
161
|
+
<div class="pane-content">
|
|
162
|
+
<pre><code>{conflict.serverContent}</code></pre>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
{:else if activeView === 'local'}
|
|
167
|
+
<div class="single-pane">
|
|
168
|
+
<div class="pane-header">
|
|
169
|
+
<span class="pane-label">Your Changes</span>
|
|
170
|
+
<span class="line-count">{localLines.length} lines</span>
|
|
171
|
+
</div>
|
|
172
|
+
<div class="pane-content">
|
|
173
|
+
<pre><code>{conflict.localContent}</code></pre>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
{:else if activeView === 'server'}
|
|
177
|
+
<div class="single-pane">
|
|
178
|
+
<div class="pane-header">
|
|
179
|
+
<span class="pane-label">Server Version</span>
|
|
180
|
+
<span class="line-count">{serverLines.length} lines</span>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="pane-content">
|
|
183
|
+
<pre><code>{conflict.serverContent}</code></pre>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
{/if}
|
|
187
|
+
|
|
188
|
+
{#if showMergeEditor}
|
|
189
|
+
<div class="merge-editor">
|
|
190
|
+
<div class="pane-header">
|
|
191
|
+
<span class="pane-label">Merged Result</span>
|
|
192
|
+
{#if hasChanges}
|
|
193
|
+
<span class="modified-indicator">Modified</span>
|
|
194
|
+
{/if}
|
|
195
|
+
</div>
|
|
196
|
+
<textarea
|
|
197
|
+
class="merge-textarea"
|
|
198
|
+
bind:value={mergedContent}
|
|
199
|
+
spellcheck="false"
|
|
200
|
+
></textarea>
|
|
201
|
+
</div>
|
|
202
|
+
{/if}
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<footer class="conflict-footer">
|
|
206
|
+
<div class="action-group secondary">
|
|
207
|
+
<button class="action-btn cancel" onclick={onCancel}>
|
|
208
|
+
Cancel
|
|
209
|
+
</button>
|
|
210
|
+
</div>
|
|
211
|
+
<div class="action-group primary">
|
|
212
|
+
<button class="action-btn discard" onclick={handleDiscard}>
|
|
213
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
214
|
+
<path d="M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" />
|
|
215
|
+
</svg>
|
|
216
|
+
Use Server Version
|
|
217
|
+
</button>
|
|
218
|
+
<button class="action-btn merge" onclick={handleMerge}>
|
|
219
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
220
|
+
<circle cx="18" cy="18" r="3" />
|
|
221
|
+
<circle cx="6" cy="6" r="3" />
|
|
222
|
+
<path d="M6 21V9a9 9 0 0 0 9 9" />
|
|
223
|
+
</svg>
|
|
224
|
+
{showMergeEditor ? 'Save Merge' : 'Merge Changes'}
|
|
225
|
+
</button>
|
|
226
|
+
<button class="action-btn overwrite" onclick={handleOverwrite}>
|
|
227
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
228
|
+
<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" />
|
|
229
|
+
</svg>
|
|
230
|
+
Overwrite with Mine
|
|
231
|
+
</button>
|
|
232
|
+
</div>
|
|
233
|
+
</footer>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<style>
|
|
238
|
+
.conflict-overlay {
|
|
239
|
+
position: fixed;
|
|
240
|
+
inset: 0;
|
|
241
|
+
background: var(--ide-bg-overlay, rgba(0, 0, 0, 0.75));
|
|
242
|
+
display: flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
justify-content: center;
|
|
245
|
+
z-index: 1000;
|
|
246
|
+
padding: 20px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.conflict-dialog {
|
|
250
|
+
background: var(--ide-bg-primary, #1e1e1e);
|
|
251
|
+
border: 1px solid var(--ide-border, #3c3c3c);
|
|
252
|
+
border-radius: 8px;
|
|
253
|
+
width: 100%;
|
|
254
|
+
max-width: 1000px;
|
|
255
|
+
max-height: 90vh;
|
|
256
|
+
display: flex;
|
|
257
|
+
flex-direction: column;
|
|
258
|
+
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.conflict-header {
|
|
262
|
+
display: flex;
|
|
263
|
+
align-items: center;
|
|
264
|
+
justify-content: space-between;
|
|
265
|
+
padding: 16px 20px;
|
|
266
|
+
border-bottom: 1px solid var(--ide-border, #3c3c3c);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.conflict-title-row {
|
|
270
|
+
display: flex;
|
|
271
|
+
align-items: center;
|
|
272
|
+
gap: 12px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.conflict-icon {
|
|
276
|
+
color: var(--ide-warning, #e5c07b);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.conflict-header h2 {
|
|
280
|
+
margin: 0;
|
|
281
|
+
font-size: 18px;
|
|
282
|
+
font-weight: 600;
|
|
283
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.close-btn {
|
|
287
|
+
background: transparent;
|
|
288
|
+
border: none;
|
|
289
|
+
color: var(--ide-text-muted, #808080);
|
|
290
|
+
cursor: pointer;
|
|
291
|
+
padding: 4px;
|
|
292
|
+
border-radius: 4px;
|
|
293
|
+
display: flex;
|
|
294
|
+
align-items: center;
|
|
295
|
+
justify-content: center;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.close-btn:hover {
|
|
299
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
300
|
+
background: var(--ide-bg-hover, #3c3c3c);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.conflict-info {
|
|
304
|
+
padding: 16px 20px;
|
|
305
|
+
background: var(--ide-bg-secondary, #252526);
|
|
306
|
+
border-bottom: 1px solid var(--ide-border, #3c3c3c);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.conflict-message {
|
|
310
|
+
margin: 0 0 12px;
|
|
311
|
+
color: var(--ide-text-secondary, #a0a0a0);
|
|
312
|
+
font-size: 14px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.conflict-message strong {
|
|
316
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.version-badges {
|
|
320
|
+
display: flex;
|
|
321
|
+
gap: 12px;
|
|
322
|
+
flex-wrap: wrap;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.version-badge {
|
|
326
|
+
padding: 4px 8px;
|
|
327
|
+
border-radius: 4px;
|
|
328
|
+
font-size: 12px;
|
|
329
|
+
font-family: var(--ide-font-mono, monospace);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.version-badge.local {
|
|
333
|
+
background: var(--ide-accent, #569cd6);
|
|
334
|
+
color: white;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.version-badge.server {
|
|
338
|
+
background: var(--ide-warning, #e5c07b);
|
|
339
|
+
color: var(--ide-bg-primary, #1e1e1e);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.modified-by {
|
|
343
|
+
opacity: 0.8;
|
|
344
|
+
margin-left: 4px;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.view-controls {
|
|
348
|
+
padding: 0 20px;
|
|
349
|
+
border-bottom: 1px solid var(--ide-border, #3c3c3c);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.view-tabs {
|
|
353
|
+
display: flex;
|
|
354
|
+
gap: 0;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.view-tab {
|
|
358
|
+
padding: 12px 16px;
|
|
359
|
+
background: transparent;
|
|
360
|
+
border: none;
|
|
361
|
+
border-bottom: 2px solid transparent;
|
|
362
|
+
color: var(--ide-text-muted, #808080);
|
|
363
|
+
font-size: 13px;
|
|
364
|
+
cursor: pointer;
|
|
365
|
+
transition: all 0.15s ease;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.view-tab:hover {
|
|
369
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.view-tab.active {
|
|
373
|
+
color: var(--ide-accent, #569cd6);
|
|
374
|
+
border-bottom-color: var(--ide-accent, #569cd6);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.diff-container {
|
|
378
|
+
flex: 1;
|
|
379
|
+
overflow: auto;
|
|
380
|
+
min-height: 300px;
|
|
381
|
+
max-height: 50vh;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.side-by-side {
|
|
385
|
+
display: grid;
|
|
386
|
+
grid-template-columns: 1fr 1fr;
|
|
387
|
+
height: 100%;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.diff-pane {
|
|
391
|
+
display: flex;
|
|
392
|
+
flex-direction: column;
|
|
393
|
+
border-right: 1px solid var(--ide-border, #3c3c3c);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.diff-pane:last-child {
|
|
397
|
+
border-right: none;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.single-pane {
|
|
401
|
+
display: flex;
|
|
402
|
+
flex-direction: column;
|
|
403
|
+
height: 100%;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.pane-header {
|
|
407
|
+
display: flex;
|
|
408
|
+
align-items: center;
|
|
409
|
+
justify-content: space-between;
|
|
410
|
+
padding: 8px 12px;
|
|
411
|
+
background: var(--ide-bg-secondary, #252526);
|
|
412
|
+
border-bottom: 1px solid var(--ide-border, #3c3c3c);
|
|
413
|
+
position: sticky;
|
|
414
|
+
top: 0;
|
|
415
|
+
z-index: 1;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.pane-label {
|
|
419
|
+
font-size: 12px;
|
|
420
|
+
font-weight: 500;
|
|
421
|
+
color: var(--ide-text-secondary, #a0a0a0);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.diff-pane.local .pane-label {
|
|
425
|
+
color: var(--ide-accent, #569cd6);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.diff-pane.server .pane-label {
|
|
429
|
+
color: var(--ide-warning, #e5c07b);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.line-count {
|
|
433
|
+
font-size: 11px;
|
|
434
|
+
color: var(--ide-text-muted, #808080);
|
|
435
|
+
font-family: var(--ide-font-mono, monospace);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.pane-content {
|
|
439
|
+
flex: 1;
|
|
440
|
+
overflow: auto;
|
|
441
|
+
padding: 12px;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.pane-content pre {
|
|
445
|
+
margin: 0;
|
|
446
|
+
font-family: var(--ide-font-mono, monospace);
|
|
447
|
+
font-size: 13px;
|
|
448
|
+
line-height: 1.5;
|
|
449
|
+
white-space: pre-wrap;
|
|
450
|
+
word-break: break-word;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.pane-content code {
|
|
454
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.merge-editor {
|
|
458
|
+
border-top: 1px solid var(--ide-border, #3c3c3c);
|
|
459
|
+
display: flex;
|
|
460
|
+
flex-direction: column;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.modified-indicator {
|
|
464
|
+
font-size: 11px;
|
|
465
|
+
color: var(--ide-warning, #e5c07b);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.merge-textarea {
|
|
469
|
+
flex: 1;
|
|
470
|
+
min-height: 150px;
|
|
471
|
+
padding: 12px;
|
|
472
|
+
background: var(--ide-bg-primary, #1e1e1e);
|
|
473
|
+
border: none;
|
|
474
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
475
|
+
font-family: var(--ide-font-mono, monospace);
|
|
476
|
+
font-size: 13px;
|
|
477
|
+
line-height: 1.5;
|
|
478
|
+
resize: vertical;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.merge-textarea:focus {
|
|
482
|
+
outline: none;
|
|
483
|
+
background: var(--ide-bg-secondary, #252526);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.conflict-footer {
|
|
487
|
+
display: flex;
|
|
488
|
+
align-items: center;
|
|
489
|
+
justify-content: space-between;
|
|
490
|
+
padding: 16px 20px;
|
|
491
|
+
border-top: 1px solid var(--ide-border, #3c3c3c);
|
|
492
|
+
background: var(--ide-bg-secondary, #252526);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.action-group {
|
|
496
|
+
display: flex;
|
|
497
|
+
gap: 8px;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.action-btn {
|
|
501
|
+
display: inline-flex;
|
|
502
|
+
align-items: center;
|
|
503
|
+
gap: 6px;
|
|
504
|
+
padding: 8px 14px;
|
|
505
|
+
border: none;
|
|
506
|
+
border-radius: 4px;
|
|
507
|
+
font-size: 13px;
|
|
508
|
+
font-weight: 500;
|
|
509
|
+
cursor: pointer;
|
|
510
|
+
transition: all 0.15s ease;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.action-btn.cancel {
|
|
514
|
+
background: transparent;
|
|
515
|
+
color: var(--ide-text-muted, #808080);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.action-btn.cancel:hover {
|
|
519
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.action-btn.discard {
|
|
523
|
+
background: var(--ide-bg-tertiary, #2d2d2d);
|
|
524
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
525
|
+
border: 1px solid var(--ide-border, #3c3c3c);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.action-btn.discard:hover {
|
|
529
|
+
background: var(--ide-bg-hover, #3c3c3c);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.action-btn.merge {
|
|
533
|
+
background: var(--ide-accent, #569cd6);
|
|
534
|
+
color: white;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.action-btn.merge:hover {
|
|
538
|
+
background: var(--ide-accent-hover, #4a8bc4);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.action-btn.overwrite {
|
|
542
|
+
background: var(--ide-warning, #e5c07b);
|
|
543
|
+
color: var(--ide-bg-primary, #1e1e1e);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.action-btn.overwrite:hover {
|
|
547
|
+
filter: brightness(1.1);
|
|
548
|
+
}
|
|
549
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VersionConflictDialog Component
|
|
3
|
+
*
|
|
4
|
+
* Displays when a file version conflict is detected, allowing the user
|
|
5
|
+
* to choose how to resolve the conflict (merge, overwrite, or discard).
|
|
6
|
+
*/
|
|
7
|
+
interface ConflictDetails {
|
|
8
|
+
path: string;
|
|
9
|
+
localVersion: number;
|
|
10
|
+
serverVersion: number;
|
|
11
|
+
localContent: string;
|
|
12
|
+
serverContent: string;
|
|
13
|
+
baseContent?: string;
|
|
14
|
+
lastModifiedBy?: string;
|
|
15
|
+
lastModifiedAt?: string;
|
|
16
|
+
}
|
|
17
|
+
interface Props {
|
|
18
|
+
conflict: ConflictDetails;
|
|
19
|
+
onResolve: (resolution: 'merge' | 'overwrite' | 'discard', mergedContent?: string) => void;
|
|
20
|
+
onCancel: () => void;
|
|
21
|
+
}
|
|
22
|
+
declare const VersionConflictDialog: import("svelte").Component<Props, {}, "">;
|
|
23
|
+
type VersionConflictDialog = ReturnType<typeof VersionConflictDialog>;
|
|
24
|
+
export default VersionConflictDialog;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as LockIndicator } from './LockIndicator.svelte';
|
|
2
|
+
export { default as LockConflictDialog } from './LockConflictDialog.svelte';
|
|
3
|
+
export { default as LockOverlay } from './LockOverlay.svelte';
|
|
4
|
+
export { default as VersionConflictDialog } from './VersionConflictDialog.svelte';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// VFS components
|
|
2
|
+
export { default as LockIndicator } from './LockIndicator.svelte';
|
|
3
|
+
export { default as LockConflictDialog } from './LockConflictDialog.svelte';
|
|
4
|
+
export { default as LockOverlay } from './LockOverlay.svelte';
|
|
5
|
+
export { default as VersionConflictDialog } from './VersionConflictDialog.svelte';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Awareness protocol for cursor and selection sync
|
|
3
|
+
*/
|
|
4
|
+
import { Awareness } from 'y-protocols/awareness';
|
|
5
|
+
import type { Doc as YDoc } from 'yjs';
|
|
6
|
+
export interface AwarenessUser {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
color: string;
|
|
10
|
+
isAI?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface AwarenessProtocol {
|
|
13
|
+
awareness: Awareness;
|
|
14
|
+
setUser(user: AwarenessUser): void;
|
|
15
|
+
setCursor(anchor: number, head: number): void;
|
|
16
|
+
setSelection(anchor: number, head: number): void;
|
|
17
|
+
setViewingFile(path: string | undefined): void;
|
|
18
|
+
setEditingFile(path: string | undefined): void;
|
|
19
|
+
setState(state: 'active' | 'idle' | 'away'): void;
|
|
20
|
+
getUsers(): AwarenessUser[];
|
|
21
|
+
getCursors(): Map<number, {
|
|
22
|
+
user: AwarenessUser;
|
|
23
|
+
cursor: {
|
|
24
|
+
anchor: number;
|
|
25
|
+
head: number;
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
28
|
+
onUsersChange(callback: (users: AwarenessUser[]) => void): () => void;
|
|
29
|
+
destroy(): void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Create an awareness protocol instance
|
|
33
|
+
*/
|
|
34
|
+
export declare function createAwarenessProtocol(doc: YDoc): AwarenessProtocol;
|
|
35
|
+
/**
|
|
36
|
+
* Generate a random color for a user
|
|
37
|
+
*/
|
|
38
|
+
export declare function generateUserColor(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Generate initials from a name
|
|
41
|
+
*/
|
|
42
|
+
export declare function getInitials(name: string): string;
|