Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GettingStartedService/Registry and initial getting started UI #111175

Merged
merged 8 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build/lib/i18n.resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@
{
"name": "vs/workbench/services/extensionRecommendations",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/gettingStarted",
"project": "vscode-workbench"
}
]
}
4 changes: 2 additions & 2 deletions src/vs/base/browser/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1373,8 +1373,8 @@ export function safeInnerHtml(node: HTMLElement, value: string): void {
const options = _extInsaneOptions({
allowedTags: ['a', 'button', 'blockquote', 'code', 'div', 'h1', 'h2', 'h3', 'input', 'label', 'li', 'p', 'pre', 'select', 'small', 'span', 'strong', 'textarea', 'ul', 'ol'],
allowedAttributes: {
'a': ['href'],
'button': ['data-href'],
'a': ['href', 'x-dispatch'],
'button': ['data-href', 'x-dispatch'],
'input': ['type', 'placeholder', 'checked', 'required'],
'label': ['for'],
'select': ['required'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
import { IQuickInputService, QuickPickInput } from 'vs/platform/quickinput/common/quickInput';
import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
import { DEFAULT_PRODUCT_ICON_THEME_ID } from 'vs/workbench/services/themes/browser/productIconThemeData';
import { IGettingStartedService } from 'vs/workbench/services/gettingStarted/common/gettingStartedService';

export class SelectColorThemeAction extends Action {

Expand All @@ -34,6 +35,7 @@ export class SelectColorThemeAction extends Action {
@IQuickInputService private readonly quickInputService: IQuickInputService,
@IWorkbenchThemeService private readonly themeService: IWorkbenchThemeService,
@IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService,
@IGettingStartedService private readonly gettingStartedService: IGettingStartedService,
@IViewletService private readonly viewletService: IViewletService
) {
super(id, label);
Expand Down Expand Up @@ -84,6 +86,7 @@ export class SelectColorThemeAction extends Action {
openExtensionViewlet(this.viewletService, `category:themes ${quickpick.value}`);
} else {
selectTheme(theme, true);
this.gettingStartedService.progressByEvent('themeSelected');
}
isCompleted = true;
quickpick.hide();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { localize } from 'vs/nls';
import { GettingStartedInputFactory, GettingStartedPage } from 'vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted';
import { Registry } from 'vs/platform/registry/common/platform';
import { Extensions as EditorInputExtensions, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor';
import { MenuId, registerAction2, Action2 } from 'vs/platform/actions/common/actions';
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration';
import product from 'vs/platform/product/common/product';

registerAction2(class extends Action2 {
constructor() {
super({
id: 'workbench.action.showGettingStarted',
title: localize('Getting Started', "Getting Started"),
category: localize('help', "Help"),
f1: true,
precondition: ContextKeyExpr.has('config.workbench.experimental.gettingStarted'),
menu: {
id: MenuId.MenubarHelpMenu,
when: ContextKeyExpr.has('config.workbench.experimental.gettingStarted'),
group: '1_welcome',
order: 2,
}
});
}

public run(accessor: ServicesAccessor) {
return accessor.get(IInstantiationService).createInstance(GettingStartedPage).openEditor();
}
});

Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactories).registerEditorInputFactory(GettingStartedInputFactory.ID, GettingStartedInputFactory);

if (product.quality !== 'stable') {
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
...workbenchConfigurationNodeBase,
properties: {
'workbench.experimental.gettingStarted': {
type: 'boolean',
description: localize('gettingStartedDescription', "Enables an experimental Getting Started page, accesible via the Help menu."),
default: false,
}
}
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

.file-icons-enabled .show-file-icons .vs_code_editor_getting_started\.md-name-file-icon.md-ext-file-icon.ext-file-icon.markdown-lang-file-icon.file-icon::before {
content: ' ';
background-image: url('../../../../browser/media/code-icon.svg');
}


.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide {
width: 100%;
position: absolute;
transition: left 0.25s;
left: 0;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.categories .header {
text-align: center;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.categories .title {
display: inline-block;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.categories .category-title {
margin-top: 6px;
margin-bottom: 2px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.categories .category-description-container {
width: 100%
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.categories .category-description {
font-size: 12pt;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.categories .category-progress {
margin-top: 6px;
font-size: 8pt;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.categories progress {
font-size: 12pt;
width: 100%;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.categories #getting-started-categories-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
width: 70%;
max-width: 900px;
margin: 20px auto;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide .getting-started-category {
width: 330px;
height: 100px;
text-align: left;
display: flex;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.categories .getting-started-category {
padding-right: 46px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide .getting-started-category .codicon {
margin: 10px 8px 0 0;
font-size: 32px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-category {
width: 330px;
height: 100px;
display: flex;
margin-left: 12px;

}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-category .codicon {
margin-left:0;
margin-top: 28px;
font-size: 22pt;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail #getting-started-detail-columns {
display: flex;
justify-content: center;
padding: 30px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-task {
width: 100%;
height: 26pt;
overflow: hidden;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-task.expanded {
width: 100%;
height: unset;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-task .task-description-container {
padding-left: 30px;
padding-right: 4px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-task .task-title {
margin-bottom: 4px;
font-size: 14pt;
}


.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-task .task-description {
font-size: 11pt;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-task .task-next {
float: right;
margin-top: 16px;
margin-right: 25px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-task .codicon.hidden {
display: none;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-task .codicon {
float: left;
font-size: 20pt;
position: relative;
top: -4px;
left: -1px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail .getting-started-task-action {
margin: 10px 0 0;
padding: 4px 8px;
font-size: 11pt;
min-width: 100px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail #getting-started-detail-left {
min-width: 330px;
width: 33%;
max-width: 400px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.detail #getting-started-detail-right {
width: 66%;
text-align: center;
padding: 35px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer button {
border: none;
margin: 10px;
color: inherit;
text-align: left;
padding: 10px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .prev-button {
position: absolute;
left: 0;
font-size: 12pt;
margin: 10px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .prev-button .codicon {
position: relative;
top: 2px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide .product-icon {
background-image: url('../../../../browser/media/code-icon.svg');
width: 75px;
height: 75px;
display: inline-block;
margin-right: 20px;
}


.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide .skip {
display: block;
width: 150px;
margin: 0 auto;
text-align: center;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide h1 {
font-size: 32pt;
font-weight: normal;
border-bottom: none;
margin-bottom: 0;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide h2 {
font-weight: normal;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide h3 {
font-weight: normal;
margin-top: 0;
margin-bottom: 0;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide .subtitle {
font-size: 18pt;
margin-top: 0;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .footer {
position: absolute;
text-align: center;
bottom: 0;
width: 100%;
margin-bottom: 20px;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.next {
left: 100%;
}

.monaco-workbench .part.editor > .content .walkThroughContent .gettingStartedContainer .gettingStartedSlide.prev {
left: -100%;
}
Loading