@innovatorved/code-lab 0.4.0 → 0.5.0
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 +2 -2
- package/CHANGELOG.md +21 -0
- package/README.md +4 -28
- package/dist/code-lab-sql.esm.js +1 -1
- package/dist/code-lab-sql.umd.js +2 -2
- package/dist/code-lab.css +1553 -98
- package/dist/code-lab.d.ts +1 -1
- package/dist/code-lab.esm.js +11883 -1619
- package/dist/code-lab.js +11882 -1618
- package/dist/code-lab.umd.js +11882 -1618
- package/dist/diagnostics.d.ts +3 -0
- package/dist/extensions/cpp.esm.js +27 -29
- package/dist/extensions/cpp.js +27 -29
- package/dist/extensions/python.esm.js +27 -28
- package/dist/extensions/python.js +27 -28
- package/dist/index.d.ts +1 -1
- package/dist/packages/settings/src/configuration-service.d.ts +7 -0
- package/dist/packages/settings/src/index.d.ts +1 -1
- package/dist/packages/ui/src/index.d.ts +2 -2
- package/dist/packages/ui/src/plugin-registry.d.ts +1 -0
- package/dist/packages/ui/src/settings-dialog.d.ts +31 -3
- package/dist/packages/ui/src/themes.d.ts +5 -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/scm.d.ts +92 -11
- package/dist/shell.esm.js +937 -113
- package/dist/shell.js +937 -113
- package/dist/storage.d.ts +47 -0
- package/dist/terminal.esm.js +1 -1
- package/dist/terminal.js +1 -1
- package/dist/workbench/index.d.ts +1 -1
- package/dist/workbench/styles.d.ts +1 -1
- package/package.json +2 -2
- 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/settings/src/builtin-schemas.ts +17 -6
- package/packages/settings/src/configuration-service.ts +72 -6
- package/packages/settings/src/index.ts +1 -0
- package/packages/sql/package.json +1 -1
- package/packages/terminal/package.json +1 -1
- package/packages/ui/package.json +1 -1
- package/packages/ui/src/index.ts +4 -0
- package/packages/ui/src/plugin-registry.ts +17 -2
- package/packages/ui/src/settings-dialog.ts +374 -92
- package/packages/ui/src/themes.ts +105 -12
- package/src/code-lab.css +1553 -98
- package/src/diagnostics.ts +139 -7
- package/src/extensions/cpp.ts +33 -33
- package/src/extensions/python.ts +33 -32
- package/src/index.ts +1 -1
- package/src/schemas.ts +1 -1
- package/src/scm.ts +781 -58
- package/src/shell.ts +936 -112
- package/src/storage.ts +336 -3
- package/src/workbench/icons.ts +8 -1
- package/src/workbench/styles.ts +25 -19
- package/src/workbench.ts +12010 -3814
package/dist/diagnostics.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface DiagnosticItem {
|
|
|
24
24
|
tags?: string[];
|
|
25
25
|
}
|
|
26
26
|
export type DiagnosticListener = (items: DiagnosticItem[]) => void;
|
|
27
|
+
export declare function normalizeDiagnosticFilePath(rawFile: string): string;
|
|
27
28
|
export declare class DiagnosticsStore {
|
|
28
29
|
private readonly items;
|
|
29
30
|
private readonly listeners;
|
|
@@ -31,6 +32,7 @@ export declare class DiagnosticsStore {
|
|
|
31
32
|
private batchDirty;
|
|
32
33
|
private normalizeItem;
|
|
33
34
|
add(item: DiagnosticItem): void;
|
|
35
|
+
setFileDiagnostics(file: string, sourceOrDiags: string | ReadonlyArray<Partial<DiagnosticItem>>, diagsOrSource?: ReadonlyArray<Partial<DiagnosticItem>> | string): DiagnosticItem[];
|
|
34
36
|
setMany(items: ReadonlyArray<DiagnosticItem>, clearSource?: string): void;
|
|
35
37
|
batch(fn: () => void): void;
|
|
36
38
|
remove(id: string): void;
|
|
@@ -44,5 +46,6 @@ export declare function createDiagnosticsStore(): DiagnosticsStore;
|
|
|
44
46
|
declare const _default: {
|
|
45
47
|
DiagnosticsStore: typeof DiagnosticsStore;
|
|
46
48
|
createDiagnosticsStore: typeof createDiagnosticsStore;
|
|
49
|
+
normalizeDiagnosticFilePath: typeof normalizeDiagnosticFilePath;
|
|
47
50
|
};
|
|
48
51
|
export default _default;
|
|
@@ -21881,35 +21881,33 @@ function installCppExtension(workbench, options = {}) {
|
|
|
21881
21881
|
seedCppHeadersIntoVfs(workbench.vfs, toolchain.options.extraHeaders);
|
|
21882
21882
|
}
|
|
21883
21883
|
workbench.hasMultipleLanguages = workbench.enabledLanguages.size > 1;
|
|
21884
|
-
|
|
21885
|
-
|
|
21886
|
-
const
|
|
21887
|
-
|
|
21888
|
-
|
|
21889
|
-
|
|
21890
|
-
|
|
21891
|
-
|
|
21892
|
-
|
|
21893
|
-
|
|
21894
|
-
|
|
21895
|
-
|
|
21896
|
-
|
|
21897
|
-
|
|
21898
|
-
|
|
21899
|
-
|
|
21900
|
-
|
|
21901
|
-
|
|
21902
|
-
|
|
21903
|
-
|
|
21904
|
-
|
|
21905
|
-
|
|
21906
|
-
|
|
21907
|
-
|
|
21908
|
-
|
|
21909
|
-
|
|
21910
|
-
|
|
21911
|
-
};
|
|
21912
|
-
}
|
|
21884
|
+
workbench._cppLintHandler = (file2, code) => {
|
|
21885
|
+
if (!file2 || !/\.(?:cpp|cc|cxx|hpp|h)$/i.test(file2)) return;
|
|
21886
|
+
const diags = analyzeCppSource(String(code ?? ""), file2, workbench ? workbench.vfs : void 0);
|
|
21887
|
+
const store = workbench ? workbench._diagnosticsStore : null;
|
|
21888
|
+
if (store && typeof store.setFileDiagnostics === "function") {
|
|
21889
|
+
store.setFileDiagnostics(file2, "cpp-linter", diags);
|
|
21890
|
+
} else if (store && typeof store.clear === "function" && typeof store.add === "function") {
|
|
21891
|
+
store.clear("cpp-linter");
|
|
21892
|
+
for (const d of diags) {
|
|
21893
|
+
store.add(d);
|
|
21894
|
+
}
|
|
21895
|
+
}
|
|
21896
|
+
if (typeof window !== "undefined" && window.monaco) {
|
|
21897
|
+
const model = workbench.models && typeof workbench.models.get === "function" && workbench.models.get(file2) || (workbench.activeFile === file2 && workbench.editor ? workbench.editor.getModel() : null);
|
|
21898
|
+
if (model) {
|
|
21899
|
+
const markers = diags.map((d) => ({
|
|
21900
|
+
startLineNumber: d.line,
|
|
21901
|
+
startColumn: d.col || 1,
|
|
21902
|
+
endLineNumber: d.endLine || d.line,
|
|
21903
|
+
endColumn: d.endCol || (d.col || 1) + 20,
|
|
21904
|
+
message: d.message,
|
|
21905
|
+
severity: d.severity === "error" ? window.monaco.MarkerSeverity.Error : window.monaco.MarkerSeverity.Warning
|
|
21906
|
+
}));
|
|
21907
|
+
window.monaco.editor.setModelMarkers(model, "cpp-linter", markers);
|
|
21908
|
+
}
|
|
21909
|
+
}
|
|
21910
|
+
};
|
|
21913
21911
|
if (options.preload) {
|
|
21914
21912
|
toolchain.ensureLoaded().catch((err) => {
|
|
21915
21913
|
if (typeof workbench._appendTerminalOutput === "function") {
|
package/dist/extensions/cpp.js
CHANGED
|
@@ -21917,35 +21917,33 @@ inline void assertBool(bool cond, bool expected, const char* expr, int line) {
|
|
|
21917
21917
|
seedCppHeadersIntoVfs(workbench.vfs, toolchain.options.extraHeaders);
|
|
21918
21918
|
}
|
|
21919
21919
|
workbench.hasMultipleLanguages = workbench.enabledLanguages.size > 1;
|
|
21920
|
-
|
|
21921
|
-
|
|
21922
|
-
const
|
|
21923
|
-
|
|
21924
|
-
|
|
21925
|
-
|
|
21926
|
-
|
|
21927
|
-
|
|
21928
|
-
|
|
21929
|
-
|
|
21930
|
-
|
|
21931
|
-
|
|
21932
|
-
|
|
21933
|
-
|
|
21934
|
-
|
|
21935
|
-
|
|
21936
|
-
|
|
21937
|
-
|
|
21938
|
-
|
|
21939
|
-
|
|
21940
|
-
|
|
21941
|
-
|
|
21942
|
-
|
|
21943
|
-
|
|
21944
|
-
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
};
|
|
21948
|
-
}
|
|
21920
|
+
workbench._cppLintHandler = (file2, code) => {
|
|
21921
|
+
if (!file2 || !/\.(?:cpp|cc|cxx|hpp|h)$/i.test(file2)) return;
|
|
21922
|
+
const diags = analyzeCppSource(String(code ?? ""), file2, workbench ? workbench.vfs : void 0);
|
|
21923
|
+
const store = workbench ? workbench._diagnosticsStore : null;
|
|
21924
|
+
if (store && typeof store.setFileDiagnostics === "function") {
|
|
21925
|
+
store.setFileDiagnostics(file2, "cpp-linter", diags);
|
|
21926
|
+
} else if (store && typeof store.clear === "function" && typeof store.add === "function") {
|
|
21927
|
+
store.clear("cpp-linter");
|
|
21928
|
+
for (const d of diags) {
|
|
21929
|
+
store.add(d);
|
|
21930
|
+
}
|
|
21931
|
+
}
|
|
21932
|
+
if (typeof window !== "undefined" && window.monaco) {
|
|
21933
|
+
const model = workbench.models && typeof workbench.models.get === "function" && workbench.models.get(file2) || (workbench.activeFile === file2 && workbench.editor ? workbench.editor.getModel() : null);
|
|
21934
|
+
if (model) {
|
|
21935
|
+
const markers = diags.map((d) => ({
|
|
21936
|
+
startLineNumber: d.line,
|
|
21937
|
+
startColumn: d.col || 1,
|
|
21938
|
+
endLineNumber: d.endLine || d.line,
|
|
21939
|
+
endColumn: d.endCol || (d.col || 1) + 20,
|
|
21940
|
+
message: d.message,
|
|
21941
|
+
severity: d.severity === "error" ? window.monaco.MarkerSeverity.Error : window.monaco.MarkerSeverity.Warning
|
|
21942
|
+
}));
|
|
21943
|
+
window.monaco.editor.setModelMarkers(model, "cpp-linter", markers);
|
|
21944
|
+
}
|
|
21945
|
+
}
|
|
21946
|
+
};
|
|
21949
21947
|
if (options.preload) {
|
|
21950
21948
|
toolchain.ensureLoaded().catch((err) => {
|
|
21951
21949
|
if (typeof workbench._appendTerminalOutput === "function") {
|
|
@@ -21211,34 +21211,33 @@ function installPythonExtension(workbench, options = {}) {
|
|
|
21211
21211
|
seedPythonModulesIntoVfs(workbench.vfs);
|
|
21212
21212
|
}
|
|
21213
21213
|
workbench.hasMultipleLanguages = workbench.enabledLanguages.size > 1;
|
|
21214
|
-
|
|
21215
|
-
|
|
21216
|
-
|
|
21217
|
-
|
|
21218
|
-
|
|
21219
|
-
|
|
21220
|
-
|
|
21221
|
-
|
|
21222
|
-
|
|
21223
|
-
|
|
21224
|
-
|
|
21225
|
-
|
|
21226
|
-
|
|
21227
|
-
|
|
21228
|
-
|
|
21229
|
-
|
|
21230
|
-
|
|
21231
|
-
|
|
21232
|
-
|
|
21233
|
-
|
|
21234
|
-
|
|
21235
|
-
|
|
21236
|
-
|
|
21237
|
-
|
|
21238
|
-
|
|
21239
|
-
|
|
21240
|
-
|
|
21241
|
-
}
|
|
21214
|
+
workbench._pyLintHandler = (file2, code) => {
|
|
21215
|
+
if (!file2 || !/\.py$/i.test(file2)) return;
|
|
21216
|
+
const diags = analyzePythonSource(String(code ?? ""), file2);
|
|
21217
|
+
const store = workbench ? workbench._diagnosticsStore : null;
|
|
21218
|
+
if (store && typeof store.setFileDiagnostics === "function") {
|
|
21219
|
+
store.setFileDiagnostics(file2, "python-linter", diags);
|
|
21220
|
+
} else if (store && typeof store.clear === "function" && typeof store.add === "function") {
|
|
21221
|
+
store.clear("python-linter");
|
|
21222
|
+
for (const d of diags) {
|
|
21223
|
+
store.add(d);
|
|
21224
|
+
}
|
|
21225
|
+
}
|
|
21226
|
+
if (typeof window !== "undefined" && window.monaco) {
|
|
21227
|
+
const model = workbench.models && typeof workbench.models.get === "function" && workbench.models.get(file2) || (workbench.activeFile === file2 && workbench.editor ? workbench.editor.getModel() : null);
|
|
21228
|
+
if (model) {
|
|
21229
|
+
const markers = diags.map((d) => ({
|
|
21230
|
+
startLineNumber: d.line,
|
|
21231
|
+
startColumn: d.col || 1,
|
|
21232
|
+
endLineNumber: d.endLine || d.line,
|
|
21233
|
+
endColumn: d.endCol || (d.col || 1) + 20,
|
|
21234
|
+
message: d.message,
|
|
21235
|
+
severity: d.severity === "error" ? window.monaco.MarkerSeverity.Error : window.monaco.MarkerSeverity.Warning
|
|
21236
|
+
}));
|
|
21237
|
+
window.monaco.editor.setModelMarkers(model, "python-linter", markers);
|
|
21238
|
+
}
|
|
21239
|
+
}
|
|
21240
|
+
};
|
|
21242
21241
|
if (options.preload) {
|
|
21243
21242
|
toolchain.ensureLoaded().catch((err) => {
|
|
21244
21243
|
if (typeof workbench._appendTerminalOutput === "function") {
|
|
@@ -21244,34 +21244,33 @@ finally:
|
|
|
21244
21244
|
seedPythonModulesIntoVfs(workbench.vfs);
|
|
21245
21245
|
}
|
|
21246
21246
|
workbench.hasMultipleLanguages = workbench.enabledLanguages.size > 1;
|
|
21247
|
-
|
|
21248
|
-
|
|
21249
|
-
|
|
21250
|
-
|
|
21251
|
-
|
|
21252
|
-
|
|
21253
|
-
|
|
21254
|
-
|
|
21255
|
-
|
|
21256
|
-
|
|
21257
|
-
|
|
21258
|
-
|
|
21259
|
-
|
|
21260
|
-
|
|
21261
|
-
|
|
21262
|
-
|
|
21263
|
-
|
|
21264
|
-
|
|
21265
|
-
|
|
21266
|
-
|
|
21267
|
-
|
|
21268
|
-
|
|
21269
|
-
|
|
21270
|
-
|
|
21271
|
-
|
|
21272
|
-
|
|
21273
|
-
|
|
21274
|
-
}
|
|
21247
|
+
workbench._pyLintHandler = (file2, code) => {
|
|
21248
|
+
if (!file2 || !/\.py$/i.test(file2)) return;
|
|
21249
|
+
const diags = analyzePythonSource(String(code ?? ""), file2);
|
|
21250
|
+
const store = workbench ? workbench._diagnosticsStore : null;
|
|
21251
|
+
if (store && typeof store.setFileDiagnostics === "function") {
|
|
21252
|
+
store.setFileDiagnostics(file2, "python-linter", diags);
|
|
21253
|
+
} else if (store && typeof store.clear === "function" && typeof store.add === "function") {
|
|
21254
|
+
store.clear("python-linter");
|
|
21255
|
+
for (const d of diags) {
|
|
21256
|
+
store.add(d);
|
|
21257
|
+
}
|
|
21258
|
+
}
|
|
21259
|
+
if (typeof window !== "undefined" && window.monaco) {
|
|
21260
|
+
const model = workbench.models && typeof workbench.models.get === "function" && workbench.models.get(file2) || (workbench.activeFile === file2 && workbench.editor ? workbench.editor.getModel() : null);
|
|
21261
|
+
if (model) {
|
|
21262
|
+
const markers = diags.map((d) => ({
|
|
21263
|
+
startLineNumber: d.line,
|
|
21264
|
+
startColumn: d.col || 1,
|
|
21265
|
+
endLineNumber: d.endLine || d.line,
|
|
21266
|
+
endColumn: d.endCol || (d.col || 1) + 20,
|
|
21267
|
+
message: d.message,
|
|
21268
|
+
severity: d.severity === "error" ? window.monaco.MarkerSeverity.Error : window.monaco.MarkerSeverity.Warning
|
|
21269
|
+
}));
|
|
21270
|
+
window.monaco.editor.setModelMarkers(model, "python-linter", markers);
|
|
21271
|
+
}
|
|
21272
|
+
}
|
|
21273
|
+
};
|
|
21275
21274
|
if (options.preload) {
|
|
21276
21275
|
toolchain.ensureLoaded().catch((err) => {
|
|
21277
21276
|
if (typeof workbench._appendTerminalOutput === "function") {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type Event, type IDisposable } from '@code-lab/core';
|
|
|
2
2
|
import { type SettingDescriptor } from './builtin-schemas';
|
|
3
3
|
import { type JsonSchema } from './schema';
|
|
4
4
|
export type ConfigurationTarget = 'default' | 'user' | 'workspace' | 'override';
|
|
5
|
+
export type ConfigurationResetScope = 'user' | 'workspace' | 'all';
|
|
5
6
|
export interface SettingDiagnostic {
|
|
6
7
|
readonly file: string;
|
|
7
8
|
readonly key?: string;
|
|
@@ -46,8 +47,11 @@ export interface IConfigurationService extends IDisposable {
|
|
|
46
47
|
get<T = unknown>(key: string, fallback?: T): T;
|
|
47
48
|
inspect<T = unknown>(key: string): SettingInspection<T>;
|
|
48
49
|
getDiagnostics(): readonly SettingDiagnostic[];
|
|
50
|
+
getWorkspaceSettings(): Record<string, unknown>;
|
|
49
51
|
setUserSetting(key: string, value: unknown): boolean;
|
|
50
52
|
resetSetting(key: string): void;
|
|
53
|
+
resetScopedSetting(key: string, scope: ConfigurationResetScope): Promise<void>;
|
|
54
|
+
resetAllSettings(scope?: ConfigurationResetScope): Promise<void>;
|
|
51
55
|
setWorkspaceSetting(key: string, value: unknown): boolean;
|
|
52
56
|
loadWorkspaceSettingsJson(rawJsonc: string, filePath?: string): readonly SettingDiagnostic[];
|
|
53
57
|
setOverrides(overrides: Readonly<Record<string, unknown>>): void;
|
|
@@ -79,6 +83,9 @@ export declare class ConfigurationService implements IConfigurationService {
|
|
|
79
83
|
setUserSetting(key: string, value: unknown): boolean;
|
|
80
84
|
setWorkspaceSetting(key: string, value: unknown): boolean;
|
|
81
85
|
resetSetting(key: string): void;
|
|
86
|
+
getWorkspaceSettings(): Record<string, unknown>;
|
|
87
|
+
resetScopedSetting(key: string, scope: ConfigurationResetScope): Promise<void>;
|
|
88
|
+
resetAllSettings(scope?: ConfigurationResetScope): Promise<void>;
|
|
82
89
|
loadWorkspaceSettingsJson(rawJsonc: string, filePath?: string): readonly SettingDiagnostic[];
|
|
83
90
|
setOverrides(overrides: Readonly<Record<string, unknown>>): void;
|
|
84
91
|
toWorkspaceJsonString(): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { type JsoncParseError, type JsoncParseResult, stripJsonCommentsAndTrailingCommas, parseJsonc } from './jsonc';
|
|
2
2
|
export { type JsonSchemaType, type JsonSchema, type SchemaValidationIssue, validateJsonSchema } from './schema';
|
|
3
3
|
export { type SettingCategory, type SettingDescriptor, BUILTIN_SETTINGS, buildSettingsJsonSchema, KEYBINDINGS_JSON_SCHEMA, TASKS_JSON_SCHEMA, EXTENSIONS_JSON_SCHEMA } from './builtin-schemas';
|
|
4
|
-
export { type ConfigurationTarget, type SettingDiagnostic, type ConfigurationChangeEvent, type SettingInspection, type WorkspaceTaskDefinition, type WorkspaceExtensionsConfig, type IConfigurationService, IConfigurationServiceId, ConfigurationService, parseTasksConfig, parseExtensionsConfig } from './configuration-service';
|
|
4
|
+
export { type ConfigurationTarget, type ConfigurationResetScope, type SettingDiagnostic, type ConfigurationChangeEvent, type SettingInspection, type WorkspaceTaskDefinition, type WorkspaceExtensionsConfig, type IConfigurationService, IConfigurationServiceId, ConfigurationService, parseTasksConfig, parseExtensionsConfig } from './configuration-service';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type ThemeKind, type ThemeDefinition, type IThemeService, DARK_THEME, LIGHT_THEME, HIGH_CONTRAST_THEME, IThemeServiceId, parseCustomTheme, ThemeService } from './themes';
|
|
1
|
+
export { type ThemeKind, type ThemeDefinition, type IThemeService, DARK_THEME, LIGHT_THEME, HIGH_CONTRAST_THEME, IThemeServiceId, pickContrastingFg, parseCustomTheme, ThemeService } from './themes';
|
|
2
2
|
export { type PanelContribution, type LanguageContribution, type PluginContributions, type PluginActivationContext, type CodeLabPluginManifest, type RegisteredPluginInfo, type IPluginRegistry, IPluginRegistryId, PluginRegistry } from './plugin-registry';
|
|
3
|
-
export { type SettingsDialogOptions, SettingsDialogController } from './settings-dialog';
|
|
3
|
+
export { type SettingsScope, type SettingsInlineMountOptions, type SettingsOpenOptions, type SettingsDialogOptions, SettingsDialogController } from './settings-dialog';
|
|
4
4
|
export { type ObservabilitySnapshotInput, scoreFuzzyFileMatch, rankWorkspaceFiles, renderObservabilityPanelHtml, WorkbenchErrorBoundary } from './observability';
|
|
@@ -34,6 +34,7 @@ export interface PluginActivationContext {
|
|
|
34
34
|
readonly keybindings: IKeybindingService;
|
|
35
35
|
readonly themes: IThemeService;
|
|
36
36
|
readonly logger: ILogger;
|
|
37
|
+
readonly registerPanel?: (panel: PanelContribution) => IDisposable;
|
|
37
38
|
}
|
|
38
39
|
export interface CodeLabPluginManifest {
|
|
39
40
|
readonly id: string;
|
|
@@ -1,23 +1,51 @@
|
|
|
1
1
|
import { type IDisposable } from '@code-lab/core';
|
|
2
2
|
import type { IConfigurationService } from '@code-lab/settings';
|
|
3
|
+
export type SettingsScope = 'user' | 'workspace';
|
|
4
|
+
export interface SettingsInlineMountOptions {
|
|
5
|
+
readonly scope?: SettingsScope;
|
|
6
|
+
readonly onOpenJson?: () => void;
|
|
7
|
+
readonly onOpenSettingsJson?: () => void;
|
|
8
|
+
readonly onWorkspaceSettingsMutated?: (nextWorkspaceSettings: Record<string, unknown>) => void;
|
|
9
|
+
}
|
|
10
|
+
export type SettingsOpenOptions = SettingsInlineMountOptions;
|
|
3
11
|
export interface SettingsDialogOptions {
|
|
4
12
|
readonly configuration: IConfigurationService;
|
|
13
|
+
readonly scope?: SettingsScope;
|
|
5
14
|
readonly onOpenSettingsJson?: () => void;
|
|
15
|
+
readonly onOpenJson?: () => void;
|
|
6
16
|
readonly onExportSettings?: (json: string) => void;
|
|
7
17
|
readonly onImportSettings?: () => void;
|
|
18
|
+
readonly onWorkspaceSettingsMutated?: (nextWorkspaceSettings: Record<string, unknown>) => void;
|
|
8
19
|
}
|
|
9
20
|
export declare class SettingsDialogController implements IDisposable {
|
|
10
|
-
private readonly
|
|
21
|
+
private readonly dialogDisposables;
|
|
22
|
+
private readonly inlineDisposables;
|
|
11
23
|
private readonly config;
|
|
12
24
|
private readonly options;
|
|
25
|
+
private hostRoot;
|
|
13
26
|
private dialogEl;
|
|
27
|
+
private inlineRootEl;
|
|
28
|
+
private runtimeCallbacks;
|
|
29
|
+
private inlineCallbacks;
|
|
30
|
+
private activeScope;
|
|
14
31
|
private activeCategory;
|
|
15
32
|
private searchQuery;
|
|
16
33
|
constructor(hostRoot: HTMLElement, options: SettingsDialogOptions);
|
|
17
|
-
|
|
34
|
+
constructor(options: SettingsDialogOptions);
|
|
35
|
+
private buildSurfaceInnerHtml;
|
|
36
|
+
private getWorkspaceSnapshot;
|
|
37
|
+
private notifyWorkspaceMutated;
|
|
38
|
+
private invokeOpenJsonCallback;
|
|
39
|
+
private bindSurfaceEvents;
|
|
40
|
+
private mountDialog;
|
|
18
41
|
get isOpen(): boolean;
|
|
19
|
-
|
|
42
|
+
get isInlineMounted(): boolean;
|
|
43
|
+
open(options?: SettingsOpenOptions): void;
|
|
20
44
|
close(): void;
|
|
45
|
+
mountInline(container: HTMLElement, options?: SettingsInlineMountOptions): void;
|
|
46
|
+
unmountInline(): void;
|
|
47
|
+
private renderAllActiveSurfaces;
|
|
48
|
+
private renderScopes;
|
|
21
49
|
private renderCategories;
|
|
22
50
|
private renderControl;
|
|
23
51
|
private renderItems;
|
|
@@ -10,6 +10,11 @@ export interface ThemeDefinition {
|
|
|
10
10
|
export declare const DARK_THEME: ThemeDefinition;
|
|
11
11
|
export declare const LIGHT_THEME: ThemeDefinition;
|
|
12
12
|
export declare const HIGH_CONTRAST_THEME: ThemeDefinition;
|
|
13
|
+
/**
|
|
14
|
+
* Picks `'#ffffff'` or `'#000000'` to maximize WCAG 2.1 contrast (>= 4.58:1)
|
|
15
|
+
* against a solid hex/rgb background color, returning `fallback` for dynamic CSS expressions.
|
|
16
|
+
*/
|
|
17
|
+
export declare function pickContrastingFg(color: string, fallback?: string): string;
|
|
13
18
|
export declare function parseCustomTheme(rawJsonc: string): ThemeDefinition;
|
|
14
19
|
export interface IThemeService extends IDisposable {
|
|
15
20
|
readonly activeTheme: ThemeDefinition;
|
package/dist/preview-sw.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ============================================================
|
|
3
|
-
* @innovatorved/code-lab v0.
|
|
3
|
+
* @innovatorved/code-lab v0.5.0 — Standalone Browser Code IDE & Virtual Runtime
|
|
4
4
|
* ============================================================
|
|
5
5
|
* Features:
|
|
6
6
|
* - Sandboxed Web Worker Execution Engine with Multi-Instance Isolation & Watchdog Timer
|
package/dist/runtime.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ============================================================
|
|
3
|
-
* @innovatorved/code-lab v0.
|
|
3
|
+
* @innovatorved/code-lab v0.5.0 — Standalone Browser Code IDE & Virtual Runtime
|
|
4
4
|
* ============================================================
|
|
5
5
|
* Features:
|
|
6
6
|
* - Sandboxed Web Worker Execution Engine with Multi-Instance Isolation & Watchdog Timer
|
package/dist/runtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ============================================================
|
|
3
|
-
* @innovatorved/code-lab v0.
|
|
3
|
+
* @innovatorved/code-lab v0.5.0 — Standalone Browser Code IDE & Virtual Runtime
|
|
4
4
|
* ============================================================
|
|
5
5
|
* Features:
|
|
6
6
|
* - Sandboxed Web Worker Execution Engine with Multi-Instance Isolation & Watchdog Timer
|
package/dist/schemas.d.ts
CHANGED
package/dist/scm.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @innovatorved/code-lab — Interactive Git Source Control (SCM) Engine
|
|
3
3
|
* ============================================================================
|
|
4
|
-
* Pure TypeScript in-browser Git status, staging, unstaging, and
|
|
5
|
-
* backed by workspace VFS state. Powers both the interactive
|
|
6
|
-
* and shell/CLI Git operations.
|
|
4
|
+
* Pure TypeScript in-browser Git status, staging, unstaging, discard, and
|
|
5
|
+
* commit engine backed by workspace VFS state. Powers both the interactive
|
|
6
|
+
* Source Control UI and shell/CLI Git operations with a unified GitState schema.
|
|
7
7
|
*
|
|
8
8
|
* Strict leaf module: fully typed, zero explicit any, zero empty catches.
|
|
9
9
|
*/
|
|
@@ -15,20 +15,50 @@ export interface GitFileStatus {
|
|
|
15
15
|
oldContent?: string;
|
|
16
16
|
newContent?: string;
|
|
17
17
|
}
|
|
18
|
+
export interface GitVfsLike {
|
|
19
|
+
existsSync?(path: string): boolean;
|
|
20
|
+
statSync?(path: string): {
|
|
21
|
+
isDirectory(): boolean;
|
|
22
|
+
};
|
|
23
|
+
readdirSync?(path: string): string[];
|
|
24
|
+
readFileSync?(path: string, encoding?: string): string | Uint8Array;
|
|
25
|
+
writeFileSync?(path: string, data: string): void;
|
|
26
|
+
mkdirSync?(path: string, options?: {
|
|
27
|
+
recursive?: boolean;
|
|
28
|
+
}): unknown;
|
|
29
|
+
unlinkSync?(path: string): void;
|
|
30
|
+
rmSync?(path: string, options?: {
|
|
31
|
+
recursive?: boolean;
|
|
32
|
+
force?: boolean;
|
|
33
|
+
}): void;
|
|
34
|
+
files?: Map<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
export interface GitShellLike {
|
|
37
|
+
cwd?: string;
|
|
38
|
+
vfs?: GitVfsLike | null;
|
|
39
|
+
gitState?: GitState | null;
|
|
40
|
+
_emitVfsMutation?(type: string, absPath: string): void;
|
|
41
|
+
}
|
|
18
42
|
export interface GitCommitRecord {
|
|
19
43
|
hash: string;
|
|
20
44
|
message: string;
|
|
21
45
|
timestamp: number;
|
|
22
46
|
author?: string;
|
|
23
|
-
|
|
47
|
+
date?: string;
|
|
48
|
+
files?: Record<string, string>;
|
|
24
49
|
}
|
|
25
50
|
export interface GitState {
|
|
51
|
+
initialized?: boolean;
|
|
52
|
+
repoRoot?: string;
|
|
26
53
|
branch: string;
|
|
27
|
-
branches?: string[]
|
|
54
|
+
branches?: string[] | Set<string>;
|
|
55
|
+
remoteUrl?: string | null;
|
|
56
|
+
remotes?: Record<string, string>;
|
|
28
57
|
headCommit: string;
|
|
29
58
|
headFiles: Record<string, string>;
|
|
30
59
|
headSnapshot?: Record<string, string>;
|
|
31
60
|
staged: Map<string, string | null> | Set<string>;
|
|
61
|
+
stagedFiles?: Map<string, string | null>;
|
|
32
62
|
commits: GitCommitRecord[];
|
|
33
63
|
}
|
|
34
64
|
export interface GitStatusEntry {
|
|
@@ -50,14 +80,40 @@ export interface GitStatusResult {
|
|
|
50
80
|
hasChanges: boolean;
|
|
51
81
|
isClean: boolean;
|
|
52
82
|
}
|
|
83
|
+
export interface CreateGitStateOptions {
|
|
84
|
+
initialized?: boolean;
|
|
85
|
+
repoRoot?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface InitRepositoryOptions {
|
|
88
|
+
branch?: string;
|
|
89
|
+
repoRoot?: string;
|
|
90
|
+
snapshotExisting?: boolean;
|
|
91
|
+
initialFiles?: Record<string, string>;
|
|
92
|
+
}
|
|
53
93
|
/**
|
|
54
94
|
* Computes a deterministic 7-character short hash for a commit payload.
|
|
55
95
|
*/
|
|
56
96
|
export declare function computeShortCommitHash(input: string): string;
|
|
97
|
+
export declare function isIgnoredScmPath(relPath: string): boolean;
|
|
98
|
+
export declare function normalizeScmRelPath(rawPath: string, repoRoot?: string): string;
|
|
99
|
+
export declare function isUnbornGitHead(gitState: GitState | null | undefined): boolean;
|
|
100
|
+
export declare function isEffectiveStagedChange(gitState: GitState | null | undefined, relPath: string, stagedVal: string | null | undefined, resolvedHeadFiles?: Record<string, string>): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Synchronizes `gitState.headFiles` and `gitState.headSnapshot` so both
|
|
103
|
+
* properties reference the exact same clean `Record<string, string>` object.
|
|
104
|
+
*/
|
|
105
|
+
export declare function syncGitHead(gitState: GitState, nextHead?: Record<string, string>): Record<string, string>;
|
|
106
|
+
/**
|
|
107
|
+
* Initializes an in-memory Git repository state from initial VFS files,
|
|
108
|
+
* keeping `headFiles` / `headSnapshot` and `staged` / `stagedFiles` synchronized.
|
|
109
|
+
*/
|
|
110
|
+
export declare function createGitState(initialFiles?: Record<string, string>, branch?: string, options?: CreateGitStateOptions): GitState;
|
|
57
111
|
/**
|
|
58
|
-
* Initializes a
|
|
112
|
+
* Initializes a Git repository on a `PosixShell` (writing `.git/HEAD` & `.git/config`)
|
|
113
|
+
* or directly on a `GitState` object. Defaults `snapshotExisting` to `false` so
|
|
114
|
+
* existing workspace files appear as untracked until staged and committed.
|
|
59
115
|
*/
|
|
60
|
-
export declare function
|
|
116
|
+
export declare function initRepository(target: GitShellLike | GitState, options?: InitRepositoryOptions): GitState;
|
|
61
117
|
/**
|
|
62
118
|
* Computes working-tree and staging-area Git status against `gitState`.
|
|
63
119
|
* Supports both `computeGitStatus(vfsFiles, repoRoot, gitState)` and
|
|
@@ -68,21 +124,46 @@ export declare function computeGitStatus(arg1: Record<string, string> | GitState
|
|
|
68
124
|
* Stages a file addition, modification, or deletion (`currentContent === null`).
|
|
69
125
|
*/
|
|
70
126
|
export declare function stageFile(gitState: GitState, relativePath: string, currentContent: string | null): void;
|
|
127
|
+
/**
|
|
128
|
+
* Stages all modified, untracked (non-ignored), and deleted tracked files.
|
|
129
|
+
*/
|
|
130
|
+
export declare function stageAll(gitState: GitState, vfsFiles: Record<string, string>, repoRoot?: string): void;
|
|
71
131
|
/**
|
|
72
132
|
* Removes a file from the staging index.
|
|
73
133
|
*/
|
|
74
134
|
export declare function unstageFile(gitState: GitState, relativePath: string): void;
|
|
75
135
|
/**
|
|
76
|
-
*
|
|
77
|
-
|
|
136
|
+
* Clears all staged entries from `gitState`.
|
|
137
|
+
*/
|
|
138
|
+
export declare function unstageAll(gitState: GitState): void;
|
|
139
|
+
/**
|
|
140
|
+
* Commits all staged changes to `gitState`, advancing `headCommit` and
|
|
141
|
+
* synchronizing `headFiles` & `headSnapshot`, prepending the new commit record,
|
|
142
|
+
* and clearing the staging area. Throws if message or staging area is empty.
|
|
78
143
|
*/
|
|
79
|
-
export declare function commitChanges(gitState: GitState, message: string): string;
|
|
144
|
+
export declare function commitChanges(gitState: GitState, message: string, author?: string): string;
|
|
145
|
+
/**
|
|
146
|
+
* Discards working-tree (and staged) changes for `filePath`:
|
|
147
|
+
* - If tracked in `HEAD`, restores `headFiles[relPath]` to `shell.vfs` (creating
|
|
148
|
+
* parent directories first) and optional `workspaceFiles`.
|
|
149
|
+
* - If untracked, deletes the file from `shell.vfs` and optional `workspaceFiles`.
|
|
150
|
+
*/
|
|
151
|
+
export declare function discardChanges(shell: GitShellLike, filePath: string, workspaceFiles?: Record<string, string>): boolean;
|
|
80
152
|
declare const _default: {
|
|
153
|
+
computeShortCommitHash: typeof computeShortCommitHash;
|
|
154
|
+
isIgnoredScmPath: typeof isIgnoredScmPath;
|
|
155
|
+
normalizeScmRelPath: typeof normalizeScmRelPath;
|
|
156
|
+
isUnbornGitHead: typeof isUnbornGitHead;
|
|
157
|
+
isEffectiveStagedChange: typeof isEffectiveStagedChange;
|
|
158
|
+
syncGitHead: typeof syncGitHead;
|
|
81
159
|
createGitState: typeof createGitState;
|
|
160
|
+
initRepository: typeof initRepository;
|
|
82
161
|
computeGitStatus: typeof computeGitStatus;
|
|
83
162
|
stageFile: typeof stageFile;
|
|
163
|
+
stageAll: typeof stageAll;
|
|
84
164
|
unstageFile: typeof unstageFile;
|
|
165
|
+
unstageAll: typeof unstageAll;
|
|
85
166
|
commitChanges: typeof commitChanges;
|
|
86
|
-
|
|
167
|
+
discardChanges: typeof discardChanges;
|
|
87
168
|
};
|
|
88
169
|
export default _default;
|