-
Notifications
You must be signed in to change notification settings - Fork 2
Changes necessary to resolve errors with RAISE Playground #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: modern-blockly
Are you sure you want to change the base?
Conversation
| import "./blocks/sensing"; | ||
| import "./blocks/sound"; | ||
| import * as scratchBlocksUtils from "./scratch_blocks_utils"; | ||
| /* BEGIN RG ADDITION */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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