mirror of
https://github.com/google/blockly.git
synced 2026-01-10 10:27:08 +01:00
refactor: Rename Blockly.Blocks, migrate to named exports (#5515)
* Rename Blockly.Blocks to Blockly.blocks Because it does not export a type as its default export. Part of #5073. * Name default export of Blockly.blocks Blocks. Use named exports in Blockly.blocks by giving the former default export the name Blocks. Part of #5153. * Reexport Blockly.blocks from blockly.js * Document the format of renamings.js better.
This commit is contained in:
committed by
GitHub
parent
f931b2eb36
commit
16b6d4526a
@@ -14,7 +14,6 @@ goog.module('Blockly.Block');
|
||||
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const Abstract = goog.requireType('Blockly.Events.Abstract');
|
||||
const Blocks = goog.require('Blockly.Blocks');
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const Comment = goog.requireType('Blockly.Comment');
|
||||
const Connection = goog.require('Blockly.Connection');
|
||||
@@ -44,6 +43,7 @@ const inputTypes = goog.require('Blockly.inputTypes');
|
||||
const object = goog.require('Blockly.utils.object');
|
||||
const utils = goog.require('Blockly.utils');
|
||||
const {ASTNode} = goog.require('Blockly.ASTNode');
|
||||
const {Blocks} = goog.require('Blockly.blocks');
|
||||
const {ConnectionType} = goog.require('Blockly.ConnectionType');
|
||||
/** @suppress {extraRequire} */
|
||||
goog.require('Blockly.Events.BlockChange');
|
||||
|
||||
@@ -18,7 +18,6 @@ goog.module('Blockly');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
const BlocklyOptions = goog.require('Blockly.BlocklyOptions');
|
||||
const Blocks = goog.require('Blockly.Blocks');
|
||||
const Bubble = goog.require('Blockly.Bubble');
|
||||
const BubbleDragger = goog.require('Blockly.BubbleDragger');
|
||||
const CollapsibleToolboxCategory = goog.require('Blockly.CollapsibleToolboxCategory');
|
||||
@@ -150,12 +149,13 @@ const toolbox = goog.require('Blockly.utils.toolbox');
|
||||
const uiPosition = goog.require('Blockly.uiPosition');
|
||||
const utils = goog.require('Blockly.utils');
|
||||
const zelos = goog.require('Blockly.zelos');
|
||||
const {ASTNode} = goog.require('Blockly.ASTNode');
|
||||
const {BasicCursor} = goog.require('Blockly.BasicCursor');
|
||||
const {Block} = goog.require('Blockly.Block');
|
||||
const {BlockDragger} = goog.require('Blockly.BlockDragger');
|
||||
const {BlockDragSurfaceSvg} = goog.require('Blockly.BlockDragSurfaceSvg');
|
||||
const {BlockSvg} = goog.require('Blockly.BlockSvg');
|
||||
const {ASTNode} = goog.require('Blockly.ASTNode');
|
||||
const {BasicCursor} = goog.require('Blockly.BasicCursor');
|
||||
const {Blocks} = goog.require('Blockly.blocks');
|
||||
const {ConnectionType} = goog.require('Blockly.ConnectionType');
|
||||
const {Cursor} = goog.require('Blockly.Cursor');
|
||||
/** @suppress {extraRequire} */
|
||||
@@ -532,6 +532,7 @@ exports.DELETE_VARIABLE_ID = internalConstants.DELETE_VARIABLE_ID;
|
||||
exports.COLLAPSED_INPUT_NAME = constants.COLLAPSED_INPUT_NAME;
|
||||
exports.COLLAPSED_FIELD_NAME = constants.COLLAPSED_FIELD_NAME;
|
||||
|
||||
// Re-export submodules that no longer declareLegacyNamespace.
|
||||
exports.ASTNode = ASTNode;
|
||||
exports.BasicCursor = BasicCursor;
|
||||
exports.Block = Block;
|
||||
@@ -539,6 +540,7 @@ exports.BlocklyOptions = BlocklyOptions;
|
||||
exports.BlockDragger = BlockDragger;
|
||||
exports.BlockDragSurfaceSvg = BlockDragSurfaceSvg;
|
||||
exports.BlockSvg = BlockSvg;
|
||||
exports.Blocks = Blocks;
|
||||
exports.Bubble = Bubble;
|
||||
exports.BubbleDragger = BubbleDragger;
|
||||
exports.CollapsibleToolboxCategory = CollapsibleToolboxCategory;
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* A mapping of block type names to block prototype objects.
|
||||
* @name Blockly.Blocks
|
||||
*/
|
||||
goog.module('Blockly.Blocks');
|
||||
goog.module.declareLegacyNamespace();
|
||||
goog.module('Blockly.blocks');
|
||||
|
||||
|
||||
/**
|
||||
* A mapping of block type names to block prototype objects.
|
||||
@@ -23,4 +23,4 @@ goog.module.declareLegacyNamespace();
|
||||
*/
|
||||
const Blocks = Object.create(null);
|
||||
|
||||
exports = Blocks;
|
||||
exports.Blocks = Blocks;
|
||||
|
||||
@@ -18,7 +18,6 @@ goog.module('Blockly.Procedures');
|
||||
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const Abstract = goog.requireType('Blockly.Events.Abstract');
|
||||
const Blocks = goog.require('Blockly.Blocks');
|
||||
const Events = goog.require('Blockly.Events');
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const Field = goog.requireType('Blockly.Field');
|
||||
@@ -32,6 +31,7 @@ const Xml = goog.require('Blockly.Xml');
|
||||
const utilsXml = goog.require('Blockly.utils.xml');
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const {Block} = goog.requireType('Blockly.Block');
|
||||
const {Blocks} = goog.require('Blockly.blocks');
|
||||
/** @suppress {extraRequire} */
|
||||
goog.require('Blockly.Events.BlockChange');
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
goog.module('Blockly.Variables');
|
||||
|
||||
const Blocks = goog.require('Blockly.Blocks');
|
||||
const Msg = goog.require('Blockly.Msg');
|
||||
const VariableModel = goog.require('Blockly.VariableModel');
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
@@ -24,6 +23,7 @@ const Workspace = goog.requireType('Blockly.Workspace');
|
||||
const Xml = goog.require('Blockly.Xml');
|
||||
const dialog = goog.require('Blockly.dialog');
|
||||
const utilsXml = goog.require('Blockly.utils.xml');
|
||||
const {Blocks} = goog.require('Blockly.blocks');
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
|
||||
goog.module('Blockly.VariablesDynamic');
|
||||
|
||||
const Blocks = goog.require('Blockly.Blocks');
|
||||
const Msg = goog.require('Blockly.Msg');
|
||||
const VariableModel = goog.require('Blockly.VariableModel');
|
||||
const Variables = goog.require('Blockly.Variables');
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const Workspace = goog.requireType('Blockly.Workspace');
|
||||
const xml = goog.require('Blockly.utils.xml');
|
||||
const {Blocks} = goog.require('Blockly.blocks');
|
||||
|
||||
|
||||
const onCreateVariableButtonClick_String = function(button) {
|
||||
|
||||
Reference in New Issue
Block a user