@codingame/monaco-vscode-accessibility-service-override 4.1.0 → 4.1.1
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/accessibility.js +2 -2
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibility.contribution.js +24 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityStatus.js +114 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/openDiffEditorAnnouncement.js +52 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/saveAccessibilitySignal.js +20 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.js +68 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.js +40 -0
package/accessibility.js
CHANGED
|
@@ -3,8 +3,8 @@ import { IAccessibleViewService, AccessibleViewService } from 'vscode/vscode/vs/
|
|
|
3
3
|
import { IAccessibilitySignalService, AccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
4
4
|
import audioAssets from './vscode/src/vs/platform/accessibilitySignal/browser/media/all.mp3.js';
|
|
5
5
|
import { registerAssets } from 'vscode/assets';
|
|
6
|
-
import 'vscode/
|
|
7
|
-
import 'vscode/
|
|
6
|
+
import './vscode/src/vs/workbench/contrib/accessibility/browser/accessibility.contribution.js';
|
|
7
|
+
import './vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.js';
|
|
8
8
|
import 'vscode/vscode/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignal.contribution';
|
|
9
9
|
|
|
10
10
|
registerAssets(audioAssets);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=( Object.keys(r.attributes)),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
2
|
+
|
|
3
|
+
export { n as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function __decorate(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
}
|
|
7
|
+
function __param(paramIndex, decorator) {
|
|
8
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { __decorate, __param };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-accessibility-service-override",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.1.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.1.1"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { registerAccessibilityConfiguration, DynamicSpeechAccessibilityConfiguration } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
2
|
+
import { Extensions, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
3
|
+
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
4
|
+
import 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleView';
|
|
5
|
+
import { UnfocusedViewDimmingContribution } from './unfocusedViewDimmingContribution.js';
|
|
6
|
+
import { HoverAccessibleViewContribution, NotificationAccessibleViewContribution, InlineCompletionsAccessibleViewContribution } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityContributions';
|
|
7
|
+
import { AccessibilityStatus } from './accessibilityStatus.js';
|
|
8
|
+
import { EditorAccessibilityHelpContribution } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp';
|
|
9
|
+
import { SaveAccessibilitySignalContribution } from './saveAccessibilitySignal.js';
|
|
10
|
+
import { CommentsAccessibilityHelpContribution } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsAccessibility';
|
|
11
|
+
import { DiffEditorActiveAnnouncementContribution } from './openDiffEditorAnnouncement.js';
|
|
12
|
+
|
|
13
|
+
registerAccessibilityConfiguration();
|
|
14
|
+
const workbenchRegistry = ( Registry.as(Extensions.Workbench));
|
|
15
|
+
workbenchRegistry.registerWorkbenchContribution(EditorAccessibilityHelpContribution, 4 );
|
|
16
|
+
workbenchRegistry.registerWorkbenchContribution(CommentsAccessibilityHelpContribution, 4 );
|
|
17
|
+
workbenchRegistry.registerWorkbenchContribution(UnfocusedViewDimmingContribution, 3 );
|
|
18
|
+
workbenchRegistry.registerWorkbenchContribution(HoverAccessibleViewContribution, 4 );
|
|
19
|
+
workbenchRegistry.registerWorkbenchContribution(NotificationAccessibleViewContribution, 4 );
|
|
20
|
+
workbenchRegistry.registerWorkbenchContribution(InlineCompletionsAccessibleViewContribution, 4 );
|
|
21
|
+
registerWorkbenchContribution2(AccessibilityStatus.ID, AccessibilityStatus, 2 );
|
|
22
|
+
registerWorkbenchContribution2(SaveAccessibilitySignalContribution.ID, SaveAccessibilitySignalContribution, 3 );
|
|
23
|
+
registerWorkbenchContribution2(DiffEditorActiveAnnouncementContribution.ID, DiffEditorActiveAnnouncementContribution, 3 );
|
|
24
|
+
registerWorkbenchContribution2(DynamicSpeechAccessibilityConfiguration.ID, DynamicSpeechAccessibilityConfiguration, 3 );
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
4
|
+
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
5
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
6
|
+
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
7
|
+
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
8
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
9
|
+
import { NotificationPriority, INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
10
|
+
import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
11
|
+
|
|
12
|
+
let AccessibilityStatus = class AccessibilityStatus extends Disposable {
|
|
13
|
+
static { this.ID = 'workbench.contrib.accessibilityStatus'; }
|
|
14
|
+
constructor(configurationService, notificationService, accessibilityService, statusbarService) {
|
|
15
|
+
super();
|
|
16
|
+
this.configurationService = configurationService;
|
|
17
|
+
this.notificationService = notificationService;
|
|
18
|
+
this.accessibilityService = accessibilityService;
|
|
19
|
+
this.statusbarService = statusbarService;
|
|
20
|
+
this.screenReaderNotification = null;
|
|
21
|
+
this.promptedScreenReader = false;
|
|
22
|
+
this.screenReaderModeElement = this._register(( new MutableDisposable()));
|
|
23
|
+
this._register(CommandsRegistry.registerCommand({ id: 'showEditorScreenReaderNotification', handler: () => this.showScreenReaderNotification() }));
|
|
24
|
+
this.updateScreenReaderModeElement(this.accessibilityService.isScreenReaderOptimized());
|
|
25
|
+
this.registerListeners();
|
|
26
|
+
}
|
|
27
|
+
registerListeners() {
|
|
28
|
+
this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => this.onScreenReaderModeChange()));
|
|
29
|
+
this._register(this.configurationService.onDidChangeConfiguration(c => {
|
|
30
|
+
if (c.affectsConfiguration('editor.accessibilitySupport')) {
|
|
31
|
+
this.onScreenReaderModeChange();
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
showScreenReaderNotification() {
|
|
36
|
+
this.screenReaderNotification = this.notificationService.prompt(Severity$1.Info, ( localizeWithPath(
|
|
37
|
+
'vs/workbench/contrib/accessibility/browser/accessibilityStatus',
|
|
38
|
+
'screenReaderDetectedExplanation.question',
|
|
39
|
+
"Are you using a screen reader to operate VS Code?"
|
|
40
|
+
)), [{
|
|
41
|
+
label: ( localizeWithPath(
|
|
42
|
+
'vs/workbench/contrib/accessibility/browser/accessibilityStatus',
|
|
43
|
+
'screenReaderDetectedExplanation.answerYes',
|
|
44
|
+
"Yes"
|
|
45
|
+
)),
|
|
46
|
+
run: () => {
|
|
47
|
+
this.configurationService.updateValue('editor.accessibilitySupport', 'on', 2 );
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
label: ( localizeWithPath(
|
|
51
|
+
'vs/workbench/contrib/accessibility/browser/accessibilityStatus',
|
|
52
|
+
'screenReaderDetectedExplanation.answerNo',
|
|
53
|
+
"No"
|
|
54
|
+
)),
|
|
55
|
+
run: () => {
|
|
56
|
+
this.configurationService.updateValue('editor.accessibilitySupport', 'off', 2 );
|
|
57
|
+
}
|
|
58
|
+
}], {
|
|
59
|
+
sticky: true,
|
|
60
|
+
priority: NotificationPriority.URGENT
|
|
61
|
+
});
|
|
62
|
+
Event.once(this.screenReaderNotification.onDidClose)(() => this.screenReaderNotification = null);
|
|
63
|
+
}
|
|
64
|
+
updateScreenReaderModeElement(visible) {
|
|
65
|
+
if (visible) {
|
|
66
|
+
if (!this.screenReaderModeElement.value) {
|
|
67
|
+
const text = ( localizeWithPath(
|
|
68
|
+
'vs/workbench/contrib/accessibility/browser/accessibilityStatus',
|
|
69
|
+
'screenReaderDetected',
|
|
70
|
+
"Screen Reader Optimized"
|
|
71
|
+
));
|
|
72
|
+
this.screenReaderModeElement.value = this.statusbarService.addEntry({
|
|
73
|
+
name: ( localizeWithPath(
|
|
74
|
+
'vs/workbench/contrib/accessibility/browser/accessibilityStatus',
|
|
75
|
+
'status.editor.screenReaderMode',
|
|
76
|
+
"Screen Reader Mode"
|
|
77
|
+
)),
|
|
78
|
+
text,
|
|
79
|
+
ariaLabel: text,
|
|
80
|
+
command: 'showEditorScreenReaderNotification',
|
|
81
|
+
kind: 'prominent',
|
|
82
|
+
showInAllWindows: true
|
|
83
|
+
}, 'status.editor.screenReaderMode', 1 , 100.6);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this.screenReaderModeElement.clear();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
onScreenReaderModeChange() {
|
|
91
|
+
const screenReaderDetected = this.accessibilityService.isScreenReaderOptimized();
|
|
92
|
+
if (screenReaderDetected) {
|
|
93
|
+
const screenReaderConfiguration = this.configurationService.getValue('editor.accessibilitySupport');
|
|
94
|
+
if (screenReaderConfiguration === 'auto') {
|
|
95
|
+
if (!this.promptedScreenReader) {
|
|
96
|
+
this.promptedScreenReader = true;
|
|
97
|
+
setTimeout(() => this.showScreenReaderNotification(), 100);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (this.screenReaderNotification) {
|
|
102
|
+
this.screenReaderNotification.close();
|
|
103
|
+
}
|
|
104
|
+
this.updateScreenReaderModeElement(this.accessibilityService.isScreenReaderOptimized());
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
AccessibilityStatus = ( __decorate([
|
|
108
|
+
( __param(0, IConfigurationService)),
|
|
109
|
+
( __param(1, INotificationService)),
|
|
110
|
+
( __param(2, IAccessibilityService)),
|
|
111
|
+
( __param(3, IStatusbarService))
|
|
112
|
+
], AccessibilityStatus));
|
|
113
|
+
|
|
114
|
+
export { AccessibilityStatus };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { isDiffEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
4
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
5
|
+
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
6
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
7
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
8
|
+
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
9
|
+
|
|
10
|
+
let DiffEditorActiveAnnouncementContribution = class DiffEditorActiveAnnouncementContribution extends Disposable {
|
|
11
|
+
static { this.ID = 'workbench.contrib.diffEditorActiveAnnouncement'; }
|
|
12
|
+
constructor(_editorService, _accessibilityService, _configurationService) {
|
|
13
|
+
super();
|
|
14
|
+
this._editorService = _editorService;
|
|
15
|
+
this._accessibilityService = _accessibilityService;
|
|
16
|
+
this._configurationService = _configurationService;
|
|
17
|
+
this._register(Event.runAndSubscribe(_accessibilityService.onDidChangeScreenReaderOptimized, () => this._updateListener()));
|
|
18
|
+
this._register(_configurationService.onDidChangeConfiguration(e => {
|
|
19
|
+
if (e.affectsConfiguration("accessibility.verbosity.diffEditorActive" )) {
|
|
20
|
+
this._updateListener();
|
|
21
|
+
}
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
_updateListener() {
|
|
25
|
+
const announcementEnabled = this._configurationService.getValue("accessibility.verbosity.diffEditorActive" );
|
|
26
|
+
const screenReaderOptimized = this._accessibilityService.isScreenReaderOptimized();
|
|
27
|
+
if (!announcementEnabled || !screenReaderOptimized) {
|
|
28
|
+
this._onDidActiveEditorChangeListener?.dispose();
|
|
29
|
+
this._onDidActiveEditorChangeListener = undefined;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (this._onDidActiveEditorChangeListener) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this._onDidActiveEditorChangeListener = this._register(this._editorService.onDidActiveEditorChange(() => {
|
|
36
|
+
if (isDiffEditor(this._editorService.activeTextEditorControl)) {
|
|
37
|
+
this._accessibilityService.alert(( localizeWithPath(
|
|
38
|
+
'vs/workbench/contrib/accessibility/browser/openDiffEditorAnnouncement',
|
|
39
|
+
'openDiffEditorAnnouncement',
|
|
40
|
+
"Diff editor"
|
|
41
|
+
)));
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
DiffEditorActiveAnnouncementContribution = ( __decorate([
|
|
47
|
+
( __param(0, IEditorService)),
|
|
48
|
+
( __param(1, IAccessibilityService)),
|
|
49
|
+
( __param(2, IConfigurationService))
|
|
50
|
+
], DiffEditorActiveAnnouncementContribution));
|
|
51
|
+
|
|
52
|
+
export { DiffEditorActiveAnnouncementContribution };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { AccessibilitySignal, IAccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
4
|
+
import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService';
|
|
5
|
+
|
|
6
|
+
let SaveAccessibilitySignalContribution = class SaveAccessibilitySignalContribution extends Disposable {
|
|
7
|
+
static { this.ID = 'workbench.contrib.saveAccessibilitySignal'; }
|
|
8
|
+
constructor(_accessibilitySignalService, _workingCopyService) {
|
|
9
|
+
super();
|
|
10
|
+
this._accessibilitySignalService = _accessibilitySignalService;
|
|
11
|
+
this._workingCopyService = _workingCopyService;
|
|
12
|
+
this._register(this._workingCopyService.onDidSave(e => this._accessibilitySignalService.playSignal(AccessibilitySignal.save, { userGesture: e.reason === 1 })));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
SaveAccessibilitySignalContribution = ( __decorate([
|
|
16
|
+
( __param(0, IAccessibilitySignalService)),
|
|
17
|
+
( __param(1, IWorkingCopyService))
|
|
18
|
+
], SaveAccessibilitySignalContribution));
|
|
19
|
+
|
|
20
|
+
export { SaveAccessibilitySignalContribution };
|
package/vscode/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { createStyleSheet } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
+
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
4
|
+
import { Disposable, toDisposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { clamp } from 'vscode/vscode/vs/base/common/numbers';
|
|
6
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
7
|
+
|
|
8
|
+
let UnfocusedViewDimmingContribution = class UnfocusedViewDimmingContribution extends Disposable {
|
|
9
|
+
constructor(configurationService) {
|
|
10
|
+
super();
|
|
11
|
+
this._styleElementDisposables = undefined;
|
|
12
|
+
this._register(toDisposable(() => this._removeStyleElement()));
|
|
13
|
+
this._register(Event.runAndSubscribe(configurationService.onDidChangeConfiguration, e => {
|
|
14
|
+
if (e && !e.affectsConfiguration("accessibility.dimUnfocused.enabled" ) && !e.affectsConfiguration("accessibility.dimUnfocused.opacity" )) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
let cssTextContent = '';
|
|
18
|
+
const enabled = ensureBoolean(configurationService.getValue("accessibility.dimUnfocused.enabled" ), false);
|
|
19
|
+
if (enabled) {
|
|
20
|
+
const opacity = clamp(ensureNumber(configurationService.getValue("accessibility.dimUnfocused.opacity" ), 0.75 ), 0.2 , 1 );
|
|
21
|
+
if (opacity !== 1) {
|
|
22
|
+
const rules = ( new Set());
|
|
23
|
+
const filterRule = `filter: opacity(${opacity});`;
|
|
24
|
+
rules.add(`.monaco-workbench .pane-body.integrated-terminal:not(:focus-within) .tabs-container { ${filterRule} }`);
|
|
25
|
+
rules.add(`.monaco-workbench .pane-body.integrated-terminal .terminal-wrapper:not(:focus-within) { ${filterRule} }`);
|
|
26
|
+
rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .monaco-editor { ${filterRule} }`);
|
|
27
|
+
rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .breadcrumbs-below-tabs { ${filterRule} }`);
|
|
28
|
+
rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .terminal-wrapper { ${filterRule} }`);
|
|
29
|
+
rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .settings-editor { ${filterRule} }`);
|
|
30
|
+
rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .keybindings-editor { ${filterRule} }`);
|
|
31
|
+
rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .monaco-editor-pane-placeholder { ${filterRule} }`);
|
|
32
|
+
rules.add(`.monaco-workbench .editor-instance:not(:focus-within) .gettingStartedContainer { ${filterRule} }`);
|
|
33
|
+
cssTextContent = [...rules].join('\n');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (cssTextContent.length === 0) {
|
|
37
|
+
this._removeStyleElement();
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this._getStyleElement().textContent = cssTextContent;
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
_getStyleElement() {
|
|
45
|
+
if (!this._styleElement) {
|
|
46
|
+
this._styleElementDisposables = ( new DisposableStore());
|
|
47
|
+
this._styleElement = createStyleSheet(undefined, undefined, this._styleElementDisposables);
|
|
48
|
+
this._styleElement.className = 'accessibilityUnfocusedViewOpacity';
|
|
49
|
+
}
|
|
50
|
+
return this._styleElement;
|
|
51
|
+
}
|
|
52
|
+
_removeStyleElement() {
|
|
53
|
+
this._styleElementDisposables?.dispose();
|
|
54
|
+
this._styleElementDisposables = undefined;
|
|
55
|
+
this._styleElement = undefined;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
UnfocusedViewDimmingContribution = ( __decorate([
|
|
59
|
+
( __param(0, IConfigurationService))
|
|
60
|
+
], UnfocusedViewDimmingContribution));
|
|
61
|
+
function ensureBoolean(value, defaultValue) {
|
|
62
|
+
return typeof value === 'boolean' ? value : defaultValue;
|
|
63
|
+
}
|
|
64
|
+
function ensureNumber(value, defaultValue) {
|
|
65
|
+
return typeof value === 'number' ? value : defaultValue;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { UnfocusedViewDimmingContribution };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
+
|
|
3
|
+
var css = ".accessible-view{background-color:var(--vscode-editorWidget-background);border:2px solid var(--vscode-focusBorder);border-radius:6px;box-shadow:0 2px 8px var(--vscode-widget-shadow);color:var(--vscode-editorWidget-foreground);margin-top:-1px;position:absolute;z-index:2550}.accessible-view-container .actions-container{display:flex;justify-content:flex-end;margin:0 auto;padding:0;width:100%}.accessible-view-title-bar{align-items:center;border-top-left-radius:5px;border-top-right-radius:5px;display:flex}.accessible-view-title{overflow:hidden;padding:3px 0;text-align:center;text-overflow:ellipsis;width:100%}.accessible-view-action-bar{flex:1;justify-content:flex-end;margin-right:4px}.accessible-view-action-bar>.actions-container{justify-content:flex-end}.accessible-view-title-bar .monaco-action-bar .action-label.codicon{background-position:50%;background-repeat:no-repeat;padding:2px}.accessible-view.hide{left:-2000px;pointer-events:none;position:fixed;top:-2000px}";
|
|
4
|
+
n(css,{});
|
|
5
|
+
|
|
6
|
+
export { css, css as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import './accessibility.css.js';
|
|
2
|
+
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
4
|
+
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
5
|
+
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
|
+
import { accessibilityHelpIsShown } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
7
|
+
import { alert } from 'vscode/vscode/vs/base/browser/ui/aria/aria';
|
|
8
|
+
import { AccessibilityHelpNLS } from 'vscode/vscode/vs/editor/common/standaloneStrings';
|
|
9
|
+
|
|
10
|
+
class ToggleScreenReaderMode extends Action2 {
|
|
11
|
+
constructor() {
|
|
12
|
+
super({
|
|
13
|
+
id: 'editor.action.toggleScreenReaderAccessibilityMode',
|
|
14
|
+
title: ( localize2WithPath(
|
|
15
|
+
'vs/workbench/contrib/codeEditor/browser/accessibility/accessibility',
|
|
16
|
+
'toggleScreenReaderMode',
|
|
17
|
+
"Toggle Screen Reader Accessibility Mode"
|
|
18
|
+
)),
|
|
19
|
+
f1: true,
|
|
20
|
+
keybinding: [{
|
|
21
|
+
primary: 2048 | 35 ,
|
|
22
|
+
weight: 200 + 10,
|
|
23
|
+
when: accessibilityHelpIsShown
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
primary: 512 | 59 | 1024 ,
|
|
27
|
+
linux: { primary: 512 | 62 | 1024 },
|
|
28
|
+
weight: 200 + 10,
|
|
29
|
+
}]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
async run(accessor) {
|
|
33
|
+
const accessibiiltyService = accessor.get(IAccessibilityService);
|
|
34
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
35
|
+
const isScreenReaderOptimized = accessibiiltyService.isScreenReaderOptimized();
|
|
36
|
+
configurationService.updateValue('editor.accessibilitySupport', isScreenReaderOptimized ? 'off' : 'on', 2 );
|
|
37
|
+
alert(isScreenReaderOptimized ? AccessibilityHelpNLS.screenReaderModeDisabled : AccessibilityHelpNLS.screenReaderModeEnabled);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
registerAction2(ToggleScreenReaderMode);
|