@codingame/monaco-vscode-accessibility-service-override 3.2.3 → 4.1.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/accessibility.js +2 -2
- package/assets/terminalBell.mp3 +0 -0
- package/assets/voiceRecordingStarted.mp3 +0 -0
- package/assets/voiceRecordingStopped.mp3 +0 -0
- package/package.json +2 -2
- package/vscode/src/vs/platform/accessibilitySignal/browser/media/all.mp3.js +2 -0
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/external/tslib/tslib.es6.js +0 -11
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibility.contribution.js +0 -21
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityStatus.js +0 -148
- package/vscode/src/vs/workbench/contrib/accessibility/browser/saveAudioCue.js +0 -22
- package/vscode/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.js +0 -68
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.js +0 -40
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 '
|
|
7
|
-
import '
|
|
6
|
+
import 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibility.contribution';
|
|
7
|
+
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility';
|
|
8
8
|
import 'vscode/vscode/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignal.contribution';
|
|
9
9
|
|
|
10
10
|
registerAssets(audioAssets);
|
package/assets/terminalBell.mp3
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-accessibility-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
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@
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.1.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -18,6 +18,8 @@ var audioAssets = {
|
|
|
18
18
|
'vs/platform/accessibilitySignal/browser/media/taskCompleted.mp3': new URL('../../../../../../../assets/taskCompleted.mp3', import.meta.url).href,
|
|
19
19
|
'vs/platform/accessibilitySignal/browser/media/taskFailed.mp3': new URL('../../../../../../../assets/taskFailed.mp3', import.meta.url).href,
|
|
20
20
|
'vs/platform/accessibilitySignal/browser/media/terminalBell.mp3': new URL('../../../../../../../assets/terminalBell.mp3', import.meta.url).href,
|
|
21
|
+
'vs/platform/accessibilitySignal/browser/media/voiceRecordingStarted.mp3': new URL('../../../../../../../assets/voiceRecordingStarted.mp3', import.meta.url).href,
|
|
22
|
+
'vs/platform/accessibilitySignal/browser/media/voiceRecordingStopped.mp3': new URL('../../../../../../../assets/voiceRecordingStopped.mp3', import.meta.url).href,
|
|
21
23
|
'vs/platform/accessibilitySignal/browser/media/warning.mp3': new URL('../../../../../../../assets/warning.mp3', import.meta.url).href
|
|
22
24
|
};
|
|
23
25
|
|
|
@@ -1,3 +0,0 @@
|
|
|
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 };
|
|
@@ -1,11 +0,0 @@
|
|
|
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 };
|
|
@@ -1,21 +0,0 @@
|
|
|
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 { UnfocusedViewDimmingContribution } from './unfocusedViewDimmingContribution.js';
|
|
5
|
-
import { HoverAccessibleViewContribution, NotificationAccessibleViewContribution, InlineCompletionsAccessibleViewContribution } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityContributions';
|
|
6
|
-
import { AccessibilityStatus } from './accessibilityStatus.js';
|
|
7
|
-
import { EditorAccessibilityHelpContribution } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp';
|
|
8
|
-
import { SaveAudioCueContribution } from './saveAudioCue.js';
|
|
9
|
-
import { CommentsAccessibilityHelpContribution } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsAccessibility';
|
|
10
|
-
|
|
11
|
-
registerAccessibilityConfiguration();
|
|
12
|
-
const workbenchRegistry = ( Registry.as(Extensions.Workbench));
|
|
13
|
-
workbenchRegistry.registerWorkbenchContribution(EditorAccessibilityHelpContribution, 4 );
|
|
14
|
-
workbenchRegistry.registerWorkbenchContribution(CommentsAccessibilityHelpContribution, 4 );
|
|
15
|
-
workbenchRegistry.registerWorkbenchContribution(UnfocusedViewDimmingContribution, 3 );
|
|
16
|
-
workbenchRegistry.registerWorkbenchContribution(HoverAccessibleViewContribution, 4 );
|
|
17
|
-
workbenchRegistry.registerWorkbenchContribution(NotificationAccessibleViewContribution, 4 );
|
|
18
|
-
workbenchRegistry.registerWorkbenchContribution(InlineCompletionsAccessibleViewContribution, 4 );
|
|
19
|
-
registerWorkbenchContribution2(AccessibilityStatus.ID, AccessibilityStatus, 2 );
|
|
20
|
-
registerWorkbenchContribution2(SaveAudioCueContribution.ID, SaveAudioCueContribution, 3 );
|
|
21
|
-
registerWorkbenchContribution2(DynamicSpeechAccessibilityConfiguration.ID, DynamicSpeechAccessibilityConfiguration, 3 );
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Disposable, toDisposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
-
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
4
|
-
import Severity 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
|
-
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
12
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
13
|
-
|
|
14
|
-
let ScreenReaderModeStatusEntry = class ScreenReaderModeStatusEntry extends Disposable {
|
|
15
|
-
constructor(statusbarService) {
|
|
16
|
-
super();
|
|
17
|
-
this.statusbarService = statusbarService;
|
|
18
|
-
this.screenReaderModeElement = this._register(( new MutableDisposable()));
|
|
19
|
-
}
|
|
20
|
-
updateScreenReaderModeElement(visible) {
|
|
21
|
-
if (visible) {
|
|
22
|
-
if (!this.screenReaderModeElement.value) {
|
|
23
|
-
const text = ( localizeWithPath(
|
|
24
|
-
'vs/workbench/contrib/accessibility/browser/accessibilityStatus',
|
|
25
|
-
'screenReaderDetected',
|
|
26
|
-
"Screen Reader Optimized"
|
|
27
|
-
));
|
|
28
|
-
this.screenReaderModeElement.value = this.statusbarService.addEntry({
|
|
29
|
-
name: ( localizeWithPath(
|
|
30
|
-
'vs/workbench/contrib/accessibility/browser/accessibilityStatus',
|
|
31
|
-
'status.editor.screenReaderMode',
|
|
32
|
-
"Screen Reader Mode"
|
|
33
|
-
)),
|
|
34
|
-
text,
|
|
35
|
-
ariaLabel: text,
|
|
36
|
-
command: 'showEditorScreenReaderNotification',
|
|
37
|
-
kind: 'prominent'
|
|
38
|
-
}, 'status.editor.screenReaderMode', 1 , 100.6);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.screenReaderModeElement.clear();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
ScreenReaderModeStatusEntry = ( __decorate([
|
|
47
|
-
( __param(0, IStatusbarService))
|
|
48
|
-
], ScreenReaderModeStatusEntry));
|
|
49
|
-
let AccessibilityStatus = class AccessibilityStatus extends Disposable {
|
|
50
|
-
static { this.ID = 'workbench.contrib.accessibilityStatus'; }
|
|
51
|
-
constructor(configurationService, notificationService, accessibilityService, instantiationService, editorGroupService) {
|
|
52
|
-
super();
|
|
53
|
-
this.configurationService = configurationService;
|
|
54
|
-
this.notificationService = notificationService;
|
|
55
|
-
this.accessibilityService = accessibilityService;
|
|
56
|
-
this.editorGroupService = editorGroupService;
|
|
57
|
-
this.screenReaderNotification = null;
|
|
58
|
-
this.promptedScreenReader = false;
|
|
59
|
-
this.screenReaderModeElements = ( new Set());
|
|
60
|
-
this.createScreenReaderModeElement(instantiationService, this._store);
|
|
61
|
-
this.updateScreenReaderModeElements(accessibilityService.isScreenReaderOptimized());
|
|
62
|
-
CommandsRegistry.registerCommand({ id: 'showEditorScreenReaderNotification', handler: () => this.showScreenReaderNotification() });
|
|
63
|
-
this.registerListeners();
|
|
64
|
-
}
|
|
65
|
-
createScreenReaderModeElement(instantiationService, disposables) {
|
|
66
|
-
const entry = disposables.add(instantiationService.createInstance(ScreenReaderModeStatusEntry));
|
|
67
|
-
this.screenReaderModeElements.add(entry);
|
|
68
|
-
disposables.add(toDisposable(() => this.screenReaderModeElements.delete(entry)));
|
|
69
|
-
return entry;
|
|
70
|
-
}
|
|
71
|
-
updateScreenReaderModeElements(visible) {
|
|
72
|
-
for (const entry of this.screenReaderModeElements) {
|
|
73
|
-
entry.updateScreenReaderModeElement(visible);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
registerListeners() {
|
|
77
|
-
this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => this.onScreenReaderModeChange()));
|
|
78
|
-
this._register(this.configurationService.onDidChangeConfiguration(c => {
|
|
79
|
-
if (c.affectsConfiguration('editor.accessibilitySupport')) {
|
|
80
|
-
this.onScreenReaderModeChange();
|
|
81
|
-
}
|
|
82
|
-
}));
|
|
83
|
-
this._register(this.editorGroupService.onDidCreateAuxiliaryEditorPart(({ instantiationService, disposables }) => {
|
|
84
|
-
const entry = this.createScreenReaderModeElement(instantiationService, disposables);
|
|
85
|
-
entry.updateScreenReaderModeElement(this.accessibilityService.isScreenReaderOptimized());
|
|
86
|
-
}));
|
|
87
|
-
}
|
|
88
|
-
showScreenReaderNotification() {
|
|
89
|
-
this.screenReaderNotification = this.notificationService.prompt(Severity.Info, ( localizeWithPath(
|
|
90
|
-
'vs/workbench/contrib/accessibility/browser/accessibilityStatus',
|
|
91
|
-
'screenReaderDetectedExplanation.question',
|
|
92
|
-
"Are you using a screen reader to operate VS Code?"
|
|
93
|
-
)), [{
|
|
94
|
-
label: ( localizeWithPath(
|
|
95
|
-
'vs/workbench/contrib/accessibility/browser/accessibilityStatus',
|
|
96
|
-
'screenReaderDetectedExplanation.answerYes',
|
|
97
|
-
"Yes"
|
|
98
|
-
)),
|
|
99
|
-
run: () => {
|
|
100
|
-
this.configurationService.updateValue('editor.accessibilitySupport', 'on', 2 );
|
|
101
|
-
}
|
|
102
|
-
}, {
|
|
103
|
-
label: ( localizeWithPath(
|
|
104
|
-
'vs/workbench/contrib/accessibility/browser/accessibilityStatus',
|
|
105
|
-
'screenReaderDetectedExplanation.answerNo',
|
|
106
|
-
"No"
|
|
107
|
-
)),
|
|
108
|
-
run: () => {
|
|
109
|
-
this.configurationService.updateValue('editor.accessibilitySupport', 'off', 2 );
|
|
110
|
-
}
|
|
111
|
-
}], {
|
|
112
|
-
sticky: true,
|
|
113
|
-
priority: NotificationPriority.URGENT
|
|
114
|
-
});
|
|
115
|
-
Event.once(this.screenReaderNotification.onDidClose)(() => this.screenReaderNotification = null);
|
|
116
|
-
}
|
|
117
|
-
onScreenReaderModeChange() {
|
|
118
|
-
const screenReaderDetected = this.accessibilityService.isScreenReaderOptimized();
|
|
119
|
-
if (screenReaderDetected) {
|
|
120
|
-
const screenReaderConfiguration = this.configurationService.getValue('editor.accessibilitySupport');
|
|
121
|
-
if (screenReaderConfiguration === 'auto') {
|
|
122
|
-
if (!this.promptedScreenReader) {
|
|
123
|
-
this.promptedScreenReader = true;
|
|
124
|
-
setTimeout(() => this.showScreenReaderNotification(), 100);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
if (this.screenReaderNotification) {
|
|
129
|
-
this.screenReaderNotification.close();
|
|
130
|
-
}
|
|
131
|
-
this.updateScreenReaderModeElements(this.accessibilityService.isScreenReaderOptimized());
|
|
132
|
-
}
|
|
133
|
-
dispose() {
|
|
134
|
-
super.dispose();
|
|
135
|
-
for (const entry of this.screenReaderModeElements) {
|
|
136
|
-
entry.dispose();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
AccessibilityStatus = ( __decorate([
|
|
141
|
-
( __param(0, IConfigurationService)),
|
|
142
|
-
( __param(1, INotificationService)),
|
|
143
|
-
( __param(2, IAccessibilityService)),
|
|
144
|
-
( __param(3, IInstantiationService)),
|
|
145
|
-
( __param(4, IEditorGroupsService))
|
|
146
|
-
], AccessibilityStatus));
|
|
147
|
-
|
|
148
|
-
export { AccessibilityStatus };
|
|
@@ -1,22 +0,0 @@
|
|
|
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 SaveAudioCueContribution = class SaveAudioCueContribution extends Disposable {
|
|
7
|
-
static { this.ID = 'workbench.contrib.saveAudioCues'; }
|
|
8
|
-
constructor(_accessibilitySignalService, _workingCopyService) {
|
|
9
|
-
super();
|
|
10
|
-
this._accessibilitySignalService = _accessibilitySignalService;
|
|
11
|
-
this._workingCopyService = _workingCopyService;
|
|
12
|
-
this._register(this._workingCopyService.onDidSave((e) => {
|
|
13
|
-
this._accessibilitySignalService.playSignal(AccessibilitySignal.save, { userGesture: e.reason === 1 });
|
|
14
|
-
}));
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
SaveAudioCueContribution = ( __decorate([
|
|
18
|
-
( __param(0, IAccessibilitySignalService)),
|
|
19
|
-
( __param(1, IWorkingCopyService))
|
|
20
|
-
], SaveAudioCueContribution));
|
|
21
|
-
|
|
22
|
-
export { SaveAudioCueContribution };
|
package/vscode/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
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 };
|
package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.css.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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 };
|
|
@@ -1,40 +0,0 @@
|
|
|
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);
|