babylonjs-accessibility 5.17.1 → 5.19.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/babylon.accessibility.d.ts +166 -6
- package/babylon.accessibility.max.js +536 -536
- package/babylon.accessibility.module.d.ts +346 -186
- package/package.json +3 -3
@@ -1,209 +1,209 @@
|
|
1
1
|
|
2
2
|
declare module "babylonjs-accessibility/HtmlTwin/htmlTwinGUIItem" {
|
3
|
-
import { Scene } from "babylonjs/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
|
-
}
|
3
|
+
import { Scene } from "babylonjs/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
46
|
|
47
47
|
}
|
48
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/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 {};
|
49
|
+
import * as React from "react";
|
50
|
+
import { HTMLTwinItem } from "babylonjs-accessibility/HtmlTwin/htmlTwinItem";
|
51
|
+
import { Scene } from "babylonjs/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
70
|
|
71
71
|
}
|
72
72
|
declare module "babylonjs-accessibility/HtmlTwin/htmlTwinItem" {
|
73
|
-
import { Node } from "babylonjs/node";
|
74
|
-
import { Scene } from "babylonjs/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
|
-
}
|
73
|
+
import { Node } from "babylonjs/node";
|
74
|
+
import { Scene } from "babylonjs/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
128
|
|
129
129
|
}
|
130
130
|
declare module "babylonjs-accessibility/HtmlTwin/htmlTwinNodeItem" {
|
131
|
-
import { Node } from "babylonjs/node";
|
132
|
-
import { Scene } from "babylonjs/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
|
-
}
|
131
|
+
import { Node } from "babylonjs/node";
|
132
|
+
import { Scene } from "babylonjs/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
171
|
|
172
172
|
}
|
173
173
|
declare module "babylonjs-accessibility/HtmlTwin/htmlTwinRenderer" {
|
174
|
-
import { Scene } from "babylonjs/scene";
|
175
|
-
export class HTMLTwinRenderer {
|
176
|
-
static Render(scene: Scene): void;
|
177
|
-
}
|
174
|
+
import { Scene } from "babylonjs/scene";
|
175
|
+
export class HTMLTwinRenderer {
|
176
|
+
static Render(scene: Scene): void;
|
177
|
+
}
|
178
178
|
|
179
179
|
}
|
180
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 {};
|
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
195
|
|
196
196
|
}
|
197
197
|
declare module "babylonjs-accessibility/HtmlTwin/index" {
|
198
|
-
export * from "babylonjs-accessibility/HtmlTwin/htmlTwinRenderer";
|
198
|
+
export * from "babylonjs-accessibility/HtmlTwin/htmlTwinRenderer";
|
199
199
|
|
200
200
|
}
|
201
201
|
declare module "babylonjs-accessibility/index" {
|
202
|
-
export * from "babylonjs-accessibility/HtmlTwin/index";
|
202
|
+
export * from "babylonjs-accessibility/HtmlTwin/index";
|
203
203
|
|
204
204
|
}
|
205
205
|
declare module "babylonjs-accessibility/legacy/legacy" {
|
206
|
-
export * from "babylonjs-accessibility/index";
|
206
|
+
export * from "babylonjs-accessibility/index";
|
207
207
|
|
208
208
|
}
|
209
209
|
|
@@ -213,17 +213,177 @@ declare module "babylonjs-accessibility" {
|
|
213
213
|
|
214
214
|
|
215
215
|
declare module BABYLON.Accessibility {
|
216
|
-
/**
|
217
216
|
* 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.
|
218
217
|
*/
|
219
218
|
export class HTMLTwinGUIItem extends HTMLTwinItem {
|
220
219
|
/**
|
221
220
|
* The corresponding BabylonJS entity. Can be a Node or a BABYLON.GUI.Control.
|
222
221
|
*/
|
223
222
|
entity: BABYLON.GUI.Control;
|
224
223
|
/**
|
225
224
|
* The children of this item in the html twin tree.
|
226
225
|
*/
|
227
226
|
children: HTMLTwinGUIItem[];
|
228
227
|
constructor(entity: BABYLON.GUI.Control, scene: BABYLON.Scene, children: HTMLTwinGUIItem[]);
|
229
228
|
/**
|
230
229
|
* The text content displayed in HTML element.
|
231
230
|
*/
|
232
231
|
get description(): string;
|
233
232
|
/**
|
234
233
|
* If this entity is actionable (can be clicked).
|
235
234
|
*/
|
236
235
|
get isActionable(): boolean;
|
237
236
|
/**
|
238
237
|
* If this entity is focusable (can be focused by tab key pressing).
|
239
238
|
*/
|
240
239
|
get isFocusable(): boolean;
|
241
240
|
/**
|
242
241
|
* Callback when the HTML element is focused. Show visual indication on BabylonJS entity.
|
243
242
|
*/
|
244
243
|
focus(): void;
|
245
244
|
/**
|
246
245
|
* Callback when the HTML element is blured. Dismiss visual indication on BabylonJS entity.
|
247
246
|
*/
|
248
247
|
blur(): void;
|
249
248
|
/**
|
250
249
|
* Callback when an event (e.g. click/right click) happens on the HTML element.
|
251
250
|
* Implemented by child classes
|
252
251
|
* @param eventType - Which event is triggered. E.g. "click", "contextmenu"
|
253
252
|
*/
|
254
253
|
triggerEvent(eventType: string): void;
|
255
254
|
}
|
255
|
+
/**
|
256
|
+
* 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.
|
257
|
+
*/
|
258
|
+
export class HTMLTwinGUIItem extends HTMLTwinItem {
|
259
|
+
/**
|
260
|
+
* The corresponding BabylonJS entity. Can be a Node or a BABYLON.GUI.Control.
|
261
|
+
*/
|
262
|
+
entity: BABYLON.GUI.Control;
|
263
|
+
/**
|
264
|
+
* The children of this item in the html twin tree.
|
265
|
+
*/
|
266
|
+
children: HTMLTwinGUIItem[];
|
267
|
+
constructor(entity: BABYLON.GUI.Control, scene: BABYLON.Scene, children: HTMLTwinGUIItem[]);
|
268
|
+
/**
|
269
|
+
* The text content displayed in HTML element.
|
270
|
+
*/
|
271
|
+
get description(): string;
|
272
|
+
/**
|
273
|
+
* If this entity is actionable (can be clicked).
|
274
|
+
*/
|
275
|
+
get isActionable(): boolean;
|
276
|
+
/**
|
277
|
+
* If this entity is focusable (can be focused by tab key pressing).
|
278
|
+
*/
|
279
|
+
get isFocusable(): boolean;
|
280
|
+
/**
|
281
|
+
* Callback when the HTML element is focused. Show visual indication on BabylonJS entity.
|
282
|
+
*/
|
283
|
+
focus(): void;
|
284
|
+
/**
|
285
|
+
* Callback when the HTML element is blured. Dismiss visual indication on BabylonJS entity.
|
286
|
+
*/
|
287
|
+
blur(): void;
|
288
|
+
/**
|
289
|
+
* Callback when an event (e.g. click/right click) happens on the HTML element.
|
290
|
+
* Implemented by child classes
|
291
|
+
* @param eventType - Which event is triggered. E.g. "click", "contextmenu"
|
292
|
+
*/
|
293
|
+
triggerEvent(eventType: string): void;
|
294
|
+
}
|
295
|
+
|
296
|
+
|
297
|
+
interface IHTMLTwinHostComponentProps {
|
298
|
+
scene: BABYLON.Scene;
|
299
|
+
}
|
300
|
+
interface IHTMLTwinHostComponentState {
|
301
|
+
a11yTreeItems: HTMLTwinItem[];
|
302
|
+
}
|
303
|
+
export class HTMLTwinHostComponent extends React.Component<IHTMLTwinHostComponentProps, IHTMLTwinHostComponentState> {
|
304
|
+
private _observersMap;
|
305
|
+
constructor(props: IHTMLTwinHostComponentProps);
|
306
|
+
componentDidMount(): void;
|
307
|
+
componentWillUnmount(): void;
|
308
|
+
render(): JSX.Element;
|
309
|
+
private _updateHTMLTwinItems;
|
310
|
+
private _getHTMLTwinItemsFromNodes;
|
311
|
+
private _getHTMLTwinItemsFromGUI;
|
312
|
+
private _isGUI;
|
313
|
+
}
|
314
|
+
|
315
|
+
|
316
|
+
export type AccessibilityEntity = BABYLON.Node | BABYLON.GUI.Control;
|
317
|
+
/**
|
318
|
+
* 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.
|
319
|
+
*/
|
320
|
+
export class HTMLTwinItem {
|
321
|
+
/**
|
322
|
+
* The corresponding BabylonJS entity. Can be a BABYLON.Node or a BABYLON.GUI.Control.
|
323
|
+
*/
|
324
|
+
entity: AccessibilityEntity;
|
325
|
+
/**
|
326
|
+
* The BabylonJS scene that the corresponding BabylonJS entity is in.
|
327
|
+
*/
|
328
|
+
scene: BABYLON.Scene;
|
329
|
+
/**
|
330
|
+
* The children of this item in the html twin tree.
|
331
|
+
*/
|
332
|
+
children: HTMLTwinItem[];
|
333
|
+
constructor(entity: AccessibilityEntity, scene: BABYLON.Scene, children: HTMLTwinItem[]);
|
334
|
+
/**
|
335
|
+
* The text content displayed in HTML element.
|
336
|
+
* Returns the description in accessibilityTag, if defined (returns "" by default).
|
337
|
+
*/
|
338
|
+
get description(): string;
|
339
|
+
/**
|
340
|
+
* If this entity is actionable (can be clicked).
|
341
|
+
* Implemented by child classes
|
342
|
+
*/
|
343
|
+
get isActionable(): boolean;
|
344
|
+
/**
|
345
|
+
* If this entity is focusable (can be focused by tab key pressing).
|
346
|
+
* Implemented by child classes
|
347
|
+
*/
|
348
|
+
get isFocusable(): boolean;
|
349
|
+
/**
|
350
|
+
* Callback when the HTML element is focused. Show visual indication on BabylonJS entity.
|
351
|
+
* Implemented by child classes
|
352
|
+
*/
|
353
|
+
focus(): void;
|
354
|
+
/**
|
355
|
+
* Callback when the HTML element is blured. Dismiss visual indication on BabylonJS entity.
|
356
|
+
* Implemented by child classes
|
357
|
+
*/
|
358
|
+
blur(): void;
|
359
|
+
/**
|
360
|
+
* Callback when an event (e.g. click/right click) happens on the HTML element.
|
361
|
+
* Implemented by child classes
|
362
|
+
* @param _eventType - Which event is triggered. E.g. "click", "contextmenu"
|
363
|
+
*/
|
364
|
+
triggerEvent(_eventType: string): void;
|
365
|
+
protected _isActionable: boolean;
|
366
|
+
protected _isFocusable: boolean;
|
367
|
+
}
|
368
|
+
|
369
|
+
|
370
|
+
/**
|
371
|
+
* 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.
|
372
|
+
*/
|
373
|
+
export class HTMLTwinNodeItem extends HTMLTwinItem {
|
374
|
+
/**
|
375
|
+
* The corresponding BabylonJS entity. Can be a BABYLON.Node or a Control.
|
376
|
+
*/
|
377
|
+
entity: BABYLON.Node;
|
378
|
+
/**
|
379
|
+
* The children of this item in the html twin tree.
|
380
|
+
*/
|
381
|
+
children: HTMLTwinItem[];
|
382
|
+
constructor(entity: BABYLON.Node, scene: BABYLON.Scene, children: HTMLTwinItem[]);
|
383
|
+
/**
|
384
|
+
* If this entity is actionable (can be clicked).
|
385
|
+
*/
|
386
|
+
get isActionable(): boolean;
|
387
|
+
/**
|
388
|
+
* If this entity is focusable (can be focused by tab key pressing).
|
389
|
+
*/
|
390
|
+
get isFocusable(): boolean;
|
391
|
+
/**
|
392
|
+
* Callback when the HTML element is focused. Show visual indication on BabylonJS entity.
|
393
|
+
*/
|
394
|
+
focus(): void;
|
395
|
+
/**
|
396
|
+
* Callback when the HTML element is blured. Dismiss visual indication on BabylonJS entity.
|
397
|
+
*/
|
398
|
+
blur(): void;
|
399
|
+
/**
|
400
|
+
* Callback when an event (e.g. click/right click) happens on the HTML element.
|
401
|
+
* Implemented by child classes
|
402
|
+
* @param eventType - Which event is triggered. E.g. "click", "contextmenu"
|
403
|
+
*/
|
404
|
+
triggerEvent(eventType: string): void;
|
405
|
+
private _getTriggerActions;
|
406
|
+
}
|
256
407
|
|
257
|
-
interface IHTMLTwinHostComponentProps {
|
258
408
|
scene: BABYLON.Scene;
|
259
409
|
}
|
260
410
|
interface IHTMLTwinHostComponentState {
|
261
411
|
a11yTreeItems: HTMLTwinItem[];
|
262
412
|
}
|
263
413
|
export class HTMLTwinHostComponent extends React.Component<IHTMLTwinHostComponentProps, IHTMLTwinHostComponentState> {
|
264
414
|
private _observersMap;
|
265
415
|
constructor(props: IHTMLTwinHostComponentProps);
|
266
416
|
componentDidMount(): void;
|
267
417
|
componentWillUnmount(): void;
|
268
418
|
render(): JSX.Element;
|
269
419
|
private _updateHTMLTwinItems;
|
270
420
|
private _getHTMLTwinItemsFromNodes;
|
271
421
|
private _getHTMLTwinItemsFromGUI;
|
272
422
|
private _isGUI;
|
273
423
|
}
|
274
424
|
|
275
|
-
export type AccessibilityEntity = BABYLON.Node | BABYLON.GUI.Control;
|
276
425
|
/**
|
277
426
|
* 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.
|
278
427
|
*/
|
279
428
|
export class HTMLTwinItem {
|
280
429
|
/**
|
281
430
|
* The corresponding BabylonJS entity. Can be a BABYLON.Node or a BABYLON.GUI.Control.
|
282
431
|
*/
|
283
432
|
entity: AccessibilityEntity;
|
284
433
|
/**
|
285
434
|
* The BabylonJS scene that the corresponding BabylonJS entity is in.
|
286
435
|
*/
|
287
436
|
scene: BABYLON.Scene;
|
288
437
|
/**
|
289
438
|
* The children of this item in the html twin tree.
|
290
439
|
*/
|
291
440
|
children: HTMLTwinItem[];
|
292
441
|
constructor(entity: AccessibilityEntity, scene: BABYLON.Scene, children: HTMLTwinItem[]);
|
293
442
|
/**
|
294
443
|
* The text content displayed in HTML element.
|
295
444
|
* Returns the description in accessibilityTag, if defined (returns "" by default).
|
296
445
|
*/
|
297
446
|
get description(): string;
|
298
447
|
/**
|
299
448
|
* If this entity is actionable (can be clicked).
|
300
449
|
* Implemented by child classes
|
301
450
|
*/
|
302
451
|
get isActionable(): boolean;
|
303
452
|
/**
|
304
453
|
* If this entity is focusable (can be focused by tab key pressing).
|
305
454
|
* Implemented by child classes
|
306
455
|
*/
|
307
456
|
get isFocusable(): boolean;
|
308
457
|
/**
|
309
458
|
* Callback when the HTML element is focused. Show visual indication on BabylonJS entity.
|
310
459
|
* Implemented by child classes
|
311
460
|
*/
|
312
461
|
focus(): void;
|
313
462
|
/**
|
314
463
|
* Callback when the HTML element is blured. Dismiss visual indication on BabylonJS entity.
|
315
464
|
* Implemented by child classes
|
316
465
|
*/
|
317
466
|
blur(): void;
|
318
467
|
/**
|
319
468
|
* Callback when an event (e.g. click/right click) happens on the HTML element.
|
320
469
|
* Implemented by child classes
|
321
470
|
* @param _eventType - Which event is triggered. E.g. "click", "contextmenu"
|
322
471
|
*/
|
323
472
|
triggerEvent(_eventType: string): void;
|
324
473
|
protected _isActionable: boolean;
|
325
474
|
protected _isFocusable: boolean;
|
326
475
|
}
|
476
|
+
export class HTMLTwinRenderer {
|
477
|
+
static Render(scene: BABYLON.Scene): void;
|
478
|
+
}
|
327
479
|
|
328
|
-
/**
|
329
480
|
* 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.
|
330
481
|
*/
|
331
482
|
export class HTMLTwinNodeItem extends HTMLTwinItem {
|
332
483
|
/**
|
333
484
|
* The corresponding BabylonJS entity. Can be a BABYLON.Node or a Control.
|
334
485
|
*/
|
335
486
|
entity: BABYLON.Node;
|
336
487
|
/**
|
337
488
|
* The children of this item in the html twin tree.
|
338
489
|
*/
|
339
490
|
children: HTMLTwinItem[];
|
340
491
|
constructor(entity: BABYLON.Node, scene: BABYLON.Scene, children: HTMLTwinItem[]);
|
341
492
|
/**
|
342
493
|
* If this entity is actionable (can be clicked).
|
343
494
|
*/
|
344
495
|
get isActionable(): boolean;
|
345
496
|
/**
|
346
497
|
* If this entity is focusable (can be focused by tab key pressing).
|
347
498
|
*/
|
348
499
|
get isFocusable(): boolean;
|
349
500
|
/**
|
350
501
|
* Callback when the HTML element is focused. Show visual indication on BabylonJS entity.
|
351
502
|
*/
|
352
503
|
focus(): void;
|
353
504
|
/**
|
354
505
|
* Callback when the HTML element is blured. Dismiss visual indication on BabylonJS entity.
|
355
506
|
*/
|
356
507
|
blur(): void;
|
357
508
|
/**
|
358
509
|
* Callback when an event (e.g. click/right click) happens on the HTML element.
|
359
510
|
* Implemented by child classes
|
360
511
|
* @param eventType - Which event is triggered. E.g. "click", "contextmenu"
|
361
512
|
*/
|
362
513
|
triggerEvent(eventType: string): void;
|
363
514
|
private _getTriggerActions;
|
364
515
|
}
|
365
516
|
|
366
|
-
export class HTMLTwinRenderer {
|
367
517
|
static Render(scene: BABYLON.Scene): void;
|
368
518
|
}
|
519
|
+
interface IHTMLTwinItemComponentProps {
|
520
|
+
a11yItem: HTMLTwinItem;
|
521
|
+
level: number;
|
522
|
+
}
|
523
|
+
export class HTMLTwinItemComponent extends React.Component<IHTMLTwinItemComponentProps> {
|
524
|
+
constructor(props: IHTMLTwinItemComponentProps);
|
525
|
+
render(): JSX.Element;
|
526
|
+
private _renderLeafNode;
|
527
|
+
private _renderParentNode;
|
528
|
+
private _renderChildren;
|
529
|
+
}
|
369
530
|
|
370
|
-
interface IHTMLTwinItemComponentProps {
|
371
531
|
a11yItem: HTMLTwinItem;
|
372
532
|
level: number;
|
373
533
|
}
|
374
534
|
export class HTMLTwinItemComponent extends React.Component<IHTMLTwinItemComponentProps> {
|
375
535
|
constructor(props: IHTMLTwinItemComponentProps);
|
376
536
|
render(): JSX.Element;
|
377
537
|
private _renderLeafNode;
|
378
538
|
private _renderParentNode;
|
379
539
|
private _renderChildren;
|
380
540
|
}
|
381
541
|
|
382
542
|
|
383
543
|
|