@babylonjs/accessibility 7.16.0 → 7.17.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.
|
@@ -1,35 +1,81 @@
|
|
|
1
1
|
|
|
2
|
-
declare module "@babylonjs/accessibility/
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export interface IHTMLTwinItemComponentProps {
|
|
6
|
-
description: string | undefined;
|
|
7
|
-
children: ReactElement[];
|
|
8
|
-
a11yItem: HTMLTwinItem;
|
|
2
|
+
declare module "@babylonjs/accessibility/index" {
|
|
3
|
+
export * from "@babylonjs/accessibility/HtmlTwin/index";
|
|
4
|
+
|
|
9
5
|
}
|
|
6
|
+
declare module "@babylonjs/accessibility/legacy/legacy" {
|
|
7
|
+
export * from "@babylonjs/accessibility/index";
|
|
10
8
|
|
|
9
|
+
}
|
|
10
|
+
declare module "@babylonjs/accessibility/HtmlTwin/index" {
|
|
11
|
+
export * from "@babylonjs/accessibility/HtmlTwin/htmlTwinRenderer";
|
|
11
12
|
|
|
12
13
|
}
|
|
13
|
-
declare module "@babylonjs/accessibility/HtmlTwin/
|
|
14
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinSceneTree" {
|
|
14
15
|
import { Scene } from "@babylonjs/core/scene";
|
|
15
|
-
import { Control } from "@babylonjs/gui/2D/controls/control";
|
|
16
|
-
import { HTMLTwinItem } from "@babylonjs/accessibility/HtmlTwin/htmlTwinItem";
|
|
17
16
|
import { IHTMLTwinRendererOptions } from "@babylonjs/accessibility/HtmlTwin/htmlTwinRenderer";
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
18
|
+
* The scene tree of the HTML twin. It contain all the top level nodes
|
|
19
|
+
* @param props
|
|
20
|
+
* @returns
|
|
20
21
|
*/
|
|
21
|
-
export
|
|
22
|
+
export function HTMLTwinSceneTree(props: {
|
|
23
|
+
scene: Scene;
|
|
24
|
+
options: IHTMLTwinRendererOptions;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinSceneContext" {
|
|
29
|
+
/// <reference types="react" />
|
|
30
|
+
/**
|
|
31
|
+
* Context used to update a scene when an entity is added or removed from the accessibility tree.
|
|
32
|
+
*/
|
|
33
|
+
export interface ISceneContext {
|
|
34
|
+
updateScene: () => void;
|
|
35
|
+
}
|
|
36
|
+
export const SceneContext: import("react").Context<ISceneContext>;
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinRenderer" {
|
|
40
|
+
import { Scene } from "@babylonjs/core/scene";
|
|
41
|
+
/**
|
|
42
|
+
* Options for the HTMLTwinRenderer.
|
|
43
|
+
*/
|
|
44
|
+
export interface IHTMLTwinRendererOptions {
|
|
22
45
|
/**
|
|
23
|
-
*
|
|
46
|
+
* If this is true, all GUI controls will be added to the twin tree, regardless if they have
|
|
47
|
+
* a defined accessibility tag or not. If it's false, only controls with an accessibility tag
|
|
48
|
+
* will be added. True by default.
|
|
24
49
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
50
|
+
addAllControls: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* This class is the main entry point for the HTML twin renderer. To render a twin for a scene,
|
|
54
|
+
* simply call HTMLTwinRenderer.Render(scene).
|
|
55
|
+
*/
|
|
56
|
+
export class HTMLTwinRenderer {
|
|
27
57
|
/**
|
|
28
|
-
*
|
|
29
|
-
* @param
|
|
30
|
-
* @
|
|
58
|
+
* Render the HTML twin for the given scene.
|
|
59
|
+
* @param scene the scene to render the twin for
|
|
60
|
+
* @param options options for the renderer
|
|
31
61
|
*/
|
|
32
|
-
|
|
62
|
+
static Render(scene: Scene, options?: IHTMLTwinRendererOptions): void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinNodeItem" {
|
|
67
|
+
import { Node } from "@babylonjs/core/node";
|
|
68
|
+
import { Scene } from "@babylonjs/core/scene";
|
|
69
|
+
import { HTMLTwinItem } from "@babylonjs/accessibility/HtmlTwin/htmlTwinItem";
|
|
70
|
+
/**
|
|
71
|
+
* 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.
|
|
72
|
+
*/
|
|
73
|
+
export class HTMLTwinNodeItem extends HTMLTwinItem {
|
|
74
|
+
/**
|
|
75
|
+
* The corresponding BabylonJS entity. Can be a Node or a Control.
|
|
76
|
+
*/
|
|
77
|
+
entity: Node;
|
|
78
|
+
constructor(entity: Node, scene: Scene);
|
|
33
79
|
/**
|
|
34
80
|
* If this entity is actionable (can be clicked).
|
|
35
81
|
*/
|
|
@@ -52,27 +98,25 @@ export class HTMLTwinGUIItem extends HTMLTwinItem {
|
|
|
52
98
|
* @param eventType - Which event is triggered. E.g. "click", "contextmenu"
|
|
53
99
|
*/
|
|
54
100
|
triggerEvent(eventType: string): void;
|
|
101
|
+
private _getTriggerActions;
|
|
55
102
|
}
|
|
56
103
|
|
|
57
104
|
}
|
|
58
|
-
declare module "@babylonjs/accessibility/HtmlTwin/
|
|
59
|
-
import
|
|
60
|
-
import { HTMLTwinItem } from "@babylonjs/accessibility/HtmlTwin/htmlTwinItem";
|
|
105
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinItemAdapter" {
|
|
106
|
+
import { AccessibilityEntity } from "@babylonjs/accessibility/HtmlTwin/htmlTwinItem";
|
|
61
107
|
import { Scene } from "@babylonjs/core/scene";
|
|
62
108
|
import { IHTMLTwinRendererOptions } from "@babylonjs/accessibility/HtmlTwin/htmlTwinRenderer";
|
|
63
|
-
|
|
109
|
+
/**
|
|
110
|
+
* An adapter that transforms a Accessible entity in a React element. Contains observables for the events that can
|
|
111
|
+
* change the state of the entity or the accesible tree.
|
|
112
|
+
* @param props the props of the adapter
|
|
113
|
+
* @returns
|
|
114
|
+
*/
|
|
115
|
+
export function HTMLTwinItemAdapter(props: {
|
|
116
|
+
node: AccessibilityEntity;
|
|
64
117
|
scene: Scene;
|
|
65
|
-
options
|
|
66
|
-
}
|
|
67
|
-
interface IHTMLTwinHostComponentState {
|
|
68
|
-
a11yTreeItems: HTMLTwinItem[];
|
|
69
|
-
}
|
|
70
|
-
export class HTMLTwinHostComponent extends React.Component<IHTMLTwinHostComponentProps, IHTMLTwinHostComponentState> {
|
|
71
|
-
private _options;
|
|
72
|
-
constructor(props: IHTMLTwinHostComponentProps);
|
|
118
|
+
options: IHTMLTwinRendererOptions;
|
|
73
119
|
|
|
74
|
-
}
|
|
75
|
-
export {};
|
|
76
120
|
|
|
77
121
|
}
|
|
78
122
|
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinItem" {
|
|
@@ -159,36 +203,46 @@ export class HTMLTwinItem {
|
|
|
159
203
|
}
|
|
160
204
|
|
|
161
205
|
}
|
|
162
|
-
declare module "@babylonjs/accessibility/HtmlTwin/
|
|
163
|
-
import
|
|
206
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinHostComponent" {
|
|
207
|
+
import * as React from "react";
|
|
208
|
+
import { HTMLTwinItem } from "@babylonjs/accessibility/HtmlTwin/htmlTwinItem";
|
|
164
209
|
import { Scene } from "@babylonjs/core/scene";
|
|
165
210
|
import { IHTMLTwinRendererOptions } from "@babylonjs/accessibility/HtmlTwin/htmlTwinRenderer";
|
|
166
|
-
|
|
167
|
-
* An adapter that transforms a Accessible entity in a React element. Contains observables for the events that can
|
|
168
|
-
* change the state of the entity or the accesible tree.
|
|
169
|
-
* @param props the props of the adapter
|
|
170
|
-
* @returns
|
|
171
|
-
*/
|
|
172
|
-
export function HTMLTwinItemAdapter(props: {
|
|
173
|
-
node: AccessibilityEntity;
|
|
211
|
+
interface IHTMLTwinHostComponentProps {
|
|
174
212
|
scene: Scene;
|
|
175
|
-
options
|
|
213
|
+
options?: IHTMLTwinRendererOptions;
|
|
214
|
+
}
|
|
215
|
+
interface IHTMLTwinHostComponentState {
|
|
216
|
+
a11yTreeItems: HTMLTwinItem[];
|
|
217
|
+
}
|
|
218
|
+
export class HTMLTwinHostComponent extends React.Component<IHTMLTwinHostComponentProps, IHTMLTwinHostComponentState> {
|
|
219
|
+
private _options;
|
|
220
|
+
constructor(props: IHTMLTwinHostComponentProps);
|
|
176
221
|
|
|
222
|
+
}
|
|
223
|
+
export {};
|
|
177
224
|
|
|
178
225
|
}
|
|
179
|
-
declare module "@babylonjs/accessibility/HtmlTwin/
|
|
180
|
-
import { Node } from "@babylonjs/core/node";
|
|
226
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinGUIItem" {
|
|
181
227
|
import { Scene } from "@babylonjs/core/scene";
|
|
228
|
+
import { Control } from "@babylonjs/gui/2D/controls/control";
|
|
182
229
|
import { HTMLTwinItem } from "@babylonjs/accessibility/HtmlTwin/htmlTwinItem";
|
|
230
|
+
import { IHTMLTwinRendererOptions } from "@babylonjs/accessibility/HtmlTwin/htmlTwinRenderer";
|
|
183
231
|
/**
|
|
184
232
|
* 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.
|
|
185
233
|
*/
|
|
186
|
-
export class
|
|
234
|
+
export class HTMLTwinGUIItem extends HTMLTwinItem {
|
|
187
235
|
/**
|
|
188
236
|
* The corresponding BabylonJS entity. Can be a Node or a Control.
|
|
189
237
|
*/
|
|
190
|
-
entity:
|
|
191
|
-
constructor(entity:
|
|
238
|
+
entity: Control;
|
|
239
|
+
constructor(entity: Control, scene: Scene);
|
|
240
|
+
/**
|
|
241
|
+
* The text content displayed in HTML element.
|
|
242
|
+
* @param options - Options to render HTML twin tree where this element is contained.
|
|
243
|
+
* @returns The text content displayed in HTML element.
|
|
244
|
+
*/
|
|
245
|
+
getDescription(options: IHTMLTwinRendererOptions): string;
|
|
192
246
|
/**
|
|
193
247
|
* If this entity is actionable (can be clicked).
|
|
194
248
|
*/
|
|
@@ -211,72 +265,18 @@ export class HTMLTwinNodeItem extends HTMLTwinItem {
|
|
|
211
265
|
* @param eventType - Which event is triggered. E.g. "click", "contextmenu"
|
|
212
266
|
*/
|
|
213
267
|
triggerEvent(eventType: string): void;
|
|
214
|
-
private _getTriggerActions;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinRenderer" {
|
|
219
|
-
import { Scene } from "@babylonjs/core/scene";
|
|
220
|
-
/**
|
|
221
|
-
* Options for the HTMLTwinRenderer.
|
|
222
|
-
*/
|
|
223
|
-
export interface IHTMLTwinRendererOptions {
|
|
224
|
-
/**
|
|
225
|
-
* If this is true, all GUI controls will be added to the twin tree, regardless if they have
|
|
226
|
-
* a defined accessibility tag or not. If it's false, only controls with an accessibility tag
|
|
227
|
-
* will be added. True by default.
|
|
228
|
-
*/
|
|
229
|
-
addAllControls: boolean;
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* This class is the main entry point for the HTML twin renderer. To render a twin for a scene,
|
|
233
|
-
* simply call HTMLTwinRenderer.Render(scene).
|
|
234
|
-
*/
|
|
235
|
-
export class HTMLTwinRenderer {
|
|
236
|
-
/**
|
|
237
|
-
* Render the HTML twin for the given scene.
|
|
238
|
-
* @param scene the scene to render the twin for
|
|
239
|
-
* @param options options for the renderer
|
|
240
|
-
*/
|
|
241
|
-
static Render(scene: Scene, options?: IHTMLTwinRendererOptions): void;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinSceneContext" {
|
|
246
|
-
/// <reference types="react" />
|
|
247
|
-
/**
|
|
248
|
-
* Context used to update a scene when an entity is added or removed from the accessibility tree.
|
|
249
|
-
*/
|
|
250
|
-
export interface ISceneContext {
|
|
251
|
-
updateScene: () => void;
|
|
252
268
|
}
|
|
253
|
-
export const SceneContext: import("react").Context<ISceneContext>;
|
|
254
269
|
|
|
255
270
|
}
|
|
256
|
-
declare module "@babylonjs/accessibility/HtmlTwin/
|
|
257
|
-
import {
|
|
258
|
-
import {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
*/
|
|
264
|
-
export function HTMLTwinSceneTree(props: {
|
|
265
|
-
scene: Scene;
|
|
266
|
-
options: IHTMLTwinRendererOptions;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
declare module "@babylonjs/accessibility/HtmlTwin/index" {
|
|
271
|
-
export * from "@babylonjs/accessibility/HtmlTwin/htmlTwinRenderer";
|
|
272
|
-
|
|
271
|
+
declare module "@babylonjs/accessibility/HtmlTwin/htmlTwinAccessibilityItem" {
|
|
272
|
+
import { ReactElement } from "react";
|
|
273
|
+
import { HTMLTwinItem } from "@babylonjs/accessibility/HtmlTwin/htmlTwinItem";
|
|
274
|
+
export interface IHTMLTwinItemComponentProps {
|
|
275
|
+
description: string | undefined;
|
|
276
|
+
children: ReactElement[];
|
|
277
|
+
a11yItem: HTMLTwinItem;
|
|
273
278
|
}
|
|
274
|
-
declare module "@babylonjs/accessibility/index" {
|
|
275
|
-
export * from "@babylonjs/accessibility/HtmlTwin/index";
|
|
276
279
|
|
|
277
|
-
}
|
|
278
|
-
declare module "@babylonjs/accessibility/legacy/legacy" {
|
|
279
|
-
export * from "@babylonjs/accessibility/index";
|
|
280
280
|
|
|
281
281
|
}
|
|
282
282
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babylonjs/accessibility",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.17.0",
|
|
4
4
|
"main": "dist/babylon.accessibility.max.js",
|
|
5
5
|
"module": "dist/babylon.accessibility.max.js",
|
|
6
6
|
"esnext": "dist/babylon.accessibility.max.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"@types/react-dom": ">=16.0.9"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@babylonjs/core": "^7.
|
|
28
|
-
"@babylonjs/gui": "^7.
|
|
27
|
+
"@babylonjs/core": "^7.17.0",
|
|
28
|
+
"@babylonjs/gui": "^7.17.0",
|
|
29
29
|
"react": "^17.0.2",
|
|
30
30
|
"react-dom": "^17.0.2"
|
|
31
31
|
},
|