fix!: refactor mutator icon (#7115)

* feat: add basic mutator icon

* feat: add actual mutation behavior to icon

* chore: add bumping blocks back into the bubble

* fix: add updating block styles

* feat: add static methods to mutator icon

* chore: delete old mutator code

* fix: use the new mutator icon

* chore: docs and format

* chore: my own comments

* chore: first pass at PR comments

* chore: make type strings internal

* chore: add todo

* chore: format

* chore: move properties to module level

* chore: fix using in demos

* chore: move Mutator to icons.MutatorIcon

* chore: move reconnect to connection

* chore: move findParentWs to workspace

* chore: properly override and call super

* chore: remove bubbleIsVisible check

* chore: change imports to import type

* chore: use elvis operator

* chore: update renamings

* chore: reduce changes to js block files
This commit is contained in:
Beka Westberg
2023-06-02 12:18:41 -07:00
committed by GitHub
parent 50d9474db5
commit 2f74ce822f
23 changed files with 629 additions and 723 deletions

View File

@@ -35,8 +35,8 @@ import {Align, Input} from './inputs/input.js';
import type {IASTNodeLocation} from './interfaces/i_ast_node_location.js';
import type {IDeletable} from './interfaces/i_deletable.js';
import type {IIcon} from './interfaces/i_icon.js';
import type {Mutator} from './mutator.js';
import {CommentIcon} from './icons/comment_icon.js';
import type {MutatorIcon} from './icons/mutator_icon.js';
import * as Tooltip from './tooltip.js';
import * as arrayUtils from './utils/array.js';
import {Coordinate} from './utils/coordinate.js';
@@ -2208,7 +2208,7 @@ export class Block implements IASTNodeLocation, IDeletable {
*
* @param _mutator A mutator dialog instance or null to remove.
*/
setMutator(_mutator: Mutator) {
setMutator(_mutator: MutatorIcon) {
// NOOP.
}
@@ -2242,6 +2242,7 @@ export class Block implements IASTNodeLocation, IDeletable {
return this.icons.some((icon) => icon.getType() === type);
}
// TODO (#7126): Make this take in a generic type.
/**
* @returns The icon with the given type if it exists on the block, undefined
* otherwise.