Skip to content

Commit

Permalink
refactor: Rename Blockly.Blocks to Blockly.blocks
Browse files Browse the repository at this point in the history
Because it does not export a type as its default export.

Part of #5073.
  • Loading branch information
cpcallen committed Sep 21, 2021
1 parent 556a242 commit 8aa44f3
Show file tree
Hide file tree
Showing 22 changed files with 129 additions and 130 deletions.
3 changes: 1 addition & 2 deletions blocks/colour.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
*/
'use strict';

goog.provide('Blockly.Blocks.colour'); // Deprecated
goog.provide('Blockly.blocks.colour'); // Deprecated
goog.provide('Blockly.Constants.Colour');

goog.require('Blockly');
goog.require('Blockly.Blocks');
goog.require('Blockly.FieldColour');
goog.require('Blockly.FieldLabel');

Expand Down
20 changes: 10 additions & 10 deletions blocks/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
goog.provide('Blockly.Constants.Lists');

goog.require('Blockly');
goog.require('Blockly.Blocks');
goog.require('Blockly.blocks');
goog.require('Blockly.FieldDropdown');
goog.require('Blockly.FieldLabel');
goog.require('Blockly.Mutator');
Expand Down Expand Up @@ -115,7 +115,7 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
}
]); // END JSON EXTRACT (Do not delete this comment.)

Blockly.Blocks['lists_create_with'] = {
Blockly.blocks['lists_create_with'] = {
/**
* Block for creating a list with any number of elements of any type.
* @this {Blockly.Block}
Expand Down Expand Up @@ -259,7 +259,7 @@ Blockly.Blocks['lists_create_with'] = {
}
};

Blockly.Blocks['lists_create_with_container'] = {
Blockly.blocks['lists_create_with_container'] = {
/**
* Mutator block for list container.
* @this {Blockly.Block}
Expand All @@ -274,7 +274,7 @@ Blockly.Blocks['lists_create_with_container'] = {
}
};

Blockly.Blocks['lists_create_with_item'] = {
Blockly.blocks['lists_create_with_item'] = {
/**
* Mutator block for adding items.
* @this {Blockly.Block}
Expand All @@ -290,7 +290,7 @@ Blockly.Blocks['lists_create_with_item'] = {
}
};

Blockly.Blocks['lists_indexOf'] = {
Blockly.blocks['lists_indexOf'] = {
/**
* Block for finding an item in the list.
* @this {Blockly.Block}
Expand Down Expand Up @@ -319,7 +319,7 @@ Blockly.Blocks['lists_indexOf'] = {
}
};

Blockly.Blocks['lists_getIndex'] = {
Blockly.blocks['lists_getIndex'] = {
/**
* Block for getting element at index.
* @this {Blockly.Block}
Expand Down Expand Up @@ -510,7 +510,7 @@ Blockly.Blocks['lists_getIndex'] = {
}
};

Blockly.Blocks['lists_setIndex'] = {
Blockly.blocks['lists_setIndex'] = {
/**
* Block for setting the element at index.
* @this {Blockly.Block}
Expand Down Expand Up @@ -656,7 +656,7 @@ Blockly.Blocks['lists_setIndex'] = {
}
};

Blockly.Blocks['lists_getSublist'] = {
Blockly.blocks['lists_getSublist'] = {
/**
* Block for getting sublist.
* @this {Blockly.Block}
Expand Down Expand Up @@ -772,7 +772,7 @@ Blockly.Blocks['lists_getSublist'] = {
}
};

Blockly.Blocks['lists_sort'] = {
Blockly.blocks['lists_sort'] = {
/**
* Block for sorting a list.
* @this {Blockly.Block}
Expand Down Expand Up @@ -812,7 +812,7 @@ Blockly.Blocks['lists_sort'] = {
}
};

Blockly.Blocks['lists_split'] = {
Blockly.blocks['lists_split'] = {
/**
* Block for splitting text into a list, or joining a list into text.
* @this {Blockly.Block}
Expand Down
3 changes: 1 addition & 2 deletions blocks/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
*/
'use strict';

goog.provide('Blockly.Blocks.logic'); // Deprecated
goog.provide('Blockly.blocks.logic'); // Deprecated
goog.provide('Blockly.Constants.Logic');

goog.require('Blockly');
goog.require('Blockly.Blocks');
goog.require('Blockly.FieldDropdown');
goog.require('Blockly.FieldLabel');
goog.require('Blockly.Mutator');
Expand Down
3 changes: 1 addition & 2 deletions blocks/loops.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
*/
'use strict';

goog.provide('Blockly.Blocks.loops'); // Deprecated
goog.provide('Blockly.blocks.loops'); // Deprecated
goog.provide('Blockly.Constants.Loops');

goog.require('Blockly');
goog.require('Blockly.Blocks');
goog.require('Blockly.FieldDropdown');
goog.require('Blockly.FieldLabel');
goog.require('Blockly.FieldNumber');
Expand Down
3 changes: 1 addition & 2 deletions blocks/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
*/
'use strict';

goog.provide('Blockly.Blocks.math'); // Deprecated
goog.provide('Blockly.blocks.math'); // Deprecated
goog.provide('Blockly.Constants.Math');

goog.require('Blockly');
goog.require('Blockly.Blocks');
goog.require('Blockly.FieldDropdown');
goog.require('Blockly.FieldLabel');
goog.require('Blockly.FieldNumber');
Expand Down
70 changes: 34 additions & 36 deletions blocks/procedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
*/
'use strict';

goog.provide('Blockly.Blocks.procedures');
goog.provide('Blockly.blocks.procedures');

goog.require('Blockly');
goog.require('Blockly.Blocks');
goog.require('Blockly.blocks');
goog.require('Blockly.Comment');
goog.require('Blockly.FieldCheckbox');
goog.require('Blockly.FieldLabel');
Expand All @@ -22,7 +22,7 @@ goog.require('Blockly.Mutator');
goog.require('Blockly.Warning');


Blockly.Blocks['procedures_defnoreturn'] = {
Blockly.blocks['procedures_defnoreturn'] = {
/**
* Block for defining a procedure with no return value.
* @this {Blockly.Block}
Expand Down Expand Up @@ -450,7 +450,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
callType_: 'procedures_callnoreturn'
};

Blockly.Blocks['procedures_defreturn'] = {
Blockly.blocks['procedures_defreturn'] = {
/**
* Block for defining a procedure with a return value.
* @this {Blockly.Block}
Expand Down Expand Up @@ -482,14 +482,12 @@ Blockly.Blocks['procedures_defreturn'] = {
this.setStatements_(true);
this.statementConnection_ = null;
},
setStatements_: Blockly.Blocks['procedures_defnoreturn'].setStatements_,
updateParams_: Blockly.Blocks['procedures_defnoreturn'].updateParams_,
mutationToDom: Blockly.Blocks['procedures_defnoreturn'].mutationToDom,
domToMutation: Blockly.Blocks['procedures_defnoreturn'].domToMutation,
saveExtraState: Blockly.Blocks['procedures_defnoreturn'].saveExtraState,
loadExtraState: Blockly.Blocks['procedures_defnoreturn'].loadExtraState,
decompose: Blockly.Blocks['procedures_defnoreturn'].decompose,
compose: Blockly.Blocks['procedures_defnoreturn'].compose,
setStatements_: Blockly.blocks['procedures_defnoreturn'].setStatements_,
updateParams_: Blockly.blocks['procedures_defnoreturn'].updateParams_,
mutationToDom: Blockly.blocks['procedures_defnoreturn'].mutationToDom,
domToMutation: Blockly.blocks['procedures_defnoreturn'].domToMutation,
decompose: Blockly.blocks['procedures_defnoreturn'].decompose,
compose: Blockly.blocks['procedures_defnoreturn'].compose,
/**
* Return the signature of this procedure definition.
* @return {!Array} Tuple containing three elements:
Expand All @@ -501,16 +499,16 @@ Blockly.Blocks['procedures_defreturn'] = {
getProcedureDef: function() {
return [this.getFieldValue('NAME'), this.arguments_, true];
},
getVars: Blockly.Blocks['procedures_defnoreturn'].getVars,
getVarModels: Blockly.Blocks['procedures_defnoreturn'].getVarModels,
renameVarById: Blockly.Blocks['procedures_defnoreturn'].renameVarById,
updateVarName: Blockly.Blocks['procedures_defnoreturn'].updateVarName,
displayRenamedVar_: Blockly.Blocks['procedures_defnoreturn'].displayRenamedVar_,
customContextMenu: Blockly.Blocks['procedures_defnoreturn'].customContextMenu,
getVars: Blockly.blocks['procedures_defnoreturn'].getVars,
getVarModels: Blockly.blocks['procedures_defnoreturn'].getVarModels,
renameVarById: Blockly.blocks['procedures_defnoreturn'].renameVarById,
updateVarName: Blockly.blocks['procedures_defnoreturn'].updateVarName,
displayRenamedVar_: Blockly.blocks['procedures_defnoreturn'].displayRenamedVar_,
customContextMenu: Blockly.blocks['procedures_defnoreturn'].customContextMenu,
callType_: 'procedures_callreturn'
};

Blockly.Blocks['procedures_mutatorcontainer'] = {
Blockly.blocks['procedures_mutatorcontainer'] = {
/**
* Mutator block for procedure container.
* @this {Blockly.Block}
Expand All @@ -528,7 +526,7 @@ Blockly.Blocks['procedures_mutatorcontainer'] = {
},
};

Blockly.Blocks['procedures_mutatorarg'] = {
Blockly.blocks['procedures_mutatorarg'] = {
/**
* Mutator block for procedure argument.
* @this {Blockly.Block}
Expand Down Expand Up @@ -639,7 +637,7 @@ Blockly.Blocks['procedures_mutatorarg'] = {
}
};

Blockly.Blocks['procedures_callnoreturn'] = {
Blockly.blocks['procedures_callnoreturn'] = {
/**
* Block for calling a procedure with no return value.
* @this {Blockly.Block}
Expand Down Expand Up @@ -1031,7 +1029,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
defType_: 'procedures_defnoreturn'
};

Blockly.Blocks['procedures_callreturn'] = {
Blockly.blocks['procedures_callreturn'] = {
/**
* Block for calling a procedure with a return value.
* @this {Blockly.Block}
Expand All @@ -1050,24 +1048,24 @@ Blockly.Blocks['procedures_callreturn'] = {
this.previousEnabledState_ = true;
},

getProcedureCall: Blockly.Blocks['procedures_callnoreturn'].getProcedureCall,
renameProcedure: Blockly.Blocks['procedures_callnoreturn'].renameProcedure,
getProcedureCall: Blockly.blocks['procedures_callnoreturn'].getProcedureCall,
renameProcedure: Blockly.blocks['procedures_callnoreturn'].renameProcedure,
setProcedureParameters_:
Blockly.Blocks['procedures_callnoreturn'].setProcedureParameters_,
updateShape_: Blockly.Blocks['procedures_callnoreturn'].updateShape_,
mutationToDom: Blockly.Blocks['procedures_callnoreturn'].mutationToDom,
domToMutation: Blockly.Blocks['procedures_callnoreturn'].domToMutation,
saveExtraState: Blockly.Blocks['procedures_callnoreturn'].saveExtraState,
loadExtraState: Blockly.Blocks['procedures_callnoreturn'].loadExtraState,
getVars: Blockly.Blocks['procedures_callnoreturn'].getVars,
getVarModels: Blockly.Blocks['procedures_callnoreturn'].getVarModels,
onchange: Blockly.Blocks['procedures_callnoreturn'].onchange,
Blockly.blocks['procedures_callnoreturn'].setProcedureParameters_,
updateShape_: Blockly.blocks['procedures_callnoreturn'].updateShape_,
mutationToDom: Blockly.blocks['procedures_callnoreturn'].mutationToDom,
domToMutation: Blockly.blocks['procedures_callnoreturn'].domToMutation,
saveExtraState: Blockly.blocks['procedures_callnoreturn'].saveExtraState,
loadExtraState: Blockly.blocks['procedures_callnoreturn'].loadExtraState,
getVars: Blockly.blocks['procedures_callnoreturn'].getVars,
getVarModels: Blockly.blocks['procedures_callnoreturn'].getVarModels,
onchange: Blockly.blocks['procedures_callnoreturn'].onchange,
customContextMenu:
Blockly.Blocks['procedures_callnoreturn'].customContextMenu,
Blockly.blocks['procedures_callnoreturn'].customContextMenu,
defType_: 'procedures_defreturn'
};

Blockly.Blocks['procedures_ifreturn'] = {
Blockly.blocks['procedures_ifreturn'] = {
/**
* Block for conditionally returning a value from a procedure.
* @this {Blockly.Block}
Expand Down Expand Up @@ -1164,7 +1162,7 @@ Blockly.Blocks['procedures_ifreturn'] = {
/**
* List of block types that are functions and thus do not need warnings.
* To add a new function type add this to your code:
* Blockly.Blocks['procedures_ifreturn'].FUNCTION_TYPES.push('custom_func');
* Blockly.blocks['procedures_ifreturn'].FUNCTION_TYPES.push('custom_func');
*/
FUNCTION_TYPES: ['procedures_defnoreturn', 'procedures_defreturn']
};
28 changes: 14 additions & 14 deletions blocks/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*/
'use strict';

goog.provide('Blockly.Blocks.texts'); // Deprecated
goog.provide('Blockly.blocks.texts'); // Deprecated
goog.provide('Blockly.Constants.Text');

goog.require('Blockly');
goog.require('Blockly.Blocks');
goog.require('Blockly.blocks');
goog.require('Blockly.FieldDropdown');
goog.require('Blockly.FieldImage');
goog.require('Blockly.FieldMultilineInput');
Expand Down Expand Up @@ -226,7 +226,7 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
}
]); // END JSON EXTRACT (Do not delete this comment.)

Blockly.Blocks['text_getSubstring'] = {
Blockly.blocks['text_getSubstring'] = {
/**
* Block for getting substring.
* @this {Blockly.Block}
Expand Down Expand Up @@ -347,7 +347,7 @@ Blockly.Blocks['text_getSubstring'] = {
}
};

Blockly.Blocks['text_changeCase'] = {
Blockly.blocks['text_changeCase'] = {
/**
* Block for changing capitalization.
* @this {Blockly.Block}
Expand All @@ -368,7 +368,7 @@ Blockly.Blocks['text_changeCase'] = {
}
};

Blockly.Blocks['text_trim'] = {
Blockly.blocks['text_trim'] = {
/**
* Block for trimming spaces.
* @this {Blockly.Block}
Expand All @@ -389,7 +389,7 @@ Blockly.Blocks['text_trim'] = {
}
};

Blockly.Blocks['text_print'] = {
Blockly.blocks['text_print'] = {
/**
* Block for print statement.
* @this {Blockly.Block}
Expand All @@ -412,7 +412,7 @@ Blockly.Blocks['text_print'] = {
}
};

Blockly.Blocks['text_prompt_ext'] = {
Blockly.blocks['text_prompt_ext'] = {
/**
* Block for prompt function (external message).
* @this {Blockly.Block}
Expand Down Expand Up @@ -474,7 +474,7 @@ Blockly.Blocks['text_prompt_ext'] = {
// XML hooks are kept for backwards compatibility.
};

Blockly.Blocks['text_prompt'] = {
Blockly.blocks['text_prompt'] = {
/**
* Block for prompt function (internal message).
* The 'text_prompt_ext' block is preferred as it is more flexible.
Expand Down Expand Up @@ -506,12 +506,12 @@ Blockly.Blocks['text_prompt'] = {
Blockly.Msg['TEXT_PROMPT_TOOLTIP_NUMBER'];
});
},
updateType_: Blockly.Blocks['text_prompt_ext'].updateType_,
mutationToDom: Blockly.Blocks['text_prompt_ext'].mutationToDom,
domToMutation: Blockly.Blocks['text_prompt_ext'].domToMutation
updateType_: Blockly.blocks['text_prompt_ext'].updateType_,
mutationToDom: Blockly.blocks['text_prompt_ext'].mutationToDom,
domToMutation: Blockly.blocks['text_prompt_ext'].domToMutation
};

Blockly.Blocks['text_count'] = {
Blockly.blocks['text_count'] = {
/**
* Block for counting how many times one string appears within another string.
* @this {Blockly.Block}
Expand Down Expand Up @@ -540,7 +540,7 @@ Blockly.Blocks['text_count'] = {
}
};

Blockly.Blocks['text_replace'] = {
Blockly.blocks['text_replace'] = {
/**
* Block for replacing one string with another in the text.
* @this {Blockly.Block}
Expand Down Expand Up @@ -574,7 +574,7 @@ Blockly.Blocks['text_replace'] = {
}
};

Blockly.Blocks['text_reverse'] = {
Blockly.blocks['text_reverse'] = {
/**
* Block for reversing a string.
* @this {Blockly.Block}
Expand Down
Loading

0 comments on commit 8aa44f3

Please sign in to comment.