@codingame/monaco-vscode-welcome-service-override 1.85.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/assets/commandPalette.svg +50 -0
- package/assets/dark-hc.png +0 -0
- package/assets/dark.png +0 -0
- package/assets/debug.svg +87 -0
- package/assets/extensions-web.svg +216 -0
- package/assets/extensions.svg +236 -0
- package/assets/git.svg +105 -0
- package/assets/languages.svg +88 -0
- package/assets/learn.svg +85 -0
- package/assets/light-hc.png +0 -0
- package/assets/light.png +0 -0
- package/assets/menuBar.svg +100 -0
- package/assets/openFolder.svg +91 -0
- package/assets/profiles.svg +47 -0
- package/assets/runTask.svg +42 -0
- package/assets/search.svg +48 -0
- package/assets/settings.svg +53 -0
- package/assets/settingsSync.svg +148 -0
- package/assets/shortcuts.svg +180 -0
- package/assets/terminal.svg +42 -0
- package/assets/workspaceTrust.svg +43 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +24 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.js +366 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.js +1461 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedColors.js +38 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedDetailsRenderer.js +263 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedIcons.js +16 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.js +53 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedList.js +97 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/startupPage.js +205 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/media/all.png.js +8 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/media/all.svg.js +21 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/media/notebookProfile.js +37 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/media/theme_picker.js +53 -0
- package/vscode/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.js +240 -0
- package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution.js +19 -0
- package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcomeContribution.js +75 -0
- package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcomeExtensionPoint.js +99 -0
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/editor/editorWalkThrough.js +62 -0
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/editor/vs_code_editor_walkthrough.js +190 -0
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/media/walkThroughPart.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThrough.contribution.js +40 -0
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughActions.js +59 -0
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughInput.js +115 -0
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughPart.js +434 -0
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/common/walkThroughContentProvider.js +75 -0
- package/welcome.d.ts +5 -0
- package/welcome.js +25 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
3
|
+
import * as arrays from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
4
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
5
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
6
|
+
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
7
|
+
import { UNKNOWN_EMPTY_WINDOW_WORKSPACE, IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
8
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
9
|
+
import { IWorkingCopyBackupService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup';
|
|
10
|
+
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
11
|
+
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
12
|
+
import { joinPath } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
13
|
+
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
14
|
+
import { GettingStartedInput, gettingStartedInputTypeId } from './gettingStartedInput.js';
|
|
15
|
+
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
16
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
17
|
+
import { getTelemetryLevel } from 'vscode/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
18
|
+
import { IProductService } from 'monaco-editor/esm/vs/platform/product/common/productService.js';
|
|
19
|
+
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
20
|
+
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
21
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
22
|
+
import { RegisteredEditorPriority, IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
23
|
+
|
|
24
|
+
const restoreWalkthroughsConfigurationKey = 'workbench.welcomePage.restorableWalkthroughs';
|
|
25
|
+
const configurationKey = 'workbench.startupEditor';
|
|
26
|
+
const oldConfigurationKey = 'workbench.welcome.enabled';
|
|
27
|
+
const telemetryOptOutStorageKey = 'workbench.telemetryOptOutShown';
|
|
28
|
+
let StartupPageContribution = class StartupPageContribution {
|
|
29
|
+
constructor(instantiationService, configurationService, editorService, workingCopyBackupService, fileService, contextService, lifecycleService, layoutService, productService, commandService, environmentService, storageService, logService, notificationService, editorResolverService) {
|
|
30
|
+
this.instantiationService = instantiationService;
|
|
31
|
+
this.configurationService = configurationService;
|
|
32
|
+
this.editorService = editorService;
|
|
33
|
+
this.workingCopyBackupService = workingCopyBackupService;
|
|
34
|
+
this.fileService = fileService;
|
|
35
|
+
this.contextService = contextService;
|
|
36
|
+
this.lifecycleService = lifecycleService;
|
|
37
|
+
this.layoutService = layoutService;
|
|
38
|
+
this.productService = productService;
|
|
39
|
+
this.commandService = commandService;
|
|
40
|
+
this.environmentService = environmentService;
|
|
41
|
+
this.storageService = storageService;
|
|
42
|
+
this.logService = logService;
|
|
43
|
+
this.notificationService = notificationService;
|
|
44
|
+
editorResolverService.registerEditor(`${GettingStartedInput.RESOURCE.scheme}:/**`, {
|
|
45
|
+
id: GettingStartedInput.ID,
|
|
46
|
+
label: ( localizeWithPath(
|
|
47
|
+
'vs/workbench/contrib/welcomeGettingStarted/browser/startupPage',
|
|
48
|
+
'welcome.displayName',
|
|
49
|
+
"Welcome Page"
|
|
50
|
+
)),
|
|
51
|
+
priority: RegisteredEditorPriority.builtin,
|
|
52
|
+
}, {
|
|
53
|
+
singlePerResource: false,
|
|
54
|
+
canSupportResource: uri => uri.scheme === GettingStartedInput.RESOURCE.scheme,
|
|
55
|
+
}, {
|
|
56
|
+
createEditorInput: ({ resource, options }) => {
|
|
57
|
+
return {
|
|
58
|
+
editor: this.instantiationService.createInstance(GettingStartedInput, options),
|
|
59
|
+
options: {
|
|
60
|
+
...options,
|
|
61
|
+
pinned: false
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
this.run().then(undefined, onUnexpectedError);
|
|
67
|
+
}
|
|
68
|
+
async run() {
|
|
69
|
+
if (this.productService.enableTelemetry
|
|
70
|
+
&& this.productService.showTelemetryOptOut
|
|
71
|
+
&& getTelemetryLevel(this.configurationService) !== 0
|
|
72
|
+
&& !this.environmentService.skipWelcome
|
|
73
|
+
&& !this.storageService.get(telemetryOptOutStorageKey, 0 )) {
|
|
74
|
+
this.storageService.store(telemetryOptOutStorageKey, true, 0 , 0 );
|
|
75
|
+
await this.openGettingStarted(true);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (this.tryOpenWalkthroughForFolder()) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const enabled = isStartupPageEnabled(this.configurationService, this.contextService, this.environmentService);
|
|
82
|
+
if (enabled && this.lifecycleService.startupKind !== 3 ) {
|
|
83
|
+
const hasBackups = await this.workingCopyBackupService.hasBackups();
|
|
84
|
+
if (hasBackups) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (!this.editorService.activeEditor || this.layoutService.openedDefaultEditors) {
|
|
88
|
+
const startupEditorSetting = this.configurationService.inspect(configurationKey);
|
|
89
|
+
const isStartupEditorReadme = startupEditorSetting.value === 'readme';
|
|
90
|
+
const isStartupEditorUserReadme = startupEditorSetting.userValue === 'readme';
|
|
91
|
+
const isStartupEditorDefaultReadme = startupEditorSetting.defaultValue === 'readme';
|
|
92
|
+
if (isStartupEditorReadme && (!isStartupEditorUserReadme || !isStartupEditorDefaultReadme)) {
|
|
93
|
+
this.logService.warn(`Warning: 'workbench.startupEditor: readme' setting ignored due to being set somewhere other than user or default settings (user=${startupEditorSetting.userValue}, default=${startupEditorSetting.defaultValue})`);
|
|
94
|
+
}
|
|
95
|
+
const openWithReadme = isStartupEditorReadme && (isStartupEditorUserReadme || isStartupEditorDefaultReadme);
|
|
96
|
+
if (openWithReadme) {
|
|
97
|
+
await this.openReadme();
|
|
98
|
+
}
|
|
99
|
+
else if (startupEditorSetting.value === 'welcomePage' || startupEditorSetting.value === 'welcomePageInEmptyWorkbench') {
|
|
100
|
+
await this.openGettingStarted();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
tryOpenWalkthroughForFolder() {
|
|
106
|
+
const toRestore = this.storageService.get(restoreWalkthroughsConfigurationKey, 0 );
|
|
107
|
+
if (!toRestore) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
const restoreData = JSON.parse(toRestore);
|
|
112
|
+
const currentWorkspace = this.contextService.getWorkspace();
|
|
113
|
+
if (restoreData.folder === UNKNOWN_EMPTY_WINDOW_WORKSPACE.id || restoreData.folder === ( currentWorkspace.folders[0].uri.toString())) {
|
|
114
|
+
this.editorService.openEditor({
|
|
115
|
+
resource: GettingStartedInput.RESOURCE,
|
|
116
|
+
options: { selectedCategory: restoreData.category, selectedStep: restoreData.step, pinned: false },
|
|
117
|
+
});
|
|
118
|
+
this.storageService.remove(restoreWalkthroughsConfigurationKey, 0 );
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
async openReadme() {
|
|
125
|
+
const readmes = arrays.coalesce(await Promise.all(( this.contextService.getWorkspace().folders.map(async (folder) => {
|
|
126
|
+
const folderUri = folder.uri;
|
|
127
|
+
const folderStat = await this.fileService.resolve(folderUri).catch(onUnexpectedError);
|
|
128
|
+
const files = folderStat?.children ? ( folderStat.children.map(child => child.name)).sort() : [];
|
|
129
|
+
const file = files.find(file => file.toLowerCase() === 'readme.md') || files.find(file => file.toLowerCase().startsWith('readme'));
|
|
130
|
+
if (file) {
|
|
131
|
+
return joinPath(folderUri, file);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
}))));
|
|
137
|
+
if (!this.editorService.activeEditor) {
|
|
138
|
+
if (readmes.length) {
|
|
139
|
+
const isMarkDown = (readme) => readme.path.toLowerCase().endsWith('.md');
|
|
140
|
+
await Promise.all([
|
|
141
|
+
this.commandService.executeCommand('markdown.showPreview', null, readmes.filter(isMarkDown), { locked: true }).catch(error => {
|
|
142
|
+
this.notificationService.error(( localizeWithPath(
|
|
143
|
+
'vs/workbench/contrib/welcomeGettingStarted/browser/startupPage',
|
|
144
|
+
'startupPage.markdownPreviewError',
|
|
145
|
+
'Could not open markdown preview: {0}.\n\nPlease make sure the markdown extension is enabled.',
|
|
146
|
+
error.message
|
|
147
|
+
)));
|
|
148
|
+
}),
|
|
149
|
+
this.editorService.openEditors(( readmes.filter(readme => !isMarkDown(readme)).map(readme => ({ resource: readme })))),
|
|
150
|
+
]);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
await this.openGettingStarted();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
async openGettingStarted(showTelemetryNotice) {
|
|
158
|
+
const startupEditorTypeID = gettingStartedInputTypeId;
|
|
159
|
+
const editor = this.editorService.activeEditor;
|
|
160
|
+
if (editor?.typeId === startupEditorTypeID || ( this.editorService.editors.some(e => e.typeId === startupEditorTypeID))) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const options = editor ? { pinned: false, index: 0 } : { pinned: false };
|
|
164
|
+
{
|
|
165
|
+
this.editorService.openEditor({
|
|
166
|
+
resource: GettingStartedInput.RESOURCE,
|
|
167
|
+
options: { showTelemetryNotice, ...options },
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
StartupPageContribution = ( __decorate([
|
|
173
|
+
( __param(0, IInstantiationService)),
|
|
174
|
+
( __param(1, IConfigurationService)),
|
|
175
|
+
( __param(2, IEditorService)),
|
|
176
|
+
( __param(3, IWorkingCopyBackupService)),
|
|
177
|
+
( __param(4, IFileService)),
|
|
178
|
+
( __param(5, IWorkspaceContextService)),
|
|
179
|
+
( __param(6, ILifecycleService)),
|
|
180
|
+
( __param(7, IWorkbenchLayoutService)),
|
|
181
|
+
( __param(8, IProductService)),
|
|
182
|
+
( __param(9, ICommandService)),
|
|
183
|
+
( __param(10, IWorkbenchEnvironmentService)),
|
|
184
|
+
( __param(11, IStorageService)),
|
|
185
|
+
( __param(12, ILogService)),
|
|
186
|
+
( __param(13, INotificationService)),
|
|
187
|
+
( __param(14, IEditorResolverService))
|
|
188
|
+
], StartupPageContribution));
|
|
189
|
+
function isStartupPageEnabled(configurationService, contextService, environmentService) {
|
|
190
|
+
if (environmentService.skipWelcome) {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
const startupEditor = configurationService.inspect(configurationKey);
|
|
194
|
+
if (!startupEditor.userValue && !startupEditor.workspaceValue) {
|
|
195
|
+
const welcomeEnabled = configurationService.inspect(oldConfigurationKey);
|
|
196
|
+
if (welcomeEnabled.value !== undefined && welcomeEnabled.value !== null) {
|
|
197
|
+
return welcomeEnabled.value;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return startupEditor.value === 'welcomePage'
|
|
201
|
+
|| startupEditor.value === 'readme' && (startupEditor.userValue === 'readme' || startupEditor.defaultValue === 'readme')
|
|
202
|
+
|| (contextService.getWorkbenchState() === 1 && startupEditor.value === 'welcomePageInEmptyWorkbench');
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export { StartupPageContribution, restoreWalkthroughsConfigurationKey };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var pngAssets = {
|
|
2
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/dark-hc.png': new URL('../../../../../../../../assets/dark-hc.png', import.meta.url).href,
|
|
3
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/dark.png': new URL('../../../../../../../../assets/dark.png', import.meta.url).href,
|
|
4
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/light-hc.png': new URL('../../../../../../../../assets/light-hc.png', import.meta.url).href,
|
|
5
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/light.png': new URL('../../../../../../../../assets/light.png', import.meta.url).href
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { pngAssets as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var svgAssets = {
|
|
2
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/commandPalette.svg': new URL('../../../../../../../../assets/commandPalette.svg', import.meta.url).href,
|
|
3
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/debug.svg': new URL('../../../../../../../../assets/debug.svg', import.meta.url).href,
|
|
4
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/extensions-web.svg': new URL('../../../../../../../../assets/extensions-web.svg', import.meta.url).href,
|
|
5
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/extensions.svg': new URL('../../../../../../../../assets/extensions.svg', import.meta.url).href,
|
|
6
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/git.svg': new URL('../../../../../../../../assets/git.svg', import.meta.url).href,
|
|
7
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/languages.svg': new URL('../../../../../../../../assets/languages.svg', import.meta.url).href,
|
|
8
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/learn.svg': new URL('../../../../../../../../assets/learn.svg', import.meta.url).href,
|
|
9
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/menuBar.svg': new URL('../../../../../../../../assets/menuBar.svg', import.meta.url).href,
|
|
10
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/openFolder.svg': new URL('../../../../../../../../assets/openFolder.svg', import.meta.url).href,
|
|
11
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/profiles.svg': new URL('../../../../../../../../assets/profiles.svg', import.meta.url).href,
|
|
12
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/runTask.svg': new URL('../../../../../../../../assets/runTask.svg', import.meta.url).href,
|
|
13
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/search.svg': new URL('../../../../../../../../assets/search.svg', import.meta.url).href,
|
|
14
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/settings.svg': new URL('../../../../../../../../assets/settings.svg', import.meta.url).href,
|
|
15
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/settingsSync.svg': new URL('../../../../../../../../assets/settingsSync.svg', import.meta.url).href,
|
|
16
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/shortcuts.svg': new URL('../../../../../../../../assets/shortcuts.svg', import.meta.url).href,
|
|
17
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/terminal.svg': new URL('../../../../../../../../assets/terminal.svg', import.meta.url).href,
|
|
18
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/workspaceTrust.svg': new URL('../../../../../../../../assets/workspaceTrust.svg', import.meta.url).href
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { svgAssets as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { escape } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
2
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
|
|
4
|
+
const profileArg = (profile) => encodeURIComponent(JSON.stringify({ profile }));
|
|
5
|
+
const imageSize = 400;
|
|
6
|
+
var notebookProfile = () => `
|
|
7
|
+
<vertically-centered>
|
|
8
|
+
<checklist>
|
|
9
|
+
<checkbox on-checked="command:notebook.setProfile?${profileArg('default')}" checked-on="config.notebook.cellFocusIndicator == 'border' && config.notebook.insertToolbarLocation == 'both' && config.notebook.globalToolbar == false && config.notebook.compactView == true && config.notebook.showCellStatusBar == 'visible'">
|
|
10
|
+
<img width="${imageSize}" src="./notebookThemes/default.png"/>
|
|
11
|
+
${escape(( localizeWithPath(
|
|
12
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/notebookProfile',
|
|
13
|
+
'default',
|
|
14
|
+
"Default"
|
|
15
|
+
)))}
|
|
16
|
+
</checkbox>
|
|
17
|
+
<checkbox on-checked="command:notebook.setProfile?${profileArg('jupyter')}" checked-on="config.notebook.cellFocusIndicator == 'gutter' && config.notebook.insertToolbarLocation == 'notebookToolbar' && config.notebook.globalToolbar == true && config.notebook.compactView == true && config.notebook.showCellStatusBar == 'visible'">
|
|
18
|
+
<img width="${imageSize}" src="./notebookThemes/jupyter.png"/>
|
|
19
|
+
${escape(( localizeWithPath(
|
|
20
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/notebookProfile',
|
|
21
|
+
'jupyter',
|
|
22
|
+
"Jupyter"
|
|
23
|
+
)))}
|
|
24
|
+
</checkbox>
|
|
25
|
+
<checkbox on-checked="command:notebook.setProfile?${profileArg('colab')}" checked-on="config.notebook.cellFocusIndicator == 'border' && config.notebook.insertToolbarLocation == 'betweenCells' && config.notebook.globalToolbar == false && config.notebook.compactView == false && config.notebook.showCellStatusBar == 'hidden'">
|
|
26
|
+
<img width="${imageSize}" src="./notebookThemes/colab.png"/>
|
|
27
|
+
${escape(( localizeWithPath(
|
|
28
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/notebookProfile',
|
|
29
|
+
'colab',
|
|
30
|
+
"Colab"
|
|
31
|
+
)))}
|
|
32
|
+
</checkbox>
|
|
33
|
+
</checklist>
|
|
34
|
+
</vertically-centered>
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
export { notebookProfile as default };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { escape } from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
2
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { ThemeSettingDefaults } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
|
|
4
|
+
|
|
5
|
+
var theme_picker = () => `
|
|
6
|
+
<checklist>
|
|
7
|
+
<div class="theme-picker-row">
|
|
8
|
+
<checkbox when-checked="setTheme:${ThemeSettingDefaults.COLOR_THEME_DARK}" checked-on="config.workbench.colorTheme == '${ThemeSettingDefaults.COLOR_THEME_DARK}'">
|
|
9
|
+
<img width="200" src="./dark.png"/>
|
|
10
|
+
${escape(( localizeWithPath(
|
|
11
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/theme_picker',
|
|
12
|
+
'dark',
|
|
13
|
+
"Dark Modern"
|
|
14
|
+
)))}
|
|
15
|
+
</checkbox>
|
|
16
|
+
<checkbox when-checked="setTheme:${ThemeSettingDefaults.COLOR_THEME_LIGHT}" checked-on="config.workbench.colorTheme == '${ThemeSettingDefaults.COLOR_THEME_LIGHT}'">
|
|
17
|
+
<img width="200" src="./light.png"/>
|
|
18
|
+
${escape(( localizeWithPath(
|
|
19
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/theme_picker',
|
|
20
|
+
'light',
|
|
21
|
+
"Light Modern"
|
|
22
|
+
)))}
|
|
23
|
+
</checkbox>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="theme-picker-row">
|
|
26
|
+
<checkbox when-checked="setTheme:${ThemeSettingDefaults.COLOR_THEME_HC_DARK}" checked-on="config.workbench.colorTheme == '${ThemeSettingDefaults.COLOR_THEME_HC_DARK}'">
|
|
27
|
+
<img width="200" src="./dark-hc.png"/>
|
|
28
|
+
${escape(( localizeWithPath(
|
|
29
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/theme_picker',
|
|
30
|
+
'HighContrast',
|
|
31
|
+
"Dark High Contrast"
|
|
32
|
+
)))}
|
|
33
|
+
</checkbox>
|
|
34
|
+
<checkbox when-checked="setTheme:${ThemeSettingDefaults.COLOR_THEME_HC_LIGHT}" checked-on="config.workbench.colorTheme == '${ThemeSettingDefaults.COLOR_THEME_HC_LIGHT}'">
|
|
35
|
+
<img width="200" src="./light-hc.png"/>
|
|
36
|
+
${escape(( localizeWithPath(
|
|
37
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/theme_picker',
|
|
38
|
+
'HighContrastLight',
|
|
39
|
+
"Light High Contrast"
|
|
40
|
+
)))}
|
|
41
|
+
</checkbox>
|
|
42
|
+
</div>
|
|
43
|
+
</checklist>
|
|
44
|
+
<checkbox class="theme-picker-link" when-checked="command:workbench.action.selectTheme" checked-on="false">
|
|
45
|
+
${escape(( localizeWithPath(
|
|
46
|
+
'vs/workbench/contrib/welcomeGettingStarted/common/media/theme_picker',
|
|
47
|
+
'seeMore',
|
|
48
|
+
"See More Themes..."
|
|
49
|
+
)))}
|
|
50
|
+
</checkbox>
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
export { theme_picker as default };
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { assertIsDefined } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
4
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
5
|
+
import { registerAction2, Action2, MenuId, MenuItemAction, MenuRegistry, IMenuService } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
6
|
+
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
7
|
+
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
8
|
+
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
9
|
+
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
10
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
11
|
+
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
12
|
+
|
|
13
|
+
var NewFileTemplatesManager_1;
|
|
14
|
+
const builtInSource = ( localizeWithPath(
|
|
15
|
+
'vs/workbench/contrib/welcomeViews/common/newFile.contribution',
|
|
16
|
+
'Built-In',
|
|
17
|
+
"Built-In"
|
|
18
|
+
));
|
|
19
|
+
const category = { value: ( localizeWithPath(
|
|
20
|
+
'vs/workbench/contrib/welcomeViews/common/newFile.contribution',
|
|
21
|
+
'Create',
|
|
22
|
+
"Create"
|
|
23
|
+
)), original: 'Create' };
|
|
24
|
+
registerAction2(class extends Action2 {
|
|
25
|
+
constructor() {
|
|
26
|
+
super({
|
|
27
|
+
id: 'welcome.showNewFileEntries',
|
|
28
|
+
title: { value: ( localizeWithPath(
|
|
29
|
+
'vs/workbench/contrib/welcomeViews/common/newFile.contribution',
|
|
30
|
+
'welcome.newFile',
|
|
31
|
+
"New File..."
|
|
32
|
+
)), original: 'New File...' },
|
|
33
|
+
category,
|
|
34
|
+
f1: true,
|
|
35
|
+
keybinding: {
|
|
36
|
+
primary: 512 + 2048 + 256 + 44 ,
|
|
37
|
+
weight: 200 ,
|
|
38
|
+
},
|
|
39
|
+
menu: {
|
|
40
|
+
id: MenuId.MenubarFileMenu,
|
|
41
|
+
group: '1_new',
|
|
42
|
+
order: 2
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async run(accessor) {
|
|
47
|
+
return assertIsDefined(NewFileTemplatesManager.Instance).run();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
let NewFileTemplatesManager = class NewFileTemplatesManager extends Disposable {
|
|
51
|
+
static { NewFileTemplatesManager_1 = this; }
|
|
52
|
+
constructor(quickInputService, contextKeyService, commandService, keybindingService, menuService) {
|
|
53
|
+
super();
|
|
54
|
+
this.quickInputService = quickInputService;
|
|
55
|
+
this.contextKeyService = contextKeyService;
|
|
56
|
+
this.commandService = commandService;
|
|
57
|
+
this.keybindingService = keybindingService;
|
|
58
|
+
NewFileTemplatesManager_1.Instance = this;
|
|
59
|
+
this._register({ dispose() { if (NewFileTemplatesManager_1.Instance === this) {
|
|
60
|
+
NewFileTemplatesManager_1.Instance = undefined;
|
|
61
|
+
} } });
|
|
62
|
+
this.menu = menuService.createMenu(MenuId.NewFile, contextKeyService);
|
|
63
|
+
}
|
|
64
|
+
allEntries() {
|
|
65
|
+
const items = [];
|
|
66
|
+
for (const [groupName, group] of this.menu.getActions({ renderShortTitle: true })) {
|
|
67
|
+
for (const action of group) {
|
|
68
|
+
if (action instanceof MenuItemAction) {
|
|
69
|
+
items.push({ commandID: action.item.id, from: action.item.source?.title ?? builtInSource, title: action.label, group: groupName });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return items;
|
|
74
|
+
}
|
|
75
|
+
async run() {
|
|
76
|
+
const entries = this.allEntries();
|
|
77
|
+
if (entries.length === 0) {
|
|
78
|
+
throw Error('Unexpected empty new items list');
|
|
79
|
+
}
|
|
80
|
+
else if (entries.length === 1) {
|
|
81
|
+
this.commandService.executeCommand(entries[0].commandID);
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
return this.selectNewEntry(entries);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async selectNewEntry(entries) {
|
|
89
|
+
let resolveResult;
|
|
90
|
+
const resultPromise = ( new Promise(resolve => {
|
|
91
|
+
resolveResult = resolve;
|
|
92
|
+
}));
|
|
93
|
+
const disposables = ( new DisposableStore());
|
|
94
|
+
const qp = this.quickInputService.createQuickPick();
|
|
95
|
+
qp.title = ( localizeWithPath(
|
|
96
|
+
'vs/workbench/contrib/welcomeViews/common/newFile.contribution',
|
|
97
|
+
'newFileTitle',
|
|
98
|
+
"New File..."
|
|
99
|
+
));
|
|
100
|
+
qp.placeholder = ( localizeWithPath(
|
|
101
|
+
'vs/workbench/contrib/welcomeViews/common/newFile.contribution',
|
|
102
|
+
'newFilePlaceholder',
|
|
103
|
+
"Select File Type or Enter File Name..."
|
|
104
|
+
));
|
|
105
|
+
qp.sortByLabel = false;
|
|
106
|
+
qp.matchOnDetail = true;
|
|
107
|
+
qp.matchOnDescription = true;
|
|
108
|
+
const sortCategories = (a, b) => {
|
|
109
|
+
const categoryPriority = { 'file': 1, 'notebook': 2 };
|
|
110
|
+
if (categoryPriority[a.group] && categoryPriority[b.group]) {
|
|
111
|
+
if (categoryPriority[a.group] !== categoryPriority[b.group]) {
|
|
112
|
+
return categoryPriority[b.group] - categoryPriority[a.group];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else if (categoryPriority[a.group]) {
|
|
116
|
+
return 1;
|
|
117
|
+
}
|
|
118
|
+
else if (categoryPriority[b.group]) {
|
|
119
|
+
return -1;
|
|
120
|
+
}
|
|
121
|
+
if (a.from === builtInSource) {
|
|
122
|
+
return 1;
|
|
123
|
+
}
|
|
124
|
+
if (b.from === builtInSource) {
|
|
125
|
+
return -1;
|
|
126
|
+
}
|
|
127
|
+
return a.from.localeCompare(b.from);
|
|
128
|
+
};
|
|
129
|
+
const displayCategory = {
|
|
130
|
+
'file': ( localizeWithPath(
|
|
131
|
+
'vs/workbench/contrib/welcomeViews/common/newFile.contribution',
|
|
132
|
+
'file',
|
|
133
|
+
"File"
|
|
134
|
+
)),
|
|
135
|
+
'notebook': ( localizeWithPath(
|
|
136
|
+
'vs/workbench/contrib/welcomeViews/common/newFile.contribution',
|
|
137
|
+
'notebook',
|
|
138
|
+
"Notebook"
|
|
139
|
+
)),
|
|
140
|
+
};
|
|
141
|
+
const refreshQp = (entries) => {
|
|
142
|
+
const items = [];
|
|
143
|
+
let lastSeparator;
|
|
144
|
+
entries
|
|
145
|
+
.sort((a, b) => -sortCategories(a, b))
|
|
146
|
+
.forEach((entry) => {
|
|
147
|
+
const command = entry.commandID;
|
|
148
|
+
const keybinding = this.keybindingService.lookupKeybinding(command || '', this.contextKeyService);
|
|
149
|
+
if (lastSeparator !== entry.group) {
|
|
150
|
+
items.push({
|
|
151
|
+
type: 'separator',
|
|
152
|
+
label: displayCategory[entry.group] ?? entry.group
|
|
153
|
+
});
|
|
154
|
+
lastSeparator = entry.group;
|
|
155
|
+
}
|
|
156
|
+
items.push({
|
|
157
|
+
...entry,
|
|
158
|
+
label: entry.title,
|
|
159
|
+
type: 'item',
|
|
160
|
+
keybinding,
|
|
161
|
+
buttons: command ? [
|
|
162
|
+
{
|
|
163
|
+
iconClass: 'codicon codicon-gear',
|
|
164
|
+
tooltip: ( localizeWithPath(
|
|
165
|
+
'vs/workbench/contrib/welcomeViews/common/newFile.contribution',
|
|
166
|
+
'change keybinding',
|
|
167
|
+
"Configure Keybinding"
|
|
168
|
+
))
|
|
169
|
+
}
|
|
170
|
+
] : [],
|
|
171
|
+
detail: '',
|
|
172
|
+
description: entry.from,
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
qp.items = items;
|
|
176
|
+
};
|
|
177
|
+
refreshQp(entries);
|
|
178
|
+
disposables.add(this.menu.onDidChange(() => refreshQp(this.allEntries())));
|
|
179
|
+
disposables.add(qp.onDidChangeValue((val) => {
|
|
180
|
+
if (val === '') {
|
|
181
|
+
refreshQp(entries);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const currentTextEntry = {
|
|
185
|
+
commandID: 'workbench.action.files.newFile',
|
|
186
|
+
commandArgs: { languageId: undefined, viewType: undefined, fileName: val },
|
|
187
|
+
title: ( localizeWithPath(
|
|
188
|
+
'vs/workbench/contrib/welcomeViews/common/newFile.contribution',
|
|
189
|
+
'miNewFileWithName',
|
|
190
|
+
"Create New File ({0})",
|
|
191
|
+
val
|
|
192
|
+
)),
|
|
193
|
+
group: 'file',
|
|
194
|
+
from: builtInSource,
|
|
195
|
+
};
|
|
196
|
+
refreshQp([currentTextEntry, ...entries]);
|
|
197
|
+
}));
|
|
198
|
+
disposables.add(qp.onDidAccept(async (e) => {
|
|
199
|
+
const selected = qp.selectedItems[0];
|
|
200
|
+
resolveResult(!!selected);
|
|
201
|
+
qp.hide();
|
|
202
|
+
if (selected) {
|
|
203
|
+
await this.commandService.executeCommand(selected.commandID, selected.commandArgs);
|
|
204
|
+
}
|
|
205
|
+
}));
|
|
206
|
+
disposables.add(qp.onDidHide(() => {
|
|
207
|
+
qp.dispose();
|
|
208
|
+
disposables.dispose();
|
|
209
|
+
resolveResult(false);
|
|
210
|
+
}));
|
|
211
|
+
disposables.add(qp.onDidTriggerItemButton(e => {
|
|
212
|
+
qp.hide();
|
|
213
|
+
this.commandService.executeCommand('workbench.action.openGlobalKeybindings', e.item.commandID);
|
|
214
|
+
resolveResult(false);
|
|
215
|
+
}));
|
|
216
|
+
qp.show();
|
|
217
|
+
return resultPromise;
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
NewFileTemplatesManager = NewFileTemplatesManager_1 = ( __decorate([
|
|
221
|
+
( __param(0, IQuickInputService)),
|
|
222
|
+
( __param(1, IContextKeyService)),
|
|
223
|
+
( __param(2, ICommandService)),
|
|
224
|
+
( __param(3, IKeybindingService)),
|
|
225
|
+
( __param(4, IMenuService))
|
|
226
|
+
], NewFileTemplatesManager));
|
|
227
|
+
( Registry.as(Extensions.Workbench))
|
|
228
|
+
.registerWorkbenchContribution(NewFileTemplatesManager, 3 );
|
|
229
|
+
MenuRegistry.appendMenuItem(MenuId.NewFile, {
|
|
230
|
+
group: 'file',
|
|
231
|
+
command: {
|
|
232
|
+
id: 'workbench.action.files.newUntitledFile',
|
|
233
|
+
title: ( localizeWithPath(
|
|
234
|
+
'vs/workbench/contrib/welcomeViews/common/newFile.contribution',
|
|
235
|
+
'miNewFile2',
|
|
236
|
+
"Text File"
|
|
237
|
+
))
|
|
238
|
+
},
|
|
239
|
+
order: 1
|
|
240
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
3
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
4
|
+
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
5
|
+
import { ViewsWelcomeContribution } from './viewsWelcomeContribution.js';
|
|
6
|
+
import { viewsWelcomeExtensionPointDescriptor } from './viewsWelcomeExtensionPoint.js';
|
|
7
|
+
import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
|
|
8
|
+
|
|
9
|
+
const extensionPoint = ( ExtensionsRegistry.registerExtensionPoint(viewsWelcomeExtensionPointDescriptor));
|
|
10
|
+
let WorkbenchConfigurationContribution = class WorkbenchConfigurationContribution {
|
|
11
|
+
constructor(instantiationService) {
|
|
12
|
+
instantiationService.createInstance(ViewsWelcomeContribution, extensionPoint);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
WorkbenchConfigurationContribution = ( __decorate([
|
|
16
|
+
( __param(0, IInstantiationService))
|
|
17
|
+
], WorkbenchConfigurationContribution));
|
|
18
|
+
( Registry.as(Extensions.Workbench))
|
|
19
|
+
.registerWorkbenchContribution(WorkbenchConfigurationContribution, 3 );
|