@codingame/monaco-vscode-welcome-service-override 3.2.3 → 4.1.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.
Files changed (25) hide show
  1. package/package.json +2 -2
  2. package/welcome.js +4 -4
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/external/tslib/tslib.es6.js +0 -11
  5. package/external/vscode-marked/lib/marked.esm.js +0 -2200
  6. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.js +0 -381
  7. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.js +0 -1416
  8. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedColors.js +0 -38
  9. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedDetailsRenderer.js +0 -263
  10. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedIcons.js +0 -16
  11. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.js +0 -53
  12. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedList.js +0 -97
  13. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css.js +0 -6
  14. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/startupPage.js +0 -218
  15. package/vscode/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.js +0 -238
  16. package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution.js +0 -19
  17. package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcomeContribution.js +0 -75
  18. package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcomeExtensionPoint.js +0 -99
  19. package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/editor/editorWalkThrough.js +0 -62
  20. package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/media/walkThroughPart.css.js +0 -6
  21. package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThrough.contribution.js +0 -39
  22. package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughActions.js +0 -59
  23. package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughInput.js +0 -115
  24. package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughPart.js +0 -434
  25. package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/common/walkThroughContentProvider.js +0 -76
@@ -1,1416 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { $, getWindow, addDisposableListener, clearNode, reset, append } from 'vscode/vscode/vs/base/browser/dom';
3
- import { renderFormattedText } from 'vscode/vscode/vs/base/browser/formattedTextRenderer';
4
- import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
5
- import { Button } from 'vscode/vscode/vs/base/browser/ui/button/button';
6
- import { renderLabelWithIcons } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabels';
7
- import { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
8
- import { Toggle } from 'vscode/vscode/vs/base/browser/ui/toggle/toggle';
9
- import { flatten, coalesce, equals } from 'vscode/vscode/vs/base/common/arrays';
10
- import { Throttler, Delayer } from 'vscode/vscode/vs/base/common/async';
11
- import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
12
- import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
13
- import { splitRecentLabel } from 'vscode/vscode/vs/base/common/labels';
14
- import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
15
- import { parse } from 'vscode/vscode/vs/base/common/marshalling';
16
- import { matchesScheme, Schemas } from 'vscode/vscode/vs/base/common/network';
17
- import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
18
- import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
19
- import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
20
- import { URI } from 'vscode/vscode/vs/base/common/uri';
21
- import { generateUuid } from 'vscode/vscode/vs/base/common/uuid';
22
- import './media/gettingStarted.css.js';
23
- import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
24
- import { MarkdownRenderer } from 'vscode/vscode/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer';
25
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
26
- import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
27
- import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
28
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
29
- import { RawContextKey, ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
30
- import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
31
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
32
- import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
33
- import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
34
- import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
35
- import { Link } from 'vscode/vscode/vs/platform/opener/browser/link';
36
- import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
37
- import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
38
- import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
39
- import { WillSaveStateReason, IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
40
- import { firstSessionDateStorageKey, ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
41
- import { getTelemetryLevel } from 'vscode/vscode/vs/platform/telemetry/common/telemetryUtils';
42
- import { defaultToggleStyles, defaultButtonStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
43
- import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
44
- import { UNKNOWN_EMPTY_WINDOW_WORKSPACE, IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
45
- import { isRecentWorkspace, isRecentFolder, IWorkspacesService } from 'vscode/vscode/vs/platform/workspaces/common/workspaces';
46
- import { OpenRecentAction } from 'vscode/vscode/vs/workbench/browser/actions/windowActions';
47
- import { OpenFolderViaWorkspaceAction, OpenFileFolderAction, OpenFolderAction } from 'vscode/vscode/vs/workbench/browser/actions/workspaceActions';
48
- import { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
49
- import { WorkbenchStateContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
50
- import { IWebviewService } from 'vscode/vscode/vs/workbench/contrib/webview/browser/webview';
51
- import './gettingStartedColors.js';
52
- import { GettingStartedDetailsRenderer } from './gettingStartedDetailsRenderer.js';
53
- import { gettingStartedUncheckedCodicon, gettingStartedCheckedCodicon } from './gettingStartedIcons.js';
54
- import { GettingStartedInput } from './gettingStartedInput.js';
55
- import { hiddenEntriesConfigurationKey, IWalkthroughsService } from 'vscode/vscode/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService';
56
- import { restoreWalkthroughsConfigurationKey } from './startupPage.js';
57
- import { startEntries } from 'vscode/vscode/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent';
58
- import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
59
- import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
60
- import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
61
- import { ThemeSettings } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
62
- import { GettingStartedIndexList } from './gettingStartedList.js';
63
-
64
- var GettingStartedPage_1;
65
- const SLIDE_TRANSITION_TIME_MS = 250;
66
- const configurationKey = 'workbench.startupEditor';
67
- const allWalkthroughsHiddenContext = ( new RawContextKey('allWalkthroughsHidden', false));
68
- const inWelcomeContext = ( new RawContextKey('inWelcome', false));
69
- const parsedStartEntries = ( startEntries.map((e, i) => ({
70
- command: e.content.command,
71
- description: e.description,
72
- icon: { type: 'icon', icon: e.icon },
73
- id: e.id,
74
- order: i,
75
- title: e.title,
76
- when: ContextKeyExpr.deserialize(e.when) ?? ContextKeyExpr.true()
77
- })));
78
- const REDUCED_MOTION_KEY = 'workbench.welcomePage.preferReducedMotion';
79
- let GettingStartedPage = class GettingStartedPage extends EditorPane {
80
- static { GettingStartedPage_1 = this; }
81
- static { this.ID = 'gettingStartedPage'; }
82
- constructor(commandService, productService, keybindingService, gettingStartedService, configurationService, telemetryService, languageService, fileService, openerService, themeService, storageService, extensionService, instantiationService, notificationService, groupsService, contextService, quickInputService, workspacesService, labelService, hostService, webviewService, workspaceContextService, accessibilityService) {
83
- super(GettingStartedPage_1.ID, telemetryService, themeService, storageService);
84
- this.commandService = commandService;
85
- this.productService = productService;
86
- this.keybindingService = keybindingService;
87
- this.gettingStartedService = gettingStartedService;
88
- this.configurationService = configurationService;
89
- this.languageService = languageService;
90
- this.fileService = fileService;
91
- this.openerService = openerService;
92
- this.storageService = storageService;
93
- this.extensionService = extensionService;
94
- this.instantiationService = instantiationService;
95
- this.notificationService = notificationService;
96
- this.groupsService = groupsService;
97
- this.quickInputService = quickInputService;
98
- this.workspacesService = workspacesService;
99
- this.labelService = labelService;
100
- this.hostService = hostService;
101
- this.webviewService = webviewService;
102
- this.workspaceContextService = workspaceContextService;
103
- this.accessibilityService = accessibilityService;
104
- this.inProgressScroll = Promise.resolve();
105
- this.dispatchListeners = ( new DisposableStore());
106
- this.stepDisposables = ( new DisposableStore());
107
- this.detailsPageDisposables = ( new DisposableStore());
108
- this.mediaDisposables = ( new DisposableStore());
109
- this.buildSlideThrottle = ( new Throttler());
110
- this.hasScrolledToFirstCategory = false;
111
- this.currentMediaComponent = undefined;
112
- this.currentMediaType = undefined;
113
- this.container = $('.gettingStartedContainer', {
114
- role: 'document',
115
- tabindex: 0,
116
- 'aria-label': ( localizeWithPath(
117
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
118
- 'welcomeAriaLabel',
119
- "Overview of how to get up to speed with your editor."
120
- ))
121
- });
122
- this.stepMediaComponent = $('.getting-started-media');
123
- this.stepMediaComponent.id = generateUuid();
124
- this.categoriesSlideDisposables = this._register(( new DisposableStore()));
125
- this.detailsRenderer = ( new GettingStartedDetailsRenderer(
126
- this.fileService,
127
- this.notificationService,
128
- this.extensionService,
129
- this.languageService
130
- ));
131
- this.contextService = this._register(contextService.createScoped(this.container));
132
- inWelcomeContext.bindTo(this.contextService).set(true);
133
- this.gettingStartedCategories = this.gettingStartedService.getWalkthroughs();
134
- this._register(this.dispatchListeners);
135
- this.buildSlideThrottle = ( new Throttler());
136
- const rerender = () => {
137
- this.gettingStartedCategories = this.gettingStartedService.getWalkthroughs();
138
- if (this.currentWalkthrough) {
139
- const existingSteps = ( this.currentWalkthrough.steps.map(step => step.id));
140
- const newCategory = this.gettingStartedCategories.find(category => this.currentWalkthrough?.id === category.id);
141
- if (newCategory) {
142
- const newSteps = ( newCategory.steps.map(step => step.id));
143
- if (!equals(newSteps, existingSteps)) {
144
- this.buildSlideThrottle.queue(() => this.buildCategoriesSlide());
145
- }
146
- }
147
- }
148
- else {
149
- this.buildSlideThrottle.queue(() => this.buildCategoriesSlide());
150
- }
151
- };
152
- this._register(this.gettingStartedService.onDidAddWalkthrough(rerender));
153
- this._register(this.gettingStartedService.onDidRemoveWalkthrough(rerender));
154
- this.recentlyOpened = this.workspacesService.getRecentlyOpened();
155
- this._register(workspacesService.onDidChangeRecentlyOpened(() => {
156
- this.recentlyOpened = workspacesService.getRecentlyOpened();
157
- rerender();
158
- }));
159
- this._register(this.gettingStartedService.onDidChangeWalkthrough(category => {
160
- const ourCategory = this.gettingStartedCategories.find(c => c.id === category.id);
161
- if (!ourCategory) {
162
- return;
163
- }
164
- ourCategory.title = category.title;
165
- ourCategory.description = category.description;
166
- this.container.querySelectorAll(`[x-category-title-for="${category.id}"]`).forEach(step => step.innerText = ourCategory.title);
167
- this.container.querySelectorAll(`[x-category-description-for="${category.id}"]`).forEach(step => step.innerText = ourCategory.description);
168
- }));
169
- this._register(this.gettingStartedService.onDidProgressStep(step => {
170
- const category = this.gettingStartedCategories.find(category => category.id === step.category);
171
- if (!category) {
172
- throw Error('Could not find category with ID: ' + step.category);
173
- }
174
- const ourStep = category.steps.find(_step => _step.id === step.id);
175
- if (!ourStep) {
176
- throw Error('Could not find step with ID: ' + step.id);
177
- }
178
- const stats = this.getWalkthroughCompletionStats(category);
179
- if (!ourStep.done && stats.stepsComplete === stats.stepsTotal - 1) {
180
- this.hideCategory(category.id);
181
- }
182
- this._register(this.configurationService.onDidChangeConfiguration(e => {
183
- if (e.affectsConfiguration(REDUCED_MOTION_KEY)) {
184
- this.container.classList.toggle('animatable', this.shouldAnimate());
185
- }
186
- }));
187
- ourStep.done = step.done;
188
- if (category.id === this.currentWalkthrough?.id) {
189
- const badgeelements = assertIsDefined(getWindow(this.container).document.querySelectorAll(`[data-done-step-id="${step.id}"]`));
190
- badgeelements.forEach(badgeelement => {
191
- if (step.done) {
192
- badgeelement.setAttribute('aria-checked', 'true');
193
- badgeelement.parentElement?.setAttribute('aria-checked', 'true');
194
- badgeelement.classList.remove(...ThemeIcon.asClassNameArray(gettingStartedUncheckedCodicon));
195
- badgeelement.classList.add('complete', ...ThemeIcon.asClassNameArray(gettingStartedCheckedCodicon));
196
- }
197
- else {
198
- badgeelement.setAttribute('aria-checked', 'false');
199
- badgeelement.parentElement?.setAttribute('aria-checked', 'false');
200
- badgeelement.classList.remove('complete', ...ThemeIcon.asClassNameArray(gettingStartedCheckedCodicon));
201
- badgeelement.classList.add(...ThemeIcon.asClassNameArray(gettingStartedUncheckedCodicon));
202
- }
203
- });
204
- }
205
- this.updateCategoryProgress();
206
- }));
207
- this._register(this.storageService.onWillSaveState((e) => {
208
- if (e.reason !== WillSaveStateReason.SHUTDOWN) {
209
- return;
210
- }
211
- if (this.workspaceContextService.getWorkspace().folders.length !== 0) {
212
- return;
213
- }
214
- if (!this.editorInput || !this.currentWalkthrough || !this.editorInput.selectedCategory || !this.editorInput.selectedStep) {
215
- return;
216
- }
217
- const restoreData = { folder: UNKNOWN_EMPTY_WINDOW_WORKSPACE.id, category: this.editorInput.selectedCategory, step: this.editorInput.selectedStep };
218
- this.storageService.store(restoreWalkthroughsConfigurationKey, JSON.stringify(restoreData), 0 , 1 );
219
- }));
220
- }
221
- shouldAnimate() {
222
- if (this.configurationService.getValue(REDUCED_MOTION_KEY)) {
223
- return false;
224
- }
225
- if (this.accessibilityService.isMotionReduced()) {
226
- return false;
227
- }
228
- return true;
229
- }
230
- getWalkthroughCompletionStats(walkthrough) {
231
- const activeSteps = walkthrough.steps.filter(s => this.contextService.contextMatchesRules(s.when));
232
- return {
233
- stepsComplete: activeSteps.filter(s => s.done).length,
234
- stepsTotal: activeSteps.length,
235
- };
236
- }
237
- async setInput(newInput, options, context, token) {
238
- this.container.classList.remove('animatable');
239
- this.editorInput = newInput;
240
- await super.setInput(newInput, options, context, token);
241
- await this.buildCategoriesSlide();
242
- if (this.shouldAnimate()) {
243
- setTimeout(() => this.container.classList.add('animatable'), 0);
244
- }
245
- }
246
- async makeCategoryVisibleWhenAvailable(categoryID, stepId) {
247
- this.scrollToCategory(categoryID, stepId);
248
- }
249
- registerDispatchListeners() {
250
- this.dispatchListeners.clear();
251
- this.container.querySelectorAll('[x-dispatch]').forEach(element => {
252
- const [command, argument] = (element.getAttribute('x-dispatch') ?? '').split(':');
253
- if (command) {
254
- this.dispatchListeners.add(addDisposableListener(element, 'click', (e) => {
255
- e.stopPropagation();
256
- this.runDispatchCommand(command, argument);
257
- }));
258
- this.dispatchListeners.add(addDisposableListener(element, 'keyup', (e) => {
259
- const keyboardEvent = ( new StandardKeyboardEvent(e));
260
- e.stopPropagation();
261
- switch (keyboardEvent.keyCode) {
262
- case 3 :
263
- case 10 :
264
- this.runDispatchCommand(command, argument);
265
- return;
266
- }
267
- }));
268
- }
269
- });
270
- }
271
- async runDispatchCommand(command, argument) {
272
- this.commandService.executeCommand('workbench.action.keepEditor');
273
- this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command, argument, walkthroughId: this.currentWalkthrough?.id });
274
- switch (command) {
275
- case 'scrollPrev': {
276
- this.scrollPrev();
277
- break;
278
- }
279
- case 'skip': {
280
- this.runSkip();
281
- break;
282
- }
283
- case 'showMoreRecents': {
284
- this.commandService.executeCommand(OpenRecentAction.ID);
285
- break;
286
- }
287
- case 'seeAllWalkthroughs': {
288
- await this.openWalkthroughSelector();
289
- break;
290
- }
291
- case 'openFolder': {
292
- if (this.contextService.contextMatchesRules(( ContextKeyExpr.and(( WorkbenchStateContext.isEqualTo('workspace')))))) {
293
- this.commandService.executeCommand(OpenFolderViaWorkspaceAction.ID);
294
- }
295
- else {
296
- this.commandService.executeCommand(isMacintosh ? 'workbench.action.files.openFileFolder' : 'workbench.action.files.openFolder');
297
- }
298
- break;
299
- }
300
- case 'selectCategory': {
301
- this.scrollToCategory(argument);
302
- this.gettingStartedService.markWalkthroughOpened(argument);
303
- break;
304
- }
305
- case 'selectStartEntry': {
306
- const selected = startEntries.find(e => e.id === argument);
307
- if (selected) {
308
- this.runStepCommand(selected.content.command);
309
- }
310
- else {
311
- throw Error('could not find start entry with id: ' + argument);
312
- }
313
- break;
314
- }
315
- case 'hideCategory': {
316
- this.hideCategory(argument);
317
- break;
318
- }
319
- case 'selectTask': {
320
- this.selectStep(argument);
321
- break;
322
- }
323
- case 'toggleStepCompletion': {
324
- this.toggleStepCompletion(argument);
325
- break;
326
- }
327
- case 'allDone': {
328
- this.markAllStepsComplete();
329
- break;
330
- }
331
- case 'nextSection': {
332
- const next = this.currentWalkthrough?.next;
333
- if (next) {
334
- this.scrollToCategory(next);
335
- }
336
- else {
337
- console.error('Error scrolling to next section of', this.currentWalkthrough);
338
- }
339
- break;
340
- }
341
- case 'openExtensionPage': {
342
- this.commandService.executeCommand('extension.open', argument);
343
- break;
344
- }
345
- case 'hideExtension': {
346
- this.hideExtension(argument);
347
- break;
348
- }
349
- default: {
350
- console.error('Dispatch to', command, argument, 'not defined');
351
- break;
352
- }
353
- }
354
- }
355
- hideCategory(categoryId) {
356
- const selectedCategory = this.gettingStartedCategories.find(category => category.id === categoryId);
357
- if (!selectedCategory) {
358
- throw Error('Could not find category with ID ' + categoryId);
359
- }
360
- this.setHiddenCategories([...this.getHiddenCategories().add(categoryId)]);
361
- this.gettingStartedList?.rerender();
362
- }
363
- hideExtension(extensionId) {
364
- this.setHiddenCategories([...this.getHiddenCategories().add(extensionId)]);
365
- this.registerDispatchListeners();
366
- }
367
- markAllStepsComplete() {
368
- if (this.currentWalkthrough) {
369
- this.currentWalkthrough?.steps.forEach(step => {
370
- if (!step.done) {
371
- this.gettingStartedService.progressStep(step.id);
372
- }
373
- });
374
- this.hideCategory(this.currentWalkthrough?.id);
375
- this.scrollPrev();
376
- }
377
- else {
378
- throw Error('No walkthrough opened');
379
- }
380
- }
381
- toggleStepCompletion(argument) {
382
- const stepToggle = assertIsDefined(this.currentWalkthrough?.steps.find(step => step.id === argument));
383
- if (stepToggle.done) {
384
- this.gettingStartedService.deprogressStep(argument);
385
- }
386
- else {
387
- this.gettingStartedService.progressStep(argument);
388
- }
389
- }
390
- async openWalkthroughSelector() {
391
- const selection = await this.quickInputService.pick(( this.gettingStartedCategories
392
- .filter(c => this.contextService.contextMatchesRules(c.when))
393
- .map(x => ({
394
- id: x.id,
395
- label: x.title,
396
- detail: x.description,
397
- description: x.source,
398
- }))), { canPickMany: false, matchOnDescription: true, matchOnDetail: true, title: ( localizeWithPath(
399
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
400
- 'pickWalkthroughs',
401
- "Open Walkthrough..."
402
- )) });
403
- if (selection) {
404
- this.runDispatchCommand('selectCategory', selection.id);
405
- }
406
- }
407
- getHiddenCategories() {
408
- return ( new Set(
409
- JSON.parse(this.storageService.get(hiddenEntriesConfigurationKey, 0 , '[]'))
410
- ));
411
- }
412
- setHiddenCategories(hidden) {
413
- this.storageService.store(hiddenEntriesConfigurationKey, JSON.stringify(hidden), 0 , 0 );
414
- }
415
- async buildMediaComponent(stepId) {
416
- if (!this.currentWalkthrough) {
417
- throw Error('no walkthrough selected');
418
- }
419
- const stepToExpand = assertIsDefined(this.currentWalkthrough.steps.find(step => step.id === stepId));
420
- if (this.currentMediaComponent === stepId) {
421
- return;
422
- }
423
- this.currentMediaComponent = stepId;
424
- this.stepDisposables.clear();
425
- this.stepDisposables.add({
426
- dispose: () => {
427
- this.currentMediaComponent = undefined;
428
- }
429
- });
430
- if (this.currentMediaType !== stepToExpand.media.type) {
431
- this.currentMediaType = stepToExpand.media.type;
432
- this.mediaDisposables.add(toDisposable(() => {
433
- this.currentMediaType = undefined;
434
- }));
435
- clearNode(this.stepMediaComponent);
436
- if (stepToExpand.media.type === 'svg') {
437
- this.webview = this.mediaDisposables.add(this.webviewService.createWebviewElement({ title: undefined, options: { disableServiceWorker: true }, contentOptions: {}, extension: undefined }));
438
- this.webview.mountTo(this.stepMediaComponent);
439
- }
440
- else if (stepToExpand.media.type === 'markdown') {
441
- this.webview = this.mediaDisposables.add(this.webviewService.createWebviewElement({ options: {}, contentOptions: { localResourceRoots: [stepToExpand.media.root], allowScripts: true }, title: '', extension: undefined }));
442
- this.webview.mountTo(this.stepMediaComponent);
443
- }
444
- }
445
- if (stepToExpand.media.type === 'image') {
446
- this.stepsContent.classList.add('image');
447
- this.stepsContent.classList.remove('markdown');
448
- const media = stepToExpand.media;
449
- const mediaElement = $('img');
450
- clearNode(this.stepMediaComponent);
451
- this.stepMediaComponent.appendChild(mediaElement);
452
- mediaElement.setAttribute('alt', media.altText);
453
- this.updateMediaSourceForColorMode(mediaElement, media.path);
454
- this.stepDisposables.add(addDisposableListener(this.stepMediaComponent, 'click', () => {
455
- const hrefs = flatten(( stepToExpand.description.map(lt => ( lt.nodes.filter((node) => typeof node !== 'string').map(node => node.href)))));
456
- if (hrefs.length === 1) {
457
- const href = hrefs[0];
458
- if (href.startsWith('http')) {
459
- this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'runStepAction', argument: href, walkthroughId: this.currentWalkthrough?.id });
460
- this.openerService.open(href);
461
- }
462
- }
463
- }));
464
- this.stepDisposables.add(this.themeService.onDidColorThemeChange(() => this.updateMediaSourceForColorMode(mediaElement, media.path)));
465
- }
466
- else if (stepToExpand.media.type === 'svg') {
467
- this.stepsContent.classList.add('image');
468
- this.stepsContent.classList.remove('markdown');
469
- const media = stepToExpand.media;
470
- this.webview.setHtml(await this.detailsRenderer.renderSVG(media.path));
471
- let isDisposed = false;
472
- this.stepDisposables.add(toDisposable(() => { isDisposed = true; }));
473
- this.stepDisposables.add(this.themeService.onDidColorThemeChange(async () => {
474
- const body = await this.detailsRenderer.renderSVG(media.path);
475
- if (!isDisposed) {
476
- this.webview.setHtml(body);
477
- }
478
- }));
479
- this.stepDisposables.add(addDisposableListener(this.stepMediaComponent, 'click', () => {
480
- const hrefs = flatten(( stepToExpand.description.map(lt => ( lt.nodes.filter((node) => typeof node !== 'string').map(node => node.href)))));
481
- if (hrefs.length === 1) {
482
- const href = hrefs[0];
483
- if (href.startsWith('http')) {
484
- this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'runStepAction', argument: href, walkthroughId: this.currentWalkthrough?.id });
485
- this.openerService.open(href);
486
- }
487
- }
488
- }));
489
- this.stepDisposables.add(this.webview.onDidClickLink(link => {
490
- if (matchesScheme(link, Schemas.https) || matchesScheme(link, Schemas.http) || (matchesScheme(link, Schemas.command))) {
491
- this.openerService.open(link, { allowCommands: true });
492
- }
493
- }));
494
- }
495
- else if (stepToExpand.media.type === 'markdown') {
496
- this.stepsContent.classList.remove('image');
497
- this.stepsContent.classList.add('markdown');
498
- const media = stepToExpand.media;
499
- const rawHTML = await this.detailsRenderer.renderMarkdown(media.path, media.base);
500
- this.webview.setHtml(rawHTML);
501
- const serializedContextKeyExprs = rawHTML.match(/checked-on=\"([^'][^"]*)\"/g)?.map(attr => attr.slice('checked-on="'.length, -1)
502
- .replace(/'/g, '\'')
503
- .replace(/&/g, '&'));
504
- const postTrueKeysMessage = () => {
505
- const enabledContextKeys = serializedContextKeyExprs?.filter(expr => this.contextService.contextMatchesRules(ContextKeyExpr.deserialize(expr)));
506
- if (enabledContextKeys) {
507
- this.webview.postMessage({
508
- enabledContextKeys
509
- });
510
- }
511
- };
512
- if (serializedContextKeyExprs) {
513
- const contextKeyExprs = coalesce(( serializedContextKeyExprs.map(expr => ContextKeyExpr.deserialize(expr))));
514
- const watchingKeys = ( new Set(flatten(( contextKeyExprs.map(expr => ( expr.keys()))))));
515
- this.stepDisposables.add(this.contextService.onDidChangeContext(e => {
516
- if (e.affectsSome(watchingKeys)) {
517
- postTrueKeysMessage();
518
- }
519
- }));
520
- }
521
- let isDisposed = false;
522
- this.stepDisposables.add(toDisposable(() => { isDisposed = true; }));
523
- this.stepDisposables.add(this.webview.onDidClickLink(link => {
524
- if (matchesScheme(link, Schemas.https) || matchesScheme(link, Schemas.http) || (matchesScheme(link, Schemas.command))) {
525
- const toSide = link.startsWith('command:toSide:');
526
- if (toSide) {
527
- link = link.replace('command:toSide:', 'command:');
528
- this.focusSideEditorGroup();
529
- }
530
- this.openerService.open(link, { allowCommands: true, openToSide: toSide });
531
- }
532
- }));
533
- if (rawHTML.indexOf('<code>') >= 0) {
534
- this.stepDisposables.add(this.themeService.onDidColorThemeChange(async () => {
535
- const body = await this.detailsRenderer.renderMarkdown(media.path, media.base);
536
- if (!isDisposed) {
537
- this.webview.setHtml(body);
538
- postTrueKeysMessage();
539
- }
540
- }));
541
- }
542
- const layoutDelayer = ( new Delayer(50));
543
- this.layoutMarkdown = () => {
544
- layoutDelayer.trigger(() => {
545
- this.webview.postMessage({ layoutMeNow: true });
546
- });
547
- };
548
- this.stepDisposables.add(layoutDelayer);
549
- this.stepDisposables.add({ dispose: () => this.layoutMarkdown = undefined });
550
- postTrueKeysMessage();
551
- this.stepDisposables.add(this.webview.onMessage(e => {
552
- const message = e.message;
553
- if (message.startsWith('command:')) {
554
- this.openerService.open(message, { allowCommands: true });
555
- }
556
- else if (message.startsWith('setTheme:')) {
557
- this.configurationService.updateValue(ThemeSettings.COLOR_THEME, message.slice('setTheme:'.length), 2 );
558
- }
559
- else {
560
- console.error('Unexpected message', message);
561
- }
562
- }));
563
- }
564
- }
565
- async selectStepLoose(id) {
566
- if (id.startsWith(`${this.editorInput.selectedCategory}#`)) {
567
- this.selectStep(id);
568
- }
569
- else {
570
- const toSelect = this.editorInput.selectedCategory + '#' + id;
571
- this.selectStep(toSelect);
572
- }
573
- }
574
- async selectStep(id, delayFocus = true) {
575
- if (id) {
576
- let stepElement = this.container.querySelector(`[data-step-id="${id}"]`);
577
- if (!stepElement) {
578
- stepElement = this.container.querySelector(`[data-step-id]`);
579
- if (!stepElement) {
580
- return;
581
- }
582
- id = assertIsDefined(stepElement.getAttribute('data-step-id'));
583
- }
584
- stepElement.parentElement?.querySelectorAll('.expanded').forEach(node => {
585
- if (node.getAttribute('data-step-id') !== id) {
586
- node.classList.remove('expanded');
587
- node.setAttribute('aria-expanded', 'false');
588
- }
589
- });
590
- setTimeout(() => stepElement.focus(), delayFocus && this.shouldAnimate() ? SLIDE_TRANSITION_TIME_MS : 0);
591
- this.editorInput.selectedStep = id;
592
- stepElement.classList.add('expanded');
593
- stepElement.setAttribute('aria-expanded', 'true');
594
- this.buildMediaComponent(id);
595
- this.gettingStartedService.progressByEvent('stepSelected:' + id);
596
- }
597
- else {
598
- this.editorInput.selectedStep = undefined;
599
- }
600
- this.detailsPageScrollbar?.scanDomNode();
601
- this.detailsScrollbar?.scanDomNode();
602
- }
603
- updateMediaSourceForColorMode(element, sources) {
604
- const themeType = this.themeService.getColorTheme().type;
605
- const src = ( sources[themeType].toString(true)).replace(/ /g, '%20');
606
- element.srcset = src.toLowerCase().endsWith('.svg') ? src : (src + ' 1.5x');
607
- }
608
- createEditor(parent) {
609
- if (this.detailsPageScrollbar) {
610
- this.detailsPageScrollbar.dispose();
611
- }
612
- if (this.categoriesPageScrollbar) {
613
- this.categoriesPageScrollbar.dispose();
614
- }
615
- this.categoriesSlide = $('.gettingStartedSlideCategories.gettingStartedSlide');
616
- const prevButton = $('button.prev-button.button-link', { 'x-dispatch': 'scrollPrev' }, $('span.scroll-button.codicon.codicon-chevron-left'), $('span.moreText', {}, ( localizeWithPath(
617
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
618
- 'welcome',
619
- "Welcome"
620
- ))));
621
- this.stepsSlide = $('.gettingStartedSlideDetails.gettingStartedSlide', {}, prevButton);
622
- this.stepsContent = $('.gettingStartedDetailsContent', {});
623
- this.detailsPageScrollbar = this._register(( new DomScrollableElement(this.stepsContent, { className: 'full-height-scrollable' })));
624
- this.categoriesPageScrollbar = this._register(( new DomScrollableElement(
625
- this.categoriesSlide,
626
- { className: 'full-height-scrollable categoriesScrollbar' }
627
- )));
628
- this.stepsSlide.appendChild(this.detailsPageScrollbar.getDomNode());
629
- const gettingStartedPage = $('.gettingStarted', {}, this.categoriesPageScrollbar.getDomNode(), this.stepsSlide);
630
- this.container.appendChild(gettingStartedPage);
631
- this.categoriesPageScrollbar.scanDomNode();
632
- this.detailsPageScrollbar.scanDomNode();
633
- parent.appendChild(this.container);
634
- }
635
- async buildCategoriesSlide() {
636
- this.categoriesSlideDisposables.clear();
637
- const showOnStartupCheckbox = ( new Toggle({
638
- icon: Codicon.check,
639
- actionClassName: 'getting-started-checkbox',
640
- isChecked: this.configurationService.getValue(configurationKey) === 'welcomePage',
641
- title: ( localizeWithPath(
642
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
643
- 'checkboxTitle',
644
- "When checked, this page will be shown on startup."
645
- )),
646
- ...defaultToggleStyles
647
- }));
648
- showOnStartupCheckbox.domNode.id = 'showOnStartup';
649
- const showOnStartupLabel = $('label.caption', { for: 'showOnStartup' }, ( localizeWithPath(
650
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
651
- 'welcomePage.showOnStartup',
652
- "Show welcome page on startup"
653
- )));
654
- const onShowOnStartupChanged = () => {
655
- if (showOnStartupCheckbox.checked) {
656
- this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'showOnStartupChecked', argument: undefined, walkthroughId: this.currentWalkthrough?.id });
657
- this.configurationService.updateValue(configurationKey, 'welcomePage');
658
- }
659
- else {
660
- this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'showOnStartupUnchecked', argument: undefined, walkthroughId: this.currentWalkthrough?.id });
661
- this.configurationService.updateValue(configurationKey, 'none');
662
- }
663
- };
664
- this.categoriesSlideDisposables.add(showOnStartupCheckbox);
665
- this.categoriesSlideDisposables.add(showOnStartupCheckbox.onChange(() => {
666
- onShowOnStartupChanged();
667
- }));
668
- this.categoriesSlideDisposables.add(addDisposableListener(showOnStartupLabel, 'click', () => {
669
- showOnStartupCheckbox.checked = !showOnStartupCheckbox.checked;
670
- onShowOnStartupChanged();
671
- }));
672
- const header = $('.header', {}, $('h1.product-name.caption', {}, this.productService.nameLong), $('p.subtitle.description', {}, ( localizeWithPath(
673
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
674
- { key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] },
675
- "Editing evolved"
676
- ))));
677
- const leftColumn = $('.categories-column.categories-column-left', {});
678
- const rightColumn = $('.categories-column.categories-column-right', {});
679
- const startList = this.buildStartList();
680
- const recentList = this.buildRecentlyOpenedList();
681
- const gettingStartedList = this.buildGettingStartedWalkthroughsList();
682
- const footer = $('.footer', {}, $('p.showOnStartup', {}, showOnStartupCheckbox.domNode, showOnStartupLabel));
683
- const layoutLists = () => {
684
- if (gettingStartedList.itemCount) {
685
- this.container.classList.remove('noWalkthroughs');
686
- reset(rightColumn, gettingStartedList.getDomElement());
687
- }
688
- else {
689
- this.container.classList.add('noWalkthroughs');
690
- reset(rightColumn);
691
- }
692
- setTimeout(() => this.categoriesPageScrollbar?.scanDomNode(), 50);
693
- layoutRecentList();
694
- };
695
- const layoutRecentList = () => {
696
- if (this.container.classList.contains('noWalkthroughs') && this.container.classList.contains('noExtensions')) {
697
- recentList.setLimit(10);
698
- reset(leftColumn, startList.getDomElement());
699
- reset(rightColumn, recentList.getDomElement());
700
- }
701
- else {
702
- recentList.setLimit(5);
703
- reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
704
- }
705
- };
706
- gettingStartedList.onDidChange(layoutLists);
707
- layoutLists();
708
- reset(this.categoriesSlide, $('.gettingStartedCategoriesContainer', {}, header, leftColumn, rightColumn, footer));
709
- this.categoriesPageScrollbar?.scanDomNode();
710
- this.updateCategoryProgress();
711
- this.registerDispatchListeners();
712
- if (this.editorInput.selectedCategory) {
713
- this.currentWalkthrough = this.gettingStartedCategories.find(category => category.id === this.editorInput.selectedCategory);
714
- if (!this.currentWalkthrough) {
715
- this.gettingStartedCategories = this.gettingStartedService.getWalkthroughs();
716
- this.currentWalkthrough = this.gettingStartedCategories.find(category => category.id === this.editorInput.selectedCategory);
717
- if (this.currentWalkthrough) {
718
- this.buildCategorySlide(this.editorInput.selectedCategory, this.editorInput.selectedStep);
719
- this.setSlide('details');
720
- return;
721
- }
722
- }
723
- else {
724
- this.buildCategorySlide(this.editorInput.selectedCategory, this.editorInput.selectedStep);
725
- this.setSlide('details');
726
- return;
727
- }
728
- }
729
- const someStepsComplete = ( this.gettingStartedCategories.some(category => category.steps.find(s => s.done)));
730
- if (this.editorInput.showTelemetryNotice && this.productService.openToWelcomeMainPage) {
731
- const telemetryNotice = $('p.telemetry-notice');
732
- this.buildTelemetryFooter(telemetryNotice);
733
- footer.appendChild(telemetryNotice);
734
- }
735
- else if (!this.productService.openToWelcomeMainPage && !someStepsComplete && !this.hasScrolledToFirstCategory) {
736
- const firstSessionDateString = this.storageService.get(firstSessionDateStorageKey, -1 ) || ( new Date()).toUTCString();
737
- const daysSinceFirstSession = ((+( new Date())) - (+( new Date(firstSessionDateString)))) / 1000 / 60 / 60 / 24;
738
- const fistContentBehaviour = daysSinceFirstSession < 1 ? 'openToFirstCategory' : 'index';
739
- if (fistContentBehaviour === 'openToFirstCategory') {
740
- const first = this.gettingStartedCategories.filter(c => !c.when || this.contextService.contextMatchesRules(c.when))[0];
741
- this.hasScrolledToFirstCategory = true;
742
- if (first) {
743
- this.currentWalkthrough = first;
744
- this.editorInput.selectedCategory = this.currentWalkthrough?.id;
745
- this.buildCategorySlide(this.editorInput.selectedCategory, undefined);
746
- this.setSlide('details');
747
- return;
748
- }
749
- }
750
- }
751
- this.setSlide('categories');
752
- }
753
- buildRecentlyOpenedList() {
754
- const renderRecent = (recent) => {
755
- let fullPath;
756
- let windowOpenable;
757
- if (isRecentFolder(recent)) {
758
- windowOpenable = { folderUri: recent.folderUri };
759
- fullPath = recent.label || this.labelService.getWorkspaceLabel(recent.folderUri, { verbose: 2 });
760
- }
761
- else {
762
- fullPath = recent.label || this.labelService.getWorkspaceLabel(recent.workspace, { verbose: 2 });
763
- windowOpenable = { workspaceUri: recent.workspace.configPath };
764
- }
765
- const { name, parentPath } = splitRecentLabel(fullPath);
766
- const li = $('li');
767
- const link = $('button.button-link');
768
- link.innerText = name;
769
- link.title = fullPath;
770
- link.setAttribute('aria-label', ( localizeWithPath(
771
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
772
- 'welcomePage.openFolderWithPath',
773
- "Open folder {0} with path {1}",
774
- name,
775
- parentPath
776
- )));
777
- link.addEventListener('click', e => {
778
- this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'openRecent', argument: undefined, walkthroughId: this.currentWalkthrough?.id });
779
- this.hostService.openWindow([windowOpenable], {
780
- forceNewWindow: e.ctrlKey || e.metaKey,
781
- remoteAuthority: recent.remoteAuthority || null
782
- });
783
- e.preventDefault();
784
- e.stopPropagation();
785
- });
786
- li.appendChild(link);
787
- const span = $('span');
788
- span.classList.add('path');
789
- span.classList.add('detail');
790
- span.innerText = parentPath;
791
- span.title = fullPath;
792
- li.appendChild(span);
793
- return li;
794
- };
795
- if (this.recentlyOpenedList) {
796
- this.recentlyOpenedList.dispose();
797
- }
798
- const recentlyOpenedList = this.recentlyOpenedList = ( new GettingStartedIndexList({
799
- title: ( localizeWithPath(
800
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
801
- 'recent',
802
- "Recent"
803
- )),
804
- klass: 'recently-opened',
805
- limit: 5,
806
- empty: $('.empty-recent', {}, ( localizeWithPath(
807
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
808
- 'noRecents',
809
- "You have no recent folders,"
810
- )), $('button.button-link', { 'x-dispatch': 'openFolder' }, ( localizeWithPath(
811
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
812
- 'openFolder',
813
- "open a folder"
814
- ))), ( localizeWithPath(
815
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
816
- 'toStart',
817
- "to start."
818
- ))),
819
- more: $('.more', {}, $('button.button-link', {
820
- 'x-dispatch': 'showMoreRecents',
821
- title: ( localizeWithPath(
822
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
823
- 'show more recents',
824
- "Show All Recent Folders {0}",
825
- this.getKeybindingLabel(OpenRecentAction.ID)
826
- ))
827
- }, ( localizeWithPath(
828
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
829
- 'showAll',
830
- "More..."
831
- )))),
832
- renderElement: renderRecent,
833
- contextService: this.contextService
834
- }));
835
- recentlyOpenedList.onDidChange(() => this.registerDispatchListeners());
836
- this.recentlyOpened.then(({ workspaces }) => {
837
- const workspacesWithID = ( workspaces
838
- .filter(recent => !this.workspaceContextService.isCurrentWorkspace(isRecentWorkspace(recent) ? recent.workspace : recent.folderUri))
839
- .map(
840
- recent => ({ ...recent, id: isRecentWorkspace(recent) ? recent.workspace.id : ( recent.folderUri.toString()) })
841
- ));
842
- const updateEntries = () => {
843
- recentlyOpenedList.setEntries(workspacesWithID);
844
- };
845
- updateEntries();
846
- recentlyOpenedList.register(this.labelService.onDidChangeFormatters(() => updateEntries()));
847
- }).catch(onUnexpectedError);
848
- return recentlyOpenedList;
849
- }
850
- buildStartList() {
851
- const renderStartEntry = (entry) => $('li', {}, $('button.button-link', {
852
- 'x-dispatch': 'selectStartEntry:' + entry.id,
853
- title: entry.description + ' ' + this.getKeybindingLabel(entry.command),
854
- }, this.iconWidgetFor(entry), $('span', {}, entry.title)));
855
- if (this.startList) {
856
- this.startList.dispose();
857
- }
858
- const startList = this.startList = ( new GettingStartedIndexList({
859
- title: ( localizeWithPath(
860
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
861
- 'start',
862
- "Start"
863
- )),
864
- klass: 'start-container',
865
- limit: 10,
866
- renderElement: renderStartEntry,
867
- rankElement: e => -e.order,
868
- contextService: this.contextService
869
- }));
870
- startList.setEntries(parsedStartEntries);
871
- startList.onDidChange(() => this.registerDispatchListeners());
872
- return startList;
873
- }
874
- buildGettingStartedWalkthroughsList() {
875
- const renderGetttingStaredWalkthrough = (category) => {
876
- const renderNewBadge = (category.newItems || category.newEntry) && !category.isFeatured;
877
- const newBadge = $('.new-badge', {});
878
- if (category.newEntry) {
879
- reset(newBadge, $('.new-category', {}, ( localizeWithPath(
880
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
881
- 'new',
882
- "New"
883
- ))));
884
- }
885
- else if (category.newItems) {
886
- reset(newBadge, $('.new-items', {}, ( localizeWithPath(
887
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
888
- { key: 'newItems', comment: ['Shown when a list of items has changed based on an update from a remote source'] },
889
- "Updated"
890
- ))));
891
- }
892
- const featuredBadge = $('.featured-badge', {});
893
- const descriptionContent = $('.description-content', {});
894
- if (category.isFeatured) {
895
- reset(featuredBadge, $('.featured', {}, $('span.featured-icon.codicon.codicon-star-full')));
896
- reset(descriptionContent, ...renderLabelWithIcons(category.description));
897
- }
898
- const titleContent = $('h3.category-title.max-lines-3', { 'x-category-title-for': category.id });
899
- reset(titleContent, ...renderLabelWithIcons(category.title));
900
- return $('button.getting-started-category' + (category.isFeatured ? '.featured' : ''), {
901
- 'x-dispatch': 'selectCategory:' + category.id,
902
- 'title': category.description
903
- }, featuredBadge, $('.main-content', {}, this.iconWidgetFor(category), titleContent, renderNewBadge ? newBadge : $('.no-badge'), $('a.codicon.codicon-close.hide-category-button', {
904
- 'tabindex': 0,
905
- 'x-dispatch': 'hideCategory:' + category.id,
906
- 'title': ( localizeWithPath(
907
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
908
- 'close',
909
- "Hide"
910
- )),
911
- 'role': 'button',
912
- 'aria-label': ( localizeWithPath(
913
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
914
- 'closeAriaLabel',
915
- "Hide"
916
- )),
917
- })), descriptionContent, $('.category-progress', { 'x-data-category-id': category.id, }, $('.progress-bar-outer', { 'role': 'progressbar' }, $('.progress-bar-inner'))));
918
- };
919
- if (this.gettingStartedList) {
920
- this.gettingStartedList.dispose();
921
- }
922
- const rankWalkthrough = (e) => {
923
- let rank = e.order;
924
- if (e.isFeatured) {
925
- rank += 7;
926
- }
927
- if (e.newEntry) {
928
- rank += 3;
929
- }
930
- if (e.newItems) {
931
- rank += 2;
932
- }
933
- if (e.recencyBonus) {
934
- rank += 4 * e.recencyBonus;
935
- }
936
- if (( this.getHiddenCategories().has(e.id))) {
937
- rank = null;
938
- }
939
- return rank;
940
- };
941
- const gettingStartedList = this.gettingStartedList = ( new GettingStartedIndexList({
942
- title: ( localizeWithPath(
943
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
944
- 'walkthroughs',
945
- "Walkthroughs"
946
- )),
947
- klass: 'getting-started',
948
- limit: 5,
949
- footer: $('span.button-link.see-all-walkthroughs', { 'x-dispatch': 'seeAllWalkthroughs', 'tabindex': 0 }, ( localizeWithPath(
950
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
951
- 'showAll',
952
- "More..."
953
- ))),
954
- renderElement: renderGetttingStaredWalkthrough,
955
- rankElement: rankWalkthrough,
956
- contextService: this.contextService,
957
- }));
958
- gettingStartedList.onDidChange(() => {
959
- const hidden = this.getHiddenCategories();
960
- const someWalkthroughsHidden = hidden.size || gettingStartedList.itemCount < this.gettingStartedCategories.filter(c => this.contextService.contextMatchesRules(c.when)).length;
961
- this.container.classList.toggle('someWalkthroughsHidden', !!someWalkthroughsHidden);
962
- this.registerDispatchListeners();
963
- allWalkthroughsHiddenContext.bindTo(this.contextService).set(gettingStartedList.itemCount === 0);
964
- this.updateCategoryProgress();
965
- });
966
- gettingStartedList.setEntries(this.gettingStartedCategories);
967
- allWalkthroughsHiddenContext.bindTo(this.contextService).set(gettingStartedList.itemCount === 0);
968
- return gettingStartedList;
969
- }
970
- layout(size) {
971
- this.detailsScrollbar?.scanDomNode();
972
- this.categoriesPageScrollbar?.scanDomNode();
973
- this.detailsPageScrollbar?.scanDomNode();
974
- this.startList?.layout(size);
975
- this.gettingStartedList?.layout(size);
976
- this.recentlyOpenedList?.layout(size);
977
- if (this.editorInput?.selectedStep && this.currentMediaType) {
978
- this.mediaDisposables.clear();
979
- this.stepDisposables.clear();
980
- this.buildMediaComponent(this.editorInput.selectedStep);
981
- }
982
- this.layoutMarkdown?.();
983
- this.container.classList.toggle('height-constrained', size.height <= 600);
984
- this.container.classList.toggle('width-constrained', size.width <= 400);
985
- this.container.classList.toggle('width-semi-constrained', size.width <= 800);
986
- this.categoriesPageScrollbar?.scanDomNode();
987
- this.detailsPageScrollbar?.scanDomNode();
988
- this.detailsScrollbar?.scanDomNode();
989
- }
990
- updateCategoryProgress() {
991
- getWindow(this.container).document.querySelectorAll('.category-progress').forEach(element => {
992
- const categoryID = element.getAttribute('x-data-category-id');
993
- const category = this.gettingStartedCategories.find(category => category.id === categoryID);
994
- if (!category) {
995
- throw Error('Could not find category with ID ' + categoryID);
996
- }
997
- const stats = this.getWalkthroughCompletionStats(category);
998
- const bar = assertIsDefined(element.querySelector('.progress-bar-inner'));
999
- bar.setAttribute('aria-valuemin', '0');
1000
- bar.setAttribute('aria-valuenow', '' + stats.stepsComplete);
1001
- bar.setAttribute('aria-valuemax', '' + stats.stepsTotal);
1002
- const progress = (stats.stepsComplete / stats.stepsTotal) * 100;
1003
- bar.style.width = `${progress}%`;
1004
- element.parentElement.classList.toggle('no-progress', stats.stepsComplete === 0);
1005
- if (stats.stepsTotal === stats.stepsComplete) {
1006
- bar.title = ( localizeWithPath(
1007
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
1008
- 'gettingStarted.allStepsComplete',
1009
- "All {0} steps complete!",
1010
- stats.stepsComplete
1011
- ));
1012
- }
1013
- else {
1014
- bar.title = ( localizeWithPath(
1015
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
1016
- 'gettingStarted.someStepsComplete',
1017
- "{0} of {1} steps complete",
1018
- stats.stepsComplete,
1019
- stats.stepsTotal
1020
- ));
1021
- }
1022
- });
1023
- }
1024
- async scrollToCategory(categoryID, stepId) {
1025
- if (!( this.gettingStartedCategories.some(c => c.id === categoryID))) {
1026
- this.gettingStartedCategories = this.gettingStartedService.getWalkthroughs();
1027
- }
1028
- const ourCategory = this.gettingStartedCategories.find(c => c.id === categoryID);
1029
- if (!ourCategory) {
1030
- throw Error('Could not find category with ID: ' + categoryID);
1031
- }
1032
- this.inProgressScroll = this.inProgressScroll.then(async () => {
1033
- reset(this.stepsContent);
1034
- this.editorInput.selectedCategory = categoryID;
1035
- this.editorInput.selectedStep = stepId;
1036
- this.currentWalkthrough = ourCategory;
1037
- this.buildCategorySlide(categoryID);
1038
- this.setSlide('details');
1039
- });
1040
- }
1041
- iconWidgetFor(category) {
1042
- const widget = category.icon.type === 'icon' ? $(ThemeIcon.asCSSSelector(category.icon.icon)) : $('img.category-icon', { src: category.icon.path });
1043
- widget.classList.add('icon-widget');
1044
- return widget;
1045
- }
1046
- focusSideEditorGroup() {
1047
- const fullSize = this.group ? this.groupsService.getPart(this.group).contentDimension : undefined;
1048
- if (!fullSize || fullSize.width <= 700) {
1049
- return;
1050
- }
1051
- if (this.groupsService.count === 1) {
1052
- const sideGroup = this.groupsService.addGroup(this.groupsService.groups[0], 3 );
1053
- this.groupsService.activateGroup(sideGroup);
1054
- const gettingStartedSize = Math.floor(fullSize.width / 2);
1055
- const gettingStartedGroup = this.groupsService.getGroups(1 ).find(group => (group.activeEditor instanceof GettingStartedInput));
1056
- this.groupsService.setSize(assertIsDefined(gettingStartedGroup), { width: gettingStartedSize, height: fullSize.height });
1057
- }
1058
- const nonGettingStartedGroup = this.groupsService.getGroups(1 ).find(group => !(group.activeEditor instanceof GettingStartedInput));
1059
- if (nonGettingStartedGroup) {
1060
- this.groupsService.activateGroup(nonGettingStartedGroup);
1061
- nonGettingStartedGroup.focus();
1062
- }
1063
- }
1064
- runStepCommand(href) {
1065
- const isCommand = href.startsWith('command:');
1066
- const toSide = href.startsWith('command:toSide:');
1067
- const command = href.replace(/command:(toSide:)?/, 'command:');
1068
- this.telemetryService.publicLog2('gettingStarted.ActionExecuted', { command: 'runStepAction', argument: href, walkthroughId: this.currentWalkthrough?.id });
1069
- if (toSide) {
1070
- this.focusSideEditorGroup();
1071
- }
1072
- if (isCommand) {
1073
- const commandURI = ( URI.parse(command));
1074
- let args = [];
1075
- try {
1076
- args = parse(decodeURIComponent(commandURI.query));
1077
- }
1078
- catch {
1079
- try {
1080
- args = parse(commandURI.query);
1081
- }
1082
- catch {
1083
- }
1084
- }
1085
- if (!Array.isArray(args)) {
1086
- args = [args];
1087
- }
1088
- if ((commandURI.path === ( OpenFileFolderAction.ID.toString()) ||
1089
- commandURI.path === ( OpenFolderAction.ID.toString())) &&
1090
- this.workspaceContextService.getWorkspace().folders.length === 0) {
1091
- const selectedStepIndex = this.currentWalkthrough?.steps.findIndex(step => step.id === this.editorInput.selectedStep);
1092
- if (selectedStepIndex !== undefined &&
1093
- selectedStepIndex > -1 &&
1094
- this.currentWalkthrough?.steps.slice(selectedStepIndex + 1).some(step => !step.done)) {
1095
- const restoreData = { folder: UNKNOWN_EMPTY_WINDOW_WORKSPACE.id, category: this.editorInput.selectedCategory, step: this.editorInput.selectedStep };
1096
- this.storageService.store(restoreWalkthroughsConfigurationKey, JSON.stringify(restoreData), 0 , 1 );
1097
- }
1098
- }
1099
- this.commandService.executeCommand(commandURI.path, ...args).then(result => {
1100
- const toOpen = result?.openFolder;
1101
- if (toOpen) {
1102
- if (!URI.isUri(toOpen)) {
1103
- console.warn('Warn: Running walkthrough command', href, 'yielded non-URI `openFolder` result', toOpen, '. It will be disregarded.');
1104
- return;
1105
- }
1106
- const restoreData = { folder: ( toOpen.toString()), category: this.editorInput.selectedCategory, step: this.editorInput.selectedStep };
1107
- this.storageService.store(restoreWalkthroughsConfigurationKey, JSON.stringify(restoreData), 0 , 1 );
1108
- this.hostService.openWindow([{ folderUri: toOpen }]);
1109
- }
1110
- });
1111
- }
1112
- else {
1113
- this.openerService.open(command, { allowCommands: true });
1114
- }
1115
- if (!isCommand && (href.startsWith('https://') || href.startsWith('http://'))) {
1116
- this.gettingStartedService.progressByEvent('onLink:' + href);
1117
- }
1118
- }
1119
- buildStepMarkdownDescription(container, text) {
1120
- while (container.firstChild) {
1121
- container.removeChild(container.firstChild);
1122
- }
1123
- for (const linkedText of text) {
1124
- if (linkedText.nodes.length === 1 && typeof linkedText.nodes[0] !== 'string') {
1125
- const node = linkedText.nodes[0];
1126
- const buttonContainer = append(container, $('.button-container'));
1127
- const button = ( new Button(
1128
- buttonContainer,
1129
- { title: node.title, supportIcons: true, ...defaultButtonStyles }
1130
- ));
1131
- const isCommand = node.href.startsWith('command:');
1132
- const command = node.href.replace(/command:(toSide:)?/, 'command:');
1133
- button.label = node.label;
1134
- button.onDidClick(e => {
1135
- e.stopPropagation();
1136
- e.preventDefault();
1137
- this.runStepCommand(node.href);
1138
- }, null, this.detailsPageDisposables);
1139
- if (isCommand) {
1140
- const keybindingLabel = this.getKeybindingLabel(command);
1141
- if (keybindingLabel) {
1142
- container.appendChild($('span.shortcut-message', {}, ( localizeWithPath(
1143
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
1144
- 'gettingStarted.keyboardTip',
1145
- 'Tip: Use keyboard shortcut '
1146
- )), $('span.keybinding', {}, keybindingLabel)));
1147
- }
1148
- }
1149
- this.detailsPageDisposables.add(button);
1150
- }
1151
- else {
1152
- const p = append(container, $('p'));
1153
- for (const node of linkedText.nodes) {
1154
- if (typeof node === 'string') {
1155
- const labelWithIcon = renderLabelWithIcons(node);
1156
- for (const element of labelWithIcon) {
1157
- if (typeof element === 'string') {
1158
- p.appendChild(renderFormattedText(element, { inline: true, renderCodeSegments: true }));
1159
- }
1160
- else {
1161
- p.appendChild(element);
1162
- }
1163
- }
1164
- }
1165
- else {
1166
- const link = this.instantiationService.createInstance(Link, p, node, { opener: (href) => this.runStepCommand(href) });
1167
- this.detailsPageDisposables.add(link);
1168
- }
1169
- }
1170
- }
1171
- }
1172
- return container;
1173
- }
1174
- clearInput() {
1175
- this.stepDisposables.clear();
1176
- super.clearInput();
1177
- }
1178
- buildCategorySlide(categoryID, selectedStep) {
1179
- if (this.detailsScrollbar) {
1180
- this.detailsScrollbar.dispose();
1181
- }
1182
- this.extensionService.whenInstalledExtensionsRegistered().then(() => {
1183
- this.extensionService.activateByEvent(`onWalkthrough:${categoryID.replace(/[^#]+#/, '')}`);
1184
- });
1185
- this.detailsPageDisposables.clear();
1186
- this.mediaDisposables.clear();
1187
- const category = this.gettingStartedCategories.find(category => category.id === categoryID);
1188
- if (!category) {
1189
- throw Error('could not find category with ID ' + categoryID);
1190
- }
1191
- const categoryDescriptorComponent = $('.getting-started-category', {}, $('.category-description-container', {}, $('h2.category-title.max-lines-3', { 'x-category-title-for': category.id }, ...renderLabelWithIcons(category.title)), $('.category-description.description.max-lines-3', { 'x-category-description-for': category.id }, ...renderLabelWithIcons(category.description))));
1192
- const stepListContainer = $('.step-list-container');
1193
- this.detailsPageDisposables.add(addDisposableListener(stepListContainer, 'keydown', (e) => {
1194
- const event = ( new StandardKeyboardEvent(e));
1195
- const currentStepIndex = () => category.steps.findIndex(e => e.id === this.editorInput.selectedStep);
1196
- if (event.keyCode === 16 ) {
1197
- const toExpand = category.steps.filter((step, index) => index < currentStepIndex() && this.contextService.contextMatchesRules(step.when));
1198
- if (toExpand.length) {
1199
- this.selectStep(toExpand[toExpand.length - 1].id, false);
1200
- }
1201
- }
1202
- if (event.keyCode === 18 ) {
1203
- const toExpand = category.steps.find((step, index) => index > currentStepIndex() && this.contextService.contextMatchesRules(step.when));
1204
- if (toExpand) {
1205
- this.selectStep(toExpand.id, false);
1206
- }
1207
- }
1208
- }));
1209
- let renderedSteps = undefined;
1210
- const contextKeysToWatch = ( new Set(category.steps.flatMap(step => ( step.when.keys()))));
1211
- const buildStepList = () => {
1212
- category.steps.sort((a, b) => a.order - b.order);
1213
- const toRender = category.steps
1214
- .filter(step => this.contextService.contextMatchesRules(step.when));
1215
- if (equals(renderedSteps, toRender, (a, b) => a.id === b.id)) {
1216
- return;
1217
- }
1218
- renderedSteps = toRender;
1219
- reset(stepListContainer, ...( renderedSteps
1220
- .map(step => {
1221
- const codicon = $('.codicon' + (step.done ? '.complete' + ThemeIcon.asCSSSelector(gettingStartedCheckedCodicon) : ThemeIcon.asCSSSelector(gettingStartedUncheckedCodicon)), {
1222
- 'data-done-step-id': step.id,
1223
- 'x-dispatch': 'toggleStepCompletion:' + step.id,
1224
- 'role': 'checkbox',
1225
- 'tabindex': '0',
1226
- 'aria-checked': step.done ? 'true' : 'false'
1227
- });
1228
- const container = $('.step-description-container', { 'x-step-description-for': step.id });
1229
- this.buildStepMarkdownDescription(container, step.description);
1230
- const stepTitle = $('h3.step-title.max-lines-3', { 'x-step-title-for': step.id });
1231
- reset(stepTitle, ...renderLabelWithIcons(step.title));
1232
- const stepDescription = $('.step-container', {}, stepTitle, container);
1233
- if (step.media.type === 'image') {
1234
- stepDescription.appendChild($('.image-description', { 'aria-label': ( localizeWithPath(
1235
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
1236
- 'imageShowing',
1237
- "Image showing {0}",
1238
- step.media.altText
1239
- )) }));
1240
- }
1241
- return $('button.getting-started-step', {
1242
- 'x-dispatch': 'selectTask:' + step.id,
1243
- 'data-step-id': step.id,
1244
- 'aria-expanded': 'false',
1245
- 'aria-checked': step.done ? 'true' : 'false',
1246
- 'role': 'button',
1247
- }, codicon, stepDescription);
1248
- })));
1249
- };
1250
- buildStepList();
1251
- this.detailsPageDisposables.add(this.contextService.onDidChangeContext(e => {
1252
- if (e.affectsSome(contextKeysToWatch)) {
1253
- buildStepList();
1254
- this.registerDispatchListeners();
1255
- this.selectStep(this.editorInput.selectedStep, false);
1256
- }
1257
- }));
1258
- const showNextCategory = this.gettingStartedCategories.find(_category => _category.id === category.next);
1259
- const stepsContainer = $('.getting-started-detail-container', { 'role': 'list' }, stepListContainer, $('.done-next-container', {}, $('button.button-link.all-done', { 'x-dispatch': 'allDone' }, $('span.codicon.codicon-check-all'), ( localizeWithPath(
1260
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
1261
- 'allDone',
1262
- "Mark Done"
1263
- ))), ...(showNextCategory
1264
- ? [$('button.button-link.next', { 'x-dispatch': 'nextSection' }, ( localizeWithPath(
1265
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
1266
- 'nextOne',
1267
- "Next Section"
1268
- )), $('span.codicon.codicon-arrow-right'))]
1269
- : [])));
1270
- this.detailsScrollbar = this._register(( new DomScrollableElement(stepsContainer, { className: 'steps-container' })));
1271
- const stepListComponent = this.detailsScrollbar.getDomNode();
1272
- const categoryFooter = $('.getting-started-footer');
1273
- if (this.editorInput.showTelemetryNotice && getTelemetryLevel(this.configurationService) !== 0 && this.productService.enableTelemetry) {
1274
- this.buildTelemetryFooter(categoryFooter);
1275
- }
1276
- reset(this.stepsContent, categoryDescriptorComponent, stepListComponent, this.stepMediaComponent, categoryFooter);
1277
- const toExpand = category.steps.find(step => this.contextService.contextMatchesRules(step.when) && !step.done) ?? category.steps[0];
1278
- this.selectStep(selectedStep ?? toExpand.id, !selectedStep);
1279
- this.detailsScrollbar.scanDomNode();
1280
- this.detailsPageScrollbar?.scanDomNode();
1281
- this.registerDispatchListeners();
1282
- }
1283
- buildTelemetryFooter(parent) {
1284
- const mdRenderer = this.instantiationService.createInstance(MarkdownRenderer, {});
1285
- const privacyStatementCopy = ( localizeWithPath(
1286
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
1287
- 'privacy statement',
1288
- "privacy statement"
1289
- ));
1290
- const privacyStatementButton = `[${privacyStatementCopy}](command:workbench.action.openPrivacyStatementUrl)`;
1291
- const optOutCopy = ( localizeWithPath(
1292
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
1293
- 'optOut',
1294
- "opt out"
1295
- ));
1296
- const optOutButton = `[${optOutCopy}](command:settings.filterByTelemetry)`;
1297
- const text = ( localizeWithPath(
1298
- 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted',
1299
- { key: 'footer', comment: ['fist substitution is "vs code", second is "privacy statement", third is "opt out".'] },
1300
- "{0} collects usage data. Read our {1} and learn how to {2}.",
1301
- this.productService.nameShort,
1302
- privacyStatementButton,
1303
- optOutButton
1304
- ));
1305
- parent.append(mdRenderer.render({ value: text, isTrusted: true }).element);
1306
- mdRenderer.dispose();
1307
- }
1308
- getKeybindingLabel(command) {
1309
- command = command.replace(/^command:/, '');
1310
- const label = this.keybindingService.lookupKeybinding(command)?.getLabel();
1311
- if (!label) {
1312
- return '';
1313
- }
1314
- else {
1315
- return `(${label})`;
1316
- }
1317
- }
1318
- async scrollPrev() {
1319
- this.inProgressScroll = this.inProgressScroll.then(async () => {
1320
- this.currentWalkthrough = undefined;
1321
- this.editorInput.selectedCategory = undefined;
1322
- this.editorInput.selectedStep = undefined;
1323
- this.editorInput.showTelemetryNotice = false;
1324
- if (this.gettingStartedCategories.length !== this.gettingStartedList?.itemCount) {
1325
- this.buildCategoriesSlide();
1326
- }
1327
- this.selectStep(undefined);
1328
- this.setSlide('categories');
1329
- this.container.focus();
1330
- });
1331
- }
1332
- runSkip() {
1333
- this.commandService.executeCommand('workbench.action.closeActiveEditor');
1334
- }
1335
- escape() {
1336
- if (this.editorInput.selectedCategory) {
1337
- this.scrollPrev();
1338
- }
1339
- else {
1340
- this.runSkip();
1341
- }
1342
- }
1343
- setSlide(toEnable) {
1344
- const slideManager = assertIsDefined(this.container.querySelector('.gettingStarted'));
1345
- if (toEnable === 'categories') {
1346
- slideManager.classList.remove('showDetails');
1347
- slideManager.classList.add('showCategories');
1348
- this.container.querySelector('.prev-button.button-link').style.display = 'none';
1349
- this.container.querySelector('.gettingStartedSlideDetails').querySelectorAll('button').forEach(button => button.disabled = true);
1350
- this.container.querySelector('.gettingStartedSlideCategories').querySelectorAll('button').forEach(button => button.disabled = false);
1351
- this.container.querySelector('.gettingStartedSlideCategories').querySelectorAll('input').forEach(button => button.disabled = false);
1352
- }
1353
- else {
1354
- slideManager.classList.add('showDetails');
1355
- slideManager.classList.remove('showCategories');
1356
- this.container.querySelector('.prev-button.button-link').style.display = 'block';
1357
- this.container.querySelector('.gettingStartedSlideDetails').querySelectorAll('button').forEach(button => button.disabled = false);
1358
- this.container.querySelector('.gettingStartedSlideCategories').querySelectorAll('button').forEach(button => button.disabled = true);
1359
- this.container.querySelector('.gettingStartedSlideCategories').querySelectorAll('input').forEach(button => button.disabled = true);
1360
- }
1361
- }
1362
- focus() {
1363
- super.focus();
1364
- const active = this.container.ownerDocument.activeElement;
1365
- let parent = this.container.parentElement;
1366
- while (parent && parent !== active) {
1367
- parent = parent.parentElement;
1368
- }
1369
- if (parent) {
1370
- this.container.focus();
1371
- }
1372
- }
1373
- };
1374
- GettingStartedPage = GettingStartedPage_1 = ( __decorate([
1375
- ( __param(0, ICommandService)),
1376
- ( __param(1, IProductService)),
1377
- ( __param(2, IKeybindingService)),
1378
- ( __param(3, IWalkthroughsService)),
1379
- ( __param(4, IConfigurationService)),
1380
- ( __param(5, ITelemetryService)),
1381
- ( __param(6, ILanguageService)),
1382
- ( __param(7, IFileService)),
1383
- ( __param(8, IOpenerService)),
1384
- ( __param(9, IThemeService)),
1385
- ( __param(10, IStorageService)),
1386
- ( __param(11, IExtensionService)),
1387
- ( __param(12, IInstantiationService)),
1388
- ( __param(13, INotificationService)),
1389
- ( __param(14, IEditorGroupsService)),
1390
- ( __param(15, IContextKeyService)),
1391
- ( __param(16, IQuickInputService)),
1392
- ( __param(17, IWorkspacesService)),
1393
- ( __param(18, ILabelService)),
1394
- ( __param(19, IHostService)),
1395
- ( __param(20, IWebviewService)),
1396
- ( __param(21, IWorkspaceContextService)),
1397
- ( __param(22, IAccessibilityService))
1398
- ], GettingStartedPage));
1399
- class GettingStartedInputSerializer {
1400
- canSerialize(editorInput) {
1401
- return true;
1402
- }
1403
- serialize(editorInput) {
1404
- return JSON.stringify({ selectedCategory: editorInput.selectedCategory, selectedStep: editorInput.selectedStep });
1405
- }
1406
- deserialize(instantiationService, serializedEditorInput) {
1407
- try {
1408
- const { selectedCategory, selectedStep } = JSON.parse(serializedEditorInput);
1409
- return ( new GettingStartedInput({ selectedCategory, selectedStep }));
1410
- }
1411
- catch { }
1412
- return ( new GettingStartedInput({}));
1413
- }
1414
- }
1415
-
1416
- export { GettingStartedInputSerializer, GettingStartedPage, allWalkthroughsHiddenContext, inWelcomeContext };