Skip to content

Commit

Permalink
Patch release with #4327 (#4328)
Browse files Browse the repository at this point in the history
* Block factory fix (#4327)

* Rebuild
  • Loading branch information
alschmiedt authored Sep 28, 2020
1 parent 8d5d2be commit 23c28a0
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 59 deletions.
105 changes: 53 additions & 52 deletions blockly_compressed.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion blockly_compressed.js.map

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions core/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,19 @@ Blockly.Options.parseThemeOptions_ = function(options) {
return Blockly.Theme.defineTheme(theme.name ||
('builtin' + Blockly.utils.IdGenerator.getNextUniqueId()), theme);
};

/**
* Parse the provided toolbox tree into a consistent DOM format.
* @param {?Node|?string} toolboxDef DOM tree of blocks, or text representation
* of same.
* @return {?Node} DOM tree of blocks, or null.
* @deprecated Use Blockly.utils.toolbox.parseToolboxTree. (2020 September 28)
*/
Blockly.Options.parseToolboxTree = function(toolboxDef) {
Blockly.utils.deprecation.warn(
'Blockly.Options.parseToolboxTree',
'September 2020',
'September 2021',
'Blockly.utils.toolbox.parseToolboxTree');
return Blockly.utils.toolbox.parseToolboxTree(toolboxDef);
};
2 changes: 1 addition & 1 deletion core/toolbox/toolbox_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Blockly.ToolboxItem = function(toolboxItemDef, toolbox, opt_parent) {
* @type {string}
* @protected
*/
this.id_ = toolboxItemDef['id'] || Blockly.utils.IdGenerator.getNextUniqueId();
this.id_ = toolboxItemDef['toolboxitemid'] || Blockly.utils.IdGenerator.getNextUniqueId();

/**
* The parent of the category.
Expand Down
4 changes: 2 additions & 2 deletions demos/blockfactory/workspacefactory/wfactory_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ WorkspaceFactoryController.prototype.updatePreview = function() {
// Only update the toolbox if not in read only mode.
if (!this.model.options['readOnly']) {
// Get toolbox XML.
var tree = Blockly.Options.parseToolboxTree(
var tree = Blockly.utils.toolbox.parseToolboxTree(
this.generator.generateToolboxXml());

// No categories, creates a simple flyout.
Expand Down Expand Up @@ -1084,7 +1084,7 @@ WorkspaceFactoryController.prototype.setStandardOptionsAndUpdate = function() {
WorkspaceFactoryController.prototype.generateNewOptions = function() {
this.model.setOptions(this.readOptions_());

this.reinjectPreview(Blockly.Options.parseToolboxTree(
this.reinjectPreview(Blockly.utils.toolbox.parseToolboxTree(
this.generator.generateToolboxXml()));
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockly",
"version": "3.20200924.0",
"version": "3.20200924.1",
"description": "Blockly is a library for building visual programming editors.",
"keywords": [
"blockly"
Expand Down
4 changes: 2 additions & 2 deletions tests/mocha/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@
<category name="Second">
<block type="stack_block"></block>
</category>
<sep id="separator" gap="-1"></sep>
<sep toolboxitemid="separator" gap="-1"></sep>
<category name="Variables" custom="VARIABLE"></category>
<category name="NestedCategory" >
<category id="nestedCategory" name="NestedItemOne"></category>
<category toolboxitemid="nestedCategory" name="NestedItemOne"></category>
</category>
<category name="lastItem"></category>
</xml>
Expand Down

0 comments on commit 23c28a0

Please sign in to comment.