@@ -37,16 +37,13 @@ import {EventType} from './events/type.js';
3737import * as eventUtils from './events/utils.js' ;
3838import { Flyout } from './flyout_base.js' ;
3939import type { FlyoutButton } from './flyout_button.js' ;
40- import { getFocusManager } from './focus_manager.js' ;
4140import { Gesture } from './gesture.js' ;
4241import { Grid } from './grid.js' ;
4342import type { IASTNodeLocationSvg } from './interfaces/i_ast_node_location_svg.js' ;
4443import type { IBoundedElement } from './interfaces/i_bounded_element.js' ;
4544import { IContextMenu } from './interfaces/i_contextmenu.js' ;
4645import type { IDragTarget } from './interfaces/i_drag_target.js' ;
4746import type { IFlyout } from './interfaces/i_flyout.js' ;
48- import type { IFocusableNode } from './interfaces/i_focusable_node.js' ;
49- import type { IFocusableTree } from './interfaces/i_focusable_tree.js' ;
5047import type { IMetricsManager } from './interfaces/i_metrics_manager.js' ;
5148import type { IToolbox } from './interfaces/i_toolbox.js' ;
5249import type {
@@ -57,7 +54,6 @@ import type {LineCursor} from './keyboard_nav/line_cursor.js';
5754import type { Marker } from './keyboard_nav/marker.js' ;
5855import { LayerManager } from './layer_manager.js' ;
5956import { MarkerManager } from './marker_manager.js' ;
60- import { Msg } from './msg.js' ;
6157import { Options } from './options.js' ;
6258import * as Procedures from './procedures.js' ;
6359import * as registry from './registry.js' ;
@@ -70,7 +66,6 @@ import {Classic} from './theme/classic.js';
7066import { ThemeManager } from './theme_manager.js' ;
7167import * as Tooltip from './tooltip.js' ;
7268import type { Trashcan } from './trashcan.js' ;
73- import * as aria from './utils/aria.js' ;
7469import * as arrayUtils from './utils/array.js' ;
7570import { Coordinate } from './utils/coordinate.js' ;
7671import * as dom from './utils/dom.js' ;
@@ -98,7 +93,7 @@ const ZOOM_TO_FIT_MARGIN = 20;
9893 */
9994export class WorkspaceSvg
10095 extends Workspace
101- implements IASTNodeLocationSvg , IContextMenu , IFocusableNode , IFocusableTree
96+ implements IASTNodeLocationSvg , IContextMenu
10297{
10398 /**
10499 * A wrapper function called when a resize event occurs.
@@ -769,19 +764,7 @@ export class WorkspaceSvg
769764 * <g class="blocklyBubbleCanvas"></g>
770765 * </g>
771766 */
772- this . svgGroup_ = dom . createSvgElement ( Svg . G , {
773- 'class' : 'blocklyWorkspace' ,
774- // Only the top-level workspace should be tabbable.
775- 'tabindex' : injectionDiv ? '0' : '-1' ,
776- 'id' : this . id ,
777- } ) ;
778- if ( injectionDiv ) {
779- aria . setState (
780- this . svgGroup_ ,
781- aria . State . LABEL ,
782- Msg [ 'WORKSPACE_ARIA_LABEL' ] ,
783- ) ;
784- }
767+ this . svgGroup_ = dom . createSvgElement ( Svg . G , { 'class' : 'blocklyWorkspace' } ) ;
785768
786769 // Note that a <g> alone does not receive mouse events--it must have a
787770 // valid target inside it. If no background class is specified, as in the
@@ -857,9 +840,6 @@ export class WorkspaceSvg
857840 this . getTheme ( ) ,
858841 isParentWorkspace ? this . getInjectionDiv ( ) : undefined ,
859842 ) ;
860-
861- getFocusManager ( ) . registerTree ( this ) ;
862-
863843 return this . svgGroup_ ;
864844 }
865845
@@ -944,10 +924,6 @@ export class WorkspaceSvg
944924 document . body . removeEventListener ( 'wheel' , this . dummyWheelListener ) ;
945925 this . dummyWheelListener = null ;
946926 }
947-
948- if ( getFocusManager ( ) . isRegistered ( this ) ) {
949- getFocusManager ( ) . unregisterTree ( this ) ;
950- }
951927 }
952928
953929 /**
@@ -2642,55 +2618,6 @@ export class WorkspaceSvg
26422618 deltaY *= scale ;
26432619 this . scroll ( this . scrollX + deltaX , this . scrollY + deltaY ) ;
26442620 }
2645-
2646- /** See IFocusableNode.getFocusableElement. */
2647- getFocusableElement ( ) : HTMLElement | SVGElement {
2648- return this . svgGroup_ ;
2649- }
2650-
2651- /** See IFocusableNode.getFocusableTree. */
2652- getFocusableTree ( ) : IFocusableTree {
2653- return this ;
2654- }
2655-
2656- /** See IFocusableNode.onNodeFocus. */
2657- onNodeFocus ( ) : void { }
2658-
2659- /** See IFocusableNode.onNodeBlur. */
2660- onNodeBlur ( ) : void { }
2661-
2662- /** See IFocusableTree.getRootFocusableNode. */
2663- getRootFocusableNode ( ) : IFocusableNode {
2664- return this ;
2665- }
2666-
2667- /** See IFocusableTree.getRestoredFocusableNode. */
2668- getRestoredFocusableNode (
2669- previousNode : IFocusableNode | null ,
2670- ) : IFocusableNode | null {
2671- if ( ! previousNode ) {
2672- return this . getTopBlocks ( true ) [ 0 ] ?? null ;
2673- } else return null ;
2674- }
2675-
2676- /** See IFocusableTree.getNestedTrees. */
2677- getNestedTrees ( ) : Array < IFocusableTree > {
2678- return [ ] ;
2679- }
2680-
2681- /** See IFocusableTree.lookUpFocusableNode. */
2682- lookUpFocusableNode ( id : string ) : IFocusableNode | null {
2683- return this . getBlockById ( id ) as IFocusableNode ;
2684- }
2685-
2686- /** See IFocusableTree.onTreeFocus. */
2687- onTreeFocus (
2688- _node : IFocusableNode ,
2689- _previousTree : IFocusableTree | null ,
2690- ) : void { }
2691-
2692- /** See IFocusableTree.onTreeBlur. */
2693- onTreeBlur ( _nextTree : IFocusableTree | null ) : void { }
26942621}
26952622
26962623/**
0 commit comments