@yaronelh/accessibilitytool 1.0.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/CHANGELOG.md +162 -0
- package/LICENSE +21 -0
- package/README.md +373 -0
- package/dist/common.d.ts +22 -0
- package/dist/common.js +215 -0
- package/dist/common.js.map +1 -0
- package/dist/core/event-utils.d.ts +2 -0
- package/dist/core/event-utils.js +15 -0
- package/dist/core/event-utils.js.map +1 -0
- package/dist/core/hotkeys.d.ts +3 -0
- package/dist/core/hotkeys.js +35 -0
- package/dist/core/hotkeys.js.map +1 -0
- package/dist/core/icon-assets.d.ts +13 -0
- package/dist/core/icon-assets.js +148 -0
- package/dist/core/icon-assets.js.map +1 -0
- package/dist/core/options.d.ts +6 -0
- package/dist/core/options.js +58 -0
- package/dist/core/options.js.map +1 -0
- package/dist/core/security.d.ts +3 -0
- package/dist/core/security.js +45 -0
- package/dist/core/security.js.map +1 -0
- package/dist/core/session.d.ts +14 -0
- package/dist/core/session.js +43 -0
- package/dist/core/session.js.map +1 -0
- package/dist/interfaces/accessibility.interface.d.ts +208 -0
- package/dist/interfaces/accessibility.interface.js +23 -0
- package/dist/interfaces/accessibility.interface.js.map +1 -0
- package/dist/interfaces/common.interface.d.ts +39 -0
- package/dist/interfaces/common.interface.js +3 -0
- package/dist/interfaces/common.interface.js.map +1 -0
- package/dist/interfaces/menu.interface.d.ts +18 -0
- package/dist/interfaces/menu.interface.js +3 -0
- package/dist/interfaces/menu.interface.js.map +1 -0
- package/dist/main.d.ts +84 -0
- package/dist/main.js +1771 -0
- package/dist/main.js.map +1 -0
- package/dist/menu-interface.d.ts +24 -0
- package/dist/menu-interface.js +561 -0
- package/dist/menu-interface.js.map +1 -0
- package/dist/storage.d.ts +9 -0
- package/dist/storage.js +40 -0
- package/dist/storage.js.map +1 -0
- package/dist-cjs/common.d.ts +22 -0
- package/dist-cjs/common.js +215 -0
- package/dist-cjs/common.js.map +1 -0
- package/dist-cjs/core/event-utils.d.ts +2 -0
- package/dist-cjs/core/event-utils.js +15 -0
- package/dist-cjs/core/event-utils.js.map +1 -0
- package/dist-cjs/core/hotkeys.d.ts +3 -0
- package/dist-cjs/core/hotkeys.js +35 -0
- package/dist-cjs/core/hotkeys.js.map +1 -0
- package/dist-cjs/core/icon-assets.d.ts +13 -0
- package/dist-cjs/core/icon-assets.js +148 -0
- package/dist-cjs/core/icon-assets.js.map +1 -0
- package/dist-cjs/core/options.d.ts +6 -0
- package/dist-cjs/core/options.js +58 -0
- package/dist-cjs/core/options.js.map +1 -0
- package/dist-cjs/core/security.d.ts +3 -0
- package/dist-cjs/core/security.js +45 -0
- package/dist-cjs/core/security.js.map +1 -0
- package/dist-cjs/core/session.d.ts +14 -0
- package/dist-cjs/core/session.js +43 -0
- package/dist-cjs/core/session.js.map +1 -0
- package/dist-cjs/interfaces/accessibility.interface.d.ts +208 -0
- package/dist-cjs/interfaces/accessibility.interface.js +23 -0
- package/dist-cjs/interfaces/accessibility.interface.js.map +1 -0
- package/dist-cjs/interfaces/common.interface.d.ts +39 -0
- package/dist-cjs/interfaces/common.interface.js +3 -0
- package/dist-cjs/interfaces/common.interface.js.map +1 -0
- package/dist-cjs/interfaces/menu.interface.d.ts +18 -0
- package/dist-cjs/interfaces/menu.interface.js +3 -0
- package/dist-cjs/interfaces/menu.interface.js.map +1 -0
- package/dist-cjs/main.d.ts +84 -0
- package/dist-cjs/main.js +1771 -0
- package/dist-cjs/main.js.map +1 -0
- package/dist-cjs/menu-interface.d.ts +24 -0
- package/dist-cjs/menu-interface.js +561 -0
- package/dist-cjs/menu-interface.js.map +1 -0
- package/dist-cjs/storage.d.ts +9 -0
- package/dist-cjs/storage.js +40 -0
- package/dist-cjs/storage.js.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.saveSessionState = saveSessionState;
|
|
4
|
+
exports.restoreSessionState = restoreSessionState;
|
|
5
|
+
const SESSION_STORAGE_KEY = 'accessibility:session:v1';
|
|
6
|
+
const LEGACY_SESSION_STORAGE_KEY = '_accessState';
|
|
7
|
+
function saveSessionState(storage, sessionState) {
|
|
8
|
+
storage.set(SESSION_STORAGE_KEY, sessionState);
|
|
9
|
+
storage.remove(LEGACY_SESSION_STORAGE_KEY);
|
|
10
|
+
}
|
|
11
|
+
function restoreSessionState(storage, handlers) {
|
|
12
|
+
const sessionState = (storage.get(SESSION_STORAGE_KEY) ??
|
|
13
|
+
storage.get(LEGACY_SESSION_STORAGE_KEY));
|
|
14
|
+
if (!sessionState)
|
|
15
|
+
return;
|
|
16
|
+
replayDelta(sessionState.textSize, handlers.applyTextSize);
|
|
17
|
+
replayDelta(sessionState.textSpace, handlers.applyTextSpace);
|
|
18
|
+
replayDelta(sessionState.lineHeight, handlers.applyLineHeight);
|
|
19
|
+
if (sessionState.invertColors)
|
|
20
|
+
handlers.enableInvertColors();
|
|
21
|
+
if (sessionState.grayHues)
|
|
22
|
+
handlers.enableGrayHues();
|
|
23
|
+
if (sessionState.underlineLinks)
|
|
24
|
+
handlers.enableUnderlineLinks();
|
|
25
|
+
if (sessionState.bigCursor)
|
|
26
|
+
handlers.enableBigCursor();
|
|
27
|
+
if (sessionState.readingGuide)
|
|
28
|
+
handlers.enableReadingGuide();
|
|
29
|
+
handlers.assignSessionState(sessionState);
|
|
30
|
+
}
|
|
31
|
+
function replayDelta(value, apply) {
|
|
32
|
+
if (!value)
|
|
33
|
+
return;
|
|
34
|
+
if (value > 0) {
|
|
35
|
+
while (value--)
|
|
36
|
+
apply(true);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
while (value++)
|
|
40
|
+
apply(false);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":";;AAMA,4CAGC;AAED,kDA6BC;AArCD,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AACvD,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAElD,SAAgB,gBAAgB,CAAC,OAAgB,EAAE,YAA2B;IAC7E,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC;IAC/C,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAC5C,CAAC;AAED,SAAgB,mBAAmB,CAClC,OAAgB,EAChB,QAUC;IAED,MAAM,YAAY,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAyB,CAAC;IAClE,IAAI,CAAC,YAAY;QAAE,OAAO;IAE1B,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC3D,WAAW,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC7D,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAE/D,IAAI,YAAY,CAAC,YAAY;QAAE,QAAQ,CAAC,kBAAkB,EAAE,CAAC;IAC7D,IAAI,YAAY,CAAC,QAAQ;QAAE,QAAQ,CAAC,cAAc,EAAE,CAAC;IACrD,IAAI,YAAY,CAAC,cAAc;QAAE,QAAQ,CAAC,oBAAoB,EAAE,CAAC;IACjE,IAAI,YAAY,CAAC,SAAS;QAAE,QAAQ,CAAC,eAAe,EAAE,CAAC;IACvD,IAAI,YAAY,CAAC,YAAY;QAAE,QAAQ,CAAC,kBAAkB,EAAE,CAAC;IAE7D,QAAQ,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,WAAW,CAAC,KAAa,EAAE,KAAoC;IACvE,IAAI,CAAC,KAAK;QAAE,OAAO;IAEnB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACf,OAAO,KAAK,EAAE;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;SAAM,CAAC;QACP,OAAO,KAAK,EAAE;YAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { ICommon, IJsonToHtml, IUnitsDim } from './common.interface.js';
|
|
2
|
+
import { IMenuInterface } from './menu.interface.js';
|
|
3
|
+
export interface IAccessibility {
|
|
4
|
+
menuInterface: IMenuInterface;
|
|
5
|
+
options: IAccessibilityOptions;
|
|
6
|
+
sessionState: ISessionState;
|
|
7
|
+
common: ICommon;
|
|
8
|
+
stateValues: IStateValues;
|
|
9
|
+
isReading: boolean;
|
|
10
|
+
readonly html: HTMLElement;
|
|
11
|
+
readonly body: HTMLBodyElement;
|
|
12
|
+
readonly recognition: any;
|
|
13
|
+
readonly fixedDefaultFont: string;
|
|
14
|
+
alterTextSize(isIncrease: boolean): void;
|
|
15
|
+
alterTextSpace(isIncrease: boolean): void;
|
|
16
|
+
alterLineHeight(isIncrease: boolean): void;
|
|
17
|
+
speechToText(): void;
|
|
18
|
+
textToSpeech(text: string): void;
|
|
19
|
+
listen(e?: Event): void;
|
|
20
|
+
read(e?: Event): void;
|
|
21
|
+
runHotkey(name: string): void;
|
|
22
|
+
toggleMenu(): void;
|
|
23
|
+
invoke(action: string, button: HTMLElement): void;
|
|
24
|
+
build(): void;
|
|
25
|
+
updateReadGuide(e: Event | TouchEvent | any): void;
|
|
26
|
+
resetIfDefined(src: string, dest: any, prop: string): void;
|
|
27
|
+
onChange(updateSession: boolean): void;
|
|
28
|
+
createScreenShot(url: string): Promise<string>;
|
|
29
|
+
injectCss(injectFull: boolean): void;
|
|
30
|
+
removeCSS(): void;
|
|
31
|
+
}
|
|
32
|
+
export interface IAccessibilityOptions {
|
|
33
|
+
icon?: IAccessibilityIconOptions;
|
|
34
|
+
hotkeys?: IAccessibilityHotkeysOptions;
|
|
35
|
+
guide?: IAccessibilityGuideOptions;
|
|
36
|
+
labels?: IAccessibilityMenuLabelsOptions;
|
|
37
|
+
textToSpeechLang?: string;
|
|
38
|
+
speechToTextLang?: string;
|
|
39
|
+
textPixelMode?: boolean;
|
|
40
|
+
textEmlMode?: boolean;
|
|
41
|
+
textSizeFactor?: number;
|
|
42
|
+
modules?: IAccessibilityModulesOptions;
|
|
43
|
+
modulesOrder?: Array<IAccessibilityModuleOrder>;
|
|
44
|
+
session?: IAccessibilitySessionOptions;
|
|
45
|
+
iframeModals?: Array<IIframeModal>;
|
|
46
|
+
customFunctions?: Array<ICustomFunction>;
|
|
47
|
+
allowedIframeOrigins?: string[];
|
|
48
|
+
statement?: IAccessibilityUrlOptions;
|
|
49
|
+
feedback?: IAccessibilityUrlOptions;
|
|
50
|
+
language?: IAccessibilityLanguageOptions;
|
|
51
|
+
suppressCssInjection?: boolean;
|
|
52
|
+
suppressDomInjection?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface ICustomFunction {
|
|
55
|
+
method: Function;
|
|
56
|
+
buttonText: string;
|
|
57
|
+
id: any;
|
|
58
|
+
toggle: boolean;
|
|
59
|
+
icon?: string;
|
|
60
|
+
emoji?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface IIframeModal {
|
|
63
|
+
iframeUrl: string;
|
|
64
|
+
buttonText: string;
|
|
65
|
+
icon?: string;
|
|
66
|
+
emoji?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface IAccessibilityIconOptions {
|
|
69
|
+
img?: string;
|
|
70
|
+
imgElem?: IJsonToHtml;
|
|
71
|
+
fontFaceSrc?: Array<string>;
|
|
72
|
+
fontClass?: string;
|
|
73
|
+
useEmojis?: boolean;
|
|
74
|
+
allowRemoteFonts?: boolean;
|
|
75
|
+
fontFamilyValidation?: string;
|
|
76
|
+
tabIndex?: number;
|
|
77
|
+
closeIcon?: string;
|
|
78
|
+
resetIcon?: string;
|
|
79
|
+
closeIconElem?: IJsonToHtml;
|
|
80
|
+
resetIconElem?: IJsonToHtml;
|
|
81
|
+
}
|
|
82
|
+
export interface IAccessibilityIconPositionOptions {
|
|
83
|
+
top?: IUnitsDim;
|
|
84
|
+
bottom?: IUnitsDim;
|
|
85
|
+
left?: IUnitsDim;
|
|
86
|
+
right?: IUnitsDim;
|
|
87
|
+
type?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface IAccessibilityIconDimensionsOptions {
|
|
90
|
+
width: IUnitsDim;
|
|
91
|
+
height: IUnitsDim;
|
|
92
|
+
}
|
|
93
|
+
export interface IAccessibilityHotkeysOptions {
|
|
94
|
+
enabled: boolean;
|
|
95
|
+
helpTitles: boolean;
|
|
96
|
+
keys: IAccessibilityHotkeysKeysOptions;
|
|
97
|
+
}
|
|
98
|
+
export interface IAccessibilityHotkeysKeysOptions {
|
|
99
|
+
toggleMenu: Array<any>;
|
|
100
|
+
invertColors: Array<any>;
|
|
101
|
+
grayHues: Array<any>;
|
|
102
|
+
underlineLinks: Array<any>;
|
|
103
|
+
bigCursor: Array<any>;
|
|
104
|
+
readingGuide: Array<any>;
|
|
105
|
+
textToSpeech: Array<any>;
|
|
106
|
+
speechToText: Array<any>;
|
|
107
|
+
disableAnimations: Array<any>;
|
|
108
|
+
}
|
|
109
|
+
export interface IAccessibilityGuideOptions {
|
|
110
|
+
cBorder: string;
|
|
111
|
+
cBackground: string;
|
|
112
|
+
height: string;
|
|
113
|
+
}
|
|
114
|
+
export interface IAccessibilityMenuDimensionsOptions {
|
|
115
|
+
width: IUnitsDim;
|
|
116
|
+
height: IUnitsDim;
|
|
117
|
+
}
|
|
118
|
+
export interface IAccessibilityMenuLabelsOptions {
|
|
119
|
+
resetTitle: string;
|
|
120
|
+
closeTitle: string;
|
|
121
|
+
menuTitle: string;
|
|
122
|
+
increaseText: string;
|
|
123
|
+
decreaseText: string;
|
|
124
|
+
increaseTextSpacing: string;
|
|
125
|
+
decreaseTextSpacing: string;
|
|
126
|
+
invertColors: string;
|
|
127
|
+
grayHues: string;
|
|
128
|
+
bigCursor: string;
|
|
129
|
+
readingGuide: string;
|
|
130
|
+
underlineLinks: string;
|
|
131
|
+
textToSpeech: string;
|
|
132
|
+
speechToText: string;
|
|
133
|
+
disableAnimations: string;
|
|
134
|
+
increaseLineHeight: string;
|
|
135
|
+
decreaseLineHeight: string;
|
|
136
|
+
hotkeyPrefix: string;
|
|
137
|
+
}
|
|
138
|
+
export interface IAccessibilityModulesOptions {
|
|
139
|
+
increaseText: boolean;
|
|
140
|
+
decreaseText: boolean;
|
|
141
|
+
increaseTextSpacing: boolean;
|
|
142
|
+
decreaseTextSpacing: boolean;
|
|
143
|
+
increaseLineHeight: boolean;
|
|
144
|
+
decreaseLineHeight: boolean;
|
|
145
|
+
invertColors: boolean;
|
|
146
|
+
grayHues: boolean;
|
|
147
|
+
bigCursor: boolean;
|
|
148
|
+
readingGuide: boolean;
|
|
149
|
+
underlineLinks: boolean;
|
|
150
|
+
textToSpeech: boolean;
|
|
151
|
+
speechToText: boolean;
|
|
152
|
+
disableAnimations: boolean;
|
|
153
|
+
}
|
|
154
|
+
export declare enum AccessibilityModulesType {
|
|
155
|
+
increaseText = 1,
|
|
156
|
+
decreaseText = 2,
|
|
157
|
+
increaseTextSpacing = 3,
|
|
158
|
+
decreaseTextSpacing = 4,
|
|
159
|
+
increaseLineHeight = 5,
|
|
160
|
+
decreaseLineHeight = 6,
|
|
161
|
+
invertColors = 7,
|
|
162
|
+
grayHues = 8,
|
|
163
|
+
bigCursor = 9,
|
|
164
|
+
readingGuide = 10,
|
|
165
|
+
underlineLinks = 11,
|
|
166
|
+
textToSpeech = 12,
|
|
167
|
+
speechToText = 13,
|
|
168
|
+
disableAnimations = 14,
|
|
169
|
+
iframeModals = 15,
|
|
170
|
+
customFunctions = 16
|
|
171
|
+
}
|
|
172
|
+
export interface IAccessibilityModuleOrder {
|
|
173
|
+
order: number;
|
|
174
|
+
type: AccessibilityModulesType;
|
|
175
|
+
}
|
|
176
|
+
export interface IAccessibilitySessionOptions {
|
|
177
|
+
persistent: boolean;
|
|
178
|
+
}
|
|
179
|
+
export interface IAccessibilityUrlOptions {
|
|
180
|
+
url: string;
|
|
181
|
+
}
|
|
182
|
+
export interface IAccessibilityLanguageOptions {
|
|
183
|
+
textToSpeechLang: string;
|
|
184
|
+
speechToTextLang: string;
|
|
185
|
+
}
|
|
186
|
+
export interface ISessionState {
|
|
187
|
+
textSize: number;
|
|
188
|
+
textSpace: number;
|
|
189
|
+
lineHeight: number;
|
|
190
|
+
invertColors: boolean;
|
|
191
|
+
grayHues: boolean;
|
|
192
|
+
underlineLinks: boolean;
|
|
193
|
+
bigCursor: boolean;
|
|
194
|
+
readingGuide: boolean;
|
|
195
|
+
}
|
|
196
|
+
export interface IStateValues {
|
|
197
|
+
underlineLinks: boolean;
|
|
198
|
+
textToSpeech: boolean;
|
|
199
|
+
bigCursor: boolean;
|
|
200
|
+
readingGuide: boolean;
|
|
201
|
+
invertColors?: boolean;
|
|
202
|
+
grayHues?: boolean;
|
|
203
|
+
speechToText?: boolean;
|
|
204
|
+
disableAnimations?: boolean;
|
|
205
|
+
speechRate?: number;
|
|
206
|
+
body: any;
|
|
207
|
+
html: any;
|
|
208
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccessibilityModulesType = void 0;
|
|
4
|
+
var AccessibilityModulesType;
|
|
5
|
+
(function (AccessibilityModulesType) {
|
|
6
|
+
AccessibilityModulesType[AccessibilityModulesType["increaseText"] = 1] = "increaseText";
|
|
7
|
+
AccessibilityModulesType[AccessibilityModulesType["decreaseText"] = 2] = "decreaseText";
|
|
8
|
+
AccessibilityModulesType[AccessibilityModulesType["increaseTextSpacing"] = 3] = "increaseTextSpacing";
|
|
9
|
+
AccessibilityModulesType[AccessibilityModulesType["decreaseTextSpacing"] = 4] = "decreaseTextSpacing";
|
|
10
|
+
AccessibilityModulesType[AccessibilityModulesType["increaseLineHeight"] = 5] = "increaseLineHeight";
|
|
11
|
+
AccessibilityModulesType[AccessibilityModulesType["decreaseLineHeight"] = 6] = "decreaseLineHeight";
|
|
12
|
+
AccessibilityModulesType[AccessibilityModulesType["invertColors"] = 7] = "invertColors";
|
|
13
|
+
AccessibilityModulesType[AccessibilityModulesType["grayHues"] = 8] = "grayHues";
|
|
14
|
+
AccessibilityModulesType[AccessibilityModulesType["bigCursor"] = 9] = "bigCursor";
|
|
15
|
+
AccessibilityModulesType[AccessibilityModulesType["readingGuide"] = 10] = "readingGuide";
|
|
16
|
+
AccessibilityModulesType[AccessibilityModulesType["underlineLinks"] = 11] = "underlineLinks";
|
|
17
|
+
AccessibilityModulesType[AccessibilityModulesType["textToSpeech"] = 12] = "textToSpeech";
|
|
18
|
+
AccessibilityModulesType[AccessibilityModulesType["speechToText"] = 13] = "speechToText";
|
|
19
|
+
AccessibilityModulesType[AccessibilityModulesType["disableAnimations"] = 14] = "disableAnimations";
|
|
20
|
+
AccessibilityModulesType[AccessibilityModulesType["iframeModals"] = 15] = "iframeModals";
|
|
21
|
+
AccessibilityModulesType[AccessibilityModulesType["customFunctions"] = 16] = "customFunctions";
|
|
22
|
+
})(AccessibilityModulesType || (exports.AccessibilityModulesType = AccessibilityModulesType = {}));
|
|
23
|
+
//# sourceMappingURL=accessibility.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibility.interface.js","sourceRoot":"","sources":["../../src/interfaces/accessibility.interface.ts"],"names":[],"mappings":";;;AAuKA,IAAY,wBAiBX;AAjBD,WAAY,wBAAwB;IACnC,uFAAgB,CAAA;IAChB,uFAAgB,CAAA;IAChB,qGAAuB,CAAA;IACvB,qGAAuB,CAAA;IACvB,mGAAsB,CAAA;IACtB,mGAAsB,CAAA;IACtB,uFAAgB,CAAA;IAChB,+EAAY,CAAA;IACZ,iFAAa,CAAA;IACb,wFAAiB,CAAA;IACjB,4FAAmB,CAAA;IACnB,wFAAiB,CAAA;IACjB,wFAAiB,CAAA;IACjB,kGAAsB,CAAA;IACtB,wFAAiB,CAAA;IACjB,8FAAoB,CAAA;AACrB,CAAC,EAjBW,wBAAwB,wCAAxB,wBAAwB,QAiBnC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface ICommon {
|
|
2
|
+
deployedObjects: IDeployedObjects;
|
|
3
|
+
isIOS(): boolean;
|
|
4
|
+
jsonToHtml(obj: IJsonToHtml): HTMLElement;
|
|
5
|
+
injectStyle(css: string, innerOptions?: IInjectStyleOptions): void;
|
|
6
|
+
getFormattedDim(value: string): IFormattedDim;
|
|
7
|
+
extend(src: any, dest: any): void;
|
|
8
|
+
injectIconsFont(urls: Array<string>, callback: Function): void;
|
|
9
|
+
getFixedFont(name: string): void;
|
|
10
|
+
getFixedPseudoFont(name: string): void;
|
|
11
|
+
isFontLoaded(fontFamily?: string, callback?: Function): void;
|
|
12
|
+
warn(msg: string): void;
|
|
13
|
+
createScreenshot(url: string): Promise<string>;
|
|
14
|
+
getFileExtension(filename: string): string;
|
|
15
|
+
}
|
|
16
|
+
export interface IJsonToHtml {
|
|
17
|
+
type: string;
|
|
18
|
+
attrs?: any;
|
|
19
|
+
children?: Array<IJsonToHtml>;
|
|
20
|
+
text?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IInjectStyleOptions {
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface IFormattedDim {
|
|
26
|
+
size: string | number;
|
|
27
|
+
suffix: string;
|
|
28
|
+
}
|
|
29
|
+
export interface IUnitsDim {
|
|
30
|
+
size: string | number;
|
|
31
|
+
units: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IDeployedObjects {
|
|
34
|
+
get(key: string): boolean;
|
|
35
|
+
contains(key: string): boolean;
|
|
36
|
+
set(key: string, val: boolean): void;
|
|
37
|
+
remove(key: string): void;
|
|
38
|
+
getAll(): Map<string, boolean>;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.interface.js","sourceRoot":"","sources":["../../src/interfaces/common.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface IMenuInterface {
|
|
2
|
+
increaseText(): void;
|
|
3
|
+
decreaseText(): void;
|
|
4
|
+
increaseTextSpacing(): void;
|
|
5
|
+
decreaseTextSpacing(): void;
|
|
6
|
+
invertColors(destroy?: boolean): void;
|
|
7
|
+
grayHues(destroy?: boolean): void;
|
|
8
|
+
underlineLinks(destroy?: boolean): void;
|
|
9
|
+
bigCursor(destroy?: boolean): void;
|
|
10
|
+
readingGuide(destroy?: boolean): void;
|
|
11
|
+
textToSpeech(destroy?: boolean): void;
|
|
12
|
+
speechToText(destroy?: boolean): void;
|
|
13
|
+
disableAnimations(destroy?: boolean): void;
|
|
14
|
+
iframeModals(destroy?: boolean, button?: HTMLElement): void;
|
|
15
|
+
customFunctions(destroy?: boolean, button?: HTMLElement): void;
|
|
16
|
+
increaseLineHeight(): void;
|
|
17
|
+
decreaseLineHeight(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.interface.js","sourceRoot":"","sources":["../../src/interfaces/menu.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Common } from './common.js';
|
|
2
|
+
import { IAccessibility, IAccessibilityOptions, ISessionState, IStateValues } from './interfaces/accessibility.interface.js';
|
|
3
|
+
import { IMenuInterface } from './interfaces/menu.interface.js';
|
|
4
|
+
export declare class Accessibility implements IAccessibility {
|
|
5
|
+
static CSS_CLASS_NAME: string;
|
|
6
|
+
static MENU_WIDTH: string;
|
|
7
|
+
static MENU_ID: string;
|
|
8
|
+
static MENU_LABEL_ID: string;
|
|
9
|
+
private _isReading;
|
|
10
|
+
private _common;
|
|
11
|
+
private _storage;
|
|
12
|
+
private _options;
|
|
13
|
+
private _sessionState;
|
|
14
|
+
private _htmlInitFS;
|
|
15
|
+
private _body;
|
|
16
|
+
private _html;
|
|
17
|
+
private _icon;
|
|
18
|
+
private _menu;
|
|
19
|
+
private _htmlOrgFontSize;
|
|
20
|
+
private _stateValues;
|
|
21
|
+
private _recognition;
|
|
22
|
+
private _speechToTextTarget;
|
|
23
|
+
private _onKeyDownBind;
|
|
24
|
+
private _fixedDefaultFont;
|
|
25
|
+
menuInterface: IMenuInterface;
|
|
26
|
+
options: IAccessibilityOptions;
|
|
27
|
+
constructor(options?: IAccessibilityOptions);
|
|
28
|
+
private hasRemoteFontSources;
|
|
29
|
+
private shouldUseEmojiIcons;
|
|
30
|
+
get stateValues(): IStateValues;
|
|
31
|
+
set stateValues(value: IStateValues);
|
|
32
|
+
get html(): HTMLElement;
|
|
33
|
+
get body(): HTMLBodyElement;
|
|
34
|
+
get sessionState(): ISessionState;
|
|
35
|
+
set sessionState(value: ISessionState);
|
|
36
|
+
get common(): Common;
|
|
37
|
+
get recognition(): any;
|
|
38
|
+
get isReading(): boolean;
|
|
39
|
+
set isReading(value: boolean);
|
|
40
|
+
get fixedDefaultFont(): string;
|
|
41
|
+
private get defaultOptions();
|
|
42
|
+
initFontSize(): void;
|
|
43
|
+
fontFallback(): void;
|
|
44
|
+
addDefaultOptions(options: IAccessibilityOptions): void;
|
|
45
|
+
addModuleOrderIfNotDefined(): void;
|
|
46
|
+
disabledUnsupportedFeatures(): void;
|
|
47
|
+
injectCss(injectFull: boolean): void;
|
|
48
|
+
removeCSS(): void;
|
|
49
|
+
injectIcon(): HTMLElement;
|
|
50
|
+
parseKeys(arr: Array<any>): string;
|
|
51
|
+
private syncMenuState;
|
|
52
|
+
injectMenu(): HTMLElement;
|
|
53
|
+
getVoices(): Promise<SpeechSynthesisVoice[]>;
|
|
54
|
+
injectTts(): Promise<void>;
|
|
55
|
+
addListeners(): void;
|
|
56
|
+
sortModuleTypes(): void;
|
|
57
|
+
disableUnsupportedModulesAndSort(): void;
|
|
58
|
+
resetAll(): void;
|
|
59
|
+
resetTextSize(): void;
|
|
60
|
+
resetLineHeight(): void;
|
|
61
|
+
resetTextSpace(): void;
|
|
62
|
+
alterTextSize(isIncrease: boolean): void;
|
|
63
|
+
alterLineHeight(isIncrease: boolean): void;
|
|
64
|
+
alterTextSpace(isIncrease: boolean): void;
|
|
65
|
+
speechToText(): void;
|
|
66
|
+
textToSpeech(text: string): void;
|
|
67
|
+
createScreenShot(url: string): Promise<string>;
|
|
68
|
+
listen(e?: Event): void;
|
|
69
|
+
read(e?: Event): void;
|
|
70
|
+
runHotkey(name: string): void;
|
|
71
|
+
toggleMenu(): void;
|
|
72
|
+
invoke(action: string, button: HTMLElement): void;
|
|
73
|
+
onKeyDown(e: KeyboardEvent): void;
|
|
74
|
+
build(): void;
|
|
75
|
+
updateReadGuide(e: Event | TouchEvent | any): void;
|
|
76
|
+
resetIfDefined(src: string, dest: any, prop: string): void;
|
|
77
|
+
onChange(updateSession: boolean): void;
|
|
78
|
+
saveSession(): void;
|
|
79
|
+
setSessionFromCache(): void;
|
|
80
|
+
destroy(): void;
|
|
81
|
+
}
|
|
82
|
+
export * from './interfaces/accessibility.interface.js';
|
|
83
|
+
export * from './interfaces/menu.interface.js';
|
|
84
|
+
export default Accessibility;
|