@codingame/monaco-vscode-accessibility-service-override 7.1.0 → 8.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/workbench/contrib/accessibility/browser/accessibilityStatus.js +6 -7
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +208 -135
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewContributions.js +8 -2
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewKeybindingResolver.js +7 -5
- package/vscode/src/vs/workbench/contrib/accessibility/browser/extensionAccesibilityHelp.contribution.js +0 -1
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignal.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/commands.js +12 -16
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/editorTextPropertySignalsContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/openDiffEditorAnnouncement.js +2 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.js +4 -6
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/reloadableWorkbenchContribution.js +0 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-accessibility-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@8.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -2,7 +2,7 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
4
4
|
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
5
|
-
import {
|
|
5
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
6
6
|
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
7
7
|
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
8
8
|
import { ConfigurationTarget } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
@@ -12,7 +12,6 @@ import { INotificationService } from 'vscode/vscode/vs/platform/notification/com
|
|
|
12
12
|
import { StatusbarAlignment } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
13
13
|
import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
14
14
|
|
|
15
|
-
const _moduleId = "vs/workbench/contrib/accessibility/browser/accessibilityStatus";
|
|
16
15
|
let AccessibilityStatus = class AccessibilityStatus extends Disposable {
|
|
17
16
|
static { this.ID = 'workbench.contrib.accessibilityStatus'; }
|
|
18
17
|
constructor(configurationService, notificationService, accessibilityService, statusbarService) {
|
|
@@ -37,13 +36,13 @@ let AccessibilityStatus = class AccessibilityStatus extends Disposable {
|
|
|
37
36
|
}));
|
|
38
37
|
}
|
|
39
38
|
showScreenReaderNotification() {
|
|
40
|
-
this.screenReaderNotification = this.notificationService.prompt(Severity$1.Info, (
|
|
41
|
-
label: (
|
|
39
|
+
this.screenReaderNotification = this.notificationService.prompt(Severity$1.Info, ( localize(5573, "Are you using a screen reader to operate VS Code?")), [{
|
|
40
|
+
label: ( localize(5574, "Yes")),
|
|
42
41
|
run: () => {
|
|
43
42
|
this.configurationService.updateValue('editor.accessibilitySupport', 'on', ConfigurationTarget.USER);
|
|
44
43
|
}
|
|
45
44
|
}, {
|
|
46
|
-
label: (
|
|
45
|
+
label: ( localize(5575, "No")),
|
|
47
46
|
run: () => {
|
|
48
47
|
this.configurationService.updateValue('editor.accessibilitySupport', 'off', ConfigurationTarget.USER);
|
|
49
48
|
}
|
|
@@ -56,9 +55,9 @@ let AccessibilityStatus = class AccessibilityStatus extends Disposable {
|
|
|
56
55
|
updateScreenReaderModeElement(visible) {
|
|
57
56
|
if (visible) {
|
|
58
57
|
if (!this.screenReaderModeElement.value) {
|
|
59
|
-
const text = (
|
|
58
|
+
const text = ( localize(5576, "Screen Reader Optimized"));
|
|
60
59
|
this.screenReaderModeElement.value = this.statusbarService.addEntry({
|
|
61
|
-
name: (
|
|
60
|
+
name: ( localize(5577, "Screen Reader Mode")),
|
|
62
61
|
text,
|
|
63
62
|
ariaLabel: text,
|
|
64
63
|
command: 'showEditorScreenReaderNotification',
|
|
@@ -7,7 +7,7 @@ import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
|
7
7
|
import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
8
8
|
import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
9
9
|
import marked_1 from 'vscode/external/vscode-marked/lib/marked.esm.js';
|
|
10
|
-
import {
|
|
10
|
+
import { isWindows, isMacintosh } from 'vscode/vscode/vs/base/common/platform';
|
|
11
11
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
12
12
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
13
13
|
import { EditorExtensionsRegistry } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
@@ -16,8 +16,8 @@ import { Position } from 'vscode/vscode/vs/editor/common/core/position';
|
|
|
16
16
|
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
17
17
|
import { AccessibilityHelpNLS } from 'vscode/vscode/vs/editor/common/standaloneStrings';
|
|
18
18
|
import { CodeActionController } from 'vscode/vscode/vs/editor/contrib/codeAction/browser/codeActionController';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
20
|
+
import { AccessibleContentProvider, AccessibleViewProviderId, ExtensionContentProvider, AccessibleViewType } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView';
|
|
21
21
|
import { ACCESSIBLE_VIEW_SHOWN_STORAGE_PREFIX } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
22
22
|
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
23
23
|
import { createAndFillInActionBarActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
@@ -36,13 +36,12 @@ import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.s
|
|
|
36
36
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
37
37
|
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
38
38
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
39
|
-
import { accessibilityHelpIsShown, accessibleViewIsShown, accessibleViewSupportsNavigation, accessibleViewVerbosityEnabled, accessibleViewGoToSymbolSupported, accessibleViewCurrentProviderId, accessibleViewInCodeBlock, accessibleViewContainsCodeBlocks, accessibleViewOnLastLine,
|
|
39
|
+
import { accessibilityHelpIsShown, accessibleViewIsShown, accessibleViewSupportsNavigation, accessibleViewVerbosityEnabled, accessibleViewGoToSymbolSupported, accessibleViewCurrentProviderId, accessibleViewInCodeBlock, accessibleViewContainsCodeBlocks, accessibleViewOnLastLine, accessibleViewHasUnassignedKeybindings, accessibleViewHasAssignedKeybindings, AccessibilityWorkbenchSettingId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
40
40
|
import { resolveContentAndKeybindingItems } from './accessibleViewKeybindingResolver.js';
|
|
41
41
|
import { AccessibilityCommandId } from 'vscode/vscode/vs/workbench/contrib/accessibility/common/accessibilityCommands';
|
|
42
42
|
import { IChatCodeBlockContextProviderService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
43
43
|
import { getSimpleEditorOptions } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
|
44
44
|
|
|
45
|
-
const _moduleId = "vs/workbench/contrib/accessibility/browser/accessibleView";
|
|
46
45
|
var DIMENSIONS;
|
|
47
46
|
( ((function(DIMENSIONS) {
|
|
48
47
|
DIMENSIONS[DIMENSIONS["MAX_WIDTH"] = 600] = "MAX_WIDTH";
|
|
@@ -75,6 +74,8 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
75
74
|
this._accessibleViewInCodeBlock = accessibleViewInCodeBlock.bindTo(this._contextKeyService);
|
|
76
75
|
this._accessibleViewContainsCodeBlocks = accessibleViewContainsCodeBlocks.bindTo(this._contextKeyService);
|
|
77
76
|
this._onLastLine = accessibleViewOnLastLine.bindTo(this._contextKeyService);
|
|
77
|
+
this._hasUnassignedKeybindings = accessibleViewHasUnassignedKeybindings.bindTo(this._contextKeyService);
|
|
78
|
+
this._hasAssignedKeybindings = accessibleViewHasAssignedKeybindings.bindTo(this._contextKeyService);
|
|
78
79
|
this._container = document.createElement('div');
|
|
79
80
|
this._container.classList.add('accessible-view');
|
|
80
81
|
if (this._configurationService.getValue(AccessibilityWorkbenchSettingId.HideAccessibleView)) {
|
|
@@ -101,6 +102,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
101
102
|
lineDecorationsWidth: 6,
|
|
102
103
|
dragAndDrop: false,
|
|
103
104
|
cursorWidth: 1,
|
|
105
|
+
wordWrap: 'off',
|
|
104
106
|
wrappingStrategy: 'advanced',
|
|
105
107
|
wrappingIndent: 'none',
|
|
106
108
|
padding: { top: 2, bottom: 2 },
|
|
@@ -117,7 +119,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
117
119
|
}
|
|
118
120
|
}));
|
|
119
121
|
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
120
|
-
if (this._currentProvider instanceof
|
|
122
|
+
if (this._currentProvider instanceof AccessibleContentProvider && e.affectsConfiguration(this._currentProvider.verbositySettingKey)) {
|
|
121
123
|
if (this._accessiblityHelpIsShown.get()) {
|
|
122
124
|
this.show(this._currentProvider);
|
|
123
125
|
}
|
|
@@ -147,6 +149,8 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
147
149
|
this._accessibleViewVerbosityEnabled.reset();
|
|
148
150
|
this._accessibleViewGoToSymbolSupported.reset();
|
|
149
151
|
this._accessibleViewCurrentProviderId.reset();
|
|
152
|
+
this._hasAssignedKeybindings.reset();
|
|
153
|
+
this._hasUnassignedKeybindings.reset();
|
|
150
154
|
}
|
|
151
155
|
getPosition(id) {
|
|
152
156
|
if (!id || !this._lastProvider || this._lastProvider.id !== id) {
|
|
@@ -202,17 +206,17 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
202
206
|
return;
|
|
203
207
|
}
|
|
204
208
|
provider.onOpen?.();
|
|
205
|
-
let viewContainer;
|
|
206
209
|
const delegate = {
|
|
207
210
|
getAnchor: () => { return { x: (getActiveWindow().innerWidth / 2) - ((Math.min(this._layoutService.activeContainerDimension.width * 0.62 , DIMENSIONS.MAX_WIDTH)) / 2), y: this._layoutService.activeContainerOffset.quickPickTop }; },
|
|
208
211
|
render: (container) => {
|
|
209
|
-
|
|
210
|
-
|
|
212
|
+
this._viewContainer = container;
|
|
213
|
+
this._viewContainer.classList.add('accessible-view-container');
|
|
211
214
|
return this._render(provider, container, showAccessibleViewHelp);
|
|
212
215
|
},
|
|
213
216
|
onHide: () => {
|
|
214
217
|
if (!showAccessibleViewHelp) {
|
|
215
218
|
this._updateLastProvider();
|
|
219
|
+
this._currentProvider?.dispose();
|
|
216
220
|
this._currentProvider = undefined;
|
|
217
221
|
this._resetContextKeys();
|
|
218
222
|
}
|
|
@@ -228,7 +232,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
228
232
|
if (symbol && this._currentProvider) {
|
|
229
233
|
this.showSymbol(this._currentProvider, symbol);
|
|
230
234
|
}
|
|
231
|
-
if (provider instanceof
|
|
235
|
+
if (provider instanceof AccessibleContentProvider && provider.onDidRequestClearLastProvider) {
|
|
232
236
|
this._register(provider.onDidRequestClearLastProvider((id) => {
|
|
233
237
|
if (this._lastProvider?.options.id === id) {
|
|
234
238
|
this._lastProvider = undefined;
|
|
@@ -246,23 +250,31 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
246
250
|
}
|
|
247
251
|
if (provider.onDidChangeContent) {
|
|
248
252
|
this._register(provider.onDidChangeContent(() => {
|
|
249
|
-
if (
|
|
250
|
-
this._render(provider,
|
|
253
|
+
if (this._viewContainer) {
|
|
254
|
+
this._render(provider, this._viewContainer, showAccessibleViewHelp);
|
|
251
255
|
}
|
|
252
256
|
}));
|
|
253
257
|
}
|
|
254
258
|
}
|
|
255
259
|
previous() {
|
|
256
|
-
this._currentProvider?.
|
|
260
|
+
const newContent = this._currentProvider?.providePreviousContent?.();
|
|
261
|
+
if (!this._currentProvider || !this._viewContainer || !newContent) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
this._render(this._currentProvider, this._viewContainer, undefined, newContent);
|
|
257
265
|
}
|
|
258
266
|
next() {
|
|
259
|
-
this._currentProvider?.
|
|
267
|
+
const newContent = this._currentProvider?.provideNextContent?.();
|
|
268
|
+
if (!this._currentProvider || !this._viewContainer || !newContent) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
this._render(this._currentProvider, this._viewContainer, undefined, newContent);
|
|
260
272
|
}
|
|
261
273
|
_verbosityEnabled() {
|
|
262
274
|
if (!this._currentProvider) {
|
|
263
275
|
return false;
|
|
264
276
|
}
|
|
265
|
-
return this._currentProvider instanceof
|
|
277
|
+
return this._currentProvider instanceof AccessibleContentProvider ? this._configurationService.getValue(this._currentProvider.verbositySettingKey) === true : this._storageService.getBoolean(`${ACCESSIBLE_VIEW_SHOWN_STORAGE_PREFIX}${this._currentProvider.id}`, StorageScope.APPLICATION, false);
|
|
266
278
|
}
|
|
267
279
|
goToSymbol() {
|
|
268
280
|
if (!this._currentProvider) {
|
|
@@ -271,6 +283,9 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
271
283
|
this._instantiationService.createInstance(AccessibleViewSymbolQuickPick, this).show(this._currentProvider);
|
|
272
284
|
}
|
|
273
285
|
calculateCodeBlocks(markdown) {
|
|
286
|
+
if (!markdown) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
274
289
|
if (this._currentProvider?.id !== AccessibleViewProviderId.Chat) {
|
|
275
290
|
return;
|
|
276
291
|
}
|
|
@@ -298,7 +313,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
298
313
|
this._accessibleViewContainsCodeBlocks.set(this._codeBlocks.length > 0);
|
|
299
314
|
}
|
|
300
315
|
getSymbols() {
|
|
301
|
-
const provider = this._currentProvider instanceof
|
|
316
|
+
const provider = this._currentProvider instanceof AccessibleContentProvider ? this._currentProvider : undefined;
|
|
302
317
|
if (!this._currentContent || !provider) {
|
|
303
318
|
return;
|
|
304
319
|
}
|
|
@@ -322,18 +337,18 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
322
337
|
}
|
|
323
338
|
this._openerService.open(( (URI.parse(this._currentProvider.options.readMoreUrl))));
|
|
324
339
|
}
|
|
325
|
-
configureKeybindings() {
|
|
340
|
+
configureKeybindings(unassigned) {
|
|
326
341
|
this._inQuickPick = true;
|
|
327
342
|
const provider = this._updateLastProvider();
|
|
328
|
-
const items = provider?.options?.configureKeybindingItems;
|
|
343
|
+
const items = unassigned ? provider?.options?.configureKeybindingItems : provider?.options?.configuredKeybindingItems;
|
|
329
344
|
if (!items) {
|
|
330
345
|
return;
|
|
331
346
|
}
|
|
332
347
|
const quickPick = this._quickInputService.createQuickPick();
|
|
333
348
|
this._register(quickPick);
|
|
334
349
|
quickPick.items = items;
|
|
335
|
-
quickPick.title = (
|
|
336
|
-
quickPick.placeholder = (
|
|
350
|
+
quickPick.title = ( localize(1791, 'Configure keybindings'));
|
|
351
|
+
quickPick.placeholder = ( localize(1792, 'Select a command ID to configure a keybinding for it'));
|
|
337
352
|
quickPick.show();
|
|
338
353
|
quickPick.onDidAccept(async () => {
|
|
339
354
|
const item = quickPick.selectedItems[0];
|
|
@@ -373,7 +388,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
373
388
|
}
|
|
374
389
|
}
|
|
375
390
|
if (label) {
|
|
376
|
-
symbols.push({ markdownToParse: label, label: (
|
|
391
|
+
symbols.push({ markdownToParse: label, label: ( localize(1793, "({0}) {1}", token.type, label)), ariaLabel: ( localize(1794, "({0}) {1}", token.type, label)), firstListItem });
|
|
377
392
|
firstListItem = undefined;
|
|
378
393
|
}
|
|
379
394
|
}
|
|
@@ -400,13 +415,12 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
400
415
|
this._updateContextKeys(provider, true);
|
|
401
416
|
}
|
|
402
417
|
disableHint() {
|
|
403
|
-
if (!(this._currentProvider instanceof
|
|
418
|
+
if (!(this._currentProvider instanceof AccessibleContentProvider)) {
|
|
404
419
|
return;
|
|
405
420
|
}
|
|
406
421
|
this._configurationService.updateValue(this._currentProvider?.verbositySettingKey, false);
|
|
407
|
-
alert((
|
|
408
|
-
|
|
409
|
-
4,
|
|
422
|
+
alert(( localize(
|
|
423
|
+
1795,
|
|
410
424
|
'{0} accessibility verbosity is now disabled',
|
|
411
425
|
this._currentProvider.verbositySettingKey
|
|
412
426
|
)));
|
|
@@ -420,53 +434,52 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
420
434
|
this._accessibleViewIsShown.set(shown);
|
|
421
435
|
this._accessiblityHelpIsShown.reset();
|
|
422
436
|
}
|
|
423
|
-
this._accessibleViewSupportsNavigation.set(provider.
|
|
437
|
+
this._accessibleViewSupportsNavigation.set(provider.provideNextContent !== undefined || provider.providePreviousContent !== undefined);
|
|
424
438
|
this._accessibleViewVerbosityEnabled.set(this._verbosityEnabled());
|
|
425
439
|
this._accessibleViewGoToSymbolSupported.set(this._goToSymbolsSupported() ? this.getSymbols()?.length > 0 : false);
|
|
426
440
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
"\n\nOpen a browser window with more information related to accessibility<keybinding:{0}>.",
|
|
435
|
-
AccessibilityCommandId.AccessibilityHelpOpenHelpLink
|
|
436
|
-
)) : '';
|
|
437
|
-
let disableHelpHint = '';
|
|
438
|
-
if (provider instanceof AdvancedContentProvider && provider.options.type === AccessibleViewType.Help && verbose) {
|
|
439
|
-
disableHelpHint = this._getDisableVerbosityHint();
|
|
441
|
+
_updateContent(provider, updatedContent) {
|
|
442
|
+
let content = updatedContent ?? provider.provideContent();
|
|
443
|
+
if (provider.options.type === AccessibleViewType.View) {
|
|
444
|
+
this._currentContent = content;
|
|
445
|
+
this._hasUnassignedKeybindings.reset();
|
|
446
|
+
this._hasAssignedKeybindings.reset();
|
|
447
|
+
return;
|
|
440
448
|
}
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
449
|
+
const readMoreLinkHint = this._readMoreHint(provider);
|
|
450
|
+
const disableHelpHint = this._disableVerbosityHint(provider);
|
|
451
|
+
const screenReaderModeHint = this._screenReaderModeHint(provider);
|
|
452
|
+
const exitThisDialogHint = this._exitDialogHint(provider);
|
|
453
|
+
let configureKbHint = '';
|
|
454
|
+
let configureAssignedKbHint = '';
|
|
455
|
+
const resolvedContent = resolveContentAndKeybindingItems(this._keybindingService, screenReaderModeHint + content + readMoreLinkHint + disableHelpHint + exitThisDialogHint);
|
|
456
|
+
if (resolvedContent) {
|
|
457
|
+
content = resolvedContent.content.value;
|
|
458
|
+
if (resolvedContent.configureKeybindingItems) {
|
|
459
|
+
provider.options.configureKeybindingItems = resolvedContent.configureKeybindingItems;
|
|
460
|
+
this._hasUnassignedKeybindings.set(true);
|
|
461
|
+
configureKbHint = this._configureUnassignedKbHint();
|
|
450
462
|
}
|
|
451
|
-
else
|
|
452
|
-
|
|
453
|
-
message += '\n';
|
|
463
|
+
else {
|
|
464
|
+
this._hasAssignedKeybindings.reset();
|
|
454
465
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
if (resolvedContent.configureKeybindingItems) {
|
|
463
|
-
provider.options.configureKeybindingItems = resolvedContent.configureKeybindingItems;
|
|
464
|
-
}
|
|
466
|
+
if (resolvedContent.configuredKeybindingItems) {
|
|
467
|
+
provider.options.configuredKeybindingItems = resolvedContent.configuredKeybindingItems;
|
|
468
|
+
this._hasAssignedKeybindings.set(true);
|
|
469
|
+
configureAssignedKbHint = this._configureAssignedKbHint();
|
|
470
|
+
}
|
|
471
|
+
else {
|
|
472
|
+
this._hasAssignedKeybindings.reset();
|
|
465
473
|
}
|
|
466
474
|
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
475
|
+
this._currentContent = content + configureKbHint + configureAssignedKbHint;
|
|
476
|
+
}
|
|
477
|
+
_render(provider, container, showAccessibleViewHelp, updatedContent) {
|
|
478
|
+
this._currentProvider = provider;
|
|
479
|
+
this._accessibleViewCurrentProviderId.set(provider.id);
|
|
480
|
+
const verbose = this._verbosityEnabled();
|
|
481
|
+
this._updateContent(provider, updatedContent);
|
|
482
|
+
this.calculateCodeBlocks(this._currentContent);
|
|
470
483
|
this._updateContextKeys(provider, true);
|
|
471
484
|
const widgetIsFocused = this._editorWidget.hasTextFocus() || this._editorWidget.hasWidgetFocus();
|
|
472
485
|
this._getTextModel(( (URI.from(
|
|
@@ -485,19 +498,18 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
485
498
|
let actionsHint = '';
|
|
486
499
|
const hasActions = this._accessibleViewSupportsNavigation.get() || this._accessibleViewVerbosityEnabled.get() || this._accessibleViewGoToSymbolSupported.get() || provider.actions?.length;
|
|
487
500
|
if (verbose && !showAccessibleViewHelp && hasActions) {
|
|
488
|
-
actionsHint = provider.options.position ? (
|
|
489
|
-
|
|
490
|
-
7,
|
|
501
|
+
actionsHint = provider.options.position ? ( localize(
|
|
502
|
+
1796,
|
|
491
503
|
'Explore actions such as disabling this hint (Shift+Tab), use Escape to exit this dialog.'
|
|
492
|
-
)) : (
|
|
504
|
+
)) : ( localize(1797, 'Explore actions such as disabling this hint (Shift+Tab).'));
|
|
493
505
|
}
|
|
494
|
-
let ariaLabel = provider.options.type === AccessibleViewType.Help ? (
|
|
506
|
+
let ariaLabel = provider.options.type === AccessibleViewType.Help ? ( localize(1798, "Accessibility Help")) : ( localize(1799, "Accessible View"));
|
|
495
507
|
this._title.textContent = ariaLabel;
|
|
496
508
|
if (actionsHint && provider.options.type === AccessibleViewType.View) {
|
|
497
|
-
ariaLabel = (
|
|
509
|
+
ariaLabel = ( localize(1800, "Accessible View, {0}", actionsHint));
|
|
498
510
|
}
|
|
499
511
|
else if (actionsHint) {
|
|
500
|
-
ariaLabel = (
|
|
512
|
+
ariaLabel = ( localize(1801, "Accessibility Help, {0}", actionsHint));
|
|
501
513
|
}
|
|
502
514
|
if (isWindows && widgetIsFocused) {
|
|
503
515
|
ariaLabel = '';
|
|
@@ -527,6 +539,8 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
527
539
|
this._updateContextKeys(provider, false);
|
|
528
540
|
this._lastProvider = undefined;
|
|
529
541
|
this._currentContent = undefined;
|
|
542
|
+
this._currentProvider?.dispose();
|
|
543
|
+
this._currentProvider = undefined;
|
|
530
544
|
};
|
|
531
545
|
const disposableStore = ( (new DisposableStore()));
|
|
532
546
|
disposableStore.add(this._editorWidget.onKeyDown((e) => {
|
|
@@ -543,7 +557,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
543
557
|
e.preventDefault();
|
|
544
558
|
e.stopPropagation();
|
|
545
559
|
}
|
|
546
|
-
if (provider instanceof
|
|
560
|
+
if (provider instanceof AccessibleContentProvider) {
|
|
547
561
|
provider.onKeyDown?.(e);
|
|
548
562
|
}
|
|
549
563
|
}));
|
|
@@ -563,7 +577,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
563
577
|
return disposableStore;
|
|
564
578
|
}
|
|
565
579
|
_updateToolbar(providedActions, type) {
|
|
566
|
-
this._toolbar.setAriaLabel(type === AccessibleViewType.Help ? (
|
|
580
|
+
this._toolbar.setAriaLabel(type === AccessibleViewType.Help ? ( localize(1802, 'Accessibility Help')) : ( localize(1803, "Accessible View")));
|
|
567
581
|
const menuActions = [];
|
|
568
582
|
const toolbarMenu = this._register(this._menuService.createMenu(MenuId.AccessibleView, this._contextKeyService));
|
|
569
583
|
createAndFillInActionBarActions(toolbarMenu, {}, menuActions);
|
|
@@ -596,14 +610,14 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
596
610
|
if (!this._currentProvider) {
|
|
597
611
|
return false;
|
|
598
612
|
}
|
|
599
|
-
return this._currentProvider.options.type === AccessibleViewType.Help || this._currentProvider.options.language === 'markdown' || this._currentProvider.options.language === undefined || (this._currentProvider instanceof
|
|
613
|
+
return this._currentProvider.options.type === AccessibleViewType.Help || this._currentProvider.options.language === 'markdown' || this._currentProvider.options.language === undefined || (this._currentProvider instanceof AccessibleContentProvider && !!this._currentProvider.getSymbols?.());
|
|
600
614
|
}
|
|
601
615
|
_updateLastProvider() {
|
|
602
616
|
const provider = this._currentProvider;
|
|
603
617
|
if (!provider) {
|
|
604
618
|
return;
|
|
605
619
|
}
|
|
606
|
-
const lastProvider = provider instanceof
|
|
620
|
+
const lastProvider = provider instanceof AccessibleContentProvider ? ( (new AccessibleContentProvider(
|
|
607
621
|
provider.id,
|
|
608
622
|
provider.options,
|
|
609
623
|
provider.provideContent.bind(provider),
|
|
@@ -611,8 +625,8 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
611
625
|
provider.verbositySettingKey,
|
|
612
626
|
provider.onOpen?.bind(provider),
|
|
613
627
|
provider.actions,
|
|
614
|
-
provider.
|
|
615
|
-
provider.
|
|
628
|
+
provider.provideNextContent?.bind(provider),
|
|
629
|
+
provider.providePreviousContent?.bind(provider),
|
|
616
630
|
provider.onDidChangeContent?.bind(provider),
|
|
617
631
|
provider.onKeyDown?.bind(provider),
|
|
618
632
|
provider.getSymbols?.bind(provider)
|
|
@@ -622,8 +636,8 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
622
636
|
provider.provideContent.bind(provider),
|
|
623
637
|
provider.onClose.bind(provider),
|
|
624
638
|
provider.onOpen?.bind(provider),
|
|
625
|
-
provider.
|
|
626
|
-
provider.
|
|
639
|
+
provider.provideNextContent?.bind(provider),
|
|
640
|
+
provider.providePreviousContent?.bind(provider),
|
|
627
641
|
provider.actions,
|
|
628
642
|
provider.onDidChangeContent?.bind(provider)
|
|
629
643
|
)));
|
|
@@ -634,25 +648,41 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
634
648
|
if (!lastProvider) {
|
|
635
649
|
return;
|
|
636
650
|
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
651
|
+
let accessibleViewHelpProvider;
|
|
652
|
+
if (lastProvider instanceof AccessibleContentProvider) {
|
|
653
|
+
accessibleViewHelpProvider = ( (new AccessibleContentProvider(
|
|
654
|
+
lastProvider.id,
|
|
655
|
+
{ type: AccessibleViewType.Help },
|
|
656
|
+
() => lastProvider.options.customHelp ? lastProvider?.options.customHelp() : this._accessibleViewHelpDialogContent(this._goToSymbolsSupported()),
|
|
657
|
+
() => {
|
|
658
|
+
this._contextViewService.hideContextView();
|
|
659
|
+
queueMicrotask(() => this.show(lastProvider));
|
|
660
|
+
},
|
|
661
|
+
lastProvider.verbositySettingKey
|
|
662
|
+
)));
|
|
663
|
+
}
|
|
664
|
+
else {
|
|
665
|
+
accessibleViewHelpProvider = ( (new ExtensionContentProvider(
|
|
666
|
+
lastProvider.id,
|
|
667
|
+
{ type: AccessibleViewType.Help },
|
|
668
|
+
() => lastProvider.options.customHelp ? lastProvider?.options.customHelp() : this._accessibleViewHelpDialogContent(this._goToSymbolsSupported()),
|
|
669
|
+
() => {
|
|
670
|
+
this._contextViewService.hideContextView();
|
|
671
|
+
queueMicrotask(() => this.show(lastProvider));
|
|
672
|
+
}
|
|
673
|
+
)));
|
|
674
|
+
}
|
|
647
675
|
this._contextViewService.hideContextView();
|
|
648
|
-
|
|
676
|
+
if (accessibleViewHelpProvider) {
|
|
677
|
+
queueMicrotask(() => this.show(accessibleViewHelpProvider, undefined, true));
|
|
678
|
+
}
|
|
649
679
|
}
|
|
650
|
-
|
|
651
|
-
const navigationHint = this.
|
|
652
|
-
const goToSymbolHint = this.
|
|
653
|
-
const toolbarHint = (
|
|
680
|
+
_accessibleViewHelpDialogContent(providerHasSymbols) {
|
|
681
|
+
const navigationHint = this._navigationHint();
|
|
682
|
+
const goToSymbolHint = this._goToSymbolHint(providerHasSymbols);
|
|
683
|
+
const toolbarHint = ( localize(1804, "Navigate to the toolbar (Shift+Tab)."));
|
|
654
684
|
const chatHints = this._getChatHints();
|
|
655
|
-
let hint = (
|
|
685
|
+
let hint = ( localize(1805, "In the accessible view, you can:\n"));
|
|
656
686
|
if (navigationHint) {
|
|
657
687
|
hint += ' - ' + navigationHint + '\n';
|
|
658
688
|
}
|
|
@@ -671,50 +701,94 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
671
701
|
if (this._currentProvider?.id !== AccessibleViewProviderId.Chat) {
|
|
672
702
|
return;
|
|
673
703
|
}
|
|
674
|
-
return [(
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
704
|
+
return [( localize(
|
|
705
|
+
1806,
|
|
706
|
+
" - Insert the code block at the cursor{0}.",
|
|
707
|
+
'<keybinding:workbench.action.chat.insertCodeBlock>'
|
|
678
708
|
)),
|
|
679
|
-
(
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
709
|
+
( localize(
|
|
710
|
+
1807,
|
|
711
|
+
" - Insert the code block into a new file{0}.",
|
|
712
|
+
'<keybinding:workbench.action.chat.insertIntoNewFile>'
|
|
683
713
|
)),
|
|
684
|
-
(
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
714
|
+
( localize(
|
|
715
|
+
1808,
|
|
716
|
+
" - Run the code block in the terminal{0}.\n",
|
|
717
|
+
'<keybinding:workbench.action.chat.runInTerminal>'
|
|
688
718
|
))].join('\n');
|
|
689
719
|
}
|
|
690
|
-
|
|
691
|
-
return (
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
AccessibilityCommandId.
|
|
696
|
-
AccessibilityCommandId.ShowPrevious
|
|
720
|
+
_navigationHint() {
|
|
721
|
+
return ( localize(
|
|
722
|
+
1809,
|
|
723
|
+
"Show the next item{0} or previous item{1}.",
|
|
724
|
+
`<keybinding:${AccessibilityCommandId.ShowNext}`,
|
|
725
|
+
`<keybinding:${AccessibilityCommandId.ShowPrevious}>`
|
|
697
726
|
));
|
|
698
727
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
728
|
+
_disableVerbosityHint(provider) {
|
|
729
|
+
if (provider.options.type === AccessibleViewType.Help && this._verbosityEnabled()) {
|
|
730
|
+
return ( localize(
|
|
731
|
+
1810,
|
|
732
|
+
"\nDisable accessibility verbosity for this feature{0}.",
|
|
733
|
+
`<keybinding:${AccessibilityCommandId.DisableVerbosityHint}>`
|
|
734
|
+
));
|
|
735
|
+
}
|
|
736
|
+
return '';
|
|
706
737
|
}
|
|
707
|
-
|
|
738
|
+
_goToSymbolHint(providerHasSymbols) {
|
|
708
739
|
if (!providerHasSymbols) {
|
|
709
740
|
return;
|
|
710
741
|
}
|
|
711
|
-
return (
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
AccessibilityCommandId.GoToSymbol
|
|
742
|
+
return ( localize(
|
|
743
|
+
1811,
|
|
744
|
+
'Go to a symbol{0}.',
|
|
745
|
+
`<keybinding:${AccessibilityCommandId.GoToSymbol}>`
|
|
716
746
|
));
|
|
717
747
|
}
|
|
748
|
+
_configureUnassignedKbHint() {
|
|
749
|
+
const configureKb = this._keybindingService.lookupKeybinding(AccessibilityCommandId.AccessibilityHelpConfigureKeybindings)?.getAriaLabel();
|
|
750
|
+
const keybindingToConfigureQuickPick = configureKb ? '(' + configureKb + ')' : 'by assigning a keybinding to the command Accessibility Help Configure Unassigned Keybindings.';
|
|
751
|
+
return ( localize(
|
|
752
|
+
1812,
|
|
753
|
+
'\nConfigure keybindings for commands that lack them {0}.',
|
|
754
|
+
keybindingToConfigureQuickPick
|
|
755
|
+
));
|
|
756
|
+
}
|
|
757
|
+
_configureAssignedKbHint() {
|
|
758
|
+
const configureKb = this._keybindingService.lookupKeybinding(AccessibilityCommandId.AccessibilityHelpConfigureAssignedKeybindings)?.getAriaLabel();
|
|
759
|
+
const keybindingToConfigureQuickPick = configureKb ? '(' + configureKb + ')' : 'by assigning a keybinding to the command Accessibility Help Configure Assigned Keybindings.';
|
|
760
|
+
return ( localize(
|
|
761
|
+
1813,
|
|
762
|
+
'\nConfigure keybindings for commands that already have assignments {0}.',
|
|
763
|
+
keybindingToConfigureQuickPick
|
|
764
|
+
));
|
|
765
|
+
}
|
|
766
|
+
_screenReaderModeHint(provider) {
|
|
767
|
+
const accessibilitySupport = this._accessibilityService.isScreenReaderOptimized();
|
|
768
|
+
let screenReaderModeHint = '';
|
|
769
|
+
const turnOnMessage = (isMacintosh
|
|
770
|
+
? AccessibilityHelpNLS.changeConfigToOnMac
|
|
771
|
+
: AccessibilityHelpNLS.changeConfigToOnWinLinux);
|
|
772
|
+
if (accessibilitySupport && provider.id === AccessibleViewProviderId.Editor) {
|
|
773
|
+
screenReaderModeHint = AccessibilityHelpNLS.auto_on;
|
|
774
|
+
screenReaderModeHint += '\n';
|
|
775
|
+
}
|
|
776
|
+
else if (!accessibilitySupport) {
|
|
777
|
+
screenReaderModeHint = AccessibilityHelpNLS.auto_off + '\n' + turnOnMessage;
|
|
778
|
+
screenReaderModeHint += '\n';
|
|
779
|
+
}
|
|
780
|
+
return screenReaderModeHint;
|
|
781
|
+
}
|
|
782
|
+
_exitDialogHint(provider) {
|
|
783
|
+
return this._verbosityEnabled() && !provider.options.position ? ( localize(1814, '\nExit this dialog (Escape).')) : '';
|
|
784
|
+
}
|
|
785
|
+
_readMoreHint(provider) {
|
|
786
|
+
return provider.options.readMoreUrl ? ( localize(
|
|
787
|
+
1815,
|
|
788
|
+
"\nOpen a browser window with more information related to accessibility{0}.",
|
|
789
|
+
`<keybinding:${AccessibilityCommandId.AccessibilityHelpOpenHelpLink}>`
|
|
790
|
+
)) : '';
|
|
791
|
+
}
|
|
718
792
|
};
|
|
719
793
|
AccessibleView = ( (__decorate([
|
|
720
794
|
( (__param(0, IOpenerService))),
|
|
@@ -745,8 +819,8 @@ let AccessibleViewService = class AccessibleViewService extends Disposable {
|
|
|
745
819
|
}
|
|
746
820
|
this._accessibleView.show(provider, undefined, undefined, position);
|
|
747
821
|
}
|
|
748
|
-
configureKeybindings() {
|
|
749
|
-
this._accessibleView?.configureKeybindings();
|
|
822
|
+
configureKeybindings(unassigned) {
|
|
823
|
+
this._accessibleView?.configureKeybindings(unassigned);
|
|
750
824
|
}
|
|
751
825
|
openHelpLink() {
|
|
752
826
|
this._accessibleView?.openHelpLink();
|
|
@@ -770,12 +844,11 @@ let AccessibleViewService = class AccessibleViewService extends Disposable {
|
|
|
770
844
|
const keybinding = this._keybindingService.lookupKeybinding(AccessibilityCommandId.OpenAccessibleView)?.getAriaLabel();
|
|
771
845
|
let hint = null;
|
|
772
846
|
if (keybinding) {
|
|
773
|
-
hint = (
|
|
847
|
+
hint = ( localize(1816, "Inspect this in the accessible view with {0}", keybinding));
|
|
774
848
|
}
|
|
775
849
|
else {
|
|
776
|
-
hint = (
|
|
777
|
-
|
|
778
|
-
24,
|
|
850
|
+
hint = ( localize(
|
|
851
|
+
1817,
|
|
779
852
|
"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."
|
|
780
853
|
));
|
|
781
854
|
}
|
|
@@ -820,8 +893,8 @@ let AccessibleViewSymbolQuickPick = class AccessibleViewSymbolQuickPick {
|
|
|
820
893
|
}
|
|
821
894
|
show(provider) {
|
|
822
895
|
const quickPick = this._quickInputService.createQuickPick();
|
|
823
|
-
quickPick.placeholder = (
|
|
824
|
-
quickPick.title = (
|
|
896
|
+
quickPick.placeholder = ( localize(1818, "Type to search symbols"));
|
|
897
|
+
quickPick.title = ( localize(1819, "Go to Symbol Accessible View"));
|
|
825
898
|
const symbols = this._accessibleView.getSymbols();
|
|
826
899
|
if (!symbols) {
|
|
827
900
|
return;
|
package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewContributions.js
CHANGED
|
@@ -20,11 +20,17 @@ class AccesibleViewContributions extends Disposable {
|
|
|
20
20
|
AccessibleViewRegistry.getImplementations().forEach(impl => {
|
|
21
21
|
const implementation = (accessor) => {
|
|
22
22
|
const provider = impl.getProvider(accessor);
|
|
23
|
-
if (provider) {
|
|
23
|
+
if (!provider) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
24
27
|
accessor.get(IAccessibleViewService).show(provider);
|
|
25
28
|
return true;
|
|
26
29
|
}
|
|
27
|
-
|
|
30
|
+
catch {
|
|
31
|
+
provider.dispose();
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
28
34
|
};
|
|
29
35
|
if (impl.type === AccessibleViewType.View) {
|
|
30
36
|
this._register(AccessibleViewAction.addImplementation(impl.priority, impl.name, implementation, impl.when));
|
package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewKeybindingResolver.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
2
|
-
import { AccessibilityCommandId } from 'vscode/vscode/vs/workbench/contrib/accessibility/common/accessibilityCommands';
|
|
3
2
|
|
|
4
3
|
function resolveContentAndKeybindingItems(keybindingService, value) {
|
|
5
4
|
if (!value) {
|
|
6
5
|
return;
|
|
7
6
|
}
|
|
8
7
|
const configureKeybindingItems = [];
|
|
8
|
+
const configuredKeybindingItems = [];
|
|
9
9
|
const matches = value.matchAll(/\<keybinding:(?<commandId>.*)\>/gm);
|
|
10
10
|
for (const match of [...matches]) {
|
|
11
11
|
const commandId = match?.groups?.commandId;
|
|
@@ -13,9 +13,7 @@ function resolveContentAndKeybindingItems(keybindingService, value) {
|
|
|
13
13
|
if (match?.length && commandId) {
|
|
14
14
|
const keybinding = keybindingService.lookupKeybinding(commandId)?.getAriaLabel();
|
|
15
15
|
if (!keybinding) {
|
|
16
|
-
|
|
17
|
-
const keybindingToConfigureQuickPick = configureKb ? '(' + configureKb + ')' : 'by assigning a keybinding to the command Accessibility Help Configure Keybindings.';
|
|
18
|
-
kbLabel = `, configure a keybinding ` + keybindingToConfigureQuickPick;
|
|
16
|
+
kbLabel = ` (unassigned keybinding)`;
|
|
19
17
|
configureKeybindingItems.push({
|
|
20
18
|
label: commandId,
|
|
21
19
|
id: commandId
|
|
@@ -23,13 +21,17 @@ function resolveContentAndKeybindingItems(keybindingService, value) {
|
|
|
23
21
|
}
|
|
24
22
|
else {
|
|
25
23
|
kbLabel = ' (' + keybinding + ')';
|
|
24
|
+
configuredKeybindingItems.push({
|
|
25
|
+
label: commandId,
|
|
26
|
+
id: commandId
|
|
27
|
+
});
|
|
26
28
|
}
|
|
27
29
|
value = value.replace(match[0], kbLabel);
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
const content = ( new MarkdownString(value));
|
|
31
33
|
content.isTrusted = true;
|
|
32
|
-
return { content, configureKeybindingItems: configureKeybindingItems.length ? configureKeybindingItems : undefined };
|
|
34
|
+
return { content, configureKeybindingItems: configureKeybindingItems.length ? configureKeybindingItems : undefined, configuredKeybindingItems: configuredKeybindingItems.length ? configuredKeybindingItems : undefined };
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
export { resolveContentAndKeybindingItems };
|
|
@@ -54,7 +54,6 @@ function registerAccessibilityHelpAction(keybindingService, viewDescriptor) {
|
|
|
54
54
|
() => viewsService.openView(viewDescriptor.id, true)
|
|
55
55
|
));
|
|
56
56
|
},
|
|
57
|
-
dispose: () => { },
|
|
58
57
|
}));
|
|
59
58
|
disposableStore.add(keybindingService.onDidUpdateKeybindings(() => {
|
|
60
59
|
disposableStore.clear();
|
|
@@ -6,9 +6,9 @@ import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs
|
|
|
6
6
|
import { AccessibilitySignalLineDebuggerContribution } from './accessibilitySignalDebuggerContribution.js';
|
|
7
7
|
import { ShowSignalSoundHelp, ShowAccessibilityAnnouncementHelp } from './commands.js';
|
|
8
8
|
import { EditorTextPropertySignalsContribution } from './editorTextPropertySignalsContribution.js';
|
|
9
|
-
import {
|
|
9
|
+
import { wrapInReloadableClass0 } from 'vscode/vscode/vs/platform/observable/common/wrapInReloadableClass';
|
|
10
10
|
|
|
11
|
-
registerWorkbenchContribution2('EditorTextPropertySignalsContribution',
|
|
11
|
+
registerWorkbenchContribution2('EditorTextPropertySignalsContribution', wrapInReloadableClass0(() => EditorTextPropertySignalsContribution), WorkbenchPhase.AfterRestored);
|
|
12
12
|
registerWorkbenchContribution2('AccessibilitySignalLineDebuggerContribution', AccessibilitySignalLineDebuggerContribution, WorkbenchPhase.AfterRestored);
|
|
13
13
|
registerAction2(ShowSignalSoundHelp);
|
|
14
14
|
registerAction2(ShowAccessibilityAnnouncementHelp);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
2
2
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
3
|
-
import {
|
|
3
|
+
import { localize2, localize } from 'vscode/vscode/vs/nls';
|
|
4
4
|
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
5
5
|
import { Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
6
|
import { AccessibilitySignal, AcknowledgeDocCommentsToken } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
@@ -9,18 +9,16 @@ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/c
|
|
|
9
9
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
10
10
|
import { IPreferencesService } from 'vscode/vscode/vs/workbench/services/preferences/common/preferences.service';
|
|
11
11
|
|
|
12
|
-
const _moduleId = "vs/workbench/contrib/accessibilitySignals/browser/commands";
|
|
13
12
|
class ShowSignalSoundHelp extends Action2 {
|
|
14
13
|
static { this.ID = 'signals.sounds.help'; }
|
|
15
14
|
constructor() {
|
|
16
15
|
super({
|
|
17
16
|
id: ShowSignalSoundHelp.ID,
|
|
18
|
-
title: (
|
|
17
|
+
title: ( localize2(5579, "Help: List Signal Sounds")),
|
|
19
18
|
f1: true,
|
|
20
19
|
metadata: {
|
|
21
|
-
description: (
|
|
22
|
-
|
|
23
|
-
1,
|
|
20
|
+
description: ( localize(
|
|
21
|
+
5580,
|
|
24
22
|
"List all accessibility sounds, noises, or audio cues and configure their settings"
|
|
25
23
|
))
|
|
26
24
|
}
|
|
@@ -38,7 +36,7 @@ class ShowSignalSoundHelp extends Action2 {
|
|
|
38
36
|
signal,
|
|
39
37
|
buttons: userGestureSignals.includes(signal) ? [{
|
|
40
38
|
iconClass: ThemeIcon.asClassName(Codicon.settingsGear),
|
|
41
|
-
tooltip: (
|
|
39
|
+
tooltip: ( localize(5581, 'Configure Sound')),
|
|
42
40
|
alwaysVisible: true
|
|
43
41
|
}] : []
|
|
44
42
|
})))).sort((a, b) => a.label.localeCompare(b.label));
|
|
@@ -72,7 +70,7 @@ class ShowSignalSoundHelp extends Action2 {
|
|
|
72
70
|
qp.onDidChangeActive(() => {
|
|
73
71
|
accessibilitySignalService.playSound(qp.activeItems[0].signal.sound.getSound(true), true, AcknowledgeDocCommentsToken);
|
|
74
72
|
});
|
|
75
|
-
qp.placeholder = (
|
|
73
|
+
qp.placeholder = ( localize(5582, 'Select a sound to play and configure'));
|
|
76
74
|
qp.canSelectMany = true;
|
|
77
75
|
await qp.show();
|
|
78
76
|
}
|
|
@@ -85,12 +83,11 @@ class ShowAccessibilityAnnouncementHelp extends Action2 {
|
|
|
85
83
|
constructor() {
|
|
86
84
|
super({
|
|
87
85
|
id: ShowAccessibilityAnnouncementHelp.ID,
|
|
88
|
-
title: (
|
|
86
|
+
title: ( localize2(5583, "Help: List Signal Announcements")),
|
|
89
87
|
f1: true,
|
|
90
88
|
metadata: {
|
|
91
|
-
description: (
|
|
92
|
-
|
|
93
|
-
5,
|
|
89
|
+
description: ( localize(
|
|
90
|
+
5584,
|
|
94
91
|
"List all accessibility announcements, alerts, braille messages, and configure their settings"
|
|
95
92
|
))
|
|
96
93
|
}
|
|
@@ -108,7 +105,7 @@ class ShowAccessibilityAnnouncementHelp extends Action2 {
|
|
|
108
105
|
signal,
|
|
109
106
|
buttons: userGestureSignals.includes(signal) ? [{
|
|
110
107
|
iconClass: ThemeIcon.asClassName(Codicon.settingsGear),
|
|
111
|
-
tooltip: (
|
|
108
|
+
tooltip: ( localize(5585, 'Configure Announcement')),
|
|
112
109
|
alwaysVisible: true,
|
|
113
110
|
}] : []
|
|
114
111
|
})))).sort((a, b) => a.label.localeCompare(b.label));
|
|
@@ -139,9 +136,8 @@ class ShowAccessibilityAnnouncementHelp extends Action2 {
|
|
|
139
136
|
qp.onDidTriggerItemButton(e => {
|
|
140
137
|
preferencesService.openUserSettings({ jsonEditor: true, revealSetting: { key: e.item.signal.settingsKey, edit: true } });
|
|
141
138
|
});
|
|
142
|
-
qp.placeholder = screenReaderOptimized ? (
|
|
143
|
-
|
|
144
|
-
8,
|
|
139
|
+
qp.placeholder = screenReaderOptimized ? ( localize(5586, 'Select an announcement to configure')) : ( localize(
|
|
140
|
+
5587,
|
|
145
141
|
'Screen reader is not active, announcements are disabled by default.'
|
|
146
142
|
));
|
|
147
143
|
qp.canSelectMany = true;
|
|
@@ -58,7 +58,7 @@ let EditorTextPropertySignalsContribution = class EditorTextPropertySignalsContr
|
|
|
58
58
|
_registerAccessibilitySignalsForEditor(editor, editorModel, store) {
|
|
59
59
|
let lastLine = -1;
|
|
60
60
|
const ignoredLineSignalsForCurrentLine = ( new Set());
|
|
61
|
-
const timeouts = ( new DisposableStore());
|
|
61
|
+
const timeouts = store.add(( new DisposableStore()));
|
|
62
62
|
const propertySources = ( this._textProperties.map(p => ({ source: p.createSource(editor, editorModel), property: p })));
|
|
63
63
|
const didType = wasEventTriggeredRecently(editor.onDidChangeModelContent, 100, store);
|
|
64
64
|
store.add(editor.onDidChangeCursorPosition(args => {
|
package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/openDiffEditorAnnouncement.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { isDiffEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
4
|
-
import {
|
|
4
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
5
5
|
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
6
6
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
7
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
8
8
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
9
9
|
import { AccessibilityVerbositySettingId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
10
10
|
|
|
11
|
-
const _moduleId = "vs/workbench/contrib/accessibilitySignals/browser/openDiffEditorAnnouncement";
|
|
12
11
|
let DiffEditorActiveAnnouncementContribution = class DiffEditorActiveAnnouncementContribution extends Disposable {
|
|
13
12
|
static { this.ID = 'workbench.contrib.diffEditorActiveAnnouncement'; }
|
|
14
13
|
constructor(_editorService, _accessibilityService, _configurationService) {
|
|
@@ -36,7 +35,7 @@ let DiffEditorActiveAnnouncementContribution = class DiffEditorActiveAnnouncemen
|
|
|
36
35
|
}
|
|
37
36
|
this._onDidActiveEditorChangeListener = this._register(this._editorService.onDidActiveEditorChange(() => {
|
|
38
37
|
if (isDiffEditor(this._editorService.activeTextEditorControl)) {
|
|
39
|
-
this._accessibilityService.alert((
|
|
38
|
+
this._accessibilityService.alert(( localize(5578, "Diff editor")));
|
|
40
39
|
}
|
|
41
40
|
}));
|
|
42
41
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './accessibility.css.js';
|
|
2
|
-
import {
|
|
2
|
+
import { localize2 } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { ConfigurationTarget } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
4
4
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
5
5
|
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
@@ -10,16 +10,14 @@ import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
|
10
10
|
import { alert } from 'vscode/vscode/vs/base/browser/ui/aria/aria';
|
|
11
11
|
import { AccessibilityHelpNLS } from 'vscode/vscode/vs/editor/common/standaloneStrings';
|
|
12
12
|
|
|
13
|
-
const _moduleId = "vs/workbench/contrib/codeEditor/browser/accessibility/accessibility";
|
|
14
13
|
class ToggleScreenReaderMode extends Action2 {
|
|
15
14
|
constructor() {
|
|
16
15
|
super({
|
|
17
16
|
id: 'editor.action.toggleScreenReaderAccessibilityMode',
|
|
18
|
-
title: (
|
|
17
|
+
title: ( localize2(1869, "Toggle Screen Reader Accessibility Mode")),
|
|
19
18
|
metadata: {
|
|
20
|
-
description: (
|
|
21
|
-
|
|
22
|
-
1,
|
|
19
|
+
description: ( localize2(
|
|
20
|
+
1870,
|
|
23
21
|
"Toggles an optimized mode for usage with screen readers, braille devices, and other assistive technologies."
|
|
24
22
|
)),
|
|
25
23
|
},
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { isHotReloadEnabled } from 'vscode/vscode/vs/base/common/hotReload';
|
|
3
|
-
import 'vscode/vscode/vs/base/common/arrays';
|
|
4
|
-
import 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
5
|
-
import { autorunWithStore } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
6
|
-
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
7
|
-
import 'vscode/vscode/vs/base/common/cancellation';
|
|
8
|
-
import { readHotReloadableExport } from 'vscode/vscode/vs/editor/browser/widget/diffEditor/utils';
|
|
9
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
|
-
|
|
11
|
-
function wrapInReloadableClass(getClass) {
|
|
12
|
-
if (!isHotReloadEnabled()) {
|
|
13
|
-
return getClass();
|
|
14
|
-
}
|
|
15
|
-
return class ReloadableWrapper extends BaseClass {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this._autorun = undefined;
|
|
19
|
-
}
|
|
20
|
-
init() {
|
|
21
|
-
this._autorun = autorunWithStore((reader, store) => {
|
|
22
|
-
const clazz = readHotReloadableExport(getClass(), reader);
|
|
23
|
-
store.add(this.instantiationService.createInstance(clazz));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
dispose() {
|
|
27
|
-
this._autorun?.dispose();
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
let BaseClass = class BaseClass {
|
|
32
|
-
constructor(instantiationService) {
|
|
33
|
-
this.instantiationService = instantiationService;
|
|
34
|
-
this.init();
|
|
35
|
-
}
|
|
36
|
-
init() { }
|
|
37
|
-
};
|
|
38
|
-
BaseClass = ( __decorate([
|
|
39
|
-
( __param(0, IInstantiationService))
|
|
40
|
-
], BaseClass));
|
|
41
|
-
|
|
42
|
-
export { wrapInReloadableClass };
|