@nocturnium/svelte-ide 1.0.2 → 1.0.4

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.
Files changed (78) hide show
  1. package/README.md +5 -3
  2. package/dist/components/ai/AIMessageContent.svelte +24 -14
  3. package/dist/components/ai/AIPanel.svelte +22 -0
  4. package/dist/components/editor/CollaborativeEditor.svelte +68 -5
  5. package/dist/components/editor/CollaborativeEditor.svelte.d.ts +14 -0
  6. package/dist/components/editor/ContextLens.svelte +16 -10
  7. package/dist/components/editor/CustomEditor.svelte +52 -33
  8. package/dist/components/editor/CustomEditor.svelte.d.ts +2 -2
  9. package/dist/components/editor/EchoCursorLayer.svelte +43 -11
  10. package/dist/components/editor/Editor.svelte +17 -0
  11. package/dist/components/editor/Editor.svelte.d.ts +9 -0
  12. package/dist/components/editor/EditorPane.svelte +18 -1
  13. package/dist/components/editor/EditorPane.svelte.d.ts +5 -0
  14. package/dist/components/editor/EditorSelections.svelte +27 -11
  15. package/dist/components/editor/EditorSelections.svelte.d.ts +1 -0
  16. package/dist/components/editor/GhostBracketLayer.svelte +38 -25
  17. package/dist/components/editor/core/folding.d.ts +11 -0
  18. package/dist/components/editor/core/folding.js +41 -0
  19. package/dist/components/editor/core/index.d.ts +0 -5
  20. package/dist/components/editor/core/index.js +4 -5
  21. package/dist/components/editor/core/state.d.ts +5 -0
  22. package/dist/components/editor/core/state.js +131 -12
  23. package/dist/components/editor/editor-find.d.ts +1 -0
  24. package/dist/components/editor/editor-find.js +6 -5
  25. package/dist/components/editor/editor-input.d.ts +1 -0
  26. package/dist/components/editor/editor-input.js +4 -1
  27. package/dist/components/editor/editor-scroll.d.ts +1 -0
  28. package/dist/components/editor/editor-scroll.js +2 -1
  29. package/dist/components/editor/index.d.ts +19 -3
  30. package/dist/components/editor/index.js +18 -4
  31. package/dist/components/editor/tokenizer/base.d.ts +1 -25
  32. package/dist/components/editor/tokenizer/base.js +0 -172
  33. package/dist/components/editor/tokenizer/index.d.ts +4 -0
  34. package/dist/components/editor/tokenizer/index.js +1 -1
  35. package/dist/components/editor/tokenizer/languages/html.d.ts +3 -2
  36. package/dist/components/editor/tokenizer/languages/html.js +64 -6
  37. package/dist/components/editor/tokenizer/languages/javascript.d.ts +0 -3
  38. package/dist/components/editor/tokenizer/languages/javascript.js +1 -2
  39. package/dist/components/editor/tokenizer/languages/svelte.d.ts +1 -1
  40. package/dist/components/editor/tokenizer/languages/svelte.js +6 -1
  41. package/dist/components/editor/tokenizer/types.d.ts +0 -28
  42. package/dist/crdt/awareness.d.ts +8 -2
  43. package/dist/crdt/awareness.js +11 -4
  44. package/dist/crdt/document.d.ts +10 -1
  45. package/dist/crdt/document.js +15 -7
  46. package/dist/crdt/index.d.ts +8 -2
  47. package/dist/crdt/index.js +5 -2
  48. package/dist/crdt/undo.d.ts +2 -7
  49. package/dist/crdt/undo.js +1 -8
  50. package/dist/index.d.ts +7 -9
  51. package/dist/index.js +7 -9
  52. package/dist/services/error-handling.d.ts +2 -11
  53. package/dist/services/error-handling.js +15 -4
  54. package/dist/services/lsp-client.d.ts +3 -0
  55. package/dist/services/lsp-client.js +55 -10
  56. package/dist/services/mock-ai.js +1 -1
  57. package/dist/services/optimistic.d.ts +8 -5
  58. package/dist/services/optimistic.js +36 -10
  59. package/dist/services/vfs-client.js +11 -3
  60. package/dist/stores/agents.svelte.js +3 -2
  61. package/dist/stores/ai-persistence.svelte.js +7 -2
  62. package/dist/stores/ai.svelte.js +3 -2
  63. package/dist/stores/collaboration.svelte.d.ts +1 -1
  64. package/dist/stores/collaboration.svelte.js +3 -2
  65. package/dist/stores/editor.svelte.js +29 -5
  66. package/dist/stores/layout.svelte.js +3 -0
  67. package/dist/stores/plugin.svelte.js +9 -3
  68. package/dist/stores/vfs.svelte.js +26 -9
  69. package/dist/styles/theme.css +43 -0
  70. package/dist/types/vfs.d.ts +15 -1
  71. package/dist/types/vfs.js +9 -0
  72. package/dist/utils/language.d.ts +4 -3
  73. package/dist/utils/language.js +8 -18
  74. package/package.json +1 -1
  75. package/dist/components/editor/MinimalEditor.svelte +0 -75
  76. package/dist/components/editor/MinimalEditor.svelte.d.ts +0 -6
  77. package/dist/components/editor/MinimalEditor2.svelte +0 -84
  78. package/dist/components/editor/MinimalEditor2.svelte.d.ts +0 -6
@@ -43,6 +43,7 @@
43
43
  --ide-bg-elevated: color-mix(in srgb, var(--ide-bg-secondary) 90%, white 10%);
44
44
  --ide-bg-hover: color-mix(in srgb, var(--ide-bg-tertiary) 50%, transparent);
45
45
  --ide-bg-active: var(--ide-bg-tertiary);
46
+ --ide-bg-overlay: color-mix(in srgb, black 75%, transparent);
46
47
  --ide-bg-selection-secondary: color-mix(
47
48
  in srgb,
48
49
  var(--color-nocturnium-aurora-purple) 22%,
@@ -62,9 +63,11 @@
62
63
  --ide-interactive-active: var(--color-nocturnium-ember);
63
64
  --ide-interactive-focus: var(--color-nocturnium-aurora-blue);
64
65
  --ide-interactive-muted: color-mix(in srgb, var(--ide-interactive) 70%, transparent);
66
+ --ide-interactive-rgb: 74, 141, 183;
65
67
 
66
68
  /* IDE Accent Colors */
67
69
  --ide-accent: var(--color-nocturnium-wave);
70
+ --ide-accent-hover: var(--color-nocturnium-flame);
68
71
  --ide-accent-strong: var(--color-nocturnium-flame);
69
72
 
70
73
  /* IDE Semantic Colors */
@@ -98,8 +101,10 @@
98
101
 
99
102
  /* IDE Borders */
100
103
  --ide-border: color-mix(in srgb, var(--ide-text-secondary) 20%, transparent);
104
+ --ide-border-light: color-mix(in srgb, var(--ide-text-secondary) 12%, transparent);
101
105
  --ide-border-focus: var(--ide-interactive);
102
106
  --ide-border-error: var(--ide-error);
107
+ --ide-focus-ring: var(--ide-interactive-focus);
103
108
 
104
109
  /* IDE Shadows */
105
110
  --ide-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
@@ -113,6 +118,7 @@
113
118
  'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Monaco, 'Courier New', monospace;
114
119
  --ide-font-size-xs: 0.75rem;
115
120
  --ide-font-size-sm: 0.875rem;
121
+ --ide-font-size-md: 1rem;
116
122
  --ide-font-size-base: 1rem;
117
123
  --ide-font-size-lg: 1.125rem;
118
124
  --ide-font-size-xl: 1.25rem;
@@ -130,8 +136,10 @@
130
136
  --ide-spacing-lg: 1.5rem;
131
137
  --ide-spacing-xl: 2rem;
132
138
  --ide-spacing-2xl: 3rem;
139
+ --ide-spacing-3xl: 4rem;
133
140
 
134
141
  /* IDE Radii */
142
+ --ide-radius-xs: 0.125rem;
135
143
  --ide-radius-sm: 0.25rem;
136
144
  --ide-radius-md: 0.375rem;
137
145
  --ide-radius-lg: 0.5rem;
@@ -165,6 +173,21 @@
165
173
  --ide-status-bar-height: 24px;
166
174
  --ide-tab-height: 36px;
167
175
  --ide-header-height: 40px;
176
+ --ide-scrollbar-thumb: var(--ide-bg-tertiary);
177
+
178
+ /* IDE Syntax Colors */
179
+ --ide-syntax-keyword: var(--color-nocturnium-aurora-purple);
180
+ --ide-syntax-string: var(--color-nocturnium-aurora-green);
181
+ --ide-syntax-function: var(--color-nocturnium-aurora-blue);
182
+ --ide-syntax-number: var(--color-nocturnium-aurora-yellow);
183
+ --ide-syntax-comment: var(--ide-text-muted);
184
+ --ide-syntax-type: var(--color-nocturnium-teal);
185
+ --ide-syntax-variable: var(--ide-text-primary);
186
+ --ide-syntax-operator: var(--ide-text-primary);
187
+ --ide-syntax-punctuation: var(--ide-text-secondary);
188
+ --ide-syntax-constant: var(--color-nocturnium-aurora-yellow);
189
+ --ide-syntax-tag: var(--color-nocturnium-aurora-pink);
190
+ --ide-syntax-attribute: var(--color-nocturnium-aurora-yellow);
168
191
 
169
192
  /* Agent Status Colors */
170
193
  --ide-agent-online: var(--color-nocturnium-aurora-green);
@@ -175,6 +198,7 @@
175
198
 
176
199
  /* Agent Type Colors */
177
200
  --ide-agent-human: var(--color-nocturnium-aurora-blue);
201
+ --ide-agent-ai: var(--color-nocturnium-ember);
178
202
  --ide-agent-ai-primary: var(--color-nocturnium-ember);
179
203
  --ide-agent-ai-secondary: var(--color-nocturnium-aurora-purple);
180
204
  --ide-agent-system: var(--color-nocturnium-ocean);
@@ -192,6 +216,12 @@
192
216
  --ide-transaction-committed: var(--color-nocturnium-aurora-green);
193
217
  --ide-transaction-failed: var(--ide-error);
194
218
 
219
+ /* File Status Colors */
220
+ --ide-status-created: var(--color-nocturnium-aurora-green);
221
+ --ide-status-modified: var(--color-nocturnium-aurora-yellow);
222
+ --ide-status-deleted: var(--ide-error);
223
+ --ide-status-renamed: var(--color-nocturnium-aurora-purple);
224
+
195
225
  /* Progress Indicators */
196
226
  --ide-progress-track: var(--ide-bg-tertiary);
197
227
  --ide-progress-fill: var(--color-nocturnium-wave);
@@ -623,6 +653,19 @@
623
653
  background: var(--ide-agent-ai-primary);
624
654
  }
625
655
 
656
+ @media (prefers-reduced-motion: reduce) {
657
+ .ide-agent-status-ring,
658
+ .ide-agent-status-ring--busy,
659
+ .ide-agent-status-ring--stalled,
660
+ .ide-lock-badge--pending,
661
+ .ide-lock-badge--conflict,
662
+ .ide-transaction-indicator--pending,
663
+ .ide-agent-cursor,
664
+ .ide-agent-cursor--typing::after {
665
+ animation: none;
666
+ }
667
+ }
668
+
626
669
  /* Force default cursor on editor gutter/line numbers */
627
670
  [class*='gutter'],
628
671
  [class*='line-number'],
@@ -112,9 +112,23 @@ export interface VFSLockAcquisitionOptions {
112
112
  export declare class VFSError extends Error {
113
113
  code: VFSErrorCode;
114
114
  details?: unknown | undefined;
115
+ statusCode?: number;
116
+ path?: string;
117
+ workspaceId?: string;
118
+ retryable: boolean;
119
+ userMessage: string;
120
+ technicalDetails?: string;
121
+ recoveryOptions: {
122
+ id: string;
123
+ label: string;
124
+ description: string;
125
+ action: 'retry' | 'force' | 'merge' | 'discard' | 'refresh' | 'wait' | 'cancel';
126
+ recommended?: boolean;
127
+ dangerous?: boolean;
128
+ }[];
115
129
  constructor(message: string, code: VFSErrorCode, details?: unknown | undefined);
116
130
  }
117
- export type VFSErrorCode = 'FILE_LOCKED' | 'VERSION_CONFLICT' | 'FILE_NOT_FOUND' | 'PERMISSION_DENIED' | 'TRANSACTION_FAILED' | 'WORKSPACE_NOT_FOUND' | 'INVALID_PATH' | 'NETWORK_ERROR';
131
+ export type VFSErrorCode = 'NETWORK_ERROR' | 'CONNECTION_LOST' | 'TIMEOUT' | 'FILE_LOCKED' | 'LOCK_EXPIRED' | 'LOCK_CONFLICT' | 'VERSION_CONFLICT' | 'FILE_NOT_FOUND' | 'PERMISSION_DENIED' | 'WORKSPACE_NOT_FOUND' | 'INVALID_OPERATION' | 'SERVER_ERROR' | 'RATE_LIMITED' | 'TRANSACTION_FAILED' | 'INVALID_PATH' | 'UNKNOWN';
118
132
  export type VFSEvent = VFSSnapshotEvent | VFSUpdateEvent | VFSPingEvent | VFSCompleteEvent | VFSErrorEvent | VFSIterationCompletedEvent | VFSChangeClassifiedEvent | VFSGateProgressEvent | VFSLockAcquiredEvent | VFSLockReleasedEvent;
119
133
  export interface VFSBaseEvent {
120
134
  timestamp: string;
package/dist/types/vfs.js CHANGED
@@ -9,10 +9,19 @@
9
9
  export class VFSError extends Error {
10
10
  code;
11
11
  details;
12
+ statusCode;
13
+ path;
14
+ workspaceId;
15
+ retryable = false;
16
+ userMessage;
17
+ technicalDetails;
18
+ recoveryOptions = [];
12
19
  constructor(message, code, details) {
13
20
  super(message);
14
21
  this.code = code;
15
22
  this.details = details;
16
23
  this.name = 'VFSError';
24
+ this.userMessage = message;
25
+ this.technicalDetails = message;
17
26
  }
18
27
  }
@@ -1,6 +1,3 @@
1
- /**
2
- * Language detection and utilities
3
- */
4
1
  /**
5
2
  * Detect language from filename
6
3
  */
@@ -17,6 +14,10 @@ export declare function getLanguageMimeType(language: string): string;
17
14
  * Check if a language is supported for syntax highlighting
18
15
  */
19
16
  export declare function isLanguageSupported(language: string): boolean;
17
+ /**
18
+ * Get languages with real syntax tokenizers.
19
+ */
20
+ export declare function getSupportedLanguages(): string[];
20
21
  /**
21
22
  * Get display name for a language
22
23
  */
@@ -1,3 +1,4 @@
1
+ import { getSupportedLanguages as getTokenizerSupportedLanguages, resolveLanguage } from '../components/editor/tokenizer';
1
2
  /**
2
3
  * Language detection and utilities
3
4
  */
@@ -144,24 +145,13 @@ export function getLanguageMimeType(language) {
144
145
  * Check if a language is supported for syntax highlighting
145
146
  */
146
147
  export function isLanguageSupported(language) {
147
- const supported = [
148
- 'javascript',
149
- 'typescript',
150
- 'html',
151
- 'css',
152
- 'json',
153
- 'markdown',
154
- 'python',
155
- 'go',
156
- 'rust',
157
- 'java',
158
- 'cpp',
159
- 'sql',
160
- 'xml',
161
- 'yaml',
162
- 'php'
163
- ];
164
- return supported.includes(language);
148
+ return getTokenizerSupportedLanguages().includes(resolveLanguage(language));
149
+ }
150
+ /**
151
+ * Get languages with real syntax tokenizers.
152
+ */
153
+ export function getSupportedLanguages() {
154
+ return getTokenizerSupportedLanguages();
165
155
  }
166
156
  /**
167
157
  * Get display name for a language
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocturnium/svelte-ide",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Svelte 5 code editor and IDE building blocks — custom editor, syntax highlighting, code folding, multi-cursor, LSP client, and optional realtime collaboration.",
5
5
  "author": "Nocturnium & Jordan Dziat <hello@nocturnium.ai> (https://nocturnium.ai)",
6
6
  "license": "MIT",
@@ -1,75 +0,0 @@
1
- <script lang="ts">
2
- // Minimal editor to debug cursor issue
3
- interface Props {
4
- content: string;
5
- }
6
-
7
- let { content }: Props = $props();
8
- const lines = $derived(content.split('\n'));
9
- </script>
10
-
11
- <div class="editor">
12
- <div class="editor__content">
13
- <div class="editor__lines">
14
- {#each lines as line, i (i)}
15
- <div class="editor__line">
16
- <div class="editor__gutter">
17
- <span class="editor__line-number">{i + 1}</span>
18
- </div>
19
- <div class="editor__line-content">{line || '\u00A0'}</div>
20
- </div>
21
- {/each}
22
- </div>
23
- </div>
24
- </div>
25
-
26
- <style>
27
- .editor {
28
- position: relative;
29
- width: 100%;
30
- height: 100%;
31
- background: #0d1421;
32
- font-family: monospace;
33
- font-size: 14px;
34
- }
35
-
36
- .editor__content {
37
- position: relative;
38
- width: 100%;
39
- height: 100%;
40
- overflow: auto;
41
- cursor: default;
42
- }
43
-
44
- .editor__lines {
45
- position: relative;
46
- min-height: 100%;
47
- }
48
-
49
- .editor__line {
50
- display: flex;
51
- line-height: 20px;
52
- cursor: default;
53
- }
54
-
55
- .editor__gutter {
56
- width: 50px;
57
- background: #1a2744;
58
- text-align: right;
59
- padding-right: 8px;
60
- user-select: none;
61
- cursor: default;
62
- }
63
-
64
- .editor__line-number {
65
- color: #666;
66
- cursor: default;
67
- }
68
-
69
- .editor__line-content {
70
- flex: 1;
71
- padding-left: 8px;
72
- color: #e8e8f0;
73
- cursor: text;
74
- }
75
- </style>
@@ -1,6 +0,0 @@
1
- interface Props {
2
- content: string;
3
- }
4
- declare const MinimalEditor: import("svelte").Component<Props, {}, "">;
5
- type MinimalEditor = ReturnType<typeof MinimalEditor>;
6
- export default MinimalEditor;
@@ -1,84 +0,0 @@
1
- <script lang="ts">
2
- // Minimal editor with CSS variables like CustomEditor
3
- interface Props {
4
- content: string;
5
- }
6
-
7
- let { content }: Props = $props();
8
- const lines = $derived(content.split('\n'));
9
- </script>
10
-
11
- <div class="custom-editor">
12
- <div class="custom-editor__content">
13
- <div class="custom-editor__lines">
14
- {#each lines as line, i (i)}
15
- <div class="custom-editor__line">
16
- <div class="custom-editor__gutter">
17
- <span class="custom-editor__line-number">{i + 1}</span>
18
- </div>
19
- <div class="custom-editor__line-content">{line || '\u00A0'}</div>
20
- </div>
21
- {/each}
22
- </div>
23
- </div>
24
- </div>
25
-
26
- <style>
27
- .custom-editor {
28
- position: relative;
29
- width: 100%;
30
- height: 100%;
31
- overflow: hidden;
32
- background: var(--ide-bg-primary);
33
- font-family: var(--ide-font-mono);
34
- font-size: 14px;
35
- }
36
-
37
- .custom-editor__content {
38
- position: relative;
39
- width: 100%;
40
- height: 100%;
41
- overflow: auto;
42
- cursor: default;
43
- }
44
-
45
- .custom-editor__lines {
46
- position: relative;
47
- min-height: 100%;
48
- z-index: 2;
49
- }
50
-
51
- .custom-editor__line {
52
- display: flex;
53
- line-height: 20px;
54
- min-height: 20px;
55
- cursor: default;
56
- }
57
-
58
- .custom-editor__gutter {
59
- position: sticky;
60
- left: 0;
61
- width: 50px;
62
- min-width: 50px;
63
- background: var(--ide-bg-secondary);
64
- border-right: 1px solid var(--ide-border);
65
- text-align: right;
66
- padding-right: 8px;
67
- user-select: none;
68
- cursor: default;
69
- z-index: 3;
70
- }
71
-
72
- .custom-editor__line-number {
73
- color: var(--ide-text-muted);
74
- cursor: default;
75
- }
76
-
77
- .custom-editor__line-content {
78
- flex: 1;
79
- white-space: pre;
80
- padding-left: 8px;
81
- color: var(--ide-text-primary);
82
- cursor: text;
83
- }
84
- </style>
@@ -1,6 +0,0 @@
1
- interface Props {
2
- content: string;
3
- }
4
- declare const MinimalEditor2: import("svelte").Component<Props, {}, "">;
5
- type MinimalEditor2 = ReturnType<typeof MinimalEditor2>;
6
- export default MinimalEditor2;