@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.
- package/package.json +2 -2
- package/vscode/src/vs/platform/update/common/update.config.contribution.js +62 -69
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownSettingRenderer.js +68 -59
- package/vscode/src/vs/workbench/contrib/update/browser/releaseNotesEditor.js +415 -392
- package/vscode/src/vs/workbench/contrib/update/browser/update.contribution.js +62 -44
- package/vscode/src/vs/workbench/contrib/update/browser/update.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/update/browser/update.js +315 -234
- package/vscode/src/vs/workbench/services/update/browser/updateService.d.ts +1 -0
- package/vscode/src/vs/workbench/services/update/browser/updateService.js +12 -12
|
@@ -38,7 +38,21 @@ import { asWebviewUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/c
|
|
|
38
38
|
|
|
39
39
|
registerCss(releasenoteseditor);
|
|
40
40
|
let ReleaseNotesManager = class ReleaseNotesManager extends Disposable {
|
|
41
|
-
constructor(
|
|
41
|
+
constructor(
|
|
42
|
+
_environmentService,
|
|
43
|
+
_keybindingService,
|
|
44
|
+
_languageService,
|
|
45
|
+
_openerService,
|
|
46
|
+
_requestService,
|
|
47
|
+
_configurationService,
|
|
48
|
+
_editorService,
|
|
49
|
+
_editorGroupService,
|
|
50
|
+
_codeEditorService,
|
|
51
|
+
_webviewWorkbenchService,
|
|
52
|
+
_extensionService,
|
|
53
|
+
_productService,
|
|
54
|
+
_instantiationService
|
|
55
|
+
) {
|
|
42
56
|
super();
|
|
43
57
|
this._environmentService = _environmentService;
|
|
44
58
|
this._keybindingService = _keybindingService;
|
|
@@ -58,8 +72,12 @@ let ReleaseNotesManager = class ReleaseNotesManager extends Disposable {
|
|
|
58
72
|
this._register(TokenizationRegistry.onDidChange(() => {
|
|
59
73
|
return this.updateHtml();
|
|
60
74
|
}));
|
|
61
|
-
this._register(
|
|
62
|
-
|
|
75
|
+
this._register(
|
|
76
|
+
_configurationService.onDidChangeConfiguration(e => this.onDidChangeConfiguration(e))
|
|
77
|
+
);
|
|
78
|
+
this._register(
|
|
79
|
+
_webviewWorkbenchService.onDidChangeActiveWebviewEditor(e => this.onDidChangeActiveWebviewEditor(e))
|
|
80
|
+
);
|
|
63
81
|
this._simpleSettingRenderer = this._instantiationService.createInstance(SimpleSettingRenderer);
|
|
64
82
|
}
|
|
65
83
|
async updateHtml() {
|
|
@@ -78,41 +96,51 @@ let ReleaseNotesManager = class ReleaseNotesManager extends Disposable {
|
|
|
78
96
|
return dirname(currentFileUri);
|
|
79
97
|
}
|
|
80
98
|
}
|
|
81
|
-
return ( URI.parse(
|
|
99
|
+
return ( URI.parse("https://code.visualstudio.com/raw"));
|
|
82
100
|
}
|
|
83
101
|
async show(version, useCurrentFile) {
|
|
84
102
|
const releaseNoteText = await this.loadReleaseNotes(version, useCurrentFile);
|
|
85
103
|
const base = await this.getBase(useCurrentFile);
|
|
86
|
-
this._lastMeta = {
|
|
104
|
+
this._lastMeta = {
|
|
105
|
+
text: releaseNoteText,
|
|
106
|
+
base
|
|
107
|
+
};
|
|
87
108
|
const html = await this.renderBody(this._lastMeta);
|
|
88
|
-
const title = ( localize(
|
|
109
|
+
const title = ( localize(13216, "Release Notes: {0}", version));
|
|
89
110
|
const activeEditorPane = this._editorService.activeEditorPane;
|
|
90
111
|
if (this._currentReleaseNotes) {
|
|
91
112
|
this._currentReleaseNotes.setWebviewTitle(title);
|
|
92
113
|
this._currentReleaseNotes.webview.setHtml(html);
|
|
93
|
-
this._webviewWorkbenchService.revealWebview(
|
|
94
|
-
|
|
95
|
-
|
|
114
|
+
this._webviewWorkbenchService.revealWebview(
|
|
115
|
+
this._currentReleaseNotes,
|
|
116
|
+
activeEditorPane ? activeEditorPane.group : this._editorGroupService.activeGroup,
|
|
117
|
+
false
|
|
118
|
+
);
|
|
119
|
+
} else {
|
|
96
120
|
this._currentReleaseNotes = this._webviewWorkbenchService.openWebview({
|
|
97
121
|
title,
|
|
98
122
|
options: {
|
|
99
123
|
tryRestoreScrollPosition: true,
|
|
100
124
|
enableFindWidget: true,
|
|
101
|
-
disableServiceWorker: useCurrentFile ? false : true
|
|
125
|
+
disableServiceWorker: useCurrentFile ? false : true
|
|
102
126
|
},
|
|
103
127
|
contentOptions: {
|
|
104
128
|
localResourceRoots: useCurrentFile ? [base] : [],
|
|
105
129
|
allowScripts: true
|
|
106
130
|
},
|
|
107
131
|
extension: undefined
|
|
108
|
-
},
|
|
132
|
+
}, "releaseNotes", title, undefined, {
|
|
133
|
+
group: ACTIVE_GROUP,
|
|
134
|
+
preserveFocus: false
|
|
135
|
+
});
|
|
109
136
|
const disposables = ( new DisposableStore());
|
|
110
|
-
disposables.add(
|
|
137
|
+
disposables.add(
|
|
138
|
+
this._currentReleaseNotes.webview.onDidClickLink(uri => this.onDidClickLink(( URI.parse(uri))))
|
|
139
|
+
);
|
|
111
140
|
disposables.add(this._currentReleaseNotes.webview.onMessage(e => {
|
|
112
|
-
if (e.message.type ===
|
|
113
|
-
this._configurationService.updateValue(
|
|
114
|
-
}
|
|
115
|
-
else if (e.message.type === 'clickSetting') {
|
|
141
|
+
if (e.message.type === "showReleaseNotes") {
|
|
142
|
+
this._configurationService.updateValue("update.showReleaseNotes", e.message.value);
|
|
143
|
+
} else if (e.message.type === "clickSetting") {
|
|
116
144
|
const x = this._currentReleaseNotes?.webview.container.offsetLeft + e.message.value.x;
|
|
117
145
|
const y = this._currentReleaseNotes?.webview.container.offsetTop + e.message.value.y;
|
|
118
146
|
this._simpleSettingRenderer.updateSetting(( URI.parse(e.message.value.uri)), x, y);
|
|
@@ -129,16 +157,16 @@ let ReleaseNotesManager = class ReleaseNotesManager extends Disposable {
|
|
|
129
157
|
async loadReleaseNotes(version, useCurrentFile) {
|
|
130
158
|
const match = /^(\d+\.\d+)\./.exec(version);
|
|
131
159
|
if (!match) {
|
|
132
|
-
throw ( new Error(
|
|
160
|
+
throw ( new Error("not found"));
|
|
133
161
|
}
|
|
134
|
-
const versionLabel = match[1].replace(/\./g,
|
|
135
|
-
const baseUrl =
|
|
162
|
+
const versionLabel = match[1].replace(/\./g, "_");
|
|
163
|
+
const baseUrl = "https://code.visualstudio.com/raw";
|
|
136
164
|
const url = `${baseUrl}/v${versionLabel}.md`;
|
|
137
|
-
const unassigned = ( localize(
|
|
138
|
-
const escapeMdHtml =
|
|
139
|
-
return escape(text).replace(/\\/g,
|
|
165
|
+
const unassigned = ( localize(13217, "unassigned"));
|
|
166
|
+
const escapeMdHtml = text => {
|
|
167
|
+
return escape(text).replace(/\\/g, "\\\\");
|
|
140
168
|
};
|
|
141
|
-
const patchKeybindings =
|
|
169
|
+
const patchKeybindings = text => {
|
|
142
170
|
const kb = (match, kb) => {
|
|
143
171
|
const keybinding = this._keybindingService.lookupKeybinding(kb);
|
|
144
172
|
if (!keybinding) {
|
|
@@ -165,28 +193,30 @@ let ReleaseNotesManager = class ReleaseNotesManager extends Disposable {
|
|
|
165
193
|
const resolved = kbstyle(match, binding);
|
|
166
194
|
return resolved ? `<code title="${binding}">${escapeMdHtml(resolved)}</code>` : resolved;
|
|
167
195
|
};
|
|
168
|
-
return text
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
196
|
+
return text.replace(/`kb\(([a-z.\d\-]+)\)`/gi, kbCode).replace(/`kbstyle\(([^\)]+)\)`/gi, kbstyleCode).replace(
|
|
197
|
+
/kb\(([a-z.\d\-]+)\)/gi,
|
|
198
|
+
(match, binding) => escapeMarkdownSyntaxTokens(kb(match, binding))
|
|
199
|
+
).replace(
|
|
200
|
+
/kbstyle\(([^\)]+)\)/gi,
|
|
201
|
+
(match, binding) => escapeMarkdownSyntaxTokens(kbstyle(match, binding))
|
|
202
|
+
);
|
|
173
203
|
};
|
|
174
204
|
const fetchReleaseNotes = async () => {
|
|
175
205
|
let text;
|
|
176
206
|
try {
|
|
177
207
|
if (useCurrentFile) {
|
|
178
208
|
const file = this._codeEditorService.getActiveCodeEditor()?.getModel()?.getValue();
|
|
179
|
-
text = file ? file.substring(file.indexOf(
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
209
|
+
text = file ? file.substring(file.indexOf("#")) : undefined;
|
|
210
|
+
} else {
|
|
211
|
+
text = await asTextOrError(await this._requestService.request({
|
|
212
|
+
url
|
|
213
|
+
}, CancellationToken.None));
|
|
183
214
|
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
throw ( new Error('Failed to fetch release notes'));
|
|
215
|
+
} catch {
|
|
216
|
+
throw ( new Error("Failed to fetch release notes"));
|
|
187
217
|
}
|
|
188
218
|
if (!text || (!/^#\s/.test(text) && !useCurrentFile)) {
|
|
189
|
-
throw ( new Error(
|
|
219
|
+
throw ( new Error("Invalid release notes"));
|
|
190
220
|
}
|
|
191
221
|
return patchKeybindings(text);
|
|
192
222
|
};
|
|
@@ -197,8 +227,7 @@ let ReleaseNotesManager = class ReleaseNotesManager extends Disposable {
|
|
|
197
227
|
this._releaseNotesCache.set(version, (async () => {
|
|
198
228
|
try {
|
|
199
229
|
return await fetchReleaseNotes();
|
|
200
|
-
}
|
|
201
|
-
catch (err) {
|
|
230
|
+
} catch (err) {
|
|
202
231
|
this._releaseNotesCache.delete(version);
|
|
203
232
|
throw err;
|
|
204
233
|
}
|
|
@@ -207,345 +236,352 @@ let ReleaseNotesManager = class ReleaseNotesManager extends Disposable {
|
|
|
207
236
|
return this._releaseNotesCache.get(version);
|
|
208
237
|
}
|
|
209
238
|
async onDidClickLink(uri) {
|
|
210
|
-
if (uri.scheme === Schemas.codeSetting)
|
|
211
|
-
|
|
212
|
-
this.addGAParameters(uri,
|
|
213
|
-
|
|
214
|
-
|
|
239
|
+
if (uri.scheme === Schemas.codeSetting)
|
|
240
|
+
; else {
|
|
241
|
+
this.addGAParameters(uri, "ReleaseNotes").then(updated => this._openerService.open(updated, {
|
|
242
|
+
allowCommands: ["workbench.action.openSettings", "summarize.release.notes"]
|
|
243
|
+
})).then(undefined, onUnexpectedError);
|
|
215
244
|
}
|
|
216
245
|
}
|
|
217
|
-
async addGAParameters(uri, origin, experiment =
|
|
246
|
+
async addGAParameters(uri, origin, experiment = "1") {
|
|
218
247
|
if (supportsTelemetry(this._productService, this._environmentService) && getTelemetryLevel(this._configurationService) === TelemetryLevel.USAGE) {
|
|
219
|
-
if (uri.scheme ===
|
|
220
|
-
return uri.with({
|
|
248
|
+
if (uri.scheme === "https" && uri.authority === "code.visualstudio.com") {
|
|
249
|
+
return uri.with({
|
|
250
|
+
query: `${uri.query ? uri.query + "&" : ""}utm_source=VsCode&utm_medium=${encodeURIComponent(origin)}&utm_content=${encodeURIComponent(experiment)}`
|
|
251
|
+
});
|
|
221
252
|
}
|
|
222
253
|
}
|
|
223
254
|
return uri;
|
|
224
255
|
}
|
|
225
256
|
async renderBody(fileContent) {
|
|
226
257
|
const nonce = generateUuid();
|
|
227
|
-
const processedContent = await renderReleaseNotesMarkdown(
|
|
258
|
+
const processedContent = await renderReleaseNotesMarkdown(
|
|
259
|
+
fileContent.text,
|
|
260
|
+
this._extensionService,
|
|
261
|
+
this._languageService,
|
|
262
|
+
this._simpleSettingRenderer
|
|
263
|
+
);
|
|
228
264
|
const colorMap = TokenizationRegistry.getColorMap();
|
|
229
|
-
const css = colorMap ? generateTokensCSSForColorMap(colorMap) :
|
|
230
|
-
const showReleaseNotes = Boolean(this._configurationService.getValue(
|
|
265
|
+
const css = colorMap ? generateTokensCSSForColorMap(colorMap) : "";
|
|
266
|
+
const showReleaseNotes = Boolean(this._configurationService.getValue("update.showReleaseNotes"));
|
|
231
267
|
return `<!DOCTYPE html>
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
268
|
+
<html>
|
|
269
|
+
<head>
|
|
270
|
+
<base href="${( asWebviewUri(fileContent.base).toString(true))}/" >
|
|
271
|
+
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
|
|
272
|
+
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src https: data:; media-src https:; style-src 'nonce-${nonce}' https://code.visualstudio.com; script-src 'nonce-${nonce}';">
|
|
273
|
+
<style nonce="${nonce}">
|
|
274
|
+
${DEFAULT_MARKDOWN_STYLES}
|
|
275
|
+
${css}
|
|
276
|
+
|
|
277
|
+
/* codesetting */
|
|
278
|
+
|
|
279
|
+
code:has(.codesetting) {
|
|
280
|
+
background-color: var(--vscode-textPreformat-background);
|
|
281
|
+
color: var(--vscode-textPreformat-foreground);
|
|
282
|
+
padding-left: 1px;
|
|
283
|
+
margin-right: 3px;
|
|
284
|
+
padding-right: 0px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
code:has(.codesetting):focus {
|
|
288
|
+
border: 1px solid var(--vscode-button-border, transparent);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.codesetting {
|
|
292
|
+
color: var(--vscode-textPreformat-foreground);
|
|
293
|
+
padding: 0px 1px 1px 0px;
|
|
294
|
+
font-size: 0px;
|
|
295
|
+
overflow: hidden;
|
|
296
|
+
text-overflow: ellipsis;
|
|
297
|
+
outline-offset: 2px !important;
|
|
298
|
+
box-sizing: border-box;
|
|
299
|
+
text-align: center;
|
|
300
|
+
cursor: pointer;
|
|
301
|
+
display: inline;
|
|
302
|
+
margin-right: 3px;
|
|
303
|
+
}
|
|
304
|
+
.codesetting svg {
|
|
305
|
+
font-size: 12px;
|
|
306
|
+
text-align: center;
|
|
307
|
+
cursor: pointer;
|
|
308
|
+
border: 1px solid var(--vscode-button-secondaryBorder, transparent);
|
|
309
|
+
outline: 1px solid transparent;
|
|
310
|
+
line-height: 9px;
|
|
311
|
+
margin-bottom: -5px;
|
|
312
|
+
padding-left: 0px;
|
|
313
|
+
padding-top: 2px;
|
|
314
|
+
padding-bottom: 2px;
|
|
315
|
+
padding-right: 2px;
|
|
316
|
+
display: inline-block;
|
|
317
|
+
text-decoration: none;
|
|
318
|
+
text-rendering: auto;
|
|
319
|
+
text-transform: none;
|
|
320
|
+
-webkit-font-smoothing: antialiased;
|
|
321
|
+
-moz-osx-font-smoothing: grayscale;
|
|
322
|
+
user-select: none;
|
|
323
|
+
-webkit-user-select: none;
|
|
324
|
+
}
|
|
325
|
+
.codesetting .setting-name {
|
|
326
|
+
font-size: 13px;
|
|
327
|
+
padding-left: 2px;
|
|
328
|
+
padding-right: 3px;
|
|
329
|
+
padding-top: 1px;
|
|
330
|
+
padding-bottom: 1px;
|
|
331
|
+
margin-top: -3px;
|
|
332
|
+
}
|
|
333
|
+
.codesetting:hover {
|
|
334
|
+
color: var(--vscode-textPreformat-foreground) !important;
|
|
335
|
+
text-decoration: none !important;
|
|
336
|
+
}
|
|
337
|
+
code:has(.codesetting):hover {
|
|
338
|
+
filter: brightness(140%);
|
|
339
|
+
text-decoration: none !important;
|
|
340
|
+
}
|
|
341
|
+
.codesetting:focus {
|
|
342
|
+
outline: 0 !important;
|
|
343
|
+
text-decoration: none !important;
|
|
344
|
+
color: var(--vscode-button-hoverForeground) !important;
|
|
345
|
+
}
|
|
346
|
+
.codesetting .separator {
|
|
347
|
+
width: 1px;
|
|
348
|
+
height: 14px;
|
|
349
|
+
margin-bottom: -3px;
|
|
350
|
+
display: inline-block;
|
|
351
|
+
background-color: var(--vscode-editor-background);
|
|
352
|
+
font-size: 12px;
|
|
353
|
+
margin-right: 4px;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
header { display: flex; align-items: center; padding-top: 1em; }
|
|
357
|
+
|
|
358
|
+
/* Release notes enhancements from vscode-docs */
|
|
359
|
+
html {
|
|
360
|
+
font-size: 10px;
|
|
361
|
+
height: 100%;
|
|
362
|
+
overscroll-behavior: none;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
body {
|
|
366
|
+
margin: 0 auto;
|
|
367
|
+
max-width: 980px;
|
|
368
|
+
height: auto;
|
|
369
|
+
overflow-y: auto;
|
|
370
|
+
overscroll-behavior: none;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/* Scroll to top button */
|
|
374
|
+
#scroll-to-top {
|
|
375
|
+
position: fixed;
|
|
376
|
+
width: 40px;
|
|
377
|
+
height: 40px;
|
|
378
|
+
right: 25px;
|
|
379
|
+
bottom: 25px;
|
|
380
|
+
background-color: var(--vscode-button-background, #444);
|
|
381
|
+
border-color: var(--vscode-button-border);
|
|
382
|
+
border-radius: 50%;
|
|
383
|
+
cursor: pointer;
|
|
384
|
+
box-shadow: 1px 1px 1px rgba(0,0,0,.25);
|
|
385
|
+
outline: none;
|
|
386
|
+
display: flex;
|
|
387
|
+
justify-content: center;
|
|
388
|
+
align-items: center;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
#scroll-to-top:hover {
|
|
392
|
+
background-color: var(--vscode-button-hoverBackground);
|
|
393
|
+
box-shadow: 2px 2px 2px rgba(0,0,0,.25);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
body.vscode-high-contrast #scroll-to-top {
|
|
397
|
+
border-width: 2px;
|
|
398
|
+
border-style: solid;
|
|
399
|
+
box-shadow: none;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
#scroll-to-top span.icon::before {
|
|
403
|
+
content: "";
|
|
404
|
+
display: block;
|
|
405
|
+
background: var(--vscode-button-foreground);
|
|
406
|
+
/* Chevron up icon */
|
|
407
|
+
-webkit-mask-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxNiAxNiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTYgMTY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojRkZGRkZGO30KCS5zdDF7ZmlsbDpub25lO30KPC9zdHlsZT4KPHRpdGxlPnVwY2hldnJvbjwvdGl0bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04LDUuMWwtNy4zLDcuM0wwLDExLjZsOC04bDgsOGwtMC43LDAuN0w4LDUuMXoiLz4KPHJlY3QgY2xhc3M9InN0MSIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ii8+Cjwvc3ZnPgo=');
|
|
408
|
+
mask-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxNiAxNiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTYgMTY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojRkZGRkZGO30KCS5zdDF7ZmlsbDpub25lO30KPC9zdHlsZT4KPHRpdGxlPnVwY2hldnJvbjwvdGl0bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04LDUuMWwtNy4zLDcuM0wwLDExLjZsOC04bDgsOGwtMC43LDAuN0w4LDUuMXoiLz4KPHJlY3QgY2xhc3M9InN0MSIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ii8+Cjwvc3ZnPgo=');
|
|
409
|
+
width: 16px;
|
|
410
|
+
height: 16px;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/* Header styling */
|
|
414
|
+
h2 {
|
|
415
|
+
margin-top: 1.2em;
|
|
416
|
+
scroll-margin-top: 1.2em;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
h2:not(:first-of-type) {
|
|
420
|
+
margin-top: 4em;
|
|
421
|
+
scroll-margin-top: 1em;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
h3 {
|
|
425
|
+
margin-top: 4em;
|
|
426
|
+
scroll-margin-top: 1em;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
h2 + h3 {
|
|
430
|
+
margin-top: 0;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/* Highlights table styling */
|
|
434
|
+
.highlights-table {
|
|
435
|
+
border-collapse: collapse;
|
|
436
|
+
border: none;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.highlights-table th {
|
|
440
|
+
vertical-align: top;
|
|
441
|
+
border: none;
|
|
442
|
+
padding-top: 2em;
|
|
443
|
+
font-weight: bold;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.highlights-table td {
|
|
447
|
+
vertical-align: top;
|
|
448
|
+
border: none;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.highlights-table tr:nth-child(2) td {
|
|
452
|
+
padding-bottom: 1em;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/* Main content layout */
|
|
456
|
+
.toc-nav-layout {
|
|
457
|
+
display: flex;
|
|
458
|
+
align-items: flex-start;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/* TOC Navigation */
|
|
462
|
+
#toc-nav {
|
|
463
|
+
position: sticky;
|
|
464
|
+
top: 20px;
|
|
465
|
+
width: 10vw;
|
|
466
|
+
min-width: 120px;
|
|
467
|
+
margin-right: 32px;
|
|
468
|
+
margin-top: 2em;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
#toc-nav > div {
|
|
472
|
+
font-weight: bold;
|
|
473
|
+
font-size: 1em;
|
|
474
|
+
margin-bottom: 1em;
|
|
475
|
+
text-transform: uppercase;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
#toc-nav ul {
|
|
479
|
+
list-style: none;
|
|
480
|
+
padding: 0;
|
|
481
|
+
margin: 0;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
#toc-nav ul li {
|
|
485
|
+
margin-bottom: 0.5em;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
#toc-nav a {
|
|
489
|
+
color: var(--vscode-editor-foreground, #ccc);
|
|
490
|
+
text-decoration: none !important;
|
|
491
|
+
transition: background-color 0.2s, color 0.2s;
|
|
492
|
+
padding: 4px 6px;
|
|
493
|
+
margin: -4px -6px;
|
|
494
|
+
border-radius: 4px;
|
|
495
|
+
display: block;
|
|
496
|
+
outline: none;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
#toc-nav a:hover {
|
|
500
|
+
background-color: var(--vscode-button-secondaryHoverBackground, #1177bb);
|
|
501
|
+
color: var(--vscode-button-secondaryForeground, #ffffff);
|
|
502
|
+
cursor: pointer;
|
|
503
|
+
text-decoration: none !important;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/* Main content area */
|
|
507
|
+
.notes-main {
|
|
508
|
+
flex: 1;
|
|
509
|
+
min-width: 0;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/* Responsive breakpoint - Hide TOC on smaller screens */
|
|
513
|
+
@media (max-width: 576px) {
|
|
514
|
+
#toc-nav {
|
|
515
|
+
display: none;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.toc-nav-layout {
|
|
519
|
+
flex-direction: column;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.notes-main {
|
|
523
|
+
margin-left: 0;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
</style>
|
|
527
|
+
</head>
|
|
528
|
+
<body>
|
|
529
|
+
${processedContent}
|
|
530
|
+
<script nonce="${nonce}">
|
|
531
|
+
const vscode = acquireVsCodeApi();
|
|
532
|
+
const container = document.createElement('p');
|
|
533
|
+
container.style.display = 'flex';
|
|
534
|
+
container.style.alignItems = 'center';
|
|
535
|
+
|
|
536
|
+
const input = document.createElement('input');
|
|
537
|
+
input.type = 'checkbox';
|
|
538
|
+
input.id = 'showReleaseNotes';
|
|
539
|
+
input.checked = ${showReleaseNotes};
|
|
540
|
+
container.appendChild(input);
|
|
541
|
+
|
|
542
|
+
const label = document.createElement('label');
|
|
543
|
+
label.htmlFor = 'showReleaseNotes';
|
|
544
|
+
label.textContent = '${( localize(13218, "Show release notes after an update"))}';
|
|
545
|
+
container.appendChild(label);
|
|
546
|
+
|
|
547
|
+
const beforeElement = document.querySelector("body > h1")?.nextElementSibling;
|
|
548
|
+
if (beforeElement) {
|
|
549
|
+
document.body.insertBefore(container, beforeElement);
|
|
550
|
+
} else {
|
|
551
|
+
document.body.appendChild(container);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
window.addEventListener('message', event => {
|
|
555
|
+
if (event.data.type === 'showReleaseNotes') {
|
|
556
|
+
input.checked = event.data.value;
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
|
|
560
|
+
window.addEventListener('click', event => {
|
|
561
|
+
const href = event.target.href ?? event.target.parentElement?.href ?? event.target.parentElement?.parentElement?.href;
|
|
562
|
+
if (href && (href.startsWith('${Schemas.codeSetting}'))) {
|
|
563
|
+
vscode.postMessage({ type: 'clickSetting', value: { uri: href, x: event.clientX, y: event.clientY }});
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
window.addEventListener('keypress', event => {
|
|
568
|
+
if (event.keyCode === 13) {
|
|
569
|
+
if (event.target.children.length > 0 && event.target.children[0].href) {
|
|
570
|
+
const clientRect = event.target.getBoundingClientRect();
|
|
571
|
+
vscode.postMessage({ type: 'clickSetting', value: { uri: event.target.children[0].href, x: clientRect.right , y: clientRect.bottom }});
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
input.addEventListener('change', event => {
|
|
577
|
+
vscode.postMessage({ type: 'showReleaseNotes', value: input.checked }, '*');
|
|
578
|
+
});
|
|
579
|
+
</script>
|
|
580
|
+
</body>
|
|
581
|
+
</html>`;
|
|
546
582
|
}
|
|
547
583
|
onDidChangeConfiguration(e) {
|
|
548
|
-
if (e.affectsConfiguration(
|
|
584
|
+
if (e.affectsConfiguration("update.showReleaseNotes")) {
|
|
549
585
|
this.updateCheckboxWebview();
|
|
550
586
|
}
|
|
551
587
|
}
|
|
@@ -557,47 +593,34 @@ let ReleaseNotesManager = class ReleaseNotesManager extends Disposable {
|
|
|
557
593
|
updateCheckboxWebview() {
|
|
558
594
|
if (this._currentReleaseNotes) {
|
|
559
595
|
this._currentReleaseNotes.webview.postMessage({
|
|
560
|
-
type:
|
|
561
|
-
value: this._configurationService.getValue(
|
|
596
|
+
type: "showReleaseNotes",
|
|
597
|
+
value: this._configurationService.getValue("update.showReleaseNotes")
|
|
562
598
|
});
|
|
563
599
|
}
|
|
564
600
|
}
|
|
565
601
|
};
|
|
566
|
-
ReleaseNotesManager = ( __decorate([
|
|
567
|
-
( __param(0, IEnvironmentService)),
|
|
568
|
-
( __param(1, IKeybindingService)),
|
|
569
|
-
( __param(2, ILanguageService)),
|
|
570
|
-
( __param(3, IOpenerService)),
|
|
571
|
-
( __param(4, IRequestService)),
|
|
572
|
-
( __param(5, IConfigurationService)),
|
|
573
|
-
( __param(6, IEditorService)),
|
|
574
|
-
( __param(7, IEditorGroupsService)),
|
|
575
|
-
( __param(8, ICodeEditorService)),
|
|
576
|
-
( __param(9, IWebviewWorkbenchService)),
|
|
577
|
-
( __param(10, IExtensionService)),
|
|
578
|
-
( __param(11, IProductService)),
|
|
579
|
-
( __param(12, IInstantiationService))
|
|
580
|
-
], ReleaseNotesManager));
|
|
602
|
+
ReleaseNotesManager = ( __decorate([( __param(0, IEnvironmentService)), ( __param(1, IKeybindingService)), ( __param(2, ILanguageService)), ( __param(3, IOpenerService)), ( __param(4, IRequestService)), ( __param(5, IConfigurationService)), ( __param(6, IEditorService)), ( __param(7, IEditorGroupsService)), ( __param(8, ICodeEditorService)), ( __param(9, IWebviewWorkbenchService)), ( __param(10, IExtensionService)), ( __param(11, IProductService)), ( __param(12, IInstantiationService))], ReleaseNotesManager));
|
|
581
603
|
async function renderReleaseNotesMarkdown(text, extensionService, languageService, simpleSettingRenderer) {
|
|
582
|
-
text = ( text
|
|
583
|
-
.toString())
|
|
584
|
-
.replace(/<!--\s*TOC\s*/gi, '')
|
|
585
|
-
.replace(/\s*Navigation End\s*-->/gi, '');
|
|
604
|
+
text = ( text.toString()).replace(/<!--\s*TOC\s*/gi, "").replace(/\s*Navigation End\s*-->/gi, "");
|
|
586
605
|
return renderMarkdownDocument(text, extensionService, languageService, {
|
|
587
606
|
sanitizerConfig: {
|
|
588
607
|
allowRelativeMediaPaths: true,
|
|
589
608
|
allowedLinkProtocols: {
|
|
590
609
|
override: [Schemas.http, Schemas.https, Schemas.command, Schemas.codeSetting]
|
|
591
610
|
},
|
|
592
|
-
allowedTags: {
|
|
593
|
-
|
|
611
|
+
allowedTags: {
|
|
612
|
+
augment: ["nav", "svg", "path"]
|
|
613
|
+
},
|
|
614
|
+
allowedAttributes: {
|
|
615
|
+
augment: ["aria-role", "viewBox", "fill", "xmlns", "d"]
|
|
616
|
+
}
|
|
594
617
|
},
|
|
595
618
|
markedExtensions: [{
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
619
|
+
renderer: {
|
|
620
|
+
html: simpleSettingRenderer.getHtmlRenderer(),
|
|
621
|
+
codespan: simpleSettingRenderer.getCodeSpanRenderer()
|
|
622
|
+
}
|
|
623
|
+
}]
|
|
601
624
|
});
|
|
602
625
|
}
|
|
603
626
|
|