Changes necessary to resolve errors with RAISE Playground#235
Changes necessary to resolve errors with RAISE Playground#235pmalacho-mit wants to merge 2 commits intogonfunko:modern-blocklyfrom
Conversation
| import "./blocks/sensing"; | ||
| import "./blocks/sound"; | ||
| import * as scratchBlocksUtils from "./scratch_blocks_utils"; | ||
| /* BEGIN RG ADDITION */ |
There was a problem hiding this comment.
This is necessary because the scratch-gui code wants to overwrite the compareStrings method:
https://github.com/scratchfoundation/scratch-gui/blob/develop/src/lib/blocks.js#L344
| */ | ||
|
|
||
| /* BEGIN RG ADDITION */ | ||
| export * from "./colours"; |
There was a problem hiding this comment.
This is necessary as there's lots of places ScratchBlocks.Colours is referenced:
(one example)
https://github.com/scratchfoundation/scratch-gui/blob/develop/src/lib/blocks.js#L70
| import * as Blockly from "blockly/core"; | ||
|
|
||
| const Colours = { | ||
| /* PBEGIN RG ADDITIONS */ |
There was a problem hiding this comment.
This is necessary as scratch-gui expects this properties to exist on ScratchBlocks.Colours
one example:
https://github.com/scratchfoundation/scratch-gui/blob/develop/src/lib/blocks.js#L70
|
|
||
| /* BEGIN RG ADDITION */ | ||
| import { StatusIndicatorLabel } from "./status_indicator_label"; | ||
| export { StatusIndicatorLabel as FlyoutExtensionCategoryHeader }; |
There was a problem hiding this comment.
This is necessary as scratch-gui expects for FlyoutExtensionCategoryHeader to be defined on ScratchBlocks. However, I don't know if the StatusIndicatorLabel actually corresponds to the FlyoutExtensionCategoryHeader.. they just both have a getExtensionState method, which is what the scratch-gui wants to interact with.
https://github.com/scratchfoundation/scratch-gui/blob/develop/src/lib/blocks.js#L326
| const style = { | ||
| colourPrimary: | ||
| "colourQuaternary" in colour | ||
| "colourQuaternary" in colour && Boolean(colour.colourQuaternary) |
There was a problem hiding this comment.
Without these checks, I'd get lots of Invalid colour: "undefined" errors. But is this code correct, @gonfunko ? As it just seems a little odd to be defining Primary Secondary and Tertiary always first trying to use the Quaternary setting..
Resolves
What Github issue does this resolve (please include link)?
Proposed Changes
Describe what this Pull Request does
Reason for Changes
Explain why these changes should be made
Test Coverage
Please show how you have added tests to cover your changes