@codingame/monaco-vscode-update-service-override 30.0.0 → 31.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/package.json +2 -2
- package/vscode/src/vs/platform/update/common/update.config.contribution.js +23 -46
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownSettingRenderer.js +14 -14
- package/vscode/src/vs/workbench/contrib/update/browser/media/postUpdateWidget.css +68 -0
- package/vscode/src/vs/workbench/contrib/update/browser/media/updateTitleBarEntry.css +2 -20
- package/vscode/src/vs/workbench/contrib/update/browser/media/updateTooltip.css +32 -26
- package/vscode/src/vs/workbench/contrib/update/browser/postUpdateWidget.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/update/browser/postUpdateWidget.js +219 -0
- package/vscode/src/vs/workbench/contrib/update/browser/releaseNotesEditor.d.ts +1 -7
- package/vscode/src/vs/workbench/contrib/update/browser/releaseNotesEditor.js +5 -177
- package/vscode/src/vs/workbench/contrib/update/browser/update.contribution.js +44 -17
- package/vscode/src/vs/workbench/contrib/update/browser/update.d.ts +1 -17
- package/vscode/src/vs/workbench/contrib/update/browser/update.js +40 -279
- package/vscode/src/vs/workbench/contrib/update/browser/updateTitleBarEntry.d.ts +5 -7
- package/vscode/src/vs/workbench/contrib/update/browser/updateTitleBarEntry.js +83 -78
- package/vscode/src/vs/workbench/contrib/update/browser/updateTooltip.d.ts +6 -12
- package/vscode/src/vs/workbench/contrib/update/browser/updateTooltip.js +83 -125
- package/vscode/src/vs/workbench/contrib/update/common/updateInfoParser.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/update/common/updateInfoParser.js +74 -0
- package/vscode/src/vs/workbench/contrib/update/common/updateUtils.js +9 -21
- package/vscode/src/vs/workbench/contrib/update/browser/media/updateStatusBarEntry.css +0 -9
- package/vscode/src/vs/workbench/contrib/update/browser/updateStatusBarEntry.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/update/browser/updateStatusBarEntry.js +0 -140
|
@@ -5,9 +5,11 @@ import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/regist
|
|
|
5
5
|
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
6
6
|
import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
|
|
7
7
|
import { Action2, MenuId, registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
8
|
+
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
9
|
+
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
8
10
|
import { ProductContribution, UpdateContribution, SwitchProductQualityContribution, DefaultAccountUpdateContribution, showReleaseNotesInEditor, CONTEXT_UPDATE_STATE } from './update.js';
|
|
9
|
-
import { UpdateStatusBarContribution } from './updateStatusBarEntry.js';
|
|
10
11
|
import { UpdateTitleBarContribution } from './updateTitleBarEntry.js';
|
|
12
|
+
import { PostUpdateWidgetContribution } from './postUpdateWidget.js';
|
|
11
13
|
import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
12
14
|
import product from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/product';
|
|
13
15
|
import { StateType } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update';
|
|
@@ -27,8 +29,8 @@ workbench.registerWorkbenchContribution(ProductContribution, LifecyclePhase.Rest
|
|
|
27
29
|
workbench.registerWorkbenchContribution(UpdateContribution, LifecyclePhase.Restored);
|
|
28
30
|
workbench.registerWorkbenchContribution(SwitchProductQualityContribution, LifecyclePhase.Restored);
|
|
29
31
|
workbench.registerWorkbenchContribution(DefaultAccountUpdateContribution, LifecyclePhase.Eventually);
|
|
30
|
-
workbench.registerWorkbenchContribution(UpdateStatusBarContribution, LifecyclePhase.Restored);
|
|
31
32
|
workbench.registerWorkbenchContribution(UpdateTitleBarContribution, LifecyclePhase.Restored);
|
|
33
|
+
workbench.registerWorkbenchContribution(PostUpdateWidgetContribution, LifecyclePhase.Restored);
|
|
32
34
|
class ShowReleaseNotesAction extends Action2 {
|
|
33
35
|
static {
|
|
34
36
|
this.AVAILABLE = !!product.releaseNotesUrl;
|
|
@@ -37,8 +39,8 @@ class ShowReleaseNotesAction extends Action2 {
|
|
|
37
39
|
super({
|
|
38
40
|
id: ShowCurrentReleaseNotesActionId,
|
|
39
41
|
title: {
|
|
40
|
-
...( localize2(
|
|
41
|
-
mnemonicTitle: ( localize(
|
|
42
|
+
...( localize2(14966, "Show Release Notes")),
|
|
43
|
+
mnemonicTitle: ( localize(14967, "Show &&Release Notes"))
|
|
42
44
|
},
|
|
43
45
|
category: {
|
|
44
46
|
value: product.nameShort,
|
|
@@ -64,7 +66,7 @@ class ShowReleaseNotesAction extends Action2 {
|
|
|
64
66
|
await openerService.open(( URI.parse(productService.releaseNotesUrl)));
|
|
65
67
|
} else {
|
|
66
68
|
throw ( new Error(( localize(
|
|
67
|
-
|
|
69
|
+
14968,
|
|
68
70
|
"This version of {0} does not have release notes online",
|
|
69
71
|
productService.nameLong
|
|
70
72
|
))));
|
|
@@ -77,10 +79,10 @@ class ShowCurrentReleaseNotesFromCurrentFileAction extends Action2 {
|
|
|
77
79
|
super({
|
|
78
80
|
id: ShowCurrentReleaseNotesFromCurrentFileActionId,
|
|
79
81
|
title: {
|
|
80
|
-
...( localize2(
|
|
81
|
-
mnemonicTitle: ( localize(
|
|
82
|
+
...( localize2(14969, "Open Current File as Release Notes")),
|
|
83
|
+
mnemonicTitle: ( localize(14967, "Show &&Release Notes"))
|
|
82
84
|
},
|
|
83
|
-
category: ( localize2(
|
|
85
|
+
category: ( localize2(14970, "Developer")),
|
|
84
86
|
f1: true
|
|
85
87
|
});
|
|
86
88
|
}
|
|
@@ -90,7 +92,7 @@ class ShowCurrentReleaseNotesFromCurrentFileAction extends Action2 {
|
|
|
90
92
|
try {
|
|
91
93
|
await showReleaseNotesInEditor(instantiationService, productService.version, true);
|
|
92
94
|
} catch (err) {
|
|
93
|
-
throw ( new Error(( localize(
|
|
95
|
+
throw ( new Error(( localize(14971, "Cannot open the current file as Release Notes"))));
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
}
|
|
@@ -102,7 +104,7 @@ class CheckForUpdateAction extends Action2 {
|
|
|
102
104
|
constructor() {
|
|
103
105
|
super({
|
|
104
106
|
id: "update.checkForUpdate",
|
|
105
|
-
title: ( localize2(
|
|
107
|
+
title: ( localize2(14972, "Check for Updates...")),
|
|
106
108
|
category: {
|
|
107
109
|
value: product.nameShort,
|
|
108
110
|
original: product.nameShort
|
|
@@ -120,7 +122,7 @@ class DownloadUpdateAction extends Action2 {
|
|
|
120
122
|
constructor() {
|
|
121
123
|
super({
|
|
122
124
|
id: "update.downloadUpdate",
|
|
123
|
-
title: ( localize2(
|
|
125
|
+
title: ( localize2(14973, "Download Update")),
|
|
124
126
|
category: {
|
|
125
127
|
value: product.nameShort,
|
|
126
128
|
original: product.nameShort
|
|
@@ -137,7 +139,7 @@ class InstallUpdateAction extends Action2 {
|
|
|
137
139
|
constructor() {
|
|
138
140
|
super({
|
|
139
141
|
id: "update.installUpdate",
|
|
140
|
-
title: ( localize2(
|
|
142
|
+
title: ( localize2(14974, "Install Update")),
|
|
141
143
|
category: {
|
|
142
144
|
value: product.nameShort,
|
|
143
145
|
original: product.nameShort
|
|
@@ -154,7 +156,7 @@ class RestartToUpdateAction extends Action2 {
|
|
|
154
156
|
constructor() {
|
|
155
157
|
super({
|
|
156
158
|
id: "update.restartToUpdate",
|
|
157
|
-
title: ( localize2(
|
|
159
|
+
title: ( localize2(14975, "Restart to Update")),
|
|
158
160
|
category: {
|
|
159
161
|
value: product.nameShort,
|
|
160
162
|
original: product.nameShort
|
|
@@ -177,7 +179,7 @@ class DownloadAction extends Action2 {
|
|
|
177
179
|
constructor() {
|
|
178
180
|
super({
|
|
179
181
|
id: DownloadAction.ID,
|
|
180
|
-
title: ( localize2(
|
|
182
|
+
title: ( localize2(14976, "Download {0}", product.nameLong)),
|
|
181
183
|
precondition: IsWebContext,
|
|
182
184
|
f1: true,
|
|
183
185
|
menu: [{
|
|
@@ -206,7 +208,7 @@ if (isWindows) {
|
|
|
206
208
|
constructor() {
|
|
207
209
|
super({
|
|
208
210
|
id: "_update.applyupdate",
|
|
209
|
-
title: ( localize2(
|
|
211
|
+
title: ( localize2(14977, "Apply Update...")),
|
|
210
212
|
category: Categories.Developer,
|
|
211
213
|
f1: true,
|
|
212
214
|
precondition: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle))
|
|
@@ -216,13 +218,13 @@ if (isWindows) {
|
|
|
216
218
|
const updateService = accessor.get(IUpdateService);
|
|
217
219
|
const fileDialogService = accessor.get(IFileDialogService);
|
|
218
220
|
const updatePath = await fileDialogService.showOpenDialog({
|
|
219
|
-
title: ( localize(
|
|
221
|
+
title: ( localize(14978, "Apply Update")),
|
|
220
222
|
filters: [{
|
|
221
223
|
name: "Setup",
|
|
222
224
|
extensions: ["exe"]
|
|
223
225
|
}],
|
|
224
226
|
canSelectFiles: true,
|
|
225
|
-
openLabel: mnemonicButtonLabel(( localize(
|
|
227
|
+
openLabel: mnemonicButtonLabel(( localize(14979, "&&Update")))
|
|
226
228
|
});
|
|
227
229
|
if (!updatePath || !updatePath[0]) {
|
|
228
230
|
return;
|
|
@@ -232,5 +234,30 @@ if (isWindows) {
|
|
|
232
234
|
}
|
|
233
235
|
registerAction2(DeveloperApplyUpdateAction);
|
|
234
236
|
}
|
|
237
|
+
registerAction2(class ShowUpdateInfoAction extends Action2 {
|
|
238
|
+
constructor() {
|
|
239
|
+
super({
|
|
240
|
+
id: "update.showUpdateInfo",
|
|
241
|
+
title: ( localize2(14980, "Show Update Info")),
|
|
242
|
+
category: Categories.Developer,
|
|
243
|
+
f1: true,
|
|
244
|
+
precondition: ( IsWebContext.negate())
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
async run(accessor) {
|
|
248
|
+
const commandService = accessor.get(ICommandService);
|
|
249
|
+
const quickInputService = accessor.get(IQuickInputService);
|
|
250
|
+
const markdown = await quickInputService.input({
|
|
251
|
+
prompt: ( localize(
|
|
252
|
+
14981,
|
|
253
|
+
"Enter markdown to render, or JSON with markdown/buttons (leave empty to load from URL)"
|
|
254
|
+
))
|
|
255
|
+
});
|
|
256
|
+
if (markdown === undefined) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
await commandService.executeCommand("_update.showUpdateInfo", markdown || undefined);
|
|
260
|
+
}
|
|
261
|
+
});
|
|
235
262
|
|
|
236
263
|
export { CheckForUpdateAction, ShowCurrentReleaseNotesFromCurrentFileAction, ShowReleaseNotesAction };
|
|
@@ -15,7 +15,6 @@ import { MenuId } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/
|
|
|
15
15
|
import { IHostService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service";
|
|
16
16
|
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
17
17
|
import { IDefaultAccountService } from "@codingame/monaco-vscode-api/vscode/vs/platform/defaultAccount/common/defaultAccount.service";
|
|
18
|
-
import { IWorkbenchLayoutService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service";
|
|
19
18
|
export declare const CONTEXT_UPDATE_STATE: RawContextKey<string>;
|
|
20
19
|
export declare const MAJOR_MINOR_UPDATE_AVAILABLE: RawContextKey<boolean>;
|
|
21
20
|
export declare function showReleaseNotesInEditor(instantiationService: IInstantiationService, version: string, useCurrentFile: boolean): Promise<boolean>;
|
|
@@ -31,34 +30,19 @@ export declare class ProductContribution implements IWorkbenchContribution {
|
|
|
31
30
|
constructor(storageService: IStorageService, instantiationService: IInstantiationService, notificationService: INotificationService, environmentService: IBrowserWorkbenchEnvironmentService, openerService: IOpenerService, configurationService: IConfigurationService, hostService: IHostService, productService: IProductService);
|
|
32
31
|
}
|
|
33
32
|
export declare class UpdateContribution extends Disposable implements IWorkbenchContribution {
|
|
34
|
-
private readonly storageService;
|
|
35
33
|
private readonly instantiationService;
|
|
36
|
-
private readonly notificationService;
|
|
37
34
|
private readonly dialogService;
|
|
38
35
|
private readonly updateService;
|
|
39
36
|
private readonly activityService;
|
|
40
|
-
private readonly contextKeyService;
|
|
41
37
|
private readonly productService;
|
|
42
|
-
private readonly openerService;
|
|
43
|
-
private readonly configurationService;
|
|
44
38
|
private readonly hostService;
|
|
45
|
-
private readonly layoutService;
|
|
46
39
|
private state;
|
|
47
40
|
private readonly badgeDisposable;
|
|
48
|
-
private overwriteNotificationHandle;
|
|
49
41
|
private updateStateContextKey;
|
|
50
42
|
private majorMinorUpdateAvailableContextKey;
|
|
51
|
-
|
|
52
|
-
constructor(storageService: IStorageService, instantiationService: IInstantiationService, notificationService: INotificationService, dialogService: IDialogService, updateService: IUpdateService, activityService: IActivityService, contextKeyService: IContextKeyService, productService: IProductService, openerService: IOpenerService, configurationService: IConfigurationService, hostService: IHostService, layoutService: IWorkbenchLayoutService);
|
|
53
|
-
private isTitleBarEnabled;
|
|
43
|
+
constructor(storageService: IStorageService, instantiationService: IInstantiationService, dialogService: IDialogService, updateService: IUpdateService, activityService: IActivityService, contextKeyService: IContextKeyService, productService: IProductService, hostService: IHostService);
|
|
54
44
|
private onUpdateStateChange;
|
|
55
|
-
private onError;
|
|
56
45
|
private onUpdateNotAvailable;
|
|
57
|
-
private onUpdateAvailable;
|
|
58
|
-
private onUpdateDownloaded;
|
|
59
|
-
private onUpdateReady;
|
|
60
|
-
private onUpdateOverwriting;
|
|
61
|
-
private shouldShowNotification;
|
|
62
46
|
private registerGlobalActivityActions;
|
|
63
47
|
}
|
|
64
48
|
export declare class SwitchProductQualityContribution extends Disposable implements IWorkbenchContribution {
|