babylonjs-accessibility 6.3.1 → 6.4.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.
@@ -31355,6 +31355,9 @@ class HTMLTwinHostComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
31355
31355
  }
31356
31356
  });
31357
31357
  };
31358
+ this._options = props.options ?? {
31359
+ addAllControls: true,
31360
+ };
31358
31361
  this.state = { a11yTreeItems: [] };
31359
31362
  }
31360
31363
  componentDidUpdate(prevProps, prevState, snapshot) {
@@ -31440,7 +31443,7 @@ class HTMLTwinHostComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
31440
31443
  const queue = [...rootItems];
31441
31444
  for (let i = 0; i < queue.length; i++) {
31442
31445
  const curNode = queue[i];
31443
- if (!curNode.isVisible) {
31446
+ if (!curNode.isVisible || (!this._options.addAllControls && curNode.name !== "root" && !curNode.accessibilityTag?.description)) {
31444
31447
  continue;
31445
31448
  }
31446
31449
  if (curNode instanceof gui_2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_6__.Container && curNode.children.length !== 0 && !(curNode instanceof gui_2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_6__.Button)) {
@@ -31673,10 +31676,20 @@ __webpack_require__.r(__webpack_exports__);
31673
31676
 
31674
31677
 
31675
31678
 
31679
+ /**
31680
+ * This class is the main entry point for the HTML twin renderer. To render a twin for a scene,
31681
+ * simply call HTMLTwinRenderer.Render(scene).
31682
+ */
31676
31683
  class HTMLTwinRenderer {
31677
- static Render(scene) {
31684
+ /**
31685
+ * Render the HTML twin for the given scene.
31686
+ * @param scene the scene to render the twin for
31687
+ * @param options options for the renderer
31688
+ */
31689
+ static Render(scene, options) {
31678
31690
  const htmlTwinHost = react__WEBPACK_IMPORTED_MODULE_0__.createElement(_htmlTwinHostComponent__WEBPACK_IMPORTED_MODULE_2__.HTMLTwinHostComponent, {
31679
31691
  scene,
31692
+ options,
31680
31693
  });
31681
31694
  react_dom__WEBPACK_IMPORTED_MODULE_1__.render(htmlTwinHost, scene.getEngine().getRenderingCanvas());
31682
31695
  }