@codingame/monaco-vscode-update-service-override 25.1.1 → 26.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.
@@ -5,7 +5,7 @@ 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 { ProductContribution, UpdateContribution, SwitchProductQualityContribution, RELEASE_NOTES_URL, showReleaseNotesInEditor, CONTEXT_UPDATE_STATE, DOWNLOAD_URL } from './update.js';
8
+ import { ProductContribution, UpdateContribution, SwitchProductQualityContribution, DefaultAccountUpdateContribution, RELEASE_NOTES_URL, showReleaseNotesInEditor, CONTEXT_UPDATE_STATE, DOWNLOAD_URL } from './update.js';
9
9
  import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
10
10
  import product from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/product';
11
11
  import { StateType } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update';
@@ -25,23 +25,27 @@ const workbench = ( Registry.as(Extensions.Workbench));
25
25
  workbench.registerWorkbenchContribution(ProductContribution, LifecyclePhase.Restored);
26
26
  workbench.registerWorkbenchContribution(UpdateContribution, LifecyclePhase.Restored);
27
27
  workbench.registerWorkbenchContribution(SwitchProductQualityContribution, LifecyclePhase.Restored);
28
+ workbench.registerWorkbenchContribution(DefaultAccountUpdateContribution, LifecyclePhase.Eventually);
28
29
  class ShowCurrentReleaseNotesAction extends Action2 {
29
30
  constructor() {
30
31
  super({
31
32
  id: ShowCurrentReleaseNotesActionId,
32
33
  title: {
33
- ...( localize2(12862, "Show Release Notes")),
34
- mnemonicTitle: ( localize(12863, "Show &&Release Notes")),
34
+ ...( localize2(13219, "Show Release Notes")),
35
+ mnemonicTitle: ( localize(13220, "Show &&Release Notes"))
36
+ },
37
+ category: {
38
+ value: product.nameShort,
39
+ original: product.nameShort
35
40
  },
36
- category: { value: product.nameShort, original: product.nameShort },
37
41
  f1: true,
38
42
  precondition: RELEASE_NOTES_URL,
39
43
  menu: [{
40
- id: MenuId.MenubarHelpMenu,
41
- group: '1_welcome',
42
- order: 5,
43
- when: RELEASE_NOTES_URL,
44
- }]
44
+ id: MenuId.MenubarHelpMenu,
45
+ group: "1_welcome",
46
+ order: 5,
47
+ when: RELEASE_NOTES_URL
48
+ }]
45
49
  });
46
50
  }
47
51
  async run(accessor) {
@@ -50,14 +54,12 @@ class ShowCurrentReleaseNotesAction extends Action2 {
50
54
  const openerService = accessor.get(IOpenerService);
51
55
  try {
52
56
  await showReleaseNotesInEditor(instantiationService, productService.version, false);
53
- }
54
- catch (err) {
57
+ } catch (err) {
55
58
  if (productService.releaseNotesUrl) {
56
59
  await openerService.open(( URI.parse(productService.releaseNotesUrl)));
57
- }
58
- else {
60
+ } else {
59
61
  throw ( new Error(( localize(
60
- 12864,
62
+ 13221,
61
63
  "This version of {0} does not have release notes online",
62
64
  productService.nameLong
63
65
  ))));
@@ -70,11 +72,11 @@ class ShowCurrentReleaseNotesFromCurrentFileAction extends Action2 {
70
72
  super({
71
73
  id: ShowCurrentReleaseNotesFromCurrentFileActionId,
72
74
  title: {
73
- ...( localize2(12865, "Open Current File as Release Notes")),
74
- mnemonicTitle: ( localize(12863, "Show &&Release Notes")),
75
+ ...( localize2(13222, "Open Current File as Release Notes")),
76
+ mnemonicTitle: ( localize(13220, "Show &&Release Notes"))
75
77
  },
76
- category: ( localize2(12866, "Developer")),
77
- f1: true,
78
+ category: ( localize2(13223, "Developer")),
79
+ f1: true
78
80
  });
79
81
  }
80
82
  async run(accessor) {
@@ -82,9 +84,8 @@ class ShowCurrentReleaseNotesFromCurrentFileAction extends Action2 {
82
84
  const productService = accessor.get(IProductService);
83
85
  try {
84
86
  await showReleaseNotesInEditor(instantiationService, productService.version, true);
85
- }
86
- catch (err) {
87
- throw ( new Error(( localize(12867, "Cannot open the current file as Release Notes"))));
87
+ } catch (err) {
88
+ throw ( new Error(( localize(13224, "Cannot open the current file as Release Notes"))));
88
89
  }
89
90
  }
90
91
  }
@@ -93,11 +94,14 @@ registerAction2(ShowCurrentReleaseNotesFromCurrentFileAction);
93
94
  class CheckForUpdateAction extends Action2 {
94
95
  constructor() {
95
96
  super({
96
- id: 'update.checkForUpdate',
97
- title: ( localize2(12868, 'Check for Updates...')),
98
- category: { value: product.nameShort, original: product.nameShort },
97
+ id: "update.checkForUpdate",
98
+ title: ( localize2(13225, "Check for Updates...")),
99
+ category: {
100
+ value: product.nameShort,
101
+ original: product.nameShort
102
+ },
99
103
  f1: true,
100
- precondition: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle)),
104
+ precondition: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle))
101
105
  });
102
106
  }
103
107
  async run(accessor) {
@@ -108,9 +112,12 @@ class CheckForUpdateAction extends Action2 {
108
112
  class DownloadUpdateAction extends Action2 {
109
113
  constructor() {
110
114
  super({
111
- id: 'update.downloadUpdate',
112
- title: ( localize2(12869, 'Download Update')),
113
- category: { value: product.nameShort, original: product.nameShort },
115
+ id: "update.downloadUpdate",
116
+ title: ( localize2(13226, "Download Update")),
117
+ category: {
118
+ value: product.nameShort,
119
+ original: product.nameShort
120
+ },
114
121
  f1: true,
115
122
  precondition: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.AvailableForDownload))
116
123
  });
@@ -122,9 +129,12 @@ class DownloadUpdateAction extends Action2 {
122
129
  class InstallUpdateAction extends Action2 {
123
130
  constructor() {
124
131
  super({
125
- id: 'update.installUpdate',
126
- title: ( localize2(12870, 'Install Update')),
127
- category: { value: product.nameShort, original: product.nameShort },
132
+ id: "update.installUpdate",
133
+ title: ( localize2(13227, "Install Update")),
134
+ category: {
135
+ value: product.nameShort,
136
+ original: product.nameShort
137
+ },
128
138
  f1: true,
129
139
  precondition: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Downloaded))
130
140
  });
@@ -136,9 +146,12 @@ class InstallUpdateAction extends Action2 {
136
146
  class RestartToUpdateAction extends Action2 {
137
147
  constructor() {
138
148
  super({
139
- id: 'update.restartToUpdate',
140
- title: ( localize2(12871, 'Restart to Update')),
141
- category: { value: product.nameShort, original: product.nameShort },
149
+ id: "update.restartToUpdate",
150
+ title: ( localize2(13228, "Restart to Update")),
151
+ category: {
152
+ value: product.nameShort,
153
+ original: product.nameShort
154
+ },
142
155
  f1: true,
143
156
  precondition: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Ready))
144
157
  });
@@ -148,17 +161,19 @@ class RestartToUpdateAction extends Action2 {
148
161
  }
149
162
  }
150
163
  class DownloadAction extends Action2 {
151
- static { this.ID = 'workbench.action.download'; }
164
+ static {
165
+ this.ID = "workbench.action.download";
166
+ }
152
167
  constructor() {
153
168
  super({
154
169
  id: DownloadAction.ID,
155
- title: ( localize2(12872, "Download {0}", product.nameLong)),
170
+ title: ( localize2(13229, "Download {0}", product.nameLong)),
156
171
  precondition: ( ContextKeyExpr.and(IsWebContext, DOWNLOAD_URL)),
157
172
  f1: true,
158
173
  menu: [{
159
- id: MenuId.StatusBarWindowIndicatorMenu,
160
- when: ( ContextKeyExpr.and(IsWebContext, DOWNLOAD_URL))
161
- }]
174
+ id: MenuId.StatusBarWindowIndicatorMenu,
175
+ when: ( ContextKeyExpr.and(IsWebContext, DOWNLOAD_URL))
176
+ }]
162
177
  });
163
178
  }
164
179
  run(accessor) {
@@ -178,8 +193,8 @@ if (isWindows) {
178
193
  class DeveloperApplyUpdateAction extends Action2 {
179
194
  constructor() {
180
195
  super({
181
- id: '_update.applyupdate',
182
- title: ( localize2(12873, 'Apply Update...')),
196
+ id: "_update.applyupdate",
197
+ title: ( localize2(13230, "Apply Update...")),
183
198
  category: Categories.Developer,
184
199
  f1: true,
185
200
  precondition: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle))
@@ -189,10 +204,13 @@ if (isWindows) {
189
204
  const updateService = accessor.get(IUpdateService);
190
205
  const fileDialogService = accessor.get(IFileDialogService);
191
206
  const updatePath = await fileDialogService.showOpenDialog({
192
- title: ( localize(12874, "Apply Update")),
193
- filters: [{ name: 'Setup', extensions: ['exe'] }],
207
+ title: ( localize(13231, "Apply Update")),
208
+ filters: [{
209
+ name: "Setup",
210
+ extensions: ["exe"]
211
+ }],
194
212
  canSelectFiles: true,
195
- openLabel: mnemonicButtonLabel(( localize(12875, "&&Update")))
213
+ openLabel: mnemonicButtonLabel(( localize(13232, "&&Update")))
196
214
  });
197
215
  if (!updatePath || !updatePath[0]) {
198
216
  return;
@@ -13,6 +13,7 @@ import { RawContextKey } from "@codingame/monaco-vscode-api/vscode/vs/platform/c
13
13
  import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
14
14
  import { IHostService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service";
15
15
  import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
16
+ import { IDefaultAccountService } from "@codingame/monaco-vscode-api/vscode/vs/platform/defaultAccount/common/defaultAccount.service";
16
17
  export declare const CONTEXT_UPDATE_STATE: RawContextKey<string>;
17
18
  export declare const MAJOR_MINOR_UPDATE_AVAILABLE: RawContextKey<boolean>;
18
19
  export declare const RELEASE_NOTES_URL: RawContextKey<string>;
@@ -36,6 +37,7 @@ export declare class UpdateContribution extends Disposable implements IWorkbench
36
37
  private readonly hostService;
37
38
  private state;
38
39
  private readonly badgeDisposable;
40
+ private overwriteNotificationHandle;
39
41
  private updateStateContextKey;
40
42
  private majorMinorUpdateAvailableContextKey;
41
43
  constructor(storageService: IStorageService, instantiationService: IInstantiationService, notificationService: INotificationService, dialogService: IDialogService, updateService: IUpdateService, activityService: IActivityService, contextKeyService: IContextKeyService, productService: IProductService, openerService: IOpenerService, configurationService: IConfigurationService, hostService: IHostService);
@@ -45,6 +47,7 @@ export declare class UpdateContribution extends Disposable implements IWorkbench
45
47
  private onUpdateAvailable;
46
48
  private onUpdateDownloaded;
47
49
  private onUpdateReady;
50
+ private onUpdateOverwriting;
48
51
  private shouldShowNotification;
49
52
  private registerGlobalActivityActions;
50
53
  }
@@ -54,3 +57,9 @@ export declare class SwitchProductQualityContribution extends Disposable impleme
54
57
  constructor(productService: IProductService, environmentService: IBrowserWorkbenchEnvironmentService);
55
58
  private registerGlobalActivityActions;
56
59
  }
60
+ export declare class DefaultAccountUpdateContribution extends Disposable implements IWorkbenchContribution {
61
+ private readonly updateService;
62
+ private readonly defaultAccountService;
63
+ constructor(updateService: IUpdateService, defaultAccountService: IDefaultAccountService);
64
+ private checkDefaultAccount;
65
+ }