@nocturnium/svelte-ide 1.0.3 → 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.
|
@@ -205,13 +205,13 @@
|
|
|
205
205
|
align-items: center;
|
|
206
206
|
gap: 6px;
|
|
207
207
|
padding: 2px 8px;
|
|
208
|
-
background:
|
|
209
|
-
border: 1px solid var(--
|
|
208
|
+
background: color-mix(in srgb, var(--ide-bg-elevated) 95%, transparent);
|
|
209
|
+
border: 1px solid var(--ide-border);
|
|
210
210
|
border-radius: 4px;
|
|
211
211
|
font-size: 11px;
|
|
212
|
-
font-family: var(--font-mono
|
|
212
|
+
font-family: var(--ide-font-mono);
|
|
213
213
|
white-space: nowrap;
|
|
214
|
-
box-shadow:
|
|
214
|
+
box-shadow: var(--ide-shadow-md);
|
|
215
215
|
animation: lens-fade-in 0.15s ease-out;
|
|
216
216
|
}
|
|
217
217
|
|
|
@@ -227,19 +227,19 @@
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
.context-lens__item--function-header {
|
|
230
|
-
border-left: 3px solid
|
|
230
|
+
border-left: 3px solid var(--ide-syntax-function);
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
.context-lens__item--variable-type {
|
|
234
|
-
border-left: 3px solid
|
|
234
|
+
border-left: 3px solid var(--ide-syntax-keyword);
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
.context-lens__item--parameter-info {
|
|
238
|
-
border-left: 3px solid
|
|
238
|
+
border-left: 3px solid var(--ide-syntax-string);
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
.context-lens__item--return-type {
|
|
242
|
-
border-left: 3px solid
|
|
242
|
+
border-left: 3px solid var(--ide-syntax-number);
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
.context-lens__icon {
|
|
@@ -248,12 +248,18 @@
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
.context-lens__label {
|
|
251
|
-
color:
|
|
251
|
+
color: var(--ide-text-primary);
|
|
252
252
|
font-weight: 600;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
.context-lens__detail {
|
|
256
|
-
color:
|
|
256
|
+
color: var(--ide-text-muted);
|
|
257
257
|
font-weight: 400;
|
|
258
258
|
}
|
|
259
|
+
|
|
260
|
+
@media (prefers-reduced-motion: reduce) {
|
|
261
|
+
.context-lens__item {
|
|
262
|
+
animation: none;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
259
265
|
</style>
|
|
@@ -96,6 +96,23 @@
|
|
|
96
96
|
return `top: ${top}px; left: ${left}px;`;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
function getEchoColorToken(cursor: EchoCursor): string {
|
|
100
|
+
const tokens = [
|
|
101
|
+
'--ide-success',
|
|
102
|
+
'--ide-warning',
|
|
103
|
+
'--ide-syntax-tag',
|
|
104
|
+
'--ide-syntax-type',
|
|
105
|
+
'--ide-ai-assistant',
|
|
106
|
+
'--ide-error',
|
|
107
|
+
'--ide-accent',
|
|
108
|
+
'--ide-accent-strong',
|
|
109
|
+
'--ide-syntax-function',
|
|
110
|
+
'--ide-syntax-string'
|
|
111
|
+
];
|
|
112
|
+
const index = echoCursors.findIndex((echo) => echo.id === cursor.id);
|
|
113
|
+
return tokens[Math.max(index, 0) % tokens.length];
|
|
114
|
+
}
|
|
115
|
+
|
|
99
116
|
/**
|
|
100
117
|
* Handle remove echo click
|
|
101
118
|
*/
|
|
@@ -116,7 +133,7 @@
|
|
|
116
133
|
class="echo-cursor"
|
|
117
134
|
class:echo-cursor--replaying={isReplaying}
|
|
118
135
|
class:echo-cursor--active={cursor.active}
|
|
119
|
-
style="{getCursorStyle(cursor)} --echo-color: {cursor
|
|
136
|
+
style="{getCursorStyle(cursor)} --echo-color: var({getEchoColorToken(cursor)});"
|
|
120
137
|
>
|
|
121
138
|
<!-- Cursor line -->
|
|
122
139
|
<div class="echo-cursor__caret" style="height: {lineHeight}px;"></div>
|
|
@@ -228,7 +245,7 @@
|
|
|
228
245
|
left: 0;
|
|
229
246
|
padding: 2px 6px;
|
|
230
247
|
background: var(--echo-color);
|
|
231
|
-
color:
|
|
248
|
+
color: var(--ide-text-inverse);
|
|
232
249
|
font-size: 10px;
|
|
233
250
|
font-weight: 600;
|
|
234
251
|
border-radius: 4px;
|
|
@@ -241,7 +258,7 @@
|
|
|
241
258
|
left: 0;
|
|
242
259
|
margin-top: 2px;
|
|
243
260
|
padding: 1px 4px;
|
|
244
|
-
background:
|
|
261
|
+
background: var(--ide-bg-overlay);
|
|
245
262
|
color: var(--echo-color);
|
|
246
263
|
font-size: 9px;
|
|
247
264
|
font-family: monospace;
|
|
@@ -262,10 +279,10 @@
|
|
|
262
279
|
width: 14px;
|
|
263
280
|
height: 14px;
|
|
264
281
|
padding: 0;
|
|
265
|
-
background:
|
|
282
|
+
background: color-mix(in srgb, var(--ide-error) 90%, transparent);
|
|
266
283
|
border: none;
|
|
267
284
|
border-radius: 50%;
|
|
268
|
-
color:
|
|
285
|
+
color: var(--ide-text-inverse);
|
|
269
286
|
font-size: 10px;
|
|
270
287
|
line-height: 14px;
|
|
271
288
|
text-align: center;
|
|
@@ -279,7 +296,7 @@
|
|
|
279
296
|
}
|
|
280
297
|
|
|
281
298
|
.echo-cursor__remove:hover {
|
|
282
|
-
background:
|
|
299
|
+
background: var(--ide-error);
|
|
283
300
|
}
|
|
284
301
|
|
|
285
302
|
.echo-cursor__replay {
|
|
@@ -288,13 +305,13 @@
|
|
|
288
305
|
left: 4px;
|
|
289
306
|
padding: 2px 6px;
|
|
290
307
|
background: var(--echo-color);
|
|
291
|
-
color:
|
|
308
|
+
color: var(--ide-text-inverse);
|
|
292
309
|
font-size: 12px;
|
|
293
310
|
font-family: monospace;
|
|
294
311
|
border-radius: 4px;
|
|
295
312
|
white-space: pre;
|
|
296
313
|
transition: opacity 0.2s ease;
|
|
297
|
-
box-shadow:
|
|
314
|
+
box-shadow: var(--ide-shadow-md);
|
|
298
315
|
}
|
|
299
316
|
|
|
300
317
|
.echo-cursor__ripple {
|
|
@@ -330,11 +347,11 @@
|
|
|
330
347
|
align-items: center;
|
|
331
348
|
gap: 6px;
|
|
332
349
|
padding: 6px 12px;
|
|
333
|
-
background:
|
|
334
|
-
border: 1px solid
|
|
350
|
+
background: color-mix(in srgb, var(--ide-success) 15%, transparent);
|
|
351
|
+
border: 1px solid color-mix(in srgb, var(--ide-success) 30%, transparent);
|
|
335
352
|
border-radius: 6px;
|
|
336
353
|
font-size: 12px;
|
|
337
|
-
color:
|
|
354
|
+
color: var(--ide-success);
|
|
338
355
|
pointer-events: auto;
|
|
339
356
|
}
|
|
340
357
|
|
|
@@ -360,4 +377,19 @@
|
|
|
360
377
|
.echo-mode-indicator__count {
|
|
361
378
|
font-weight: 500;
|
|
362
379
|
}
|
|
380
|
+
|
|
381
|
+
@media (prefers-reduced-motion: reduce) {
|
|
382
|
+
.echo-cursor__caret,
|
|
383
|
+
.echo-cursor--replaying .echo-cursor__caret,
|
|
384
|
+
.echo-cursor__ripple,
|
|
385
|
+
.echo-mode-indicator__icon {
|
|
386
|
+
animation: none;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.echo-cursor__delay,
|
|
390
|
+
.echo-cursor__remove,
|
|
391
|
+
.echo-cursor__replay {
|
|
392
|
+
transition: none;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
363
395
|
</style>
|
|
@@ -107,23 +107,23 @@
|
|
|
107
107
|
/**
|
|
108
108
|
* Get color for confidence level
|
|
109
109
|
*/
|
|
110
|
-
function
|
|
111
|
-
if (confidence >= 0.85) return '
|
|
112
|
-
if (confidence >= 0.7) return '
|
|
113
|
-
return '
|
|
110
|
+
function getConfidenceToken(confidence: number): string {
|
|
111
|
+
if (confidence >= 0.85) return '--ide-status-created';
|
|
112
|
+
if (confidence >= 0.7) return '--ide-status-modified';
|
|
113
|
+
return '--ide-accent-strong';
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
* Get severity color
|
|
118
118
|
*/
|
|
119
|
-
function
|
|
119
|
+
function getSeverityToken(severity: BracketMismatch['severity']): string {
|
|
120
120
|
switch (severity) {
|
|
121
121
|
case 'error':
|
|
122
|
-
return '
|
|
122
|
+
return '--ide-status-deleted';
|
|
123
123
|
case 'warning':
|
|
124
|
-
return '
|
|
124
|
+
return '--ide-status-modified';
|
|
125
125
|
default:
|
|
126
|
-
return '
|
|
126
|
+
return '--ide-text-muted';
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
</script>
|
|
@@ -132,12 +132,12 @@
|
|
|
132
132
|
<div class="ghost-bracket-layer" aria-hidden="true">
|
|
133
133
|
<!-- Ghost bracket suggestions -->
|
|
134
134
|
{#each ghosts as ghost (ghost.id)}
|
|
135
|
-
{@const color =
|
|
135
|
+
{@const color = getConfidenceToken(ghost.confidence)}
|
|
136
136
|
{@const connectorStyle = getConnectorStyle(ghost)}
|
|
137
137
|
|
|
138
138
|
<!-- Connector line to matching bracket -->
|
|
139
139
|
{#if connectorStyle && hoveredGhost?.id === ghost.id}
|
|
140
|
-
<div class="ghost-connector" style="{connectorStyle} --ghost-color: {color};">
|
|
140
|
+
<div class="ghost-connector" style="{connectorStyle} --ghost-color: var({color});">
|
|
141
141
|
<div class="ghost-connector__line"></div>
|
|
142
142
|
</div>
|
|
143
143
|
{/if}
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div
|
|
147
147
|
class="ghost-bracket"
|
|
148
148
|
role="tooltip"
|
|
149
|
-
style="{getGhostStyle(ghost)} --ghost-color: {color};"
|
|
149
|
+
style="{getGhostStyle(ghost)} --ghost-color: var({color});"
|
|
150
150
|
onmouseenter={() => (hoveredGhost = ghost)}
|
|
151
151
|
onmouseleave={() => (hoveredGhost = null)}
|
|
152
152
|
>
|
|
@@ -187,10 +187,10 @@
|
|
|
187
187
|
|
|
188
188
|
<!-- Bracket mismatch markers -->
|
|
189
189
|
{#each mismatches as mismatch (`${mismatch.position.line}:${mismatch.position.column}:${mismatch.issue}`)}
|
|
190
|
-
{@const color =
|
|
190
|
+
{@const color = getSeverityToken(mismatch.severity)}
|
|
191
191
|
<div
|
|
192
192
|
class="bracket-mismatch bracket-mismatch--{mismatch.issue}"
|
|
193
|
-
style="{getMismatchStyle(mismatch)} --mismatch-color: {color};"
|
|
193
|
+
style="{getMismatchStyle(mismatch)} --mismatch-color: var({color});"
|
|
194
194
|
title={mismatch.issue === 'unclosed'
|
|
195
195
|
? `Unclosed '${mismatch.character}'`
|
|
196
196
|
: mismatch.issue === 'unexpected'
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
top: -16px;
|
|
254
254
|
left: 0;
|
|
255
255
|
padding: 1px 4px;
|
|
256
|
-
background:
|
|
256
|
+
background: var(--ide-bg-overlay);
|
|
257
257
|
color: var(--ghost-color);
|
|
258
258
|
font-size: 9px;
|
|
259
259
|
font-family: monospace;
|
|
@@ -272,17 +272,17 @@
|
|
|
272
272
|
left: 0;
|
|
273
273
|
margin-top: 4px;
|
|
274
274
|
padding: 8px;
|
|
275
|
-
background: var(--
|
|
276
|
-
border: 1px solid var(--
|
|
275
|
+
background: var(--ide-bg-elevated);
|
|
276
|
+
border: 1px solid var(--ide-border);
|
|
277
277
|
border-radius: 6px;
|
|
278
|
-
box-shadow:
|
|
278
|
+
box-shadow: var(--ide-shadow-lg);
|
|
279
279
|
min-width: 140px;
|
|
280
280
|
z-index: 100;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
.ghost-bracket__reason {
|
|
284
284
|
font-size: 11px;
|
|
285
|
-
color: var(--
|
|
285
|
+
color: var(--ide-text-secondary);
|
|
286
286
|
margin-bottom: 8px;
|
|
287
287
|
line-height: 1.3;
|
|
288
288
|
}
|
|
@@ -304,21 +304,21 @@
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
.ghost-bracket__btn--accept {
|
|
307
|
-
background:
|
|
308
|
-
color:
|
|
307
|
+
background: color-mix(in srgb, var(--ide-status-created) 20%, transparent);
|
|
308
|
+
color: var(--ide-status-created);
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
.ghost-bracket__btn--accept:hover {
|
|
312
|
-
background:
|
|
312
|
+
background: color-mix(in srgb, var(--ide-status-created) 30%, transparent);
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
.ghost-bracket__btn--dismiss {
|
|
316
|
-
background:
|
|
317
|
-
color:
|
|
316
|
+
background: color-mix(in srgb, var(--ide-status-deleted) 20%, transparent);
|
|
317
|
+
color: var(--ide-status-deleted);
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
.ghost-bracket__btn--dismiss:hover {
|
|
321
|
-
background:
|
|
321
|
+
background: color-mix(in srgb, var(--ide-status-deleted) 30%, transparent);
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
/* Connector line */
|
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
left: 0;
|
|
377
377
|
padding: 1px 3px;
|
|
378
378
|
background: var(--mismatch-color);
|
|
379
|
-
color:
|
|
379
|
+
color: var(--ide-text-inverse);
|
|
380
380
|
font-size: 9px;
|
|
381
381
|
font-family: monospace;
|
|
382
382
|
border-radius: 2px;
|
|
@@ -387,4 +387,17 @@
|
|
|
387
387
|
.bracket-mismatch:hover .bracket-mismatch__expected {
|
|
388
388
|
opacity: 1;
|
|
389
389
|
}
|
|
390
|
+
|
|
391
|
+
@media (prefers-reduced-motion: reduce) {
|
|
392
|
+
.ghost-bracket__char,
|
|
393
|
+
.bracket-mismatch--unclosed .bracket-mismatch__underline {
|
|
394
|
+
animation: none;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.ghost-bracket__confidence,
|
|
398
|
+
.ghost-bracket__btn,
|
|
399
|
+
.bracket-mismatch__expected {
|
|
400
|
+
transition: none;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
390
403
|
</style>
|
package/dist/services/mock-ai.js
CHANGED
|
@@ -282,7 +282,7 @@ export function createMockMessage(role, content, options = {}) {
|
|
|
282
282
|
...options,
|
|
283
283
|
metadata: role === 'assistant'
|
|
284
284
|
? {
|
|
285
|
-
model: '
|
|
285
|
+
model: 'nocturnium-demo-mock',
|
|
286
286
|
tokensUsed: Math.floor(content.length / 4),
|
|
287
287
|
latencyMs: Math.floor(500 + Math.random() * 1500),
|
|
288
288
|
...options.metadata
|
package/dist/stores/ai.svelte.js
CHANGED
|
@@ -9,7 +9,7 @@ import { SvelteMap } from 'svelte/reactivity';
|
|
|
9
9
|
// Default configuration
|
|
10
10
|
const defaultConfig = {
|
|
11
11
|
endpoint: '/api/chat',
|
|
12
|
-
model: '
|
|
12
|
+
model: 'nocturnium-demo-mock',
|
|
13
13
|
systemPrompt: 'You are a helpful coding assistant integrated into an IDE.',
|
|
14
14
|
tools: [],
|
|
15
15
|
maxTokens: 4096,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocturnium/svelte-ide",
|
|
3
|
-
"version": "1.0.
|
|
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",
|