Skip to content
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

[Google Blockly] add field colour plugin #57895

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
"@blockly/block-shareable-procedures": "~4.0.5",
"@blockly/field-angle": "^4.0.0",
"@blockly/field-bitmap": "^4.0.13",
"@blockly/field-colour": "^4.0.0",
"@blockly/field-grid-dropdown": "~4.0.9",
"@blockly/keyboard-navigation": "~0.5.6",
"@blockly/plugin-cross-tab-copy-paste": "~5.0.4",
Expand Down
6 changes: 5 additions & 1 deletion apps/src/blockly/googleBlocklyWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '@blockly/plugin-scroll-options';
import {LineCursor, NavigationController} from '@blockly/keyboard-navigation';
import {CrossTabCopyPaste} from '@blockly/plugin-cross-tab-copy-paste';
import {installAllBlocks as installColourBlocks} from '@blockly/field-colour';
import {
BlockColors,
BlocklyVersion,
Expand Down Expand Up @@ -374,7 +375,10 @@ function initializeBlocklyWrapper(blocklyInstance: GoogleBlocklyInstance) {
// Assign all of the properties of the javascript generator to the forBlock array
// Prevents deprecation warnings related to https://github.com/google/blockly/pull/7150
Object.setPrototypeOf(javascriptGenerator.forBlock, javascriptGenerator);

// Installs all colour blocks, the colour field, and the JS generator functions.
installColourBlocks({
javascript: javascriptGenerator,
});
blocklyWrapper.JavaScript = javascriptGenerator;
blocklyWrapper.LineCursor = LineCursor;
blocklyWrapper.navigationController = new NavigationController();
Expand Down
10 changes: 10 additions & 0 deletions apps/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3142,6 +3142,15 @@ __metadata:
languageName: node
linkType: hard

"@blockly/field-colour@npm:^4.0.0":
version: 4.0.0
resolution: "@blockly/field-colour@npm:4.0.0"
peerDependencies:
blockly: ^10.4.3
checksum: 206c614cc3b405d18ecf66f47c0cbe1938726f4a99a48806edda4509f6f6721cc63670bd756d85cf1b0820459af43404a7e7bba6424eff27bcaee291f694845b
languageName: node
linkType: hard

"@blockly/field-grid-dropdown@npm:~4.0.9":
version: 4.0.10
resolution: "@blockly/field-grid-dropdown@npm:4.0.10"
Expand Down Expand Up @@ -8109,6 +8118,7 @@ __metadata:
"@blockly/block-shareable-procedures": ~4.0.5
"@blockly/field-angle": ^4.0.0
"@blockly/field-bitmap": ^4.0.13
"@blockly/field-colour": ^4.0.0
"@blockly/field-grid-dropdown": ~4.0.9
"@blockly/keyboard-navigation": ~0.5.6
"@blockly/plugin-cross-tab-copy-paste": ~5.0.4
Expand Down