@babylonjs/accessibility 5.31.2 → 5.32.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.
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
|
|
2
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinGUIItem" {
|
|
3
|
+
import { Scene } from "@babylonjs/core/scene";
|
|
4
|
+
import { Control } from "@babylonjs/gui/2D/controls/control";
|
|
5
|
+
import { HTMLTwinItem } from "@babylonjs/accessibility/HtmlTwin/htmlTwinItem";
|
|
6
|
+
/**
|
|
7
|
+
* A abstract layer to store the html twin tree structure. It is constructed from the BabylonJS scene entities that need to be accessible. It informs the parent-children relationship of html twin tree, and informs how to render: description, isActionable, onclick/onrightclick/onfocus/onblur.
|
|
8
|
+
*/
|
|
9
|
+
export class HTMLTwinGUIItem extends HTMLTwinItem {
|
|
10
|
+
/**
|
|
11
|
+
* The corresponding BabylonJS entity. Can be a Node or a Control.
|
|
12
|
+
*/
|
|
13
|
+
entity: Control;
|
|
14
|
+
/**
|
|
15
|
+
* The children of this item in the html twin tree.
|
|
16
|
+
*/
|
|
17
|
+
children: HTMLTwinGUIItem[];
|
|
18
|
+
constructor(entity: Control, scene: Scene, children: HTMLTwinGUIItem[]);
|
|
19
|
+
/**
|
|
20
|
+
* The text content displayed in HTML element.
|
|
21
|
+
*/
|
|
22
|
+
get description(): string;
|
|
23
|
+
/**
|
|
24
|
+
* If this entity is actionable (can be clicked).
|
|
25
|
+
*/
|
|
26
|
+
get isActionable(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* If this entity is focusable (can be focused by tab key pressing).
|
|
29
|
+
*/
|
|
30
|
+
get isFocusable(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Callback when the HTML element is focused. Show visual indication on BabylonJS entity.
|
|
33
|
+
*/
|
|
34
|
+
focus(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Callback when the HTML element is blured. Dismiss visual indication on BabylonJS entity.
|
|
37
|
+
*/
|
|
38
|
+
blur(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Callback when an event (e.g. click/right click) happens on the HTML element.
|
|
41
|
+
* Implemented by child classes
|
|
42
|
+
* @param eventType - Which event is triggered. E.g. "click", "contextmenu"
|
|
43
|
+
*/
|
|
44
|
+
triggerEvent(eventType: string): void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinHostComponent" {
|
|
49
|
+
import * as React from "react";
|
|
50
|
+
import { HTMLTwinItem } from "@babylonjs/accessibility/HtmlTwin/htmlTwinItem";
|
|
51
|
+
import { Scene } from "@babylonjs/core/scene";
|
|
52
|
+
interface IHTMLTwinHostComponentProps {
|
|
53
|
+
scene: Scene;
|
|
54
|
+
}
|
|
55
|
+
interface IHTMLTwinHostComponentState {
|
|
56
|
+
a11yTreeItems: HTMLTwinItem[];
|
|
57
|
+
}
|
|
58
|
+
export class HTMLTwinHostComponent extends React.Component<IHTMLTwinHostComponentProps, IHTMLTwinHostComponentState> {
|
|
59
|
+
private _observersMap;
|
|
60
|
+
constructor(props: IHTMLTwinHostComponentProps);
|
|
61
|
+
componentDidMount(): void;
|
|
62
|
+
componentWillUnmount(): void;
|
|
63
|
+
render(): JSX.Element;
|
|
64
|
+
private _updateHTMLTwinItems;
|
|
65
|
+
private _getHTMLTwinItemsFromNodes;
|
|
66
|
+
private _getHTMLTwinItemsFromGUI;
|
|
67
|
+
private _isGUI;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinItem" {
|
|
73
|
+
import { Node } from "@babylonjs/core/node";
|
|
74
|
+
import { Scene } from "@babylonjs/core/scene";
|
|
75
|
+
import { Control } from "@babylonjs/gui/2D/controls/control";
|
|
76
|
+
export type AccessibilityEntity = Node | Control;
|
|
77
|
+
/**
|
|
78
|
+
* A abstract layer to store the html twin tree structure. It is constructed from the BabylonJS scene entities that need to be accessible. It informs the parent-children relationship of html twin tree, and informs how to render: description, isActionable, onclick/onrightclick/onfocus/onblur.
|
|
79
|
+
*/
|
|
80
|
+
export class HTMLTwinItem {
|
|
81
|
+
/**
|
|
82
|
+
* The corresponding BabylonJS entity. Can be a Node or a Control.
|
|
83
|
+
*/
|
|
84
|
+
entity: AccessibilityEntity;
|
|
85
|
+
/**
|
|
86
|
+
* The BabylonJS scene that the corresponding BabylonJS entity is in.
|
|
87
|
+
*/
|
|
88
|
+
scene: Scene;
|
|
89
|
+
/**
|
|
90
|
+
* The children of this item in the html twin tree.
|
|
91
|
+
*/
|
|
92
|
+
children: HTMLTwinItem[];
|
|
93
|
+
constructor(entity: AccessibilityEntity, scene: Scene, children: HTMLTwinItem[]);
|
|
94
|
+
/**
|
|
95
|
+
* The text content displayed in HTML element.
|
|
96
|
+
* Returns the description in accessibilityTag, if defined (returns "" by default).
|
|
97
|
+
*/
|
|
98
|
+
get description(): string;
|
|
99
|
+
/**
|
|
100
|
+
* If this entity is actionable (can be clicked).
|
|
101
|
+
* Implemented by child classes
|
|
102
|
+
*/
|
|
103
|
+
get isActionable(): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* If this entity is focusable (can be focused by tab key pressing).
|
|
106
|
+
* Implemented by child classes
|
|
107
|
+
*/
|
|
108
|
+
get isFocusable(): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Callback when the HTML element is focused. Show visual indication on BabylonJS entity.
|
|
111
|
+
* Implemented by child classes
|
|
112
|
+
*/
|
|
113
|
+
focus(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Callback when the HTML element is blured. Dismiss visual indication on BabylonJS entity.
|
|
116
|
+
* Implemented by child classes
|
|
117
|
+
*/
|
|
118
|
+
blur(): void;
|
|
119
|
+
/**
|
|
120
|
+
* Callback when an event (e.g. click/right click) happens on the HTML element.
|
|
121
|
+
* Implemented by child classes
|
|
122
|
+
* @param _eventType - Which event is triggered. E.g. "click", "contextmenu"
|
|
123
|
+
*/
|
|
124
|
+
triggerEvent(_eventType: string): void;
|
|
125
|
+
protected _isActionable: boolean;
|
|
126
|
+
protected _isFocusable: boolean;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinNodeItem" {
|
|
131
|
+
import { Node } from "@babylonjs/core/node";
|
|
132
|
+
import { Scene } from "@babylonjs/core/scene";
|
|
133
|
+
import { HTMLTwinItem } from "@babylonjs/accessibility/HtmlTwin/htmlTwinItem";
|
|
134
|
+
/**
|
|
135
|
+
* A abstract layer to store the html twin tree structure. It is constructed from the BabylonJS scene entities that need to be accessible. It informs the parent-children relationship of html twin tree, and informs how to render: description, isActionable, onclick/onrightclick/onfocus/onblur.
|
|
136
|
+
*/
|
|
137
|
+
export class HTMLTwinNodeItem extends HTMLTwinItem {
|
|
138
|
+
/**
|
|
139
|
+
* The corresponding BabylonJS entity. Can be a Node or a Control.
|
|
140
|
+
*/
|
|
141
|
+
entity: Node;
|
|
142
|
+
/**
|
|
143
|
+
* The children of this item in the html twin tree.
|
|
144
|
+
*/
|
|
145
|
+
children: HTMLTwinItem[];
|
|
146
|
+
constructor(entity: Node, scene: Scene, children: HTMLTwinItem[]);
|
|
147
|
+
/**
|
|
148
|
+
* If this entity is actionable (can be clicked).
|
|
149
|
+
*/
|
|
150
|
+
get isActionable(): boolean;
|
|
151
|
+
/**
|
|
152
|
+
* If this entity is focusable (can be focused by tab key pressing).
|
|
153
|
+
*/
|
|
154
|
+
get isFocusable(): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Callback when the HTML element is focused. Show visual indication on BabylonJS entity.
|
|
157
|
+
*/
|
|
158
|
+
focus(): void;
|
|
159
|
+
/**
|
|
160
|
+
* Callback when the HTML element is blured. Dismiss visual indication on BabylonJS entity.
|
|
161
|
+
*/
|
|
162
|
+
blur(): void;
|
|
163
|
+
/**
|
|
164
|
+
* Callback when an event (e.g. click/right click) happens on the HTML element.
|
|
165
|
+
* Implemented by child classes
|
|
166
|
+
* @param eventType - Which event is triggered. E.g. "click", "contextmenu"
|
|
167
|
+
*/
|
|
168
|
+
triggerEvent(eventType: string): void;
|
|
169
|
+
private _getTriggerActions;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinRenderer" {
|
|
174
|
+
import { Scene } from "@babylonjs/core/scene";
|
|
175
|
+
export class HTMLTwinRenderer {
|
|
176
|
+
static Render(scene: Scene): void;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
}
|
|
180
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinTreeComponent" {
|
|
181
|
+
import * as React from "react";
|
|
182
|
+
import { HTMLTwinItem } from "@babylonjs/accessibility/HtmlTwin/htmlTwinItem";
|
|
183
|
+
interface IHTMLTwinItemComponentProps {
|
|
184
|
+
a11yItem: HTMLTwinItem;
|
|
185
|
+
level: number;
|
|
186
|
+
}
|
|
187
|
+
export class HTMLTwinItemComponent extends React.Component<IHTMLTwinItemComponentProps> {
|
|
188
|
+
constructor(props: IHTMLTwinItemComponentProps);
|
|
189
|
+
render(): JSX.Element;
|
|
190
|
+
private _renderLeafNode;
|
|
191
|
+
private _renderParentNode;
|
|
192
|
+
private _renderChildren;
|
|
193
|
+
}
|
|
194
|
+
export {};
|
|
195
|
+
|
|
196
|
+
}
|
|
197
|
+
declare module "@babylonjs/accessibility/HtmlTwin/index" {
|
|
198
|
+
export * from "@babylonjs/accessibility/HtmlTwin/htmlTwinRenderer";
|
|
199
|
+
|
|
200
|
+
}
|
|
201
|
+
declare module "@babylonjs/accessibility/index" {
|
|
202
|
+
export * from "@babylonjs/accessibility/HtmlTwin/index";
|
|
203
|
+
|
|
204
|
+
}
|
|
205
|
+
declare module "@babylonjs/accessibility/legacy/legacy" {
|
|
206
|
+
export * from "@babylonjs/accessibility/index";
|
|
207
|
+
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
declare module "@babylonjs/accessibility" {
|
|
211
|
+
export * from "@babylonjs/accessibility/legacy/legacy";
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babylonjs/accessibility",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.32.1",
|
|
4
4
|
"main": "dist/babylon.accessibility.max.js",
|
|
5
5
|
"module": "dist/babylon.accessibility.max.js",
|
|
6
6
|
"esnext": "dist/babylon.accessibility.max.js",
|
|
7
7
|
"typings": "dist/babylon.accessibility.module.d.ts",
|
|
8
8
|
"files": [
|
|
9
|
-
"dist",
|
|
10
9
|
"readme.md",
|
|
11
|
-
"license.md"
|
|
10
|
+
"license.md",
|
|
11
|
+
"dist/**/*.*"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "npm run clean && npm run build:dev && npm run build:prod && npm run build:declaration",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@types/react-dom": ">=16.0.9"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@babylonjs/core": "^5.
|
|
28
|
-
"@babylonjs/gui": "^5.
|
|
27
|
+
"@babylonjs/core": "^5.32.1",
|
|
28
|
+
"@babylonjs/gui": "^5.32.1",
|
|
29
29
|
"react": "^17.0.2",
|
|
30
30
|
"react-dom": "^17.0.2",
|
|
31
31
|
"rimraf": "^3.0.2",
|