@innovatorved/code-lab 0.6.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.
- package/ARCHITECTURE.md +1 -1
- package/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/code-lab-sql.css +87 -64
- package/dist/code-lab-sql.esm.js +109 -86
- package/dist/code-lab-sql.umd.js +110 -87
- package/dist/code-lab.css +1 -1
- package/dist/code-lab.d.ts +1 -1
- package/dist/code-lab.esm.js +601 -248
- package/dist/code-lab.js +600 -247
- package/dist/code-lab.umd.js +600 -247
- package/dist/index.d.ts +1 -1
- package/dist/packages/sql/src/styles.d.ts +1 -1
- package/dist/packages/ui/src/settings-dialog.d.ts +2 -0
- package/dist/preview-sw.js +1 -1
- package/dist/runtime.esm.js +1 -1
- package/dist/runtime.js +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/shell.esm.js +1 -1
- package/dist/shell.js +1 -1
- package/dist/terminal.esm.js +1 -1
- package/dist/terminal.js +1 -1
- package/dist/workbench/index.d.ts +1 -1
- package/dist/workbench/intellisense.d.ts +1 -1
- package/dist/workbench/styles.d.ts +1 -1
- package/package.json +1 -1
- package/packages/commands/package.json +1 -1
- package/packages/core/package.json +1 -1
- package/packages/editor/package.json +1 -1
- package/packages/fs/package.json +1 -1
- package/packages/preview/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/settings/package.json +1 -1
- package/packages/sql/package.json +1 -1
- package/packages/sql/src/styles.ts +87 -64
- package/packages/terminal/package.json +1 -1
- package/packages/ui/package.json +1 -1
- package/packages/ui/src/observability.ts +12 -14
- package/packages/ui/src/settings-dialog.ts +379 -55
- package/packages/ui/src/themes.ts +78 -78
- package/src/code-lab.css +750 -309
- package/src/index.ts +1 -1
- package/src/schemas.ts +1 -1
- package/src/workbench/diff-editor.ts +5 -1
- package/src/workbench/drawer.ts +5 -5
- package/src/workbench/icons.ts +5 -5
- package/src/workbench/intellisense.ts +94 -82
- package/src/workbench/styles.ts +58 -54
- package/src/workbench/toolbar.ts +1 -1
- package/src/workbench/xterm-adapter.ts +61 -56
- package/src/workbench.ts +98 -92
|
@@ -112,27 +112,27 @@ function sanitizeLogType(type?: string): string {
|
|
|
112
112
|
export function getXtermTheme(mode: string = 'dark'): ITheme {
|
|
113
113
|
if (mode === 'light') {
|
|
114
114
|
return {
|
|
115
|
-
background: '#
|
|
116
|
-
foreground: '#
|
|
117
|
-
cursor: '#
|
|
118
|
-
cursorAccent: '#
|
|
119
|
-
selectionBackground: 'rgba(
|
|
120
|
-
black: '#
|
|
121
|
-
red: '#
|
|
122
|
-
green: '#
|
|
123
|
-
yellow: '#
|
|
124
|
-
blue: '#
|
|
125
|
-
magenta: '#
|
|
126
|
-
cyan: '#
|
|
127
|
-
white: '#
|
|
128
|
-
brightBlack: '#
|
|
129
|
-
brightRed: '#
|
|
130
|
-
brightGreen: '#
|
|
131
|
-
brightYellow: '#
|
|
132
|
-
brightBlue: '#
|
|
133
|
-
brightMagenta: '#
|
|
134
|
-
brightCyan: '#
|
|
135
|
-
brightWhite: '#
|
|
115
|
+
background: '#ffffff',
|
|
116
|
+
foreground: '#18181b',
|
|
117
|
+
cursor: '#18181b',
|
|
118
|
+
cursorAccent: '#ffffff',
|
|
119
|
+
selectionBackground: 'rgba(24, 24, 27, 0.14)',
|
|
120
|
+
black: '#18181b',
|
|
121
|
+
red: '#b42318',
|
|
122
|
+
green: '#067647',
|
|
123
|
+
yellow: '#b54708',
|
|
124
|
+
blue: '#1d4ed8',
|
|
125
|
+
magenta: '#6d28d9',
|
|
126
|
+
cyan: '#0f766e',
|
|
127
|
+
white: '#52525b',
|
|
128
|
+
brightBlack: '#6e6a64',
|
|
129
|
+
brightRed: '#dc2626',
|
|
130
|
+
brightGreen: '#059669',
|
|
131
|
+
brightYellow: '#d97706',
|
|
132
|
+
brightBlue: '#2563eb',
|
|
133
|
+
brightMagenta: '#7c3aed',
|
|
134
|
+
brightCyan: '#0d9488',
|
|
135
|
+
brightWhite: '#09090b'
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
if (mode === 'hc' || mode === 'high-contrast') {
|
|
@@ -143,44 +143,44 @@ export function getXtermTheme(mode: string = 'dark'): ITheme {
|
|
|
143
143
|
cursorAccent: '#000000',
|
|
144
144
|
selectionBackground: 'rgba(255, 255, 255, 0.35)',
|
|
145
145
|
black: '#000000',
|
|
146
|
-
red: '#
|
|
147
|
-
green: '#
|
|
148
|
-
yellow: '#
|
|
149
|
-
blue: '#
|
|
150
|
-
magenta: '#
|
|
151
|
-
cyan: '#
|
|
146
|
+
red: '#f87171',
|
|
147
|
+
green: '#34d399',
|
|
148
|
+
yellow: '#fbbf24',
|
|
149
|
+
blue: '#93c5fd',
|
|
150
|
+
magenta: '#c084fc',
|
|
151
|
+
cyan: '#2dd4bf',
|
|
152
152
|
white: '#ffffff',
|
|
153
|
-
brightBlack: '#
|
|
154
|
-
brightRed: '#
|
|
155
|
-
brightGreen: '#
|
|
156
|
-
brightYellow: '#
|
|
157
|
-
brightBlue: '#
|
|
158
|
-
brightMagenta: '#
|
|
159
|
-
brightCyan: '#
|
|
153
|
+
brightBlack: '#a1a1aa',
|
|
154
|
+
brightRed: '#f87171',
|
|
155
|
+
brightGreen: '#34d399',
|
|
156
|
+
brightYellow: '#fbbf24',
|
|
157
|
+
brightBlue: '#93c5fd',
|
|
158
|
+
brightMagenta: '#c084fc',
|
|
159
|
+
brightCyan: '#2dd4bf',
|
|
160
160
|
brightWhite: '#ffffff'
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
return {
|
|
164
|
-
background: '#
|
|
165
|
-
foreground: '#
|
|
166
|
-
cursor: '#
|
|
167
|
-
cursorAccent: '#
|
|
168
|
-
selectionBackground: 'rgba(
|
|
169
|
-
black: '#
|
|
170
|
-
red: '#
|
|
171
|
-
green: '#
|
|
172
|
-
yellow: '#
|
|
173
|
-
blue: '#
|
|
174
|
-
magenta: '#
|
|
175
|
-
cyan: '#
|
|
176
|
-
white: '#
|
|
177
|
-
brightBlack: '#
|
|
178
|
-
brightRed: '#
|
|
179
|
-
brightGreen: '#
|
|
180
|
-
brightYellow: '#
|
|
181
|
-
brightBlue: '#
|
|
182
|
-
brightMagenta: '#
|
|
183
|
-
brightCyan: '#
|
|
164
|
+
background: '#0f0f10',
|
|
165
|
+
foreground: '#f4f4f5',
|
|
166
|
+
cursor: '#f4f4f5',
|
|
167
|
+
cursorAccent: '#0f0f10',
|
|
168
|
+
selectionBackground: 'rgba(244, 244, 245, 0.22)',
|
|
169
|
+
black: '#18181a',
|
|
170
|
+
red: '#f87171',
|
|
171
|
+
green: '#34d399',
|
|
172
|
+
yellow: '#fbbf24',
|
|
173
|
+
blue: '#93c5fd',
|
|
174
|
+
magenta: '#c084fc',
|
|
175
|
+
cyan: '#2dd4bf',
|
|
176
|
+
white: '#d4d4d8',
|
|
177
|
+
brightBlack: '#8e8e97',
|
|
178
|
+
brightRed: '#fca5a5',
|
|
179
|
+
brightGreen: '#6ee7b7',
|
|
180
|
+
brightYellow: '#fde047',
|
|
181
|
+
brightBlue: '#bfdbfe',
|
|
182
|
+
brightMagenta: '#d8b4fe',
|
|
183
|
+
brightCyan: '#5eead4',
|
|
184
184
|
brightWhite: '#ffffff'
|
|
185
185
|
};
|
|
186
186
|
}
|
|
@@ -310,7 +310,7 @@ export class XtermTerminalEngine {
|
|
|
310
310
|
: rawCwd.startsWith('/home/codelab/')
|
|
311
311
|
? '~' + rawCwd.slice('/home/codelab'.length)
|
|
312
312
|
: rawCwd;
|
|
313
|
-
return `\x1b[1;32mcodelab\x1b[0m:\x1b[
|
|
313
|
+
return `\x1b[1;32mcodelab\x1b[0m:\x1b[1m${displayCwd}\x1b[0m$ `;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
public setPrompt(p: string | null): void {
|
|
@@ -717,10 +717,15 @@ export class XtermTerminalEngine {
|
|
|
717
717
|
if (xtermMount && canUseXtermInEnvironment(xtermMount)) {
|
|
718
718
|
const { Terminal: XtermTerminal, FitAddon: XtermFitAddon, WebLinksAddon: XtermWebLinksAddon } =
|
|
719
719
|
getXtermRuntimeClasses();
|
|
720
|
+
const computedMono =
|
|
721
|
+
typeof window !== 'undefined' && typeof window.getComputedStyle === 'function'
|
|
722
|
+
? window.getComputedStyle(xtermMount).getPropertyValue('--cl-font-mono').trim()
|
|
723
|
+
: '';
|
|
720
724
|
const term = new XtermTerminal({
|
|
721
725
|
fontFamily:
|
|
722
726
|
this.options.fontFamily ||
|
|
723
|
-
|
|
727
|
+
computedMono ||
|
|
728
|
+
'"Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace',
|
|
724
729
|
fontSize: this.options.fontSize || 13,
|
|
725
730
|
lineHeight: 1.35,
|
|
726
731
|
cursorBlink: true,
|
package/src/workbench.ts
CHANGED
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
|
|
84
84
|
// The bundler rewrites this literal from package.json at build time. Keeping
|
|
85
85
|
// the fallback in sync lets tests require src/workbench.js directly.
|
|
86
|
-
const CODELAB_VERSION = '0.6.
|
|
86
|
+
const CODELAB_VERSION = '0.6.1';
|
|
87
87
|
|
|
88
88
|
// Ambient TypeScript declarations for Node.js built-ins inside Monaco
|
|
89
89
|
const NODE_AMBIENT_DTS = `
|
|
@@ -1019,36 +1019,37 @@ declare module 'bun:sqlite' {
|
|
|
1019
1019
|
reject(new Error('Monaco failed to initialize'));
|
|
1020
1020
|
return;
|
|
1021
1021
|
}
|
|
1022
|
-
// Define custom themes synced with Ved Gupta Monochrome
|
|
1022
|
+
// Define custom themes synced with Ved Gupta Monochrome Charcoal Ink & Warm Paper Design System (Geist)
|
|
1023
1023
|
m.editor.defineTheme('codelab-dark', {
|
|
1024
1024
|
base: 'vs-dark',
|
|
1025
1025
|
inherit: true,
|
|
1026
1026
|
rules: [
|
|
1027
|
-
{ token: 'comment', foreground: '
|
|
1028
|
-
{ token: 'keyword', foreground: '
|
|
1029
|
-
{ token: 'string', foreground: '
|
|
1030
|
-
{ token: 'number', foreground: '
|
|
1031
|
-
{ token: 'type', foreground: '
|
|
1027
|
+
{ token: 'comment', foreground: '8e8e97', fontStyle: 'italic' },
|
|
1028
|
+
{ token: 'keyword', foreground: 'f87171' },
|
|
1029
|
+
{ token: 'string', foreground: '86efac' },
|
|
1030
|
+
{ token: 'number', foreground: 'fcd34d' },
|
|
1031
|
+
{ token: 'type', foreground: 'fb923c' },
|
|
1032
|
+
{ token: 'function', foreground: 'c084fc' }
|
|
1032
1033
|
],
|
|
1033
1034
|
colors: {
|
|
1034
|
-
'editor.background': '#
|
|
1035
|
-
'editor.foreground': '#
|
|
1036
|
-
'editorGutter.background': '#
|
|
1037
|
-
'editorLineNumber.foreground': '#
|
|
1038
|
-
'editorLineNumber.activeForeground': '#
|
|
1039
|
-
'editor.lineHighlightBackground': '#
|
|
1040
|
-
'editor.lineHighlightBorder': '#
|
|
1041
|
-
'editor.selectionBackground': '#
|
|
1042
|
-
'editor.inactiveSelectionBackground': '#
|
|
1043
|
-
'editorCursor.foreground': '#
|
|
1044
|
-
'editorIndentGuide.background1': '#
|
|
1045
|
-
'editorIndentGuide.activeBackground1': '#
|
|
1046
|
-
'editorWidget.background': '#
|
|
1047
|
-
'editorWidget.border': '#
|
|
1048
|
-
'editorHoverWidget.background': '#
|
|
1049
|
-
'editorHoverWidget.border': '#
|
|
1050
|
-
'scrollbarSlider.background': '#
|
|
1051
|
-
'scrollbarSlider.hoverBackground': '#
|
|
1035
|
+
'editor.background': '#0f0f10',
|
|
1036
|
+
'editor.foreground': '#f4f4f5',
|
|
1037
|
+
'editorGutter.background': '#0f0f10',
|
|
1038
|
+
'editorLineNumber.foreground': '#6e6e77',
|
|
1039
|
+
'editorLineNumber.activeForeground': '#f4f4f5',
|
|
1040
|
+
'editor.lineHighlightBackground': '#18181a99',
|
|
1041
|
+
'editor.lineHighlightBorder': '#00000000',
|
|
1042
|
+
'editor.selectionBackground': '#28282b',
|
|
1043
|
+
'editor.inactiveSelectionBackground': '#1f1f22',
|
|
1044
|
+
'editorCursor.foreground': '#f4f4f5',
|
|
1045
|
+
'editorIndentGuide.background1': '#27272a80',
|
|
1046
|
+
'editorIndentGuide.activeBackground1': '#3a3a3e',
|
|
1047
|
+
'editorWidget.background': '#18181a',
|
|
1048
|
+
'editorWidget.border': '#27272a',
|
|
1049
|
+
'editorHoverWidget.background': '#18181a',
|
|
1050
|
+
'editorHoverWidget.border': '#27272a',
|
|
1051
|
+
'scrollbarSlider.background': '#3a3a3e66',
|
|
1052
|
+
'scrollbarSlider.hoverBackground': '#52525b99'
|
|
1052
1053
|
}
|
|
1053
1054
|
});
|
|
1054
1055
|
|
|
@@ -1056,25 +1057,30 @@ declare module 'bun:sqlite' {
|
|
|
1056
1057
|
base: 'vs',
|
|
1057
1058
|
inherit: true,
|
|
1058
1059
|
rules: [
|
|
1059
|
-
{ token: 'comment', foreground: '
|
|
1060
|
+
{ token: 'comment', foreground: '6e6a64', fontStyle: 'italic' },
|
|
1061
|
+
{ token: 'keyword', foreground: 'c2410c' },
|
|
1062
|
+
{ token: 'string', foreground: '067647' },
|
|
1063
|
+
{ token: 'number', foreground: 'b54708' },
|
|
1064
|
+
{ token: 'type', foreground: '9a3412' },
|
|
1065
|
+
{ token: 'function', foreground: '6d28d9' }
|
|
1060
1066
|
],
|
|
1061
1067
|
colors: {
|
|
1062
1068
|
'editor.background': '#ffffff',
|
|
1063
|
-
'editor.foreground': '#
|
|
1069
|
+
'editor.foreground': '#18181b',
|
|
1064
1070
|
'editorGutter.background': '#ffffff',
|
|
1065
|
-
'editorLineNumber.foreground': '#
|
|
1066
|
-
'editorLineNumber.activeForeground': '#
|
|
1067
|
-
'editor.lineHighlightBackground': '#
|
|
1068
|
-
'editor.lineHighlightBorder': '#
|
|
1069
|
-
'editor.selectionBackground': '#
|
|
1070
|
-
'editor.inactiveSelectionBackground': '#
|
|
1071
|
-
'editorCursor.foreground': '#
|
|
1072
|
-
'editorIndentGuide.background1': '#
|
|
1073
|
-
'editorIndentGuide.activeBackground1': '#
|
|
1074
|
-
'editorWidget.background': '#
|
|
1075
|
-
'editorWidget.border': '#
|
|
1076
|
-
'editorHoverWidget.background': '#
|
|
1077
|
-
'editorHoverWidget.border': '#
|
|
1071
|
+
'editorLineNumber.foreground': '#8a8680',
|
|
1072
|
+
'editorLineNumber.activeForeground': '#18181b',
|
|
1073
|
+
'editor.lineHighlightBackground': '#f7f7f5',
|
|
1074
|
+
'editor.lineHighlightBorder': '#00000000',
|
|
1075
|
+
'editor.selectionBackground': '#e6e4df',
|
|
1076
|
+
'editor.inactiveSelectionBackground': '#f1f1ee',
|
|
1077
|
+
'editorCursor.foreground': '#18181b',
|
|
1078
|
+
'editorIndentGuide.background1': '#e6e4df',
|
|
1079
|
+
'editorIndentGuide.activeBackground1': '#d3d0c9',
|
|
1080
|
+
'editorWidget.background': '#f7f7f5',
|
|
1081
|
+
'editorWidget.border': '#e6e4df',
|
|
1082
|
+
'editorHoverWidget.background': '#f7f7f5',
|
|
1083
|
+
'editorHoverWidget.border': '#e6e4df'
|
|
1078
1084
|
}
|
|
1079
1085
|
});
|
|
1080
1086
|
|
|
@@ -5288,7 +5294,7 @@ int main() {
|
|
|
5288
5294
|
</div>
|
|
5289
5295
|
` : `
|
|
5290
5296
|
<div class="codelab-guide__footer-row">
|
|
5291
|
-
<span
|
|
5297
|
+
<span class="cl-ui-muted-note">100% In-Browser Web Worker Sandbox</span>
|
|
5292
5298
|
</div>
|
|
5293
5299
|
`}
|
|
5294
5300
|
`;
|
|
@@ -6073,7 +6079,7 @@ int main() {
|
|
|
6073
6079
|
<button type="button" class="codelab-pkg-btn" data-cl-action="open-packages" title="Manage Dependencies & Built-ins">
|
|
6074
6080
|
${CL_ICONS.package}
|
|
6075
6081
|
<span>Packages</span>
|
|
6076
|
-
<span class="codelab-drawer__pill"
|
|
6082
|
+
<span class="codelab-drawer__pill">${pkgBadge}</span>
|
|
6077
6083
|
</button>
|
|
6078
6084
|
`;
|
|
6079
6085
|
|
|
@@ -6981,12 +6987,12 @@ int main() {
|
|
|
6981
6987
|
|
|
6982
6988
|
if (this.drawerTab === 'stdin') {
|
|
6983
6989
|
bodyEl.innerHTML = `
|
|
6984
|
-
<div class="codelab-stdin-panel"
|
|
6985
|
-
<div
|
|
6990
|
+
<div class="codelab-stdin-panel">
|
|
6991
|
+
<div class="codelab-stdin-panel__header">
|
|
6986
6992
|
<span>Standard Input (std::cin / sys.stdin / process.stdin)</span>
|
|
6987
|
-
<button type="button" class="codelab-btn codelab-btn--sm" id="cl-stdin-clear-btn"
|
|
6993
|
+
<button type="button" class="codelab-btn codelab-btn--sm" id="cl-stdin-clear-btn">Clear</button>
|
|
6988
6994
|
</div>
|
|
6989
|
-
<textarea id="cl-stdin-textarea" class="codelab-stdin-textarea
|
|
6995
|
+
<textarea id="cl-stdin-textarea" class="codelab-stdin-textarea codelab-stdin-panel__textarea" placeholder="Enter or paste custom stdin here (used by std::cin, sys.stdin, fs.readFileSync(0))...">${escapeHtml(this.customStdin || '')}</textarea>
|
|
6990
6996
|
</div>
|
|
6991
6997
|
`;
|
|
6992
6998
|
const ta = bodyEl.querySelector('#cl-stdin-textarea');
|
|
@@ -7022,9 +7028,9 @@ int main() {
|
|
|
7022
7028
|
<div class="codelab-test-summary ${passed === total ? 'all-pass' : 'has-fail'}">
|
|
7023
7029
|
<div>
|
|
7024
7030
|
<strong>${passed === total ? `All ${total} Tests Passing` : `${passed} of ${total} Tests Passing`}</strong>
|
|
7025
|
-
${this.steps.length ? `<span
|
|
7031
|
+
${this.steps.length ? `<span class="cl-ui-meta-inline">(${this.completedSteps.size}/${this.steps.length} Guided Steps Complete)</span>` : ''}
|
|
7026
7032
|
</div>
|
|
7027
|
-
<span
|
|
7033
|
+
<span class="cl-ui-metric">${totalMs} ms</span>
|
|
7028
7034
|
</div>
|
|
7029
7035
|
<div class="codelab-test-list">
|
|
7030
7036
|
${this.lastTestResults.map(t => `
|
|
@@ -7059,7 +7065,7 @@ int main() {
|
|
|
7059
7065
|
const html = ansiToHtml ? ansiToHtml(item.text || '') : escapeHtml(item.text || '');
|
|
7060
7066
|
return `<div class="codelab-log-line ${escapeHtml(item.type || '')}">${html}</div>`;
|
|
7061
7067
|
}).join('')
|
|
7062
|
-
: `<div
|
|
7068
|
+
: `<div class="cl-ui-muted-note">No output messages yet. Run your code or workspace tasks to inspect output logs.</div>`;
|
|
7063
7069
|
bodyEl.innerHTML = `<div class="codelab-output-panel" id="cl-output-surface" style="font-size:${termFontPx}px;line-height:1.5;">${linesHtml}</div>`;
|
|
7064
7070
|
bodyEl.scrollTop = bodyEl.scrollHeight;
|
|
7065
7071
|
return;
|
|
@@ -7250,7 +7256,7 @@ int main() {
|
|
|
7250
7256
|
<span style="display:inline-flex;align-items:center;gap:6px;">${CL_ICONS.database}<span>Virtual POSIX File System (${tmpFiles.length} files)</span></span>
|
|
7251
7257
|
<span>In-Memory VFS</span>
|
|
7252
7258
|
</div>
|
|
7253
|
-
${tmpFiles.length === 0 ? `<div
|
|
7259
|
+
${tmpFiles.length === 0 ? `<div class="cl-ui-muted-note">Run Demo or Tests to inspect virtual files (e.g. /tmp WAL segments & SSTables).</div>` : ''}
|
|
7254
7260
|
${tmpFiles.map(f => `
|
|
7255
7261
|
<div class="codelab-vfs-item">
|
|
7256
7262
|
<div class="codelab-vfs-item__head">
|
|
@@ -7268,7 +7274,7 @@ int main() {
|
|
|
7268
7274
|
<span style="display:inline-flex;align-items:center;gap:6px;">${CL_ICONS.globe}<span>Virtual Loopback HTTP Trace (${this.lastHttpTrace.length} requests)</span></span>
|
|
7269
7275
|
<span>127.0.0.1</span>
|
|
7270
7276
|
</div>
|
|
7271
|
-
${this.lastHttpTrace.length === 0 ? `<div
|
|
7277
|
+
${this.lastHttpTrace.length === 0 ? `<div class="cl-ui-muted-note">Virtual HTTP loopback requests (e.g., Layer-7 Load Balancer traffic & active health probes) appear here.</div>` : ''}
|
|
7272
7278
|
${this.lastHttpTrace.map(req => `
|
|
7273
7279
|
<div class="codelab-vfs-item">
|
|
7274
7280
|
<div class="codelab-vfs-item__head">
|
|
@@ -7299,13 +7305,13 @@ int main() {
|
|
|
7299
7305
|
? `<div class="codelab-test-summary ${res.verification.passed ? 'all-pass' : 'has-fail'}" style="margin-bottom:10px;">
|
|
7300
7306
|
<div>
|
|
7301
7307
|
<strong>${res.verification.passed ? '✓ Step Verification Passed' : '✖ Step Verification Failed'}</strong>
|
|
7302
|
-
${res.verification.message ? `<span
|
|
7308
|
+
${res.verification.message ? `<span class="cl-ui-meta-inline">${escapeHtml(res.verification.message)}</span>` : ''}
|
|
7303
7309
|
</div>
|
|
7304
|
-
<span
|
|
7310
|
+
<span class="cl-ui-metric">${typeof res.durationMs === 'number' ? `${res.durationMs.toFixed(1)} ms` : ''}</span>
|
|
7305
7311
|
</div>`
|
|
7306
7312
|
: '';
|
|
7307
7313
|
const errHtml = res.error
|
|
7308
|
-
? `<div role="alert"
|
|
7314
|
+
? `<div role="alert" class="cl-ui-alert-error">${escapeHtml(typeof res.error === 'string' ? res.error : (res.error.message || String(res.error)))}</div>`
|
|
7309
7315
|
: '';
|
|
7310
7316
|
const cols = Array.isArray(res.columns) ? res.columns : [];
|
|
7311
7317
|
const rows = Array.isArray(res.rows) ? res.rows : [];
|
|
@@ -7339,12 +7345,12 @@ int main() {
|
|
|
7339
7345
|
</table>
|
|
7340
7346
|
</div>`
|
|
7341
7347
|
: (!res.error
|
|
7342
|
-
? `<div
|
|
7348
|
+
? `<div class="cl-ui-muted-note" style="padding:8px 2px;">Statement executed (${escapeHtml(rowSummary)}).</div>`
|
|
7343
7349
|
: '');
|
|
7344
7350
|
const planHtml = res.plan
|
|
7345
7351
|
? `<div style="margin-top:10px;">
|
|
7346
|
-
<div
|
|
7347
|
-
<pre
|
|
7352
|
+
<div class="cl-ui-section-label">Query Execution Plan</div>
|
|
7353
|
+
<pre class="cl-ui-code-box">${escapeHtml(typeof res.plan === 'string' ? res.plan : JSON.stringify(res.plan, null, 2))}</pre>
|
|
7348
7354
|
</div>`
|
|
7349
7355
|
: '';
|
|
7350
7356
|
bodyEl.innerHTML = `<div style="padding:10px;">${verificationHtml}${errHtml}${tableHtml}${planHtml}</div>`;
|
|
@@ -7363,7 +7369,7 @@ int main() {
|
|
|
7363
7369
|
workerStatus: this.runtimeStatusText || 'Idle'
|
|
7364
7370
|
});
|
|
7365
7371
|
} else {
|
|
7366
|
-
bodyEl.innerHTML = `<div
|
|
7372
|
+
bodyEl.innerHTML = `<div class="cl-ui-muted-note" style="padding:14px;">Observability kernel is not initialized.</div>`;
|
|
7367
7373
|
}
|
|
7368
7374
|
return;
|
|
7369
7375
|
}
|
|
@@ -8142,8 +8148,8 @@ int main() {
|
|
|
8142
8148
|
if (servers.length === 0) {
|
|
8143
8149
|
serversHtml = `
|
|
8144
8150
|
<div class="codelab-ports-empty">
|
|
8145
|
-
<p
|
|
8146
|
-
<span
|
|
8151
|
+
<p class="cl-ui-body-p">No active port listeners</p>
|
|
8152
|
+
<span class="cl-ui-muted-note">
|
|
8147
8153
|
Run an HTTP or WebSocket server in the terminal (e.g. <code>node server.js &</code> or <code>bun run server.ts &</code>) to bind a virtual port.
|
|
8148
8154
|
</span>
|
|
8149
8155
|
</div>
|
|
@@ -8266,7 +8272,7 @@ int main() {
|
|
|
8266
8272
|
<div class="codelab-panel-section">
|
|
8267
8273
|
<div class="codelab-section-title">
|
|
8268
8274
|
<span>${CL_ICONS.send || ''} Mini HTTP Client</span>
|
|
8269
|
-
<span
|
|
8275
|
+
<span class="cl-ui-muted-xs">Virtual Loopback (127.0.0.1)</span>
|
|
8270
8276
|
</div>
|
|
8271
8277
|
<div class="codelab-http-client">
|
|
8272
8278
|
<div class="codelab-http-url-bar">
|
|
@@ -8415,7 +8421,7 @@ int main() {
|
|
|
8415
8421
|
|
|
8416
8422
|
topologyHtml = `
|
|
8417
8423
|
<div class="codelab-topo-bar">
|
|
8418
|
-
<div class="codelab-topo-nodes">${nodePills || '<span
|
|
8424
|
+
<div class="codelab-topo-nodes">${nodePills || '<span class="cl-ui-muted-xs">No listening servers</span>'}</div>
|
|
8419
8425
|
${edgePills ? `<div class="codelab-topo-edges">${edgePills}</div>` : ''}
|
|
8420
8426
|
</div>
|
|
8421
8427
|
`;
|
|
@@ -8467,8 +8473,8 @@ int main() {
|
|
|
8467
8473
|
<td><span class="codelab-method-badge codelab-method-${(t.method || 'GET').toLowerCase()}">${escapeHtml(t.method || 'GET')}</span></td>
|
|
8468
8474
|
<td class="codelab-net-path" title="${escapeHtml(t.url || '/')}">${escapeHtml(t.url || '/')}</td>
|
|
8469
8475
|
<td><code>${escapeHtml(hopLabel)}</code></td>
|
|
8470
|
-
<td
|
|
8471
|
-
<td
|
|
8476
|
+
<td class="cl-ui-metric-cell">${(t.durationMs || 0).toFixed(1)} ms</td>
|
|
8477
|
+
<td class="cl-ui-metric-cell">${t.size != null ? t.size : 0} B</td>
|
|
8472
8478
|
<td class="codelab-waterfall-cell">
|
|
8473
8479
|
<div class="codelab-waterfall-track">
|
|
8474
8480
|
<div class="codelab-waterfall-bar" style="width:${widthPct}%;"></div>
|
|
@@ -8583,7 +8589,7 @@ int main() {
|
|
|
8583
8589
|
<option value="5xx" ${filter.status === '5xx' ? 'selected' : ''}>5xx / Network Fault</option>
|
|
8584
8590
|
</select>
|
|
8585
8591
|
<button type="button" class="codelab-btn" data-cl-action="clear-net-traces">Clear</button>
|
|
8586
|
-
<span id="cl-net-count"
|
|
8592
|
+
<span id="cl-net-count" class="cl-ui-net-count">${filtered.length} of ${traces.length} requests</span>
|
|
8587
8593
|
</div>
|
|
8588
8594
|
<div class="codelab-net-main">
|
|
8589
8595
|
<div class="codelab-net-table-container">
|
|
@@ -8665,8 +8671,8 @@ int main() {
|
|
|
8665
8671
|
<td><span class="codelab-method-badge codelab-method-${(t.method || 'GET').toLowerCase()}">${escapeHtml(t.method || 'GET')}</span></td>
|
|
8666
8672
|
<td class="codelab-net-path" title="${escapeHtml(t.url || '/')}">${escapeHtml(t.url || '/')}</td>
|
|
8667
8673
|
<td><code>${escapeHtml(hopLabel)}</code></td>
|
|
8668
|
-
<td
|
|
8669
|
-
<td
|
|
8674
|
+
<td class="cl-ui-metric-cell">${(t.durationMs || 0).toFixed(1)} ms</td>
|
|
8675
|
+
<td class="cl-ui-metric-cell">${t.size != null ? t.size : 0} B</td>
|
|
8670
8676
|
<td class="codelab-waterfall-cell">
|
|
8671
8677
|
<div class="codelab-waterfall-track">
|
|
8672
8678
|
<div class="codelab-waterfall-bar" style="width:${widthPct}%;"></div>
|
|
@@ -14002,7 +14008,7 @@ int main() {
|
|
|
14002
14008
|
type: 'symbol',
|
|
14003
14009
|
id: `${activeTarget}:${sym.line}:${sym.name}`,
|
|
14004
14010
|
label: `${sym.name} (${sym.kind})`,
|
|
14005
|
-
labelHtml: `${escapeHtml(sym.name)} <span
|
|
14011
|
+
labelHtml: `${escapeHtml(sym.name)} <span class="cl-ui-palette-sub">${escapeHtml(sym.kind)} · Ln ${sym.line}</span>`,
|
|
14006
14012
|
shortcut: activeTarget || '',
|
|
14007
14013
|
action: () => {
|
|
14008
14014
|
if (activeTarget) {
|
|
@@ -14029,7 +14035,7 @@ int main() {
|
|
|
14029
14035
|
type: 'symbol',
|
|
14030
14036
|
id: `${file}:${sym.line}:${sym.name}`,
|
|
14031
14037
|
label: `${sym.name} — ${file}`,
|
|
14032
|
-
labelHtml: `${escapeHtml(sym.name)} <span
|
|
14038
|
+
labelHtml: `${escapeHtml(sym.name)} <span class="cl-ui-palette-sub">${escapeHtml(file)}:${sym.line}</span>`,
|
|
14033
14039
|
shortcut: sym.kind,
|
|
14034
14040
|
action: () => {
|
|
14035
14041
|
this.openFile(file);
|
|
@@ -15065,37 +15071,37 @@ int main() {
|
|
|
15065
15071
|
<button type="button" class="codelab-btn" data-cl-action="close-modal">Close (Esc)</button>
|
|
15066
15072
|
</div>
|
|
15067
15073
|
</div>
|
|
15068
|
-
<div class="codelab-modal__body"
|
|
15069
|
-
<div
|
|
15070
|
-
<input id="cl-pkg-input" type="text" placeholder="Add npm package (e.g. zod, lru-cache, nanoid@5.0.0)..."
|
|
15074
|
+
<div class="codelab-modal__body">
|
|
15075
|
+
<div class="cl-ui-form-row">
|
|
15076
|
+
<input id="cl-pkg-input" class="cl-ui-input cl-ui-input--mono" type="text" placeholder="Add npm package (e.g. zod, lru-cache, nanoid@5.0.0)..." />
|
|
15071
15077
|
<button type="button" class="codelab-btn codelab-btn--primary" data-cl-action="add-package">+ Add Dependency</button>
|
|
15072
15078
|
</div>
|
|
15073
15079
|
<div style="margin-bottom:16px;">
|
|
15074
|
-
<div
|
|
15080
|
+
<div class="cl-ui-section-label">
|
|
15075
15081
|
External NPM Packages (${pkgs.length})
|
|
15076
15082
|
</div>
|
|
15077
15083
|
${pkgs.length === 0 ? `
|
|
15078
|
-
<div
|
|
15084
|
+
<div class="cl-ui-card-note">
|
|
15079
15085
|
No external npm packages imported yet. Any <code>import ... from 'pkg'</code> or <code>require('pkg')</code> in your code is automatically resolved via <strong>jsDelivr</strong> when you run or test.
|
|
15080
15086
|
</div>
|
|
15081
15087
|
` : `
|
|
15082
|
-
<div
|
|
15088
|
+
<div class="cl-ui-stack-xs">
|
|
15083
15089
|
${pkgs.map(p => `
|
|
15084
|
-
<div
|
|
15085
|
-
<span
|
|
15086
|
-
<span
|
|
15090
|
+
<div class="cl-ui-pkg-row">
|
|
15091
|
+
<span class="cl-ui-pkg-row__name">${escapeHtml(p.name)}</span>
|
|
15092
|
+
<span class="cl-ui-pkg-row__meta">${escapeHtml(p.version)} · jsDelivr</span>
|
|
15087
15093
|
</div>
|
|
15088
15094
|
`).join('')}
|
|
15089
15095
|
</div>
|
|
15090
15096
|
`}
|
|
15091
15097
|
</div>
|
|
15092
15098
|
<div>
|
|
15093
|
-
<div
|
|
15099
|
+
<div class="cl-ui-section-label">
|
|
15094
15100
|
Built-in Virtual Node.js Modules (Zero-Latency In-Memory VFS)
|
|
15095
15101
|
</div>
|
|
15096
|
-
<div
|
|
15102
|
+
<div class="cl-ui-chip-wrap">
|
|
15097
15103
|
${builtins.map(b => `
|
|
15098
|
-
<span
|
|
15104
|
+
<span class="cl-ui-chip">${b}</span>
|
|
15099
15105
|
`).join('')}
|
|
15100
15106
|
</div>
|
|
15101
15107
|
</div>
|
|
@@ -18226,7 +18232,7 @@ int main() {
|
|
|
18226
18232
|
<button type="button" class="codelab-btn codelab-btn--icon" data-cl-action="close-modal" title="Close" aria-label="Close">×</button>
|
|
18227
18233
|
</div>
|
|
18228
18234
|
<div class="codelab-modal__body">
|
|
18229
|
-
<p id="cl-discard-modal-desc"
|
|
18235
|
+
<p id="cl-discard-modal-desc" class="cl-ui-modal-desc">${escapeHtml(desc)}</p>
|
|
18230
18236
|
<div style="display:flex;justify-content:flex-end;gap:8px;">
|
|
18231
18237
|
<button type="button" class="codelab-btn" id="cl-discard-cancel-btn" data-cl-action="close-modal">Cancel</button>
|
|
18232
18238
|
<button type="button" class="codelab-btn codelab-btn--danger" id="cl-discard-confirm-btn">Discard Changes</button>
|
|
@@ -19758,12 +19764,12 @@ int main() {
|
|
|
19758
19764
|
this._captureModalReturnFocus();
|
|
19759
19765
|
const rowsHtml = list.length > 0
|
|
19760
19766
|
? list.map((ws) => `
|
|
19761
|
-
<button type="button" class="codelab-recent-ws-item" data-cl-workspace="${escapeHtml(ws.labId)}"
|
|
19767
|
+
<button type="button" class="codelab-recent-ws-item" data-cl-workspace="${escapeHtml(ws.labId)}">
|
|
19762
19768
|
<span>
|
|
19763
19769
|
<strong>${escapeHtml(ws.title || ws.labId)}</strong>
|
|
19764
|
-
${ws.labId === this.labId ? '<span
|
|
19770
|
+
${ws.labId === this.labId ? '<span class="cl-ui-meta-inline">(Current)</span>' : ''}
|
|
19765
19771
|
</span>
|
|
19766
|
-
<code
|
|
19772
|
+
<code class="cl-ui-chip">${escapeHtml(ws.labId)}</code>
|
|
19767
19773
|
</button>
|
|
19768
19774
|
`).join('')
|
|
19769
19775
|
: '<p style="margin:0;color:var(--cl-fg-muted);">No saved workspaces found yet.</p>';
|
|
@@ -20231,8 +20237,8 @@ int main() {
|
|
|
20231
20237
|
<button type="button" class="codelab-btn" data-cl-action="close-modal">Close (Esc)</button>
|
|
20232
20238
|
</div>
|
|
20233
20239
|
<div class="codelab-modal__body">
|
|
20234
|
-
<div
|
|
20235
|
-
${rows.map(([label, kbd]) => `<span>${escapeHtml(label)}</span><kbd
|
|
20240
|
+
<div class="cl-ui-shortcuts-grid">
|
|
20241
|
+
${rows.map(([label, kbd]) => `<span>${escapeHtml(label)}</span><kbd class="cl-ui-kbd">${escapeHtml(kbd)}</kbd>`).join('')}
|
|
20236
20242
|
</div>
|
|
20237
20243
|
</div>
|
|
20238
20244
|
</div>
|
|
@@ -20253,9 +20259,9 @@ int main() {
|
|
|
20253
20259
|
<span>About CodeLab</span>
|
|
20254
20260
|
<button type="button" class="codelab-btn" data-cl-action="close-modal">Close (Esc)</button>
|
|
20255
20261
|
</div>
|
|
20256
|
-
<div class="codelab-modal__body"
|
|
20257
|
-
<p
|
|
20258
|
-
<p
|
|
20262
|
+
<div class="codelab-modal__body">
|
|
20263
|
+
<p class="cl-ui-body-p"><strong>@innovatorved/code-lab</strong> — Full-featured in-browser IDE & runtime workbench.</p>
|
|
20264
|
+
<p class="cl-ui-muted-note">Node.js v22 Worker · TypeScript 5.x · C++20 WASI · Python 3.12 WASI · SQLite / PostgreSQL · Git</p>
|
|
20259
20265
|
</div>
|
|
20260
20266
|
</div>
|
|
20261
20267
|
</dialog>
|
|
@@ -20747,8 +20753,8 @@ int main() {
|
|
|
20747
20753
|
<span id="cl-clone-modal-title" style="display:inline-flex;align-items:center;gap:6px;">${CL_ICONS.gitBranch || CL_ICONS.terminal || CL_ICONS.folder}<span>Clone Public GitHub Repository</span></span>
|
|
20748
20754
|
<button type="button" class="codelab-btn" id="cl-clone-close-btn" data-cl-action="close-modal" aria-label="Close">✕</button>
|
|
20749
20755
|
</div>
|
|
20750
|
-
<div class="codelab-modal__body"
|
|
20751
|
-
<p id="cl-clone-modal-desc"
|
|
20756
|
+
<div class="codelab-modal__body">
|
|
20757
|
+
<p id="cl-clone-modal-desc" class="cl-ui-modal-desc">
|
|
20752
20758
|
Enter a public GitHub repository URL or <code>owner/repo</code> slug. Files are cloned transactionally into the Virtual Filesystem (VFS).
|
|
20753
20759
|
</p>
|
|
20754
20760
|
<form id="cl-clone-repo-form" class="codelab-clone-form" novalidate>
|