@innovatorved/code-lab 0.5.0 → 0.6.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.
Files changed (76) hide show
  1. package/ARCHITECTURE.md +3 -3
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +3 -3
  4. package/dist/code-lab-sql.css +87 -64
  5. package/dist/code-lab-sql.esm.js +109 -86
  6. package/dist/code-lab-sql.umd.js +110 -87
  7. package/dist/code-lab.css +32 -7273
  8. package/dist/code-lab.d.ts +1 -1
  9. package/dist/code-lab.esm.js +4966 -74622
  10. package/dist/code-lab.js +4974 -74631
  11. package/dist/code-lab.umd.js +4974 -74631
  12. package/dist/extensions/cpp.d.ts +2 -2
  13. package/dist/extensions/cpp.esm.js +1788 -14707
  14. package/dist/extensions/cpp.js +1788 -14707
  15. package/dist/extensions/guided-lab.esm.js +2938 -16127
  16. package/dist/extensions/guided-lab.js +2938 -16127
  17. package/dist/extensions/python.d.ts +2 -2
  18. package/dist/extensions/python.esm.js +1769 -14701
  19. package/dist/extensions/python.js +1769 -14701
  20. package/dist/index.d.ts +1 -1
  21. package/dist/packages/sql/src/styles.d.ts +1 -1
  22. package/dist/packages/ui/src/settings-dialog.d.ts +2 -0
  23. package/dist/preview-sw.js +4 -188
  24. package/dist/runtime.esm.js +109 -10284
  25. package/dist/runtime.js +107 -10284
  26. package/dist/schemas.d.ts +2 -2
  27. package/dist/schemas.esm.js +2938 -16127
  28. package/dist/schemas.js +2941 -16130
  29. package/dist/scm.d.ts +221 -20
  30. package/dist/shell.esm.js +811 -10002
  31. package/dist/shell.js +811 -10002
  32. package/dist/storage.d.ts +9 -0
  33. package/dist/terminal.esm.js +20 -1347
  34. package/dist/terminal.js +20 -1347
  35. package/dist/workbench/command-palette.d.ts +16 -1
  36. package/dist/workbench/diff-editor.d.ts +27 -1
  37. package/dist/workbench/icons.d.ts +6 -2
  38. package/dist/workbench/index.d.ts +33 -1
  39. package/dist/workbench/intellisense.d.ts +194 -0
  40. package/dist/workbench/styles.d.ts +1 -1
  41. package/dist/workbench/xterm-adapter.d.ts +122 -0
  42. package/package.json +7 -1
  43. package/packages/commands/package.json +1 -1
  44. package/packages/core/package.json +1 -1
  45. package/packages/editor/package.json +1 -1
  46. package/packages/fs/package.json +1 -1
  47. package/packages/preview/package.json +1 -1
  48. package/packages/runtime/package.json +1 -1
  49. package/packages/settings/package.json +1 -1
  50. package/packages/sql/package.json +1 -1
  51. package/packages/sql/src/styles.ts +87 -64
  52. package/packages/terminal/package.json +1 -1
  53. package/packages/ui/package.json +1 -1
  54. package/packages/ui/src/observability.ts +12 -14
  55. package/packages/ui/src/settings-dialog.ts +383 -47
  56. package/packages/ui/src/themes.ts +89 -23
  57. package/src/code-lab.css +1883 -578
  58. package/src/extensions/cpp.ts +304 -38
  59. package/src/extensions/python.ts +342 -43
  60. package/src/index.ts +1 -1
  61. package/src/runtime.ts +272 -43
  62. package/src/schemas.ts +2 -2
  63. package/src/scm.ts +1467 -92
  64. package/src/shell.ts +1075 -93
  65. package/src/storage.ts +66 -3
  66. package/src/terminal.ts +148 -12
  67. package/src/workbench/command-palette.ts +289 -48
  68. package/src/workbench/diff-editor.ts +244 -78
  69. package/src/workbench/drawer.ts +5 -5
  70. package/src/workbench/icons.ts +250 -53
  71. package/src/workbench/index.ts +7 -1
  72. package/src/workbench/intellisense.ts +1871 -0
  73. package/src/workbench/styles.ts +58 -54
  74. package/src/workbench/toolbar.ts +1 -1
  75. package/src/workbench/xterm-adapter.ts +1571 -0
  76. package/src/workbench.ts +1699 -324
@@ -41,11 +41,352 @@ const ALL_CATEGORIES: ReadonlyArray<'All' | SettingCategory> = [
41
41
  'SQL'
42
42
  ];
43
43
 
44
- const BTN_STYLE =
45
- 'padding:5px 10px;border-radius:5px;border:1px solid var(--cl-border,#262626);background:var(--cl-surface,#0a0a0a);color:var(--cl-fg,#f5f5f5);cursor:pointer;font-size:12px;';
44
+ const SETTINGS_STYLE_ID = 'codelab-ui-settings-styles';
45
+
46
+ export const SETTINGS_COMPONENT_CSS = `/* @innovatorved/code-lab/ui — Tokenized Settings & Control Components */
47
+ .cl-settings-dialog,
48
+ .cl-settings-editor {
49
+ --cl-ui-sans: var(--cl-font-sans, var(--ds-font-sans, var(--font-sans, "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif)));
50
+ --cl-ui-mono: var(--cl-font-mono, var(--ds-font-mono, var(--font-mono, "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace)));
51
+ --cl-ui-text-2xs: var(--cl-text-2xs, var(--ds-text-2xs, 0.6875rem));
52
+ --cl-ui-text-xs: var(--cl-text-xs, var(--ds-text-xs, 0.75rem));
53
+ --cl-ui-text-sm: var(--cl-text-sm, var(--ds-text-sm, 0.8125rem));
54
+ --cl-ui-text-base: var(--cl-text-base, var(--ds-text-base, 0.875rem));
55
+ font-family: var(--cl-ui-sans);
56
+ color: var(--cl-fg, #f4f4f5);
57
+ }
58
+
59
+ .cl-settings-editor.cl-settings-inline {
60
+ display: flex;
61
+ flex-direction: column;
62
+ height: 100%;
63
+ min-height: 0;
64
+ background: var(--cl-editor-bg, var(--cl-bg, #0f0f10));
65
+ }
66
+
67
+ .cl-settings-header {
68
+ display: flex;
69
+ align-items: center;
70
+ justify-content: space-between;
71
+ gap: 12px;
72
+ padding: 12px 20px;
73
+ border-bottom: 1px solid var(--cl-border, #27272a);
74
+ background: var(--cl-surface, var(--cl-bg-elevated, #141415));
75
+ flex-wrap: wrap;
76
+ }
77
+
78
+ .cl-settings-title {
79
+ margin: 0;
80
+ font-size: var(--cl-ui-text-base);
81
+ font-weight: 600;
82
+ letter-spacing: -0.015em;
83
+ color: var(--cl-fg-active, var(--cl-fg, #f4f4f5));
84
+ }
85
+
86
+ .cl-settings-actions {
87
+ display: flex;
88
+ align-items: center;
89
+ gap: 6px;
90
+ flex-wrap: wrap;
91
+ }
92
+
93
+ .cl-settings-toolbar {
94
+ padding: 12px 20px 0 20px;
95
+ border-bottom: 1px solid var(--cl-border, #27272a);
96
+ background: var(--cl-surface, var(--cl-bg-elevated, #141415));
97
+ display: flex;
98
+ flex-direction: column;
99
+ gap: 10px;
100
+ }
101
+
102
+ .cl-settings-search {
103
+ width: 100%;
104
+ height: 32px;
105
+ padding: 0 10px;
106
+ border-radius: var(--cl-radius-md, 6px);
107
+ border: 1px solid var(--cl-input-border, var(--cl-border, #27272a));
108
+ background: var(--cl-input-bg, var(--cl-bg, #0f0f10));
109
+ color: var(--cl-fg, #f4f4f5);
110
+ font-family: var(--cl-ui-sans);
111
+ font-size: var(--cl-ui-text-sm);
112
+ outline: none;
113
+ transition: border-color 120ms ease;
114
+ }
115
+
116
+ .cl-settings-search::placeholder {
117
+ color: var(--cl-fg-faint, var(--cl-fg-muted, #8e8e97));
118
+ }
119
+
120
+ .cl-settings-search:focus {
121
+ border-color: var(--cl-focus-border, #a1a1aa);
122
+ }
123
+
124
+ .cl-settings-scopes {
125
+ display: flex;
126
+ align-items: center;
127
+ gap: 4px;
128
+ overflow-x: auto;
129
+ }
130
+
131
+ .cl-settings-scope-tab {
132
+ flex: none;
133
+ padding: 6px 12px;
134
+ border: none;
135
+ border-bottom: 2px solid transparent;
136
+ background: transparent;
137
+ color: var(--cl-fg-muted, #a1a1aa);
138
+ font-family: var(--cl-ui-sans);
139
+ font-size: var(--cl-ui-text-xs);
140
+ font-weight: 500;
141
+ cursor: pointer;
142
+ transition: color 120ms ease, border-color 120ms ease;
143
+ }
144
+
145
+ .cl-settings-scope-tab:hover {
146
+ color: var(--cl-fg, #f4f4f5);
147
+ }
148
+
149
+ .cl-settings-scope-tab[aria-selected="true"] {
150
+ color: var(--cl-fg-active, var(--cl-fg, #f4f4f5));
151
+ font-weight: 600;
152
+ border-bottom-color: var(--cl-accent, #f4f4f5);
153
+ }
154
+
155
+ .cl-settings-body {
156
+ display: grid;
157
+ grid-template-columns: 180px minmax(0, 1fr);
158
+ }
159
+
160
+ .cl-settings-body--dialog {
161
+ min-height: 320px;
162
+ max-height: 62vh;
163
+ }
164
+
165
+ .cl-settings-body--inline {
166
+ flex: 1;
167
+ min-height: 0;
168
+ overflow: hidden;
169
+ }
170
+
171
+ .cl-settings-categories {
172
+ border-right: 1px solid var(--cl-border, #27272a);
173
+ background: var(--cl-surface, var(--cl-bg-elevated, #141415));
174
+ padding: 10px 8px;
175
+ display: flex;
176
+ flex-direction: column;
177
+ gap: 2px;
178
+ overflow-y: auto;
179
+ }
180
+
181
+ .cl-settings-cat-btn {
182
+ text-align: left;
183
+ padding: 6px 10px;
184
+ border: 1px solid transparent;
185
+ border-radius: var(--cl-radius-md, 6px);
186
+ background: transparent;
187
+ color: var(--cl-fg-muted, #a1a1aa);
188
+ font-family: var(--cl-ui-sans);
189
+ font-size: var(--cl-ui-text-sm);
190
+ font-weight: 500;
191
+ line-height: 1.35;
192
+ cursor: pointer;
193
+ transition: background 120ms ease, color 120ms ease;
194
+ }
195
+
196
+ .cl-settings-cat-btn:hover {
197
+ background: var(--cl-list-hover, var(--cl-bg-hover, #1f1f22));
198
+ color: var(--cl-fg, #f4f4f5);
199
+ }
200
+
201
+ .cl-settings-cat-btn[aria-current="true"] {
202
+ background: var(--cl-list-active, var(--cl-bg-active, #28282b));
203
+ color: var(--cl-list-active-fg, var(--cl-fg, #f4f4f5));
204
+ font-weight: 600;
205
+ }
206
+
207
+ .cl-settings-list {
208
+ padding: 14px 24px 28px 20px;
209
+ overflow-y: auto;
210
+ display: flex;
211
+ flex-direction: column;
212
+ gap: 8px;
213
+ }
214
+
215
+ .cl-settings-empty {
216
+ padding: 16px 4px;
217
+ color: var(--cl-fg-muted, #a1a1aa);
218
+ font-size: var(--cl-ui-text-sm);
219
+ }
220
+
221
+ .cl-setting-item {
222
+ padding: 14px 16px;
223
+ border: 1px solid var(--cl-border, #27272a);
224
+ border-radius: var(--cl-radius-lg, 8px);
225
+ background: var(--cl-widget-bg, var(--cl-bg-panel, #18181a));
226
+ display: flex;
227
+ flex-direction: column;
228
+ gap: 6px;
229
+ transition: border-color 120ms ease;
230
+ }
46
231
 
47
- const CONTROL_STYLE =
48
- 'padding:5px 8px;border-radius:5px;border:1px solid var(--cl-border,#262626);background:var(--cl-surface,#0a0a0a);color:var(--cl-fg,#f5f5f5);font-size:12.5px;';
232
+ .cl-setting-item--modified {
233
+ border-color: var(--cl-border-strong, #3a3a3e);
234
+ }
235
+
236
+ .cl-setting-item__top {
237
+ display: flex;
238
+ align-items: center;
239
+ justify-content: space-between;
240
+ gap: 12px;
241
+ flex-wrap: wrap;
242
+ }
243
+
244
+ .cl-setting-item__heading {
245
+ display: flex;
246
+ align-items: center;
247
+ gap: 6px;
248
+ flex-wrap: wrap;
249
+ min-width: 0;
250
+ }
251
+
252
+ .cl-setting-item__cat {
253
+ font-size: var(--cl-ui-text-xs);
254
+ color: var(--cl-fg-muted, #a1a1aa);
255
+ font-weight: 500;
256
+ }
257
+
258
+ .cl-setting-item__title {
259
+ font-size: var(--cl-ui-text-sm);
260
+ font-weight: 600;
261
+ color: var(--cl-fg-active, var(--cl-fg, #f4f4f5));
262
+ }
263
+
264
+ .cl-setting-item__key {
265
+ font-family: var(--cl-ui-mono);
266
+ font-size: var(--cl-ui-text-2xs);
267
+ padding: 1px 5px;
268
+ border-radius: var(--cl-radius-sm, 4px);
269
+ border: 1px solid var(--cl-border, #27272a);
270
+ background: var(--cl-input-bg, var(--cl-bg, #0f0f10));
271
+ color: var(--cl-fg-muted, #a1a1aa);
272
+ }
273
+
274
+ .cl-setting-badge {
275
+ font-family: var(--cl-ui-mono);
276
+ font-size: var(--cl-ui-text-2xs);
277
+ font-weight: 600;
278
+ padding: 1px 6px;
279
+ border-radius: 999px;
280
+ background: var(--cl-btn-primary-bg, var(--cl-accent, #f4f4f5));
281
+ color: var(--cl-btn-primary-fg, var(--cl-accent-fg, #0f0f10));
282
+ }
283
+
284
+ .cl-setting-item__desc {
285
+ font-size: var(--cl-ui-text-xs);
286
+ line-height: 1.5;
287
+ color: var(--cl-fg-muted, #a1a1aa);
288
+ }
289
+
290
+ .cl-setting-item__control {
291
+ display: flex;
292
+ align-items: center;
293
+ gap: 8px;
294
+ margin-top: 2px;
295
+ }
296
+
297
+ .cl-ui-btn {
298
+ display: inline-flex;
299
+ align-items: center;
300
+ justify-content: center;
301
+ gap: 6px;
302
+ height: 28px;
303
+ padding: 0 10px;
304
+ border-radius: var(--cl-radius-md, 6px);
305
+ border: 1px solid var(--cl-input-border, var(--cl-border, #27272a));
306
+ background: var(--cl-input-bg, var(--cl-bg, #0f0f10));
307
+ color: var(--cl-fg, #f4f4f5);
308
+ font-family: var(--cl-ui-sans);
309
+ font-size: var(--cl-ui-text-xs);
310
+ font-weight: 500;
311
+ line-height: 1;
312
+ cursor: pointer;
313
+ transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
314
+ }
315
+
316
+ .cl-ui-btn:hover {
317
+ background: var(--cl-list-hover, var(--cl-bg-hover, #1f1f22));
318
+ border-color: var(--cl-border-strong, #3a3a3e);
319
+ }
320
+
321
+ .cl-ui-control {
322
+ height: 30px;
323
+ padding: 0 9px;
324
+ border-radius: var(--cl-radius-md, 6px);
325
+ border: 1px solid var(--cl-input-border, var(--cl-border, #27272a));
326
+ background: var(--cl-input-bg, var(--cl-bg, #0f0f10));
327
+ color: var(--cl-fg, #f4f4f5);
328
+ font-family: var(--cl-ui-sans);
329
+ font-size: var(--cl-ui-text-sm);
330
+ outline: none;
331
+ transition: border-color 120ms ease;
332
+ }
333
+
334
+ .cl-ui-control:focus {
335
+ border-color: var(--cl-focus-border, #a1a1aa);
336
+ }
337
+
338
+ .cl-ui-control--num {
339
+ width: 104px;
340
+ font-family: var(--cl-ui-mono);
341
+ font-variant-numeric: tabular-nums;
342
+ }
343
+
344
+ .cl-ui-control--array {
345
+ width: min(280px, 100%);
346
+ font-family: var(--cl-ui-mono);
347
+ font-size: var(--cl-ui-text-xs);
348
+ }
349
+
350
+ .cl-ui-control--text {
351
+ width: min(200px, 100%);
352
+ }
353
+
354
+ .cl-ui-checkbox {
355
+ width: 16px;
356
+ height: 16px;
357
+ accent-color: var(--cl-accent, #f4f4f5);
358
+ cursor: pointer;
359
+ }
360
+
361
+ @media (max-width: 640px) {
362
+ .cl-settings-body {
363
+ grid-template-columns: minmax(0, 1fr);
364
+ }
365
+ .cl-settings-categories {
366
+ flex-direction: row;
367
+ border-right: none;
368
+ border-bottom: 1px solid var(--cl-border, #27272a);
369
+ overflow-x: auto;
370
+ }
371
+ }
372
+ `;
373
+
374
+ export function ensureSettingsStylesInjected(doc?: Document): void {
375
+ const targetDoc = doc ?? (typeof document !== 'undefined' ? document : undefined);
376
+ if (!targetDoc || !targetDoc.head) return;
377
+ const existing =
378
+ typeof targetDoc.getElementById === 'function'
379
+ ? targetDoc.getElementById(SETTINGS_STYLE_ID)
380
+ : typeof targetDoc.head.querySelector === 'function'
381
+ ? targetDoc.head.querySelector(`#${SETTINGS_STYLE_ID}`)
382
+ : null;
383
+ if (existing) return;
384
+ if (typeof targetDoc.createElement !== 'function') return;
385
+ const styleEl = targetDoc.createElement('style');
386
+ styleEl.id = SETTINGS_STYLE_ID;
387
+ styleEl.textContent = SETTINGS_COMPONENT_CSS;
388
+ targetDoc.head.appendChild(styleEl);
389
+ }
49
390
 
50
391
  function isDomHostElement(candidate: unknown): candidate is HTMLElement {
51
392
  return Boolean(
@@ -91,32 +432,29 @@ export class SettingsDialogController implements IDisposable {
91
432
 
92
433
  private buildSurfaceInnerHtml(mode: 'dialog' | 'inline'): string {
93
434
  const titleId = mode === 'dialog' ? 'cl-settings-dialog-title' : 'cl-settings-inline-title';
94
- const bodyHeightStyle =
95
- mode === 'dialog'
96
- ? 'min-height:320px;max-height:62vh;'
97
- : 'flex:1;min-height:0;overflow:hidden;';
435
+ const bodyModeClass = mode === 'dialog' ? 'cl-settings-body--dialog' : 'cl-settings-body--inline';
98
436
  const closeBtnHtml =
99
437
  mode === 'dialog'
100
- ? `<button type="button" class="codelab-btn" data-settings-action="close" aria-label="Close Settings" style="${BTN_STYLE}">✕</button>`
438
+ ? `<button type="button" class="codelab-btn cl-ui-btn" data-settings-action="close" aria-label="Close Settings">✕</button>`
101
439
  : '';
102
440
 
103
441
  return (
104
- `<div class="cl-settings-header" style="display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid var(--cl-border,#262626);flex-wrap:wrap;">` +
105
- `<h2 id="${titleId}" style="margin:0;font-size:15px;font-weight:600;color:var(--cl-fg,#f5f5f5);">Settings</h2>` +
106
- `<div style="display:flex;align-items:center;gap:8px;flex-wrap:wrap;">` +
107
- `<button type="button" class="codelab-btn" data-settings-action="open-json" aria-label="Open Settings (JSON)" title="Open .codelab/settings.json" style="${BTN_STYLE}">Open Settings (JSON)</button>` +
108
- `<button type="button" class="codelab-btn" data-settings-action="reset-all" aria-label="Reset All Settings" title="Reset all settings to defaults" style="${BTN_STYLE}">Reset All Settings</button>` +
109
- `<button type="button" class="codelab-btn" data-settings-action="export" title="Export Settings JSON" style="${BTN_STYLE}">Export</button>` +
442
+ `<div class="cl-settings-header">` +
443
+ `<h2 id="${titleId}" class="cl-settings-title">Settings</h2>` +
444
+ `<div class="cl-settings-actions">` +
445
+ `<button type="button" class="codelab-btn cl-ui-btn" data-settings-action="open-json" aria-label="Open Settings (JSON)" title="Open .codelab/settings.json">Open Settings (JSON)</button>` +
446
+ `<button type="button" class="codelab-btn cl-ui-btn" data-settings-action="reset-all" aria-label="Reset All Settings" title="Reset all settings to defaults">Reset All Settings</button>` +
447
+ `<button type="button" class="codelab-btn cl-ui-btn" data-settings-action="export" title="Export Settings JSON">Export</button>` +
110
448
  closeBtnHtml +
111
449
  `</div>` +
112
450
  `</div>` +
113
- `<div style="padding:10px 16px 0 16px;border-bottom:1px solid var(--cl-border,#262626);display:flex;flex-direction:column;gap:8px;">` +
114
- `<input type="search" data-role="settings-search" aria-label="Search settings" value="${escapeAttr(this.searchQuery)}" placeholder="Search settings (e.g. fontSize, theme, wordWrap, autoSave)..." style="width:100%;padding:7px 10px;border-radius:6px;border:1px solid var(--cl-border,#262626);background:var(--cl-surface,#0a0a0a);color:var(--cl-fg,#f5f5f5);font-size:13px;" />` +
115
- `<div role="tablist" aria-label="Settings scope" data-role="settings-scopes" style="display:flex;align-items:center;gap:4px;overflow-x:auto;"></div>` +
451
+ `<div class="cl-settings-toolbar">` +
452
+ `<input type="search" class="cl-settings-search" data-role="settings-search" aria-label="Search settings" value="${escapeAttr(this.searchQuery)}" placeholder="Search settings…" />` +
453
+ `<div role="tablist" aria-label="Settings scope" class="cl-settings-scopes" data-role="settings-scopes"></div>` +
116
454
  `</div>` +
117
- `<div class="cl-settings-body" style="display:grid;grid-template-columns:150px minmax(0,1fr);${bodyHeightStyle}">` +
118
- `<nav data-role="settings-categories" aria-label="Setting categories" style="border-right:1px solid var(--cl-border,#262626);padding:8px;display:flex;flex-direction:column;gap:4px;overflow-y:auto;"></nav>` +
119
- `<div data-role="settings-list" style="padding:12px 16px;overflow-y:auto;display:flex;flex-direction:column;gap:12px;"></div>` +
455
+ `<div class="cl-settings-body ${bodyModeClass}">` +
456
+ `<nav class="cl-settings-categories" data-role="settings-categories" aria-label="Setting categories"></nav>` +
457
+ `<div class="cl-settings-list" data-role="settings-list"></div>` +
120
458
  `</div>`
121
459
  );
122
460
  }
@@ -318,6 +656,7 @@ export class SettingsDialogController implements IDisposable {
318
656
  this.dialogDisposables.clear();
319
657
  this.dialogEl?.remove();
320
658
  const doc = hostRoot.ownerDocument ?? document;
659
+ ensureSettingsStylesInjected(doc);
321
660
  const dialog = doc.createElement('dialog');
322
661
  dialog.className = 'codelab-dialog cl-settings-dialog';
323
662
  dialog.setAttribute('closedby', 'any');
@@ -327,7 +666,6 @@ export class SettingsDialogController implements IDisposable {
327
666
  hostRoot.appendChild(dialog);
328
667
  this.dialogEl = dialog;
329
668
 
330
- // Reset returnValue on close + Safari fallback for `closedby="any"` light dismiss
331
669
  const onClose = (): void => {
332
670
  dialog.returnValue = '';
333
671
  };
@@ -404,13 +742,10 @@ export class SettingsDialogController implements IDisposable {
404
742
  this.inlineCallbacks = options;
405
743
 
406
744
  const doc = container.ownerDocument ?? document;
745
+ ensureSettingsStylesInjected(doc);
407
746
  const root = doc.createElement('div');
408
747
  root.className = 'cl-settings-editor cl-settings-inline';
409
748
  root.setAttribute('data-role', 'settings-inline-root');
410
- root.setAttribute(
411
- 'style',
412
- 'display:flex;flex-direction:column;height:100%;min-height:0;background:var(--cl-bg,#000000);color:var(--cl-fg,#f5f5f5);'
413
- );
414
749
  root.innerHTML = this.buildSurfaceInnerHtml('inline');
415
750
 
416
751
  container.appendChild(root);
@@ -457,8 +792,7 @@ export class SettingsDialogController implements IDisposable {
457
792
  .map((tab) => {
458
793
  const selected = this.activeScope === tab.id;
459
794
  return (
460
- `<button type="button" role="tab" data-settings-scope="${tab.id}" aria-selected="${selected ? 'true' : 'false'}" ` +
461
- `style="flex:none;padding:6px 12px;border-top:1px solid transparent;border-left:1px solid transparent;border-right:1px solid transparent;border-bottom:2px solid ${selected ? 'var(--cl-accent,#0369a1)' : 'transparent'};background:${selected ? 'var(--cl-surface,#0a0a0a)' : 'transparent'};color:${selected ? 'var(--cl-fg,#f5f5f5)' : 'var(--cl-fg-muted,var(--cl-muted,#64748b))'};cursor:pointer;font-size:12.5px;font-weight:500;">` +
795
+ `<button type="button" role="tab" class="cl-settings-scope-tab" data-settings-scope="${tab.id}" aria-selected="${selected ? 'true' : 'false'}">` +
462
796
  `${escapeAttr(tab.label)}` +
463
797
  `</button>`
464
798
  );
@@ -472,8 +806,7 @@ export class SettingsDialogController implements IDisposable {
472
806
  nav.innerHTML = ALL_CATEGORIES.map((cat) => {
473
807
  const selected = cat === this.activeCategory;
474
808
  return (
475
- `<button type="button" data-settings-cat="${cat}" aria-current="${selected ? 'true' : 'false'}" ` +
476
- `style="text-align:left;padding:6px 10px;border-radius:5px;border:1px solid ${selected ? 'var(--cl-accent,#0369a1)' : 'transparent'};background:${selected ? 'var(--cl-accent,#0369a1)' : 'transparent'};color:${selected ? 'var(--cl-accent-fg,#ffffff)' : 'var(--cl-fg,#f5f5f5)'};cursor:pointer;font-size:12.5px;font-weight:500;">` +
809
+ `<button type="button" class="cl-settings-cat-btn" data-settings-cat="${cat}" aria-current="${selected ? 'true' : 'false'}">` +
477
810
  `${escapeAttr(cat)}` +
478
811
  `</button>`
479
812
  );
@@ -490,22 +823,22 @@ export class SettingsDialogController implements IDisposable {
490
823
  return `<option value="${escapeAttr(str)}"${sel}>${escapeAttr(str)}</option>`;
491
824
  })
492
825
  .join('');
493
- return `<select data-setting-key="${keyAttr}" aria-label="${escapeAttr(desc.title)}" style="${CONTROL_STYLE}">${opts}</select>`;
826
+ return `<select class="cl-ui-control" data-setting-key="${keyAttr}" aria-label="${escapeAttr(desc.title)}">${opts}</select>`;
494
827
  }
495
828
  if (desc.schema.type === 'boolean') {
496
829
  const checked = Boolean(currentVal) ? ' checked' : '';
497
- return `<input type="checkbox" data-setting-key="${keyAttr}" aria-label="${escapeAttr(desc.title)}"${checked} />`;
830
+ return `<input type="checkbox" class="cl-ui-checkbox" data-setting-key="${keyAttr}" aria-label="${escapeAttr(desc.title)}"${checked} />`;
498
831
  }
499
832
  if (desc.schema.type === 'integer' || desc.schema.type === 'number') {
500
833
  const min = desc.schema.minimum !== undefined ? ` min="${desc.schema.minimum}"` : '';
501
834
  const max = desc.schema.maximum !== undefined ? ` max="${desc.schema.maximum}"` : '';
502
- return `<input type="number" data-setting-key="${keyAttr}" aria-label="${escapeAttr(desc.title)}" value="${escapeAttr(String(currentVal ?? ''))}"${min}${max} style="width:100px;${CONTROL_STYLE}" />`;
835
+ return `<input type="number" class="cl-ui-control cl-ui-control--num" data-setting-key="${keyAttr}" aria-label="${escapeAttr(desc.title)}" value="${escapeAttr(String(currentVal ?? ''))}"${min}${max} />`;
503
836
  }
504
837
  if (desc.schema.type === 'array') {
505
838
  const joined = Array.isArray(currentVal) ? currentVal.join(', ') : '';
506
- return `<input type="text" data-setting-key="${keyAttr}" aria-label="${escapeAttr(desc.title)}" value="${escapeAttr(joined)}" style="width:260px;${CONTROL_STYLE}" />`;
839
+ return `<input type="text" class="cl-ui-control cl-ui-control--array" data-setting-key="${keyAttr}" aria-label="${escapeAttr(desc.title)}" value="${escapeAttr(joined)}" />`;
507
840
  }
508
- return `<input type="text" data-setting-key="${keyAttr}" aria-label="${escapeAttr(desc.title)}" value="${escapeAttr(String(currentVal ?? ''))}" style="width:180px;${CONTROL_STYLE}" />`;
841
+ return `<input type="text" class="cl-ui-control cl-ui-control--text" data-setting-key="${keyAttr}" aria-label="${escapeAttr(desc.title)}" value="${escapeAttr(String(currentVal ?? ''))}" />`;
509
842
  }
510
843
 
511
844
  private renderItems(root: HTMLElement): void {
@@ -519,7 +852,7 @@ export class SettingsDialogController implements IDisposable {
519
852
  });
520
853
 
521
854
  if (descriptors.length === 0) {
522
- listEl.innerHTML = `<div style="color:var(--cl-fg-muted,var(--cl-muted,#64748b));font-size:13px;">No matching settings found.</div>`;
855
+ listEl.innerHTML = `<div class="cl-settings-empty">No matching settings found.</div>`;
523
856
  return;
524
857
  }
525
858
 
@@ -539,24 +872,27 @@ export class SettingsDialogController implements IDisposable {
539
872
  ? (insp.workspaceValue !== undefined ? 'workspace' : '')
540
873
  : (insp.effectiveSource !== 'default' ? insp.effectiveSource : '');
541
874
 
875
+ const modClass = canReset ? ' cl-setting-item--modified' : '';
876
+
542
877
  return (
543
- `<div class="cl-setting-item" data-setting-row="${escapeAttr(desc.key)}" style="padding:10px 12px;border:1px solid var(--cl-border,#262626);border-radius:7px;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;">` +
544
- `<div style="min-width:0;">` +
545
- `<div style="display:flex;align-items:center;gap:6px;flex-wrap:wrap;">` +
546
- `<strong style="font-size:13px;color:var(--cl-fg,#f5f5f5);">${escapeAttr(desc.title)}</strong>` +
547
- `<code style="font-size:11px;color:var(--cl-fg-muted,var(--cl-muted,#64748b));">${escapeAttr(desc.key)}</code>` +
878
+ `<div class="cl-setting-item${modClass}" data-setting-row="${escapeAttr(desc.key)}">` +
879
+ `<div class="cl-setting-item__top">` +
880
+ `<div class="cl-setting-item__heading">` +
881
+ `<span class="cl-setting-item__cat">${escapeAttr(desc.category)}:</span>` +
882
+ `<strong class="cl-setting-item__title">${escapeAttr(desc.title)}</strong>` +
883
+ `<code class="cl-setting-item__key">${escapeAttr(desc.key)}</code>` +
548
884
  (badgeLabel
549
- ? `<span data-role="setting-badge" style="font-size:10px;padding:1px 6px;border-radius:4px;background:var(--cl-accent,#0369a1);color:var(--cl-accent-fg,#ffffff);font-weight:600;">${escapeAttr(badgeLabel)}</span>`
885
+ ? `<span class="cl-setting-badge" data-role="setting-badge">${escapeAttr(badgeLabel)}</span>`
550
886
  : '') +
551
887
  `</div>` +
552
- `<div style="font-size:12px;color:var(--cl-fg-muted,var(--cl-muted,#64748b));margin-top:3px;">${escapeAttr(desc.description)}</div>` +
553
- `</div>` +
554
- `<div style="display:flex;align-items:center;gap:6px;flex-shrink:0;">` +
555
- this.renderControl(desc, displayedVal) +
556
888
  (canReset
557
- ? `<button type="button" class="codelab-btn" data-reset-key="${escapeAttr(desc.key)}" title="Reset to Default (${escapeAttr(JSON.stringify(desc.defaultValue))})" style="${BTN_STYLE}">Reset</button>`
889
+ ? `<button type="button" class="codelab-btn cl-ui-btn" data-reset-key="${escapeAttr(desc.key)}" title="Reset to Default (${escapeAttr(JSON.stringify(desc.defaultValue))})">Reset</button>`
558
890
  : '') +
559
891
  `</div>` +
892
+ `<div class="cl-setting-item__desc">${escapeAttr(desc.description)}</div>` +
893
+ `<div class="cl-setting-item__control">` +
894
+ this.renderControl(desc, displayedVal) +
895
+ `</div>` +
560
896
  `</div>`
561
897
  );
562
898
  })
@@ -20,52 +20,118 @@ export interface ThemeDefinition {
20
20
 
21
21
  export const DARK_THEME: ThemeDefinition = {
22
22
  id: 'dark',
23
- label: 'CodeLab Dark',
23
+ label: 'Charcoal Ink',
24
24
  kind: 'dark',
25
25
  monacoBase: 'vs-dark',
26
26
  colors: {
27
- '--cl-bg': '#000000',
28
- '--cl-surface': '#0a0a0a',
29
- '--cl-fg': '#f5f5f5',
30
- '--cl-muted': '#8e8e93',
31
- '--cl-fg-muted': '#8e8e93',
32
- '--cl-border': '#262626',
33
- '--cl-accent': '#0ea5e9',
34
- '--cl-accent-fg': '#000000'
27
+ '--cl-bg': '#0f0f10',
28
+ '--cl-editor-bg': '#0f0f10',
29
+ '--cl-surface': '#141415',
30
+ '--cl-chrome-bg': '#141415',
31
+ '--cl-widget-bg': '#18181a',
32
+ '--cl-input-bg': '#141415',
33
+ '--cl-input-border': '#27272a',
34
+ '--cl-fg': '#f4f4f5',
35
+ '--cl-fg-active': '#ffffff',
36
+ '--cl-muted': '#a1a1aa',
37
+ '--cl-fg-muted': '#a1a1aa',
38
+ '--cl-border': '#27272a',
39
+ '--cl-accent': '#f4f4f5',
40
+ '--cl-accent-fg': '#0f0f10',
41
+ '--cl-btn-primary-bg': '#f4f4f5',
42
+ '--cl-btn-primary-hover': '#ffffff',
43
+ '--cl-btn-primary-fg': '#0f0f10',
44
+ '--cl-focus-border': '#a1a1aa',
45
+ '--cl-list-hover': '#1f1f22',
46
+ '--cl-list-active': '#28282b',
47
+ '--cl-list-active-fg': '#f4f4f5',
48
+ '--cl-badge-bg': '#28282b',
49
+ '--cl-badge-fg': '#f4f4f5',
50
+ '--cl-git-modified': '#fbbf24',
51
+ '--cl-git-added': '#34d399',
52
+ '--cl-git-untracked': '#34d399',
53
+ '--cl-git-deleted': '#f87171',
54
+ '--cl-error': '#f87171',
55
+ '--cl-warning': '#fbbf24',
56
+ '--cl-info': '#e4e4e7'
35
57
  }
36
58
  };
37
59
 
38
60
  export const LIGHT_THEME: ThemeDefinition = {
39
61
  id: 'light',
40
- label: 'CodeLab Light',
62
+ label: 'Warm Paper',
41
63
  kind: 'light',
42
64
  monacoBase: 'vs',
43
65
  colors: {
44
66
  '--cl-bg': '#ffffff',
45
- '--cl-surface': '#f8fafc',
46
- '--cl-fg': '#0f172a',
47
- '--cl-muted': '#475569',
48
- '--cl-fg-muted': '#475569',
49
- '--cl-border': '#cbd5e1',
50
- '--cl-accent': '#0369a1',
51
- '--cl-accent-fg': '#ffffff'
67
+ '--cl-editor-bg': '#ffffff',
68
+ '--cl-surface': '#f7f7f5',
69
+ '--cl-chrome-bg': '#f7f7f5',
70
+ '--cl-widget-bg': '#f1f1ee',
71
+ '--cl-input-bg': '#ffffff',
72
+ '--cl-input-border': '#d3d0c9',
73
+ '--cl-fg': '#18181b',
74
+ '--cl-fg-active': '#09090b',
75
+ '--cl-muted': '#52525b',
76
+ '--cl-fg-muted': '#52525b',
77
+ '--cl-border': '#e6e4df',
78
+ '--cl-accent': '#18181b',
79
+ '--cl-accent-fg': '#ffffff',
80
+ '--cl-btn-primary-bg': '#18181b',
81
+ '--cl-btn-primary-hover': '#27272a',
82
+ '--cl-btn-primary-fg': '#ffffff',
83
+ '--cl-focus-border': '#3f3f46',
84
+ '--cl-list-hover': '#f1f1ee',
85
+ '--cl-list-active': '#ecebe7',
86
+ '--cl-list-active-fg': '#18181b',
87
+ '--cl-badge-bg': '#ecebe7',
88
+ '--cl-badge-fg': '#18181b',
89
+ '--cl-git-modified': '#b54708',
90
+ '--cl-git-added': '#067647',
91
+ '--cl-git-untracked': '#067647',
92
+ '--cl-git-deleted': '#b42318',
93
+ '--cl-error': '#b42318',
94
+ '--cl-warning': '#b54708',
95
+ '--cl-info': '#18181b'
52
96
  }
53
97
  };
54
98
 
55
99
  export const HIGH_CONTRAST_THEME: ThemeDefinition = {
56
100
  id: 'high-contrast',
57
- label: 'CodeLab High Contrast',
101
+ label: 'High Contrast Ink',
58
102
  kind: 'high-contrast',
59
103
  monacoBase: 'hc-black',
60
104
  colors: {
61
105
  '--cl-bg': '#000000',
106
+ '--cl-editor-bg': '#000000',
62
107
  '--cl-surface': '#000000',
108
+ '--cl-chrome-bg': '#000000',
109
+ '--cl-widget-bg': '#0f0f10',
110
+ '--cl-input-bg': '#000000',
111
+ '--cl-input-border': '#ffffff',
63
112
  '--cl-fg': '#ffffff',
64
- '--cl-muted': '#e5e5e5',
65
- '--cl-fg-muted': '#e5e5e5',
66
- '--cl-border': '#facc15',
67
- '--cl-accent': '#38bdf8',
68
- '--cl-accent-fg': '#000000'
113
+ '--cl-fg-active': '#ffffff',
114
+ '--cl-muted': '#e4e4e7',
115
+ '--cl-fg-muted': '#e4e4e7',
116
+ '--cl-border': '#ffffff',
117
+ '--cl-accent': '#ffffff',
118
+ '--cl-accent-fg': '#000000',
119
+ '--cl-btn-primary-bg': '#ffffff',
120
+ '--cl-btn-primary-hover': '#e4e4e7',
121
+ '--cl-btn-primary-fg': '#000000',
122
+ '--cl-focus-border': '#fbbf24',
123
+ '--cl-list-hover': '#18181a',
124
+ '--cl-list-active': '#27272a',
125
+ '--cl-list-active-fg': '#ffffff',
126
+ '--cl-badge-bg': '#ffffff',
127
+ '--cl-badge-fg': '#000000',
128
+ '--cl-git-modified': '#fbbf24',
129
+ '--cl-git-added': '#34d399',
130
+ '--cl-git-untracked': '#34d399',
131
+ '--cl-git-deleted': '#f87171',
132
+ '--cl-error': '#f87171',
133
+ '--cl-warning': '#fbbf24',
134
+ '--cl-info': '#ffffff'
69
135
  }
70
136
  };
71
137