@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,194 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* LockIndicator - Badge showing lock status on files
|
|
4
|
+
*
|
|
5
|
+
* Visual states:
|
|
6
|
+
* - Unlocked: No indicator shown
|
|
7
|
+
* - Owned by you: Green lock (filled)
|
|
8
|
+
* - Owned by other: Yellow lock (outline)
|
|
9
|
+
* - AI owns: Ember lock with sparkle
|
|
10
|
+
* - Acquiring: Blue lock with spinner
|
|
11
|
+
* - Conflict: Red lock with exclamation
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { VFSFileLock, VFSLockStatus } from '../../types';
|
|
15
|
+
import { Tooltip, Icon } from '../core';
|
|
16
|
+
|
|
17
|
+
interface Props {
|
|
18
|
+
/** Current lock status */
|
|
19
|
+
status: VFSLockStatus;
|
|
20
|
+
/** Whether current user owns the lock */
|
|
21
|
+
isOwned?: boolean;
|
|
22
|
+
/** Whether lock is held by an AI agent */
|
|
23
|
+
isAI?: boolean;
|
|
24
|
+
/** Size of the indicator */
|
|
25
|
+
size?: 'xs' | 'sm' | 'md';
|
|
26
|
+
/** Show tooltip with details */
|
|
27
|
+
showTooltip?: boolean;
|
|
28
|
+
/** Additional CSS class */
|
|
29
|
+
class?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let {
|
|
33
|
+
status,
|
|
34
|
+
isOwned = false,
|
|
35
|
+
isAI = false,
|
|
36
|
+
size = 'sm',
|
|
37
|
+
showTooltip = true,
|
|
38
|
+
class: className = ''
|
|
39
|
+
}: Props = $props();
|
|
40
|
+
|
|
41
|
+
const sizeMap = {
|
|
42
|
+
xs: 12,
|
|
43
|
+
sm: 14,
|
|
44
|
+
md: 16
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
let iconSize = $derived(sizeMap[size]);
|
|
48
|
+
|
|
49
|
+
function getStatusClass(): string {
|
|
50
|
+
if (status.status === 'unlocked') return '';
|
|
51
|
+
if (status.status === 'acquiring') return 'lock-indicator--pending';
|
|
52
|
+
if (status.status === 'failed') return 'lock-indicator--conflict';
|
|
53
|
+
|
|
54
|
+
// Locked status
|
|
55
|
+
if (isOwned) return 'lock-indicator--owned';
|
|
56
|
+
if (isAI) return 'lock-indicator--ai';
|
|
57
|
+
return 'lock-indicator--other';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function getTooltipText(): string {
|
|
61
|
+
if (status.status === 'unlocked') return 'Unlocked';
|
|
62
|
+
if (status.status === 'acquiring') return 'Acquiring lock...';
|
|
63
|
+
if (status.status === 'failed') return `Lock failed: ${status.error}`;
|
|
64
|
+
|
|
65
|
+
const lock = status.lock;
|
|
66
|
+
const timeRemaining = getTimeRemaining(lock);
|
|
67
|
+
|
|
68
|
+
if (isOwned) return `Locked by you (${timeRemaining} remaining)`;
|
|
69
|
+
if (isAI) return `AI Agent editing (${timeRemaining} remaining)`;
|
|
70
|
+
return `Locked by ${lock.holderName ?? lock.holder} (${timeRemaining} remaining)`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function getTimeRemaining(lock: VFSFileLock): string {
|
|
74
|
+
const expiresAt = new Date(lock.expiresAt).getTime();
|
|
75
|
+
const now = Date.now();
|
|
76
|
+
const remaining = Math.max(0, expiresAt - now);
|
|
77
|
+
|
|
78
|
+
const minutes = Math.floor(remaining / 60000);
|
|
79
|
+
const seconds = Math.floor((remaining % 60000) / 1000);
|
|
80
|
+
|
|
81
|
+
if (minutes > 0) return `${minutes}:${seconds.toString().padStart(2, '0')}`;
|
|
82
|
+
return `${seconds}s`;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function getIcon(): string {
|
|
86
|
+
if (status.status === 'acquiring') return 'loader';
|
|
87
|
+
if (status.status === 'failed') return 'alert-circle';
|
|
88
|
+
if (isOwned) return 'lock';
|
|
89
|
+
return 'lock';
|
|
90
|
+
}
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
{#if status.status !== 'unlocked'}
|
|
94
|
+
{#if showTooltip}
|
|
95
|
+
<Tooltip content={getTooltipText()} position="top">
|
|
96
|
+
<div class="lock-indicator {getStatusClass()} {className}">
|
|
97
|
+
{#if status.status === 'acquiring'}
|
|
98
|
+
<Icon name="loader" size={iconSize} class="lock-indicator__spinner" />
|
|
99
|
+
{:else if status.status === 'failed'}
|
|
100
|
+
<Icon name="alert-circle" size={iconSize} />
|
|
101
|
+
{:else if isAI}
|
|
102
|
+
<svg
|
|
103
|
+
class="lock-indicator__icon"
|
|
104
|
+
viewBox="0 0 16 16"
|
|
105
|
+
fill="currentColor"
|
|
106
|
+
width={iconSize}
|
|
107
|
+
height={iconSize}
|
|
108
|
+
>
|
|
109
|
+
<path
|
|
110
|
+
d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2m3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2"
|
|
111
|
+
/>
|
|
112
|
+
</svg>
|
|
113
|
+
<span class="lock-indicator__sparkle">*</span>
|
|
114
|
+
{:else}
|
|
115
|
+
<svg
|
|
116
|
+
class="lock-indicator__icon"
|
|
117
|
+
viewBox="0 0 16 16"
|
|
118
|
+
fill={isOwned ? 'currentColor' : 'none'}
|
|
119
|
+
stroke="currentColor"
|
|
120
|
+
stroke-width={isOwned ? 0 : 1.5}
|
|
121
|
+
width={iconSize}
|
|
122
|
+
height={iconSize}
|
|
123
|
+
>
|
|
124
|
+
{#if isOwned}
|
|
125
|
+
<path
|
|
126
|
+
d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2m3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2"
|
|
127
|
+
/>
|
|
128
|
+
{:else}
|
|
129
|
+
<rect x="3" y="7" width="10" height="8" rx="1" />
|
|
130
|
+
<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" />
|
|
131
|
+
{/if}
|
|
132
|
+
</svg>
|
|
133
|
+
{/if}
|
|
134
|
+
</div>
|
|
135
|
+
</Tooltip>
|
|
136
|
+
{:else}
|
|
137
|
+
<div class="lock-indicator {getStatusClass()} {className}">
|
|
138
|
+
{#if status.status === 'acquiring'}
|
|
139
|
+
<Icon name="loader" size={iconSize} class="lock-indicator__spinner" />
|
|
140
|
+
{:else if status.status === 'failed'}
|
|
141
|
+
<Icon name="alert-circle" size={iconSize} />
|
|
142
|
+
{:else}
|
|
143
|
+
<Icon name="lock" size={iconSize} />
|
|
144
|
+
{/if}
|
|
145
|
+
</div>
|
|
146
|
+
{/if}
|
|
147
|
+
{/if}
|
|
148
|
+
|
|
149
|
+
<style>
|
|
150
|
+
.lock-indicator {
|
|
151
|
+
display: inline-flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
justify-content: center;
|
|
154
|
+
position: relative;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.lock-indicator--owned {
|
|
158
|
+
color: var(--ide-lock-owned);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.lock-indicator--other {
|
|
162
|
+
color: var(--ide-lock-other);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.lock-indicator--ai {
|
|
166
|
+
color: var(--ide-agent-ai-primary);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.lock-indicator--pending {
|
|
170
|
+
color: var(--ide-lock-pending);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.lock-indicator--conflict {
|
|
174
|
+
color: var(--ide-lock-conflict);
|
|
175
|
+
animation: ide-conflict-flash 0.5s infinite;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.lock-indicator__icon {
|
|
179
|
+
display: block;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.lock-indicator__sparkle {
|
|
183
|
+
position: absolute;
|
|
184
|
+
top: -4px;
|
|
185
|
+
right: -4px;
|
|
186
|
+
font-size: 10px;
|
|
187
|
+
color: var(--color-nocturnium-flame);
|
|
188
|
+
animation: ide-pulse 1s infinite;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:global(.lock-indicator__spinner) {
|
|
192
|
+
animation: ide-spin 1s linear infinite;
|
|
193
|
+
}
|
|
194
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LockIndicator - Badge showing lock status on files
|
|
3
|
+
*
|
|
4
|
+
* Visual states:
|
|
5
|
+
* - Unlocked: No indicator shown
|
|
6
|
+
* - Owned by you: Green lock (filled)
|
|
7
|
+
* - Owned by other: Yellow lock (outline)
|
|
8
|
+
* - AI owns: Ember lock with sparkle
|
|
9
|
+
* - Acquiring: Blue lock with spinner
|
|
10
|
+
* - Conflict: Red lock with exclamation
|
|
11
|
+
*/
|
|
12
|
+
import type { VFSLockStatus } from '../../types';
|
|
13
|
+
interface Props {
|
|
14
|
+
/** Current lock status */
|
|
15
|
+
status: VFSLockStatus;
|
|
16
|
+
/** Whether current user owns the lock */
|
|
17
|
+
isOwned?: boolean;
|
|
18
|
+
/** Whether lock is held by an AI agent */
|
|
19
|
+
isAI?: boolean;
|
|
20
|
+
/** Size of the indicator */
|
|
21
|
+
size?: 'xs' | 'sm' | 'md';
|
|
22
|
+
/** Show tooltip with details */
|
|
23
|
+
showTooltip?: boolean;
|
|
24
|
+
/** Additional CSS class */
|
|
25
|
+
class?: string;
|
|
26
|
+
}
|
|
27
|
+
declare const LockIndicator: import("svelte").Component<Props, {}, "">;
|
|
28
|
+
type LockIndicator = ReturnType<typeof LockIndicator>;
|
|
29
|
+
export default LockIndicator;
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* LockOverlay Component
|
|
4
|
+
*
|
|
5
|
+
* Displays a read-only overlay when a file is locked by another user/agent.
|
|
6
|
+
* Shows lock holder info, time remaining, and options to request access.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { VFSFileLock } from '../../types';
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
lock: VFSFileLock;
|
|
13
|
+
onRequestAccess?: () => void;
|
|
14
|
+
onOpenReadOnly?: () => void;
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
showActions?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let { lock, onRequestAccess, onOpenReadOnly, onClose, showActions = true }: Props = $props();
|
|
20
|
+
|
|
21
|
+
// Calculate time remaining
|
|
22
|
+
let timeRemaining = $derived.by(() => {
|
|
23
|
+
const expires = new Date(lock.expiresAt).getTime();
|
|
24
|
+
const now = Date.now();
|
|
25
|
+
const remaining = Math.max(0, expires - now);
|
|
26
|
+
|
|
27
|
+
if (remaining === 0) return 'Expired';
|
|
28
|
+
|
|
29
|
+
const minutes = Math.floor(remaining / 60000);
|
|
30
|
+
const seconds = Math.floor((remaining % 60000) / 1000);
|
|
31
|
+
|
|
32
|
+
if (minutes > 0) {
|
|
33
|
+
return `${minutes}m ${seconds}s remaining`;
|
|
34
|
+
}
|
|
35
|
+
return `${seconds}s remaining`;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Lock holder display name
|
|
39
|
+
let holderDisplay = $derived(lock.holderType === 'agent' ? `AI: ${lock.holder}` : lock.holder);
|
|
40
|
+
|
|
41
|
+
// Lock purpose display
|
|
42
|
+
let purposeDisplay = $derived.by(() => {
|
|
43
|
+
switch (lock.purpose) {
|
|
44
|
+
case 'edit':
|
|
45
|
+
return 'Editing';
|
|
46
|
+
case 'refactor':
|
|
47
|
+
return 'Refactoring';
|
|
48
|
+
case 'delete':
|
|
49
|
+
return 'Deleting';
|
|
50
|
+
case 'rename':
|
|
51
|
+
return 'Renaming';
|
|
52
|
+
default:
|
|
53
|
+
return 'Modifying';
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<div class="lock-overlay">
|
|
59
|
+
<div class="lock-content">
|
|
60
|
+
<div class="lock-icon">
|
|
61
|
+
{#if lock.holderType === 'agent'}
|
|
62
|
+
<svg
|
|
63
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
64
|
+
width="32"
|
|
65
|
+
height="32"
|
|
66
|
+
viewBox="0 0 24 24"
|
|
67
|
+
fill="none"
|
|
68
|
+
stroke="currentColor"
|
|
69
|
+
stroke-width="2"
|
|
70
|
+
stroke-linecap="round"
|
|
71
|
+
stroke-linejoin="round"
|
|
72
|
+
>
|
|
73
|
+
<rect x="3" y="11" width="18" height="11" rx="2" ry="2" />
|
|
74
|
+
<path d="M7 11V7a5 5 0 0 1 10 0v4" />
|
|
75
|
+
<circle cx="12" cy="16" r="1" />
|
|
76
|
+
</svg>
|
|
77
|
+
<span class="ai-sparkle">✦</span>
|
|
78
|
+
{:else}
|
|
79
|
+
<svg
|
|
80
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
81
|
+
width="32"
|
|
82
|
+
height="32"
|
|
83
|
+
viewBox="0 0 24 24"
|
|
84
|
+
fill="none"
|
|
85
|
+
stroke="currentColor"
|
|
86
|
+
stroke-width="2"
|
|
87
|
+
stroke-linecap="round"
|
|
88
|
+
stroke-linejoin="round"
|
|
89
|
+
>
|
|
90
|
+
<rect x="3" y="11" width="18" height="11" rx="2" ry="2" />
|
|
91
|
+
<path d="M7 11V7a5 5 0 0 1 10 0v4" />
|
|
92
|
+
</svg>
|
|
93
|
+
{/if}
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div class="lock-info">
|
|
97
|
+
<h3 class="lock-title">File Locked</h3>
|
|
98
|
+
<p class="lock-holder">
|
|
99
|
+
<span class="label">Locked by:</span>
|
|
100
|
+
<span class="value">{holderDisplay}</span>
|
|
101
|
+
</p>
|
|
102
|
+
<p class="lock-purpose">
|
|
103
|
+
<span class="label">Purpose:</span>
|
|
104
|
+
<span class="value">{purposeDisplay}</span>
|
|
105
|
+
</p>
|
|
106
|
+
<p class="lock-time">
|
|
107
|
+
<span class="label">Time:</span>
|
|
108
|
+
<span class="value time-remaining">{timeRemaining}</span>
|
|
109
|
+
</p>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
{#if showActions}
|
|
113
|
+
<div class="lock-actions">
|
|
114
|
+
{#if onRequestAccess}
|
|
115
|
+
<button class="action-btn request" onclick={onRequestAccess}>
|
|
116
|
+
<svg
|
|
117
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
118
|
+
width="16"
|
|
119
|
+
height="16"
|
|
120
|
+
viewBox="0 0 24 24"
|
|
121
|
+
fill="none"
|
|
122
|
+
stroke="currentColor"
|
|
123
|
+
stroke-width="2"
|
|
124
|
+
stroke-linecap="round"
|
|
125
|
+
stroke-linejoin="round"
|
|
126
|
+
>
|
|
127
|
+
<path d="M15 3h6v6" />
|
|
128
|
+
<path d="M10 14 21 3" />
|
|
129
|
+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />
|
|
130
|
+
</svg>
|
|
131
|
+
Request Access
|
|
132
|
+
</button>
|
|
133
|
+
{/if}
|
|
134
|
+
{#if onOpenReadOnly}
|
|
135
|
+
<button class="action-btn readonly" onclick={onOpenReadOnly}>
|
|
136
|
+
<svg
|
|
137
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
138
|
+
width="16"
|
|
139
|
+
height="16"
|
|
140
|
+
viewBox="0 0 24 24"
|
|
141
|
+
fill="none"
|
|
142
|
+
stroke="currentColor"
|
|
143
|
+
stroke-width="2"
|
|
144
|
+
stroke-linecap="round"
|
|
145
|
+
stroke-linejoin="round"
|
|
146
|
+
>
|
|
147
|
+
<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" />
|
|
148
|
+
<circle cx="12" cy="12" r="3" />
|
|
149
|
+
</svg>
|
|
150
|
+
Open Read-Only
|
|
151
|
+
</button>
|
|
152
|
+
{/if}
|
|
153
|
+
{#if onClose}
|
|
154
|
+
<button class="action-btn close" onclick={onClose}>
|
|
155
|
+
<svg
|
|
156
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
157
|
+
width="16"
|
|
158
|
+
height="16"
|
|
159
|
+
viewBox="0 0 24 24"
|
|
160
|
+
fill="none"
|
|
161
|
+
stroke="currentColor"
|
|
162
|
+
stroke-width="2"
|
|
163
|
+
stroke-linecap="round"
|
|
164
|
+
stroke-linejoin="round"
|
|
165
|
+
>
|
|
166
|
+
<path d="M18 6 6 18" />
|
|
167
|
+
<path d="m6 6 12 12" />
|
|
168
|
+
</svg>
|
|
169
|
+
Close
|
|
170
|
+
</button>
|
|
171
|
+
{/if}
|
|
172
|
+
</div>
|
|
173
|
+
{/if}
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<div class="overlay-message">
|
|
177
|
+
<span class="readonly-badge">READ-ONLY</span>
|
|
178
|
+
<span class="message-text">This file is currently being edited by another user</span>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<style>
|
|
183
|
+
.lock-overlay {
|
|
184
|
+
position: absolute;
|
|
185
|
+
inset: 0;
|
|
186
|
+
background: var(--ide-bg-overlay, rgba(0, 0, 0, 0.75));
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
align-items: center;
|
|
190
|
+
justify-content: center;
|
|
191
|
+
z-index: 100;
|
|
192
|
+
backdrop-filter: blur(2px);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.lock-content {
|
|
196
|
+
background: var(--ide-bg-secondary, #1e1e1e);
|
|
197
|
+
border: 1px solid var(--ide-border, #3c3c3c);
|
|
198
|
+
border-radius: 8px;
|
|
199
|
+
padding: 24px;
|
|
200
|
+
display: flex;
|
|
201
|
+
flex-direction: column;
|
|
202
|
+
align-items: center;
|
|
203
|
+
gap: 16px;
|
|
204
|
+
max-width: 320px;
|
|
205
|
+
text-align: center;
|
|
206
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.lock-icon {
|
|
210
|
+
position: relative;
|
|
211
|
+
color: var(--ide-lock-other, #e5c07b);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.ai-sparkle {
|
|
215
|
+
position: absolute;
|
|
216
|
+
top: -4px;
|
|
217
|
+
right: -8px;
|
|
218
|
+
font-size: 14px;
|
|
219
|
+
color: var(--ide-agent-ai, #d19a66);
|
|
220
|
+
animation: sparkle 2s ease-in-out infinite;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@keyframes sparkle {
|
|
224
|
+
0%,
|
|
225
|
+
100% {
|
|
226
|
+
opacity: 1;
|
|
227
|
+
transform: scale(1);
|
|
228
|
+
}
|
|
229
|
+
50% {
|
|
230
|
+
opacity: 0.6;
|
|
231
|
+
transform: scale(1.2);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.lock-info {
|
|
236
|
+
display: flex;
|
|
237
|
+
flex-direction: column;
|
|
238
|
+
gap: 8px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.lock-title {
|
|
242
|
+
margin: 0;
|
|
243
|
+
font-size: 18px;
|
|
244
|
+
font-weight: 600;
|
|
245
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.lock-holder,
|
|
249
|
+
.lock-purpose,
|
|
250
|
+
.lock-time {
|
|
251
|
+
margin: 0;
|
|
252
|
+
font-size: 13px;
|
|
253
|
+
color: var(--ide-text-secondary, #a0a0a0);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.label {
|
|
257
|
+
color: var(--ide-text-muted, #808080);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.value {
|
|
261
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
262
|
+
margin-left: 4px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.time-remaining {
|
|
266
|
+
color: var(--ide-lock-other, #e5c07b);
|
|
267
|
+
font-family: var(--ide-font-mono, monospace);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.lock-actions {
|
|
271
|
+
display: flex;
|
|
272
|
+
gap: 8px;
|
|
273
|
+
flex-wrap: wrap;
|
|
274
|
+
justify-content: center;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.action-btn {
|
|
278
|
+
display: inline-flex;
|
|
279
|
+
align-items: center;
|
|
280
|
+
gap: 6px;
|
|
281
|
+
padding: 8px 12px;
|
|
282
|
+
border: none;
|
|
283
|
+
border-radius: 4px;
|
|
284
|
+
font-size: 13px;
|
|
285
|
+
font-weight: 500;
|
|
286
|
+
cursor: pointer;
|
|
287
|
+
transition: all 0.15s ease;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.action-btn.request {
|
|
291
|
+
background: var(--ide-accent, #569cd6);
|
|
292
|
+
color: white;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.action-btn.request:hover {
|
|
296
|
+
background: var(--ide-accent-hover, #4a8bc4);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.action-btn.readonly {
|
|
300
|
+
background: var(--ide-bg-tertiary, #2d2d2d);
|
|
301
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
302
|
+
border: 1px solid var(--ide-border, #3c3c3c);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.action-btn.readonly:hover {
|
|
306
|
+
background: var(--ide-bg-hover, #3c3c3c);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.action-btn.close {
|
|
310
|
+
background: transparent;
|
|
311
|
+
color: var(--ide-text-muted, #808080);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.action-btn.close:hover {
|
|
315
|
+
color: var(--ide-text-primary, #e0e0e0);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.overlay-message {
|
|
319
|
+
position: absolute;
|
|
320
|
+
bottom: 24px;
|
|
321
|
+
display: flex;
|
|
322
|
+
align-items: center;
|
|
323
|
+
gap: 12px;
|
|
324
|
+
padding: 8px 16px;
|
|
325
|
+
background: var(--ide-bg-secondary, #1e1e1e);
|
|
326
|
+
border: 1px solid var(--ide-border, #3c3c3c);
|
|
327
|
+
border-radius: 4px;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.readonly-badge {
|
|
331
|
+
padding: 2px 6px;
|
|
332
|
+
background: var(--ide-lock-other, #e5c07b);
|
|
333
|
+
color: var(--ide-bg-primary, #1e1e1e);
|
|
334
|
+
font-size: 10px;
|
|
335
|
+
font-weight: 700;
|
|
336
|
+
border-radius: 2px;
|
|
337
|
+
letter-spacing: 0.5px;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.message-text {
|
|
341
|
+
font-size: 12px;
|
|
342
|
+
color: var(--ide-text-secondary, #a0a0a0);
|
|
343
|
+
}
|
|
344
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LockOverlay Component
|
|
3
|
+
*
|
|
4
|
+
* Displays a read-only overlay when a file is locked by another user/agent.
|
|
5
|
+
* Shows lock holder info, time remaining, and options to request access.
|
|
6
|
+
*/
|
|
7
|
+
import type { VFSFileLock } from '../../types';
|
|
8
|
+
interface Props {
|
|
9
|
+
lock: VFSFileLock;
|
|
10
|
+
onRequestAccess?: () => void;
|
|
11
|
+
onOpenReadOnly?: () => void;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
showActions?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const LockOverlay: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type LockOverlay = ReturnType<typeof LockOverlay>;
|
|
17
|
+
export default LockOverlay;
|