Skip to content

Commit

Permalink
fix: load the continuous toolbox (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonfunko authored Apr 19, 2024
1 parent 920febf commit ea68b1c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"webpack-dev-server": "^4.11.1"
},
"dependencies": {
"@blockly/continuous-toolbox": "^5.0.15",
"blockly": "^10.0.0"
}
}
18 changes: 18 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import * as Blockly from 'blockly/core';
import '../blocks_common/math.js';
import '../blocks_vertical/vertical_extensions.js';
import '../blocks_vertical/control.js';
Expand All @@ -15,9 +16,26 @@ import '../blocks_vertical/operators.js';
import '../blocks_vertical/sensing.js';
import '../blocks_vertical/sound.js';
import * as scratchBlocksUtils from '../core/scratch_blocks_utils.js';
import {
ContinuousToolbox,
ContinuousFlyout,
ContinuousMetrics,
} from '@blockly/continuous-toolbox';

export * from 'blockly';
export * from './categories.js';
export * from '../core/colours.js';
export * from '../msg/scratch_msgs.js';
export {scratchBlocksUtils};

export function inject(container, options) {
Object.assign(options, {
plugins: {
toolbox: ContinuousToolbox,
flyoutsVerticalToolbox: ContinuousFlyout,
metricsManager: ContinuousMetrics,
},
});
const workspace = Blockly.inject(container, options);
return workspace;
}

0 comments on commit ea68b1c

Please # to comment.