@codingame/monaco-vscode-welcome-service-override 18.3.1 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -6
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.js +12 -12
- package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcomeContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcomeExtensionPoint.js +8 -8
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExpService.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExpService.js +0 -98
package/index.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import './vscode/src/vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution.js';
|
|
3
3
|
import './vscode/src/vs/workbench/contrib/welcomeViews/common/newFile.contribution.js';
|
|
4
|
-
import { IGettingStartedExperimentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExpService.service';
|
|
5
|
-
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
6
|
-
import { GettingStartedExperimentService } from './vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExpService.js';
|
|
7
4
|
|
|
8
5
|
function getServiceOverride() {
|
|
9
|
-
return {
|
|
10
|
-
[IGettingStartedExperimentService.toString()]: new SyncDescriptor(GettingStartedExperimentService, [], true)
|
|
11
|
-
};
|
|
6
|
+
return {};
|
|
12
7
|
}
|
|
13
8
|
|
|
14
9
|
export { getServiceOverride as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-welcome-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - welcome service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "19.0.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -3,7 +3,7 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
3
3
|
import { promiseWithResolvers } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
4
|
import { KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
5
5
|
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
-
import {
|
|
6
|
+
import { assertReturnsDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
7
7
|
import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
8
8
|
import { registerAction2, Action2, MenuId, MenuItemAction, MenuRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
9
9
|
import { IMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service';
|
|
@@ -17,13 +17,13 @@ import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/com
|
|
|
17
17
|
import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
18
18
|
|
|
19
19
|
var NewFileTemplatesManager_1;
|
|
20
|
-
const builtInSource = ( localize(
|
|
21
|
-
const category = ( localize2(
|
|
20
|
+
const builtInSource = ( localize(12313, "Built-In"));
|
|
21
|
+
const category = ( localize2(12314, 'Create'));
|
|
22
22
|
registerAction2(class extends Action2 {
|
|
23
23
|
constructor() {
|
|
24
24
|
super({
|
|
25
25
|
id: 'welcome.showNewFileEntries',
|
|
26
|
-
title: ( localize2(
|
|
26
|
+
title: ( localize2(12315, 'New File...')),
|
|
27
27
|
category,
|
|
28
28
|
f1: true,
|
|
29
29
|
keybinding: {
|
|
@@ -38,7 +38,7 @@ registerAction2(class extends Action2 {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
async run(accessor) {
|
|
41
|
-
return
|
|
41
|
+
return assertReturnsDefined(NewFileTemplatesManager.Instance).run();
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
let NewFileTemplatesManager = class NewFileTemplatesManager extends Disposable {
|
|
@@ -83,8 +83,8 @@ let NewFileTemplatesManager = class NewFileTemplatesManager extends Disposable {
|
|
|
83
83
|
const { promise: resultPromise, resolve: resolveResult } = promiseWithResolvers();
|
|
84
84
|
const disposables = ( new DisposableStore());
|
|
85
85
|
const qp = this.quickInputService.createQuickPick({ useSeparators: true });
|
|
86
|
-
qp.title = ( localize(
|
|
87
|
-
qp.placeholder = ( localize(
|
|
86
|
+
qp.title = ( localize(12316, "New File..."));
|
|
87
|
+
qp.placeholder = ( localize(12317, "Select File Type or Enter File Name..."));
|
|
88
88
|
qp.sortByLabel = false;
|
|
89
89
|
qp.matchOnDetail = true;
|
|
90
90
|
qp.matchOnDescription = true;
|
|
@@ -110,8 +110,8 @@ let NewFileTemplatesManager = class NewFileTemplatesManager extends Disposable {
|
|
|
110
110
|
return a.from.localeCompare(b.from);
|
|
111
111
|
};
|
|
112
112
|
const displayCategory = {
|
|
113
|
-
'file': ( localize(
|
|
114
|
-
'notebook': ( localize(
|
|
113
|
+
'file': ( localize(12318, "File")),
|
|
114
|
+
'notebook': ( localize(12319, "Notebook")),
|
|
115
115
|
};
|
|
116
116
|
const refreshQp = (entries) => {
|
|
117
117
|
const items = [];
|
|
@@ -136,7 +136,7 @@ let NewFileTemplatesManager = class NewFileTemplatesManager extends Disposable {
|
|
|
136
136
|
buttons: command ? [
|
|
137
137
|
{
|
|
138
138
|
iconClass: 'codicon codicon-gear',
|
|
139
|
-
tooltip: ( localize(
|
|
139
|
+
tooltip: ( localize(12320, "Configure Keybinding"))
|
|
140
140
|
}
|
|
141
141
|
] : [],
|
|
142
142
|
detail: '',
|
|
@@ -155,7 +155,7 @@ let NewFileTemplatesManager = class NewFileTemplatesManager extends Disposable {
|
|
|
155
155
|
const currentTextEntry = {
|
|
156
156
|
commandID: 'workbench.action.files.newFile',
|
|
157
157
|
commandArgs: { languageId: undefined, viewType: undefined, fileName: val },
|
|
158
|
-
title: ( localize(
|
|
158
|
+
title: ( localize(12321, "Create New File ({0})", val)),
|
|
159
159
|
group: 'file',
|
|
160
160
|
from: builtInSource,
|
|
161
161
|
};
|
|
@@ -196,7 +196,7 @@ MenuRegistry.appendMenuItem(MenuId.NewFile, {
|
|
|
196
196
|
group: 'file',
|
|
197
197
|
command: {
|
|
198
198
|
id: 'workbench.action.files.newUntitledFile',
|
|
199
|
-
title: ( localize(
|
|
199
|
+
title: ( localize(12322, "Text File"))
|
|
200
200
|
},
|
|
201
201
|
order: 1
|
|
202
202
|
});
|
|
@@ -54,7 +54,7 @@ function parseGroupAndOrder(welcome, contribution) {
|
|
|
54
54
|
if (welcome.group) {
|
|
55
55
|
if (!isProposedApiEnabled(contribution.description, 'contribViewsWelcome')) {
|
|
56
56
|
contribution.collector.warn(( localize(
|
|
57
|
-
|
|
57
|
+
12323,
|
|
58
58
|
"The viewsWelcome contribution in '{0}' requires 'enabledApiProposals: [\"contribViewsWelcome\"]' in order to use the 'group' proposed property.",
|
|
59
59
|
contribution.description.identifier.value
|
|
60
60
|
)));
|
|
@@ -18,12 +18,12 @@ const ViewIdentifierMap = {
|
|
|
18
18
|
const viewsWelcomeExtensionPointSchema = ( Object.freeze({
|
|
19
19
|
type: 'array',
|
|
20
20
|
description: ( localize(
|
|
21
|
-
|
|
21
|
+
12324,
|
|
22
22
|
"Contributed views welcome content. Welcome content will be rendered in tree based views whenever they have no meaningful content to display, ie. the File Explorer when no folder is open. Such content is useful as in-product documentation to drive users to use certain features before they are available. A good example would be a `Clone Repository` button in the File Explorer welcome view."
|
|
23
23
|
)),
|
|
24
24
|
items: {
|
|
25
25
|
type: 'object',
|
|
26
|
-
description: ( localize(
|
|
26
|
+
description: ( localize(12325, "Contributed welcome content for a specific view.")),
|
|
27
27
|
required: [
|
|
28
28
|
ViewsWelcomeExtensionPointFields.view,
|
|
29
29
|
ViewsWelcomeExtensionPointFields.contents
|
|
@@ -34,14 +34,14 @@ const viewsWelcomeExtensionPointSchema = ( Object.freeze({
|
|
|
34
34
|
{
|
|
35
35
|
type: 'string',
|
|
36
36
|
description: ( localize(
|
|
37
|
-
|
|
37
|
+
12326,
|
|
38
38
|
"Target view identifier for this welcome content. Only tree based views are supported."
|
|
39
39
|
))
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
type: 'string',
|
|
43
43
|
description: ( localize(
|
|
44
|
-
|
|
44
|
+
12326,
|
|
45
45
|
"Target view identifier for this welcome content. Only tree based views are supported."
|
|
46
46
|
)),
|
|
47
47
|
enum: ( Object.keys(ViewIdentifierMap))
|
|
@@ -51,22 +51,22 @@ const viewsWelcomeExtensionPointSchema = ( Object.freeze({
|
|
|
51
51
|
[ViewsWelcomeExtensionPointFields.contents]: {
|
|
52
52
|
type: 'string',
|
|
53
53
|
description: ( localize(
|
|
54
|
-
|
|
54
|
+
12327,
|
|
55
55
|
"Welcome content to be displayed. The format of the contents is a subset of Markdown, with support for links only."
|
|
56
56
|
)),
|
|
57
57
|
},
|
|
58
58
|
[ViewsWelcomeExtensionPointFields.when]: {
|
|
59
59
|
type: 'string',
|
|
60
|
-
description: ( localize(
|
|
60
|
+
description: ( localize(12328, "Condition when the welcome content should be displayed.")),
|
|
61
61
|
},
|
|
62
62
|
[ViewsWelcomeExtensionPointFields.group]: {
|
|
63
63
|
type: 'string',
|
|
64
|
-
description: ( localize(
|
|
64
|
+
description: ( localize(12329, "Group to which this welcome content belongs. Proposed API.")),
|
|
65
65
|
},
|
|
66
66
|
[ViewsWelcomeExtensionPointFields.enablement]: {
|
|
67
67
|
type: 'string',
|
|
68
68
|
description: ( localize(
|
|
69
|
-
|
|
69
|
+
12330,
|
|
70
70
|
"Condition when the welcome content buttons and command links should be enabled."
|
|
71
71
|
)),
|
|
72
72
|
},
|
package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExpService.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
-
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
3
|
-
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
4
|
-
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
5
|
-
import { IGettingStartedExperimentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExpService.service";
|
|
6
|
-
export interface IGettingStartedExperiment {
|
|
7
|
-
cohort: number;
|
|
8
|
-
experimentGroup: string;
|
|
9
|
-
walkthroughId: string;
|
|
10
|
-
iteration: number;
|
|
11
|
-
}
|
|
12
|
-
export declare enum GettingStartedExperimentGroup {
|
|
13
|
-
New = "newExp",
|
|
14
|
-
Control = "controlExp",
|
|
15
|
-
Default = "defaultExp"
|
|
16
|
-
}
|
|
17
|
-
export declare class GettingStartedExperimentService extends Disposable implements IGettingStartedExperimentService {
|
|
18
|
-
private readonly storageService;
|
|
19
|
-
private readonly telemetryService;
|
|
20
|
-
private readonly productService;
|
|
21
|
-
readonly _serviceBrand: undefined;
|
|
22
|
-
private readonly experiment;
|
|
23
|
-
constructor(storageService: IStorageService, telemetryService: ITelemetryService, productService: IProductService);
|
|
24
|
-
private getExperimentAllocation;
|
|
25
|
-
private getOrCreateExperiment;
|
|
26
|
-
private createNewExperiment;
|
|
27
|
-
private sendExperimentTelemetry;
|
|
28
|
-
getCurrentExperiment(): IGettingStartedExperiment | undefined;
|
|
29
|
-
}
|
package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExpService.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
5
|
-
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
6
|
-
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
7
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
8
|
-
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
9
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
|
-
|
|
11
|
-
const EXPERIMENT_STORAGE_KEY = 'gettingStartedExperiment';
|
|
12
|
-
var GettingStartedExperimentGroup;
|
|
13
|
-
(function (GettingStartedExperimentGroup) {
|
|
14
|
-
GettingStartedExperimentGroup["New"] = "newExp";
|
|
15
|
-
GettingStartedExperimentGroup["Control"] = "controlExp";
|
|
16
|
-
GettingStartedExperimentGroup["Default"] = "defaultExp";
|
|
17
|
-
})(GettingStartedExperimentGroup || (GettingStartedExperimentGroup = {}));
|
|
18
|
-
const STABLE_EXPERIMENT_GROUPS = [
|
|
19
|
-
{ name: GettingStartedExperimentGroup.New, min: 0.0, max: 0.2, iteration: 1, walkthroughId: 'NewWelcomeExperience' },
|
|
20
|
-
{ name: GettingStartedExperimentGroup.Control, min: 0.2, max: 0.4, iteration: 1, walkthroughId: 'Setup' },
|
|
21
|
-
{ name: GettingStartedExperimentGroup.Default, min: 0.4, max: 1, iteration: 1, walkthroughId: 'Setup' }
|
|
22
|
-
];
|
|
23
|
-
const INSIDERS_EXPERIMENT_GROUPS = [
|
|
24
|
-
{ name: GettingStartedExperimentGroup.New, min: 0.0, max: 0.3, iteration: 1, walkthroughId: 'NewWelcomeExperience' },
|
|
25
|
-
{ name: GettingStartedExperimentGroup.Control, min: 0.3, max: 0.6, iteration: 1, walkthroughId: 'Setup' },
|
|
26
|
-
{ name: GettingStartedExperimentGroup.Default, min: 0.6, max: 1, iteration: 1, walkthroughId: 'Setup' }
|
|
27
|
-
];
|
|
28
|
-
let GettingStartedExperimentService = class GettingStartedExperimentService extends Disposable {
|
|
29
|
-
constructor(storageService, telemetryService, productService) {
|
|
30
|
-
super();
|
|
31
|
-
this.storageService = storageService;
|
|
32
|
-
this.telemetryService = telemetryService;
|
|
33
|
-
this.productService = productService;
|
|
34
|
-
this.experiment = this.getOrCreateExperiment();
|
|
35
|
-
this.sendExperimentTelemetry();
|
|
36
|
-
}
|
|
37
|
-
getExperimentAllocation() {
|
|
38
|
-
const quality = this.productService.quality;
|
|
39
|
-
if (quality === 'stable') {
|
|
40
|
-
return STABLE_EXPERIMENT_GROUPS;
|
|
41
|
-
}
|
|
42
|
-
else if (quality === 'insider') {
|
|
43
|
-
return INSIDERS_EXPERIMENT_GROUPS;
|
|
44
|
-
}
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
getOrCreateExperiment() {
|
|
48
|
-
const storedExperiment = this.storageService.get(EXPERIMENT_STORAGE_KEY, StorageScope.APPLICATION);
|
|
49
|
-
if (storedExperiment) {
|
|
50
|
-
try {
|
|
51
|
-
return JSON.parse(storedExperiment);
|
|
52
|
-
}
|
|
53
|
-
catch (e) {
|
|
54
|
-
this.storageService.remove(EXPERIMENT_STORAGE_KEY, StorageScope.APPLICATION);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const newExperiment = this.createNewExperiment();
|
|
58
|
-
if (!newExperiment) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
this.storageService.store(EXPERIMENT_STORAGE_KEY, JSON.stringify(newExperiment), StorageScope.APPLICATION, StorageTarget.MACHINE);
|
|
62
|
-
return newExperiment;
|
|
63
|
-
}
|
|
64
|
-
createNewExperiment() {
|
|
65
|
-
const cohort = Math.random();
|
|
66
|
-
const experimentGroups = this.getExperimentAllocation();
|
|
67
|
-
if (!experimentGroups) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
for (const group of experimentGroups) {
|
|
71
|
-
if (cohort >= group.min && cohort < group.max) {
|
|
72
|
-
return { cohort, experimentGroup: group.name, walkthroughId: group.walkthroughId, iteration: group.iteration };
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
sendExperimentTelemetry() {
|
|
78
|
-
if (!this.experiment) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
this.telemetryService.publicLog2('gettingStarted.experimentCohort', {
|
|
82
|
-
cohort: this.experiment.cohort,
|
|
83
|
-
experimentGroup: this.experiment.experimentGroup,
|
|
84
|
-
iteration: this.experiment.iteration,
|
|
85
|
-
walkthroughId: this.experiment.walkthroughId
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
getCurrentExperiment() {
|
|
89
|
-
return this.experiment;
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
GettingStartedExperimentService = ( __decorate([
|
|
93
|
-
( __param(0, IStorageService)),
|
|
94
|
-
( __param(1, ITelemetryService)),
|
|
95
|
-
( __param(2, IProductService))
|
|
96
|
-
], GettingStartedExperimentService));
|
|
97
|
-
|
|
98
|
-
export { GettingStartedExperimentGroup, GettingStartedExperimentService };
|