-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: collapsing blocks with children with icons (#7111)
* fix: collapsing blocks with icons * chore: add tests for hiding icons of collapsed children
- Loading branch information
Showing
6 changed files
with
138 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/** | ||
* @license | ||
* Copyright 2023 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export class MockIcon { | ||
getType() { | ||
return 'mock icon'; | ||
} | ||
|
||
initView() {} | ||
|
||
dispose() {} | ||
|
||
getWeight() {} | ||
|
||
getSize() { | ||
return new Blockly.utils.Size(0, 0); | ||
} | ||
|
||
applyColour() {} | ||
|
||
hideForInsertionMarker() {} | ||
|
||
updateEditable() {} | ||
|
||
updateCollapsed() {} | ||
|
||
isShownWhenCollapsed() {} | ||
|
||
setOffsetInBlock() {} | ||
|
||
onLocationChange() {} | ||
|
||
onClick() {} | ||
} | ||
|
||
export class MockSerializableIcon extends MockIcon { | ||
constructor() { | ||
super(); | ||
this.state = ''; | ||
} | ||
|
||
getType() { | ||
return 'serializable icon'; | ||
} | ||
|
||
getWeight() { | ||
return 1; | ||
} | ||
|
||
saveState() { | ||
return 'some state'; | ||
} | ||
|
||
loadState(state) { | ||
this.state = state; | ||
} | ||
} | ||
|
||
export class MockBubbleIcon extends MockIcon { | ||
constructor() { | ||
super(); | ||
this.visible = false; | ||
} | ||
|
||
getType() { | ||
return 'bubble icon'; | ||
} | ||
|
||
updateCollapsed() {} | ||
|
||
bubbleIsVisible() { | ||
return this.visible; | ||
} | ||
|
||
setBubbleVisible(visible) { | ||
this.visible = visible; | ||
} | ||
} |