@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,37 @@
|
|
|
1
|
+
import type { EditorPreferences } from '../../types';
|
|
2
|
+
import { type Cursor } from './core';
|
|
3
|
+
import { type ComplexityMetrics } from './core/complexity-analyzer';
|
|
4
|
+
import type { AIAwareness } from './core/ai-awareness';
|
|
5
|
+
interface Props {
|
|
6
|
+
content: string;
|
|
7
|
+
language?: string;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
preferences?: Partial<EditorPreferences>;
|
|
10
|
+
class?: string;
|
|
11
|
+
/** Enable code folding */
|
|
12
|
+
folding?: boolean;
|
|
13
|
+
/** Enable multi-cursor editing (default: true) */
|
|
14
|
+
multiCursor?: boolean;
|
|
15
|
+
/** Maximum number of cursors (default: 100) */
|
|
16
|
+
maxCursors?: number;
|
|
17
|
+
/** Enable complexity highlighting (default: true) */
|
|
18
|
+
complexityHighlighting?: boolean;
|
|
19
|
+
/** Minimum complexity score to show highlighting (default: 50) */
|
|
20
|
+
complexityThreshold?: number;
|
|
21
|
+
/** AI agents for Ghost Pair visualization */
|
|
22
|
+
aiAgents?: AIAwareness[];
|
|
23
|
+
/** Show AI cursor labels (default: true) */
|
|
24
|
+
showAILabels?: boolean;
|
|
25
|
+
/** Show AI focus regions (default: true) */
|
|
26
|
+
showAIFocusRegions?: boolean;
|
|
27
|
+
onChange?: (content: string) => void;
|
|
28
|
+
onCursorChange?: (line: number, column: number) => void;
|
|
29
|
+
/** Callback when cursors change (for multi-cursor) */
|
|
30
|
+
onCursorsChange?: (cursors: readonly Cursor[]) => void;
|
|
31
|
+
/** Callback when complexity metrics change */
|
|
32
|
+
onComplexityChange?: (metrics: ComplexityMetrics | null) => void;
|
|
33
|
+
onSave?: () => void;
|
|
34
|
+
}
|
|
35
|
+
declare const CustomEditor: import("svelte").Component<Props, {}, "content">;
|
|
36
|
+
type CustomEditor = ReturnType<typeof CustomEditor>;
|
|
37
|
+
export default CustomEditor;
|
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Debug Console
|
|
4
|
+
*
|
|
5
|
+
* Interactive console for debugging:
|
|
6
|
+
* - Expression evaluation
|
|
7
|
+
* - Log output display
|
|
8
|
+
* - Variable inspection
|
|
9
|
+
* - Command history
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { onMount } from 'svelte';
|
|
13
|
+
|
|
14
|
+
export type ConsoleEntryType = 'input' | 'output' | 'error' | 'warning' | 'info' | 'log';
|
|
15
|
+
|
|
16
|
+
export interface ConsoleEntry {
|
|
17
|
+
/** Unique identifier */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Entry type */
|
|
20
|
+
type: ConsoleEntryType;
|
|
21
|
+
/** Content (can be string or structured data) */
|
|
22
|
+
content: unknown;
|
|
23
|
+
/** Timestamp */
|
|
24
|
+
timestamp: Date;
|
|
25
|
+
/** Source location (optional) */
|
|
26
|
+
source?: {
|
|
27
|
+
file: string;
|
|
28
|
+
line: number;
|
|
29
|
+
};
|
|
30
|
+
/** Whether entry is expandable */
|
|
31
|
+
expandable?: boolean;
|
|
32
|
+
/** Whether entry is expanded */
|
|
33
|
+
expanded?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface Props {
|
|
37
|
+
/** Console entries */
|
|
38
|
+
entries?: ConsoleEntry[];
|
|
39
|
+
/** Whether console is open */
|
|
40
|
+
open?: boolean;
|
|
41
|
+
/** Panel height */
|
|
42
|
+
height?: number;
|
|
43
|
+
/** Callback when expression is evaluated */
|
|
44
|
+
onEvaluate?: (expression: string) => void;
|
|
45
|
+
/** Callback when console is cleared */
|
|
46
|
+
onClear?: () => void;
|
|
47
|
+
/** Callback when panel is closed */
|
|
48
|
+
onClose?: () => void;
|
|
49
|
+
/** Whether to show input */
|
|
50
|
+
showInput?: boolean;
|
|
51
|
+
/** Placeholder text for input */
|
|
52
|
+
inputPlaceholder?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let {
|
|
56
|
+
entries = [],
|
|
57
|
+
open = true,
|
|
58
|
+
height = 200,
|
|
59
|
+
onEvaluate,
|
|
60
|
+
onClear,
|
|
61
|
+
onClose,
|
|
62
|
+
showInput = true,
|
|
63
|
+
inputPlaceholder = 'Evaluate expression...'
|
|
64
|
+
}: Props = $props();
|
|
65
|
+
|
|
66
|
+
let inputValue = $state('');
|
|
67
|
+
let commandHistory = $state<string[]>([]);
|
|
68
|
+
let historyIndex = $state(-1);
|
|
69
|
+
let inputRef = $state<HTMLInputElement>(null!);
|
|
70
|
+
let consoleRef = $state<HTMLDivElement>(null!);
|
|
71
|
+
let filter = $state<ConsoleEntryType | 'all'>('all');
|
|
72
|
+
let expandedIds = $state<Set<string>>(new Set());
|
|
73
|
+
|
|
74
|
+
// Entry counter for unique IDs
|
|
75
|
+
let entryCounter = 0;
|
|
76
|
+
|
|
77
|
+
// Filtered entries
|
|
78
|
+
const filteredEntries = $derived(
|
|
79
|
+
filter === 'all' ? entries : entries.filter((e) => e.type === filter)
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
// Entry counts by type
|
|
83
|
+
const entryCounts = $derived(() => {
|
|
84
|
+
const counts: Record<ConsoleEntryType | 'all', number> = {
|
|
85
|
+
all: entries.length,
|
|
86
|
+
input: 0,
|
|
87
|
+
output: 0,
|
|
88
|
+
error: 0,
|
|
89
|
+
warning: 0,
|
|
90
|
+
info: 0,
|
|
91
|
+
log: 0
|
|
92
|
+
};
|
|
93
|
+
for (const entry of entries) {
|
|
94
|
+
counts[entry.type]++;
|
|
95
|
+
}
|
|
96
|
+
return counts;
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Handle input submission
|
|
101
|
+
*/
|
|
102
|
+
function handleSubmit() {
|
|
103
|
+
const expression = inputValue.trim();
|
|
104
|
+
if (!expression) return;
|
|
105
|
+
|
|
106
|
+
// Add to history
|
|
107
|
+
commandHistory = [expression, ...commandHistory.slice(0, 49)];
|
|
108
|
+
historyIndex = -1;
|
|
109
|
+
|
|
110
|
+
// Evaluate
|
|
111
|
+
onEvaluate?.(expression);
|
|
112
|
+
|
|
113
|
+
// Clear input
|
|
114
|
+
inputValue = '';
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Handle keyboard navigation
|
|
119
|
+
*/
|
|
120
|
+
function handleKeyDown(event: KeyboardEvent) {
|
|
121
|
+
switch (event.key) {
|
|
122
|
+
case 'Enter':
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
handleSubmit();
|
|
125
|
+
break;
|
|
126
|
+
case 'ArrowUp':
|
|
127
|
+
if (commandHistory.length > 0) {
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
historyIndex = Math.min(historyIndex + 1, commandHistory.length - 1);
|
|
130
|
+
inputValue = commandHistory[historyIndex] || '';
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
case 'ArrowDown':
|
|
134
|
+
if (historyIndex >= 0) {
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
historyIndex = Math.max(historyIndex - 1, -1);
|
|
137
|
+
inputValue = historyIndex >= 0 ? commandHistory[historyIndex] : '';
|
|
138
|
+
}
|
|
139
|
+
break;
|
|
140
|
+
case 'Escape':
|
|
141
|
+
if (inputValue) {
|
|
142
|
+
inputValue = '';
|
|
143
|
+
historyIndex = -1;
|
|
144
|
+
}
|
|
145
|
+
break;
|
|
146
|
+
case 'l':
|
|
147
|
+
if (event.ctrlKey) {
|
|
148
|
+
event.preventDefault();
|
|
149
|
+
onClear?.();
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Toggle entry expansion
|
|
157
|
+
*/
|
|
158
|
+
function toggleExpand(id: string) {
|
|
159
|
+
const newExpanded = new Set(expandedIds);
|
|
160
|
+
if (newExpanded.has(id)) {
|
|
161
|
+
newExpanded.delete(id);
|
|
162
|
+
} else {
|
|
163
|
+
newExpanded.add(id);
|
|
164
|
+
}
|
|
165
|
+
expandedIds = newExpanded;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Format value for display
|
|
170
|
+
*/
|
|
171
|
+
function formatValue(value: unknown): string {
|
|
172
|
+
if (value === null) return 'null';
|
|
173
|
+
if (value === undefined) return 'undefined';
|
|
174
|
+
if (typeof value === 'string') return `"${value}"`;
|
|
175
|
+
if (typeof value === 'number' || typeof value === 'boolean') return String(value);
|
|
176
|
+
if (typeof value === 'function') return `ƒ ${value.name || 'anonymous'}()`;
|
|
177
|
+
if (Array.isArray(value)) return `Array(${value.length})`;
|
|
178
|
+
if (typeof value === 'object') {
|
|
179
|
+
const constructor = (value as object).constructor?.name;
|
|
180
|
+
return constructor || 'Object';
|
|
181
|
+
}
|
|
182
|
+
return String(value);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Get type color
|
|
187
|
+
*/
|
|
188
|
+
function getTypeColor(type: ConsoleEntryType): string {
|
|
189
|
+
switch (type) {
|
|
190
|
+
case 'error':
|
|
191
|
+
return '#f44747';
|
|
192
|
+
case 'warning':
|
|
193
|
+
return '#ff8c00';
|
|
194
|
+
case 'info':
|
|
195
|
+
return '#3794ff';
|
|
196
|
+
case 'log':
|
|
197
|
+
return '#9cdcfe';
|
|
198
|
+
case 'input':
|
|
199
|
+
return '#dcdcaa';
|
|
200
|
+
case 'output':
|
|
201
|
+
return '#4ec9b0';
|
|
202
|
+
default:
|
|
203
|
+
return '#aaa';
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Get type icon
|
|
209
|
+
*/
|
|
210
|
+
function getTypeIcon(type: ConsoleEntryType): string {
|
|
211
|
+
switch (type) {
|
|
212
|
+
case 'error':
|
|
213
|
+
return '✕';
|
|
214
|
+
case 'warning':
|
|
215
|
+
return '⚠';
|
|
216
|
+
case 'info':
|
|
217
|
+
return 'ℹ';
|
|
218
|
+
case 'log':
|
|
219
|
+
return '●';
|
|
220
|
+
case 'input':
|
|
221
|
+
return '›';
|
|
222
|
+
case 'output':
|
|
223
|
+
return '‹';
|
|
224
|
+
default:
|
|
225
|
+
return '';
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Format timestamp
|
|
231
|
+
*/
|
|
232
|
+
function formatTime(date: Date): string {
|
|
233
|
+
return date.toLocaleTimeString('en-US', {
|
|
234
|
+
hour12: false,
|
|
235
|
+
hour: '2-digit',
|
|
236
|
+
minute: '2-digit',
|
|
237
|
+
second: '2-digit',
|
|
238
|
+
fractionalSecondDigits: 3
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Scroll to bottom when new entries are added
|
|
243
|
+
$effect(() => {
|
|
244
|
+
if (entries.length > 0 && consoleRef) {
|
|
245
|
+
requestAnimationFrame(() => {
|
|
246
|
+
consoleRef.scrollTop = consoleRef.scrollHeight;
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
// Focus input when opened
|
|
252
|
+
$effect(() => {
|
|
253
|
+
if (open && showInput) {
|
|
254
|
+
setTimeout(() => inputRef?.focus(), 50);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
</script>
|
|
258
|
+
|
|
259
|
+
{#if open}
|
|
260
|
+
<div class="debug-console" style="height: {height}px;">
|
|
261
|
+
<!-- Header -->
|
|
262
|
+
<div class="console-header">
|
|
263
|
+
<div class="header-left">
|
|
264
|
+
<h3 class="console-title">Debug Console</h3>
|
|
265
|
+
</div>
|
|
266
|
+
|
|
267
|
+
<div class="header-filters">
|
|
268
|
+
{#each (['all', 'error', 'warning', 'info', 'log'] as const) as filterType}
|
|
269
|
+
{@const count = entryCounts()[filterType]}
|
|
270
|
+
<button
|
|
271
|
+
class="filter-btn"
|
|
272
|
+
class:active={filter === filterType}
|
|
273
|
+
class:has-items={count > 0}
|
|
274
|
+
style="--filter-color: {getTypeColor(filterType === 'all' ? 'log' : filterType)};"
|
|
275
|
+
onclick={() => (filter = filterType)}
|
|
276
|
+
>
|
|
277
|
+
{#if filterType !== 'all'}
|
|
278
|
+
<span class="filter-icon">{getTypeIcon(filterType)}</span>
|
|
279
|
+
{/if}
|
|
280
|
+
<span class="filter-label">
|
|
281
|
+
{filterType === 'all' ? 'All' : filterType.charAt(0).toUpperCase() + filterType.slice(1)}
|
|
282
|
+
</span>
|
|
283
|
+
{#if count > 0}
|
|
284
|
+
<span class="filter-count">{count}</span>
|
|
285
|
+
{/if}
|
|
286
|
+
</button>
|
|
287
|
+
{/each}
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
<div class="header-actions">
|
|
291
|
+
<button class="action-btn" onclick={onClear} title="Clear console (Ctrl+L)">
|
|
292
|
+
🗑
|
|
293
|
+
</button>
|
|
294
|
+
{#if onClose}
|
|
295
|
+
<button class="action-btn" onclick={onClose} title="Close">
|
|
296
|
+
×
|
|
297
|
+
</button>
|
|
298
|
+
{/if}
|
|
299
|
+
</div>
|
|
300
|
+
</div>
|
|
301
|
+
|
|
302
|
+
<!-- Console output -->
|
|
303
|
+
<div class="console-output" bind:this={consoleRef}>
|
|
304
|
+
{#if filteredEntries.length === 0}
|
|
305
|
+
<div class="console-empty">
|
|
306
|
+
{#if filter !== 'all'}
|
|
307
|
+
No {filter} entries
|
|
308
|
+
{:else}
|
|
309
|
+
Console is empty
|
|
310
|
+
{/if}
|
|
311
|
+
</div>
|
|
312
|
+
{:else}
|
|
313
|
+
{#each filteredEntries as entry (entry.id)}
|
|
314
|
+
{@const isExpanded = expandedIds.has(entry.id)}
|
|
315
|
+
<div
|
|
316
|
+
class="console-entry console-entry--{entry.type}"
|
|
317
|
+
class:expandable={entry.expandable}
|
|
318
|
+
class:expanded={isExpanded}
|
|
319
|
+
>
|
|
320
|
+
<span class="entry-icon" style="color: {getTypeColor(entry.type)};">
|
|
321
|
+
{getTypeIcon(entry.type)}
|
|
322
|
+
</span>
|
|
323
|
+
|
|
324
|
+
{#if entry.expandable}
|
|
325
|
+
<button
|
|
326
|
+
class="entry-expand"
|
|
327
|
+
onclick={() => toggleExpand(entry.id)}
|
|
328
|
+
>
|
|
329
|
+
{isExpanded ? '▾' : '▸'}
|
|
330
|
+
</button>
|
|
331
|
+
{/if}
|
|
332
|
+
|
|
333
|
+
<div class="entry-content">
|
|
334
|
+
{#if entry.type === 'input'}
|
|
335
|
+
<span class="entry-prompt">›</span>
|
|
336
|
+
<code class="entry-code">{entry.content}</code>
|
|
337
|
+
{:else if typeof entry.content === 'string'}
|
|
338
|
+
<span class="entry-text">{entry.content}</span>
|
|
339
|
+
{:else if entry.expandable && isExpanded}
|
|
340
|
+
<pre class="entry-json">{JSON.stringify(entry.content, null, 2)}</pre>
|
|
341
|
+
{:else}
|
|
342
|
+
<span class="entry-value">{formatValue(entry.content)}</span>
|
|
343
|
+
{/if}
|
|
344
|
+
</div>
|
|
345
|
+
|
|
346
|
+
{#if entry.source}
|
|
347
|
+
<span class="entry-source">
|
|
348
|
+
{entry.source.file}:{entry.source.line}
|
|
349
|
+
</span>
|
|
350
|
+
{/if}
|
|
351
|
+
|
|
352
|
+
<span class="entry-time">{formatTime(entry.timestamp)}</span>
|
|
353
|
+
</div>
|
|
354
|
+
{/each}
|
|
355
|
+
{/if}
|
|
356
|
+
</div>
|
|
357
|
+
|
|
358
|
+
<!-- Input -->
|
|
359
|
+
{#if showInput}
|
|
360
|
+
<div class="console-input">
|
|
361
|
+
<span class="input-prompt">›</span>
|
|
362
|
+
<input
|
|
363
|
+
type="text"
|
|
364
|
+
class="input-field"
|
|
365
|
+
bind:this={inputRef}
|
|
366
|
+
bind:value={inputValue}
|
|
367
|
+
onkeydown={handleKeyDown}
|
|
368
|
+
placeholder={inputPlaceholder}
|
|
369
|
+
/>
|
|
370
|
+
<button
|
|
371
|
+
class="input-submit"
|
|
372
|
+
onclick={handleSubmit}
|
|
373
|
+
disabled={!inputValue.trim()}
|
|
374
|
+
>
|
|
375
|
+
⏎
|
|
376
|
+
</button>
|
|
377
|
+
</div>
|
|
378
|
+
{/if}
|
|
379
|
+
</div>
|
|
380
|
+
{/if}
|
|
381
|
+
|
|
382
|
+
<style>
|
|
383
|
+
.debug-console {
|
|
384
|
+
display: flex;
|
|
385
|
+
flex-direction: column;
|
|
386
|
+
background: var(--ide-bg-secondary, #1e1e2e);
|
|
387
|
+
border-top: 1px solid var(--ide-border, #333);
|
|
388
|
+
overflow: hidden;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.console-header {
|
|
392
|
+
display: flex;
|
|
393
|
+
align-items: center;
|
|
394
|
+
padding: 8px 12px;
|
|
395
|
+
background: rgba(0, 0, 0, 0.2);
|
|
396
|
+
border-bottom: 1px solid var(--ide-border, #333);
|
|
397
|
+
gap: 12px;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.header-left {
|
|
401
|
+
display: flex;
|
|
402
|
+
align-items: center;
|
|
403
|
+
gap: 8px;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.console-title {
|
|
407
|
+
margin: 0;
|
|
408
|
+
font-size: 12px;
|
|
409
|
+
font-weight: 600;
|
|
410
|
+
color: var(--ide-text-primary, #e8e8f0);
|
|
411
|
+
text-transform: uppercase;
|
|
412
|
+
letter-spacing: 0.5px;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.header-filters {
|
|
416
|
+
display: flex;
|
|
417
|
+
align-items: center;
|
|
418
|
+
gap: 4px;
|
|
419
|
+
flex: 1;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.filter-btn {
|
|
423
|
+
display: flex;
|
|
424
|
+
align-items: center;
|
|
425
|
+
gap: 4px;
|
|
426
|
+
padding: 4px 8px;
|
|
427
|
+
background: transparent;
|
|
428
|
+
border: 1px solid transparent;
|
|
429
|
+
border-radius: 4px;
|
|
430
|
+
color: var(--ide-text-muted, #666);
|
|
431
|
+
font-size: 11px;
|
|
432
|
+
cursor: pointer;
|
|
433
|
+
transition: all 0.15s ease;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.filter-btn:hover {
|
|
437
|
+
background: rgba(255, 255, 255, 0.05);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.filter-btn.active {
|
|
441
|
+
border-color: var(--filter-color);
|
|
442
|
+
color: var(--filter-color);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.filter-icon {
|
|
446
|
+
font-size: 10px;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.filter-count {
|
|
450
|
+
padding: 1px 5px;
|
|
451
|
+
background: rgba(255, 255, 255, 0.1);
|
|
452
|
+
border-radius: 8px;
|
|
453
|
+
font-size: 10px;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.filter-btn.has-items .filter-count {
|
|
457
|
+
font-weight: 600;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.header-actions {
|
|
461
|
+
display: flex;
|
|
462
|
+
gap: 4px;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.action-btn {
|
|
466
|
+
width: 24px;
|
|
467
|
+
height: 24px;
|
|
468
|
+
padding: 0;
|
|
469
|
+
background: transparent;
|
|
470
|
+
border: none;
|
|
471
|
+
border-radius: 4px;
|
|
472
|
+
color: var(--ide-text-muted, #666);
|
|
473
|
+
font-size: 12px;
|
|
474
|
+
cursor: pointer;
|
|
475
|
+
transition: all 0.1s ease;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.action-btn:hover {
|
|
479
|
+
background: rgba(255, 255, 255, 0.1);
|
|
480
|
+
color: var(--ide-text-primary, #e8e8f0);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.console-output {
|
|
484
|
+
flex: 1;
|
|
485
|
+
overflow-y: auto;
|
|
486
|
+
font-family: 'JetBrains Mono', monospace;
|
|
487
|
+
font-size: 12px;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.console-empty {
|
|
491
|
+
padding: 24px;
|
|
492
|
+
text-align: center;
|
|
493
|
+
color: var(--ide-text-muted, #666);
|
|
494
|
+
font-size: 12px;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.console-entry {
|
|
498
|
+
display: flex;
|
|
499
|
+
align-items: flex-start;
|
|
500
|
+
padding: 4px 12px;
|
|
501
|
+
gap: 8px;
|
|
502
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.03);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.console-entry:hover {
|
|
506
|
+
background: rgba(255, 255, 255, 0.02);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.console-entry--error {
|
|
510
|
+
background: rgba(244, 71, 71, 0.08);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.console-entry--warning {
|
|
514
|
+
background: rgba(255, 140, 0, 0.08);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.entry-icon {
|
|
518
|
+
flex-shrink: 0;
|
|
519
|
+
width: 14px;
|
|
520
|
+
font-size: 10px;
|
|
521
|
+
text-align: center;
|
|
522
|
+
padding-top: 2px;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.entry-expand {
|
|
526
|
+
flex-shrink: 0;
|
|
527
|
+
width: 14px;
|
|
528
|
+
padding: 0;
|
|
529
|
+
background: transparent;
|
|
530
|
+
border: none;
|
|
531
|
+
color: var(--ide-text-muted, #666);
|
|
532
|
+
font-size: 10px;
|
|
533
|
+
cursor: pointer;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.entry-expand:hover {
|
|
537
|
+
color: var(--ide-text-primary, #e8e8f0);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.entry-content {
|
|
541
|
+
flex: 1;
|
|
542
|
+
min-width: 0;
|
|
543
|
+
word-break: break-word;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.entry-prompt {
|
|
547
|
+
color: #dcdcaa;
|
|
548
|
+
margin-right: 6px;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
.entry-code {
|
|
552
|
+
color: #dcdcaa;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.entry-text {
|
|
556
|
+
color: var(--ide-text-primary, #e8e8f0);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
.entry-value {
|
|
560
|
+
color: #4ec9b0;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.entry-json {
|
|
564
|
+
margin: 4px 0 0;
|
|
565
|
+
padding: 8px;
|
|
566
|
+
background: rgba(0, 0, 0, 0.2);
|
|
567
|
+
border-radius: 4px;
|
|
568
|
+
font-size: 11px;
|
|
569
|
+
color: var(--ide-text-secondary, #aaa);
|
|
570
|
+
white-space: pre-wrap;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.console-entry--error .entry-text {
|
|
574
|
+
color: #f44747;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.console-entry--warning .entry-text {
|
|
578
|
+
color: #ff8c00;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.entry-source {
|
|
582
|
+
flex-shrink: 0;
|
|
583
|
+
font-size: 10px;
|
|
584
|
+
color: var(--ide-text-muted, #666);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.entry-time {
|
|
588
|
+
flex-shrink: 0;
|
|
589
|
+
font-size: 10px;
|
|
590
|
+
color: var(--ide-text-muted, #555);
|
|
591
|
+
font-family: monospace;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/* Input */
|
|
595
|
+
.console-input {
|
|
596
|
+
display: flex;
|
|
597
|
+
align-items: center;
|
|
598
|
+
padding: 8px 12px;
|
|
599
|
+
background: rgba(0, 0, 0, 0.15);
|
|
600
|
+
border-top: 1px solid var(--ide-border, #333);
|
|
601
|
+
gap: 8px;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.input-prompt {
|
|
605
|
+
color: #dcdcaa;
|
|
606
|
+
font-family: 'JetBrains Mono', monospace;
|
|
607
|
+
font-size: 14px;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.input-field {
|
|
611
|
+
flex: 1;
|
|
612
|
+
padding: 6px 0;
|
|
613
|
+
background: transparent;
|
|
614
|
+
border: none;
|
|
615
|
+
color: var(--ide-text-primary, #e8e8f0);
|
|
616
|
+
font-family: 'JetBrains Mono', monospace;
|
|
617
|
+
font-size: 13px;
|
|
618
|
+
outline: none;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.input-field::placeholder {
|
|
622
|
+
color: var(--ide-text-muted, #555);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.input-submit {
|
|
626
|
+
width: 28px;
|
|
627
|
+
height: 28px;
|
|
628
|
+
padding: 0;
|
|
629
|
+
background: rgba(55, 148, 255, 0.15);
|
|
630
|
+
border: none;
|
|
631
|
+
border-radius: 4px;
|
|
632
|
+
color: #3794ff;
|
|
633
|
+
font-size: 14px;
|
|
634
|
+
cursor: pointer;
|
|
635
|
+
transition: all 0.15s ease;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
.input-submit:hover:not(:disabled) {
|
|
639
|
+
background: rgba(55, 148, 255, 0.25);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.input-submit:disabled {
|
|
643
|
+
opacity: 0.3;
|
|
644
|
+
cursor: not-allowed;
|
|
645
|
+
}
|
|
646
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type ConsoleEntryType = 'input' | 'output' | 'error' | 'warning' | 'info' | 'log';
|
|
2
|
+
export interface ConsoleEntry {
|
|
3
|
+
/** Unique identifier */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Entry type */
|
|
6
|
+
type: ConsoleEntryType;
|
|
7
|
+
/** Content (can be string or structured data) */
|
|
8
|
+
content: unknown;
|
|
9
|
+
/** Timestamp */
|
|
10
|
+
timestamp: Date;
|
|
11
|
+
/** Source location (optional) */
|
|
12
|
+
source?: {
|
|
13
|
+
file: string;
|
|
14
|
+
line: number;
|
|
15
|
+
};
|
|
16
|
+
/** Whether entry is expandable */
|
|
17
|
+
expandable?: boolean;
|
|
18
|
+
/** Whether entry is expanded */
|
|
19
|
+
expanded?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface Props {
|
|
22
|
+
/** Console entries */
|
|
23
|
+
entries?: ConsoleEntry[];
|
|
24
|
+
/** Whether console is open */
|
|
25
|
+
open?: boolean;
|
|
26
|
+
/** Panel height */
|
|
27
|
+
height?: number;
|
|
28
|
+
/** Callback when expression is evaluated */
|
|
29
|
+
onEvaluate?: (expression: string) => void;
|
|
30
|
+
/** Callback when console is cleared */
|
|
31
|
+
onClear?: () => void;
|
|
32
|
+
/** Callback when panel is closed */
|
|
33
|
+
onClose?: () => void;
|
|
34
|
+
/** Whether to show input */
|
|
35
|
+
showInput?: boolean;
|
|
36
|
+
/** Placeholder text for input */
|
|
37
|
+
inputPlaceholder?: string;
|
|
38
|
+
}
|
|
39
|
+
declare const DebugConsole: import("svelte").Component<Props, {}, "">;
|
|
40
|
+
type DebugConsole = ReturnType<typeof DebugConsole>;
|
|
41
|
+
export default DebugConsole;
|