Skip to content

Commit 7a07b4b

Browse files
authored
refactor!: Remove old cursor and tab support. (#8803)
1 parent e02d385 commit 7a07b4b

File tree

6 files changed

+0
-326
lines changed

6 files changed

+0
-326
lines changed

core/block_svg.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import {BlockDragStrategy} from './dragging/block_drag_strategy.js';
3434
import type {BlockMove} from './events/events_block_move.js';
3535
import {EventType} from './events/type.js';
3636
import * as eventUtils from './events/utils.js';
37-
import type {Field} from './field.js';
3837
import {FieldLabel} from './field_label.js';
3938
import {IconType} from './icons/icon_types.js';
4039
import {MutatorIcon} from './icons/mutator_icon.js';
@@ -46,8 +45,6 @@ import type {ICopyable} from './interfaces/i_copyable.js';
4645
import type {IDragStrategy, IDraggable} from './interfaces/i_draggable.js';
4746
import {IIcon} from './interfaces/i_icon.js';
4847
import * as internalConstants from './internal_constants.js';
49-
import {ASTNode} from './keyboard_nav/ast_node.js';
50-
import {TabNavigateCursor} from './keyboard_nav/tab_navigate_cursor.js';
5148
import {MarkerManager} from './marker_manager.js';
5249
import {Msg} from './msg.js';
5350
import * as renderManagement from './render_management.js';
@@ -550,35 +547,6 @@ export class BlockSvg
550547
input.appendField(new FieldLabel(text), collapsedFieldName);
551548
}
552549

553-
/**
554-
* Open the next (or previous) FieldTextInput.
555-
*
556-
* @param start Current field.
557-
* @param forward If true go forward, otherwise backward.
558-
*/
559-
tab(start: Field, forward: boolean) {
560-
const tabCursor = new TabNavigateCursor();
561-
tabCursor.setCurNode(ASTNode.createFieldNode(start)!);
562-
const currentNode = tabCursor.getCurNode();
563-
564-
if (forward) {
565-
tabCursor.next();
566-
} else {
567-
tabCursor.prev();
568-
}
569-
570-
const nextNode = tabCursor.getCurNode();
571-
if (nextNode && nextNode !== currentNode) {
572-
const nextField = nextNode.getLocation() as Field;
573-
nextField.showEditor();
574-
575-
// Also move the cursor if we're in keyboard nav mode.
576-
if (this.workspace.keyboardAccessibilityMode) {
577-
this.workspace.getCursor()!.setCurNode(nextNode);
578-
}
579-
}
580-
}
581-
582550
/**
583551
* Handle a pointerdown on an SVG block.
584552
*

core/blockly.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,8 @@ import {IVariableMap} from './interfaces/i_variable_map.js';
169169
import {IVariableModel, IVariableState} from './interfaces/i_variable_model.js';
170170
import * as internalConstants from './internal_constants.js';
171171
import {ASTNode} from './keyboard_nav/ast_node.js';
172-
import {BasicCursor} from './keyboard_nav/basic_cursor.js';
173172
import {Cursor} from './keyboard_nav/cursor.js';
174173
import {Marker} from './keyboard_nav/marker.js';
175-
import {TabNavigateCursor} from './keyboard_nav/tab_navigate_cursor.js';
176174
import type {LayerManager} from './layer_manager.js';
177175
import * as layers from './layers.js';
178176
import {MarkerManager} from './marker_manager.js';
@@ -432,7 +430,6 @@ Names.prototype.populateProcedures = function (
432430
// Re-export submodules that no longer declareLegacyNamespace.
433431
export {
434432
ASTNode,
435-
BasicCursor,
436433
Block,
437434
BlockSvg,
438435
BlocklyOptions,
@@ -589,7 +586,6 @@ export {
589586
ScrollbarPair,
590587
SeparatorFlyoutInflater,
591588
ShortcutRegistry,
592-
TabNavigateCursor,
593589
Theme,
594590
ThemeManager,
595591
Toolbox,

core/field.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,15 +1331,6 @@ export abstract class Field<T = any>
13311331
return false;
13321332
}
13331333

1334-
/**
1335-
* Returns whether or not the field is tab navigable.
1336-
*
1337-
* @returns True if the field is tab navigable.
1338-
*/
1339-
isTabNavigable(): boolean {
1340-
return false;
1341-
}
1342-
13431334
/**
13441335
* Handles the given keyboard shortcut.
13451336
*

core/field_input.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,6 @@ export abstract class FieldInput<T extends InputTypes> extends Field<
562562
);
563563
WidgetDiv.hideIfOwner(this);
564564
dropDownDiv.hideWithoutAnimation();
565-
} else if (e.key === 'Tab') {
566-
WidgetDiv.hideIfOwner(this);
567-
dropDownDiv.hideWithoutAnimation();
568-
(this.sourceBlock_ as BlockSvg).tab(this, !e.shiftKey);
569-
e.preventDefault();
570565
}
571566
}
572567

@@ -674,15 +669,6 @@ export abstract class FieldInput<T extends InputTypes> extends Field<
674669
return true;
675670
}
676671

677-
/**
678-
* Returns whether or not the field is tab navigable.
679-
*
680-
* @returns True if the field is tab navigable.
681-
*/
682-
override isTabNavigable(): boolean {
683-
return true;
684-
}
685-
686672
/**
687673
* Use the `getText_` developer hook to override the field's text
688674
* representation. When we're currently editing, return the current HTML value

core/keyboard_nav/basic_cursor.ts

Lines changed: 0 additions & 222 deletions
This file was deleted.

core/keyboard_nav/tab_navigate_cursor.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)