@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
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
-
import { Disposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { isWeb } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
6
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
7
|
-
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
8
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
9
|
-
import { StateType } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update';
|
|
10
|
-
import { IUpdateService } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update.service';
|
|
11
|
-
import { ShowTooltipCommand, StatusbarAlignment } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
12
|
-
import { IStatusbarService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
13
|
-
import { computeProgressPercent, formatBytes } from '../common/updateUtils.js';
|
|
14
|
-
import * as updateStatusBarEntry from './media/updateStatusBarEntry.css';
|
|
15
|
-
import { UpdateTooltip } from './updateTooltip.js';
|
|
16
|
-
|
|
17
|
-
var UpdateStatusBarContribution_1;
|
|
18
|
-
registerCss(updateStatusBarEntry);
|
|
19
|
-
let UpdateStatusBarContribution = class UpdateStatusBarContribution extends Disposable {
|
|
20
|
-
static {
|
|
21
|
-
UpdateStatusBarContribution_1 = this;
|
|
22
|
-
}
|
|
23
|
-
static {
|
|
24
|
-
this.actionableStates = [StateType.AvailableForDownload, StateType.Downloaded, StateType.Ready];
|
|
25
|
-
}
|
|
26
|
-
constructor(
|
|
27
|
-
configurationService,
|
|
28
|
-
instantiationService,
|
|
29
|
-
statusbarService,
|
|
30
|
-
updateService
|
|
31
|
-
) {
|
|
32
|
-
super();
|
|
33
|
-
this.configurationService = configurationService;
|
|
34
|
-
this.statusbarService = statusbarService;
|
|
35
|
-
this.accessor = this._register(( new MutableDisposable()));
|
|
36
|
-
if (isWeb) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
this.tooltip = this._register(instantiationService.createInstance(UpdateTooltip, false));
|
|
40
|
-
this._register(updateService.onStateChange(this.onStateChange.bind(this)));
|
|
41
|
-
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
42
|
-
if (e.affectsConfiguration("update.statusBar") || e.affectsConfiguration("update.titleBar")) {
|
|
43
|
-
this.onStateChange(updateService.state);
|
|
44
|
-
}
|
|
45
|
-
}));
|
|
46
|
-
this.onStateChange(updateService.state);
|
|
47
|
-
}
|
|
48
|
-
onStateChange(state) {
|
|
49
|
-
const titleBarMode = this.configurationService.getValue("update.titleBar");
|
|
50
|
-
if (titleBarMode !== "none") {
|
|
51
|
-
this.accessor.clear();
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const mode = this.configurationService.getValue("update.statusBar");
|
|
55
|
-
if (mode === "hidden" || mode === "actionable" && !UpdateStatusBarContribution_1.actionableStates.includes(state.type)) {
|
|
56
|
-
this.accessor.clear();
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (this.lastStateType !== state.type) {
|
|
60
|
-
this.accessor.clear();
|
|
61
|
-
this.lastStateType = state.type;
|
|
62
|
-
}
|
|
63
|
-
this.tooltip.renderState(state);
|
|
64
|
-
switch (state.type) {
|
|
65
|
-
case StateType.CheckingForUpdates:
|
|
66
|
-
this.updateEntry("$(loading~spin) " + ( localize(14860, "Checking for updates...")), ( localize(14861, "Checking for updates")), ShowTooltipCommand);
|
|
67
|
-
break;
|
|
68
|
-
case StateType.AvailableForDownload:
|
|
69
|
-
this.updateEntry("$(circle-filled) " + ( localize(14862, "Update available, click to download.")), ( localize(14863, "Update available, click to download.")), "update.downloadNow");
|
|
70
|
-
break;
|
|
71
|
-
case StateType.Downloading:
|
|
72
|
-
this.updateEntry(this.getDownloadingText(state), ( localize(14864, "Downloading update")), ShowTooltipCommand);
|
|
73
|
-
break;
|
|
74
|
-
case StateType.Downloaded:
|
|
75
|
-
this.updateEntry("$(circle-filled) " + ( localize(14865, "Update downloaded, click to install.")), ( localize(14866, "Update downloaded, click to install.")), "update.install");
|
|
76
|
-
break;
|
|
77
|
-
case StateType.Updating:
|
|
78
|
-
this.updateEntry(this.getUpdatingText(state), undefined, ShowTooltipCommand);
|
|
79
|
-
break;
|
|
80
|
-
case StateType.Ready:
|
|
81
|
-
this.updateEntry("$(circle-filled) " + ( localize(14867, "Update is ready, click to restart.")), ( localize(14868, "Update is ready, click to restart.")), "update.restart");
|
|
82
|
-
break;
|
|
83
|
-
case StateType.Overwriting:
|
|
84
|
-
this.updateEntry("$(loading~spin) " + ( localize(14869, "Downloading update...")), ( localize(14870, "Downloading a newer update")), ShowTooltipCommand);
|
|
85
|
-
break;
|
|
86
|
-
default:
|
|
87
|
-
this.accessor.clear();
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
updateEntry(text, ariaLabel, command) {
|
|
92
|
-
const entry = {
|
|
93
|
-
text,
|
|
94
|
-
ariaLabel: ariaLabel ?? text,
|
|
95
|
-
name: ( localize(14871, "Update Status")),
|
|
96
|
-
tooltip: this.tooltip?.domNode,
|
|
97
|
-
command
|
|
98
|
-
};
|
|
99
|
-
if (this.accessor.value) {
|
|
100
|
-
this.accessor.value.update(entry);
|
|
101
|
-
} else {
|
|
102
|
-
this.accessor.value = this.statusbarService.addEntry(entry, "status.update", StatusbarAlignment.LEFT, -Number.MAX_VALUE);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
getDownloadingText(
|
|
106
|
-
{
|
|
107
|
-
downloadedBytes,
|
|
108
|
-
totalBytes
|
|
109
|
-
}
|
|
110
|
-
) {
|
|
111
|
-
if (downloadedBytes !== undefined && totalBytes !== undefined && totalBytes > 0) {
|
|
112
|
-
const percent = computeProgressPercent(downloadedBytes, totalBytes) ?? 0;
|
|
113
|
-
return "$(loading~spin) " + ( localize(
|
|
114
|
-
14872,
|
|
115
|
-
"Downloading update: {0} / {1} • {2}%",
|
|
116
|
-
formatBytes(downloadedBytes),
|
|
117
|
-
formatBytes(totalBytes),
|
|
118
|
-
percent
|
|
119
|
-
));
|
|
120
|
-
} else {
|
|
121
|
-
return "$(loading~spin) " + ( localize(14873, "Downloading update..."));
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
getUpdatingText(
|
|
125
|
-
{
|
|
126
|
-
currentProgress,
|
|
127
|
-
maxProgress
|
|
128
|
-
}
|
|
129
|
-
) {
|
|
130
|
-
const percentage = computeProgressPercent(currentProgress, maxProgress);
|
|
131
|
-
if (percentage !== undefined) {
|
|
132
|
-
return "$(loading~spin) " + ( localize(14874, "Installing update: {0}%", percentage));
|
|
133
|
-
} else {
|
|
134
|
-
return "$(loading~spin) " + ( localize(14875, "Installing update..."));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
UpdateStatusBarContribution = UpdateStatusBarContribution_1 = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IInstantiationService)), ( __param(2, IStatusbarService)), ( __param(3, IUpdateService))], UpdateStatusBarContribution));
|
|
139
|
-
|
|
140
|
-
export { UpdateStatusBarContribution };
|