From 35cf6482e3799e86c822645fe8191c0d32e55e51 Mon Sep 17 00:00:00 2001 From: kozbial Date: Tue, 10 Aug 2021 15:50:15 -0700 Subject: [PATCH] Migrate core/renderers/measurables/inputs.js named requires --- .../measurables/external_value_input.js | 25 ++++++++++--------- core/renderers/measurables/inline_input.js | 25 ++++++++++--------- .../renderers/measurables/input_connection.js | 25 ++++++++++--------- core/renderers/measurables/statement_input.js | 25 ++++++++++--------- 4 files changed, 52 insertions(+), 48 deletions(-) diff --git a/core/renderers/measurables/external_value_input.js b/core/renderers/measurables/external_value_input.js index 9832d0659..b0f7c9841 100644 --- a/core/renderers/measurables/external_value_input.js +++ b/core/renderers/measurables/external_value_input.js @@ -13,29 +13,30 @@ goog.module('Blockly.blockRendering.ExternalValueInput'); goog.module.declareLegacyNamespace(); -goog.require('Blockly.blockRendering.InputConnection'); -goog.require('Blockly.blockRendering.Types'); -goog.require('Blockly.utils.object'); - -goog.requireType('Blockly.blockRendering.ConstantProvider'); -goog.requireType('Blockly.Input'); +/* eslint-disable-next-line no-unused-vars */ +const ConstantProvider = goog.requireType('Blockly.blockRendering.ConstantProvider'); +/* eslint-disable-next-line no-unused-vars */ +const Input = goog.requireType('Blockly.Input'); +const InputConnection = goog.require('Blockly.blockRendering.InputConnection'); +const Types = goog.require('Blockly.blockRendering.Types'); +const object = goog.require('Blockly.utils.object'); /** * An object containing information about the space an external value input * takes up during rendering - * @param {!Blockly.blockRendering.ConstantProvider} constants The rendering + * @param {!ConstantProvider} constants The rendering * constants provider. - * @param {!Blockly.Input} input The external value input to measure and store + * @param {!Input} input The external value input to measure and store * information for. * @package * @constructor - * @extends {Blockly.blockRendering.InputConnection} + * @extends {InputConnection} */ const ExternalValueInput = function(constants, input) { ExternalValueInput.superClass_.constructor.call(this, constants, input); - this.type |= Blockly.blockRendering.Types.EXTERNAL_VALUE_INPUT; + this.type |= Types.EXTERNAL_VALUE_INPUT; if (!this.connectedBlock) { this.height = this.shape.height; } else { @@ -50,7 +51,7 @@ const ExternalValueInput = function(constants, input) { this.connectionHeight = this.shape.height; this.connectionWidth = this.shape.width; }; -Blockly.utils.object.inherits(ExternalValueInput, - Blockly.blockRendering.InputConnection); +object.inherits(ExternalValueInput, + InputConnection); exports = ExternalValueInput; diff --git a/core/renderers/measurables/inline_input.js b/core/renderers/measurables/inline_input.js index 3b3974d79..7b623e701 100644 --- a/core/renderers/measurables/inline_input.js +++ b/core/renderers/measurables/inline_input.js @@ -13,29 +13,30 @@ goog.module('Blockly.blockRendering.InlineInput'); goog.module.declareLegacyNamespace(); -goog.require('Blockly.blockRendering.InputConnection'); -goog.require('Blockly.blockRendering.Types'); -goog.require('Blockly.utils.object'); - -goog.requireType('Blockly.blockRendering.ConstantProvider'); -goog.requireType('Blockly.Input'); +/* eslint-disable-next-line no-unused-vars */ +const ConstantProvider = goog.requireType('Blockly.blockRendering.ConstantProvider'); +/* eslint-disable-next-line no-unused-vars */ +const Input = goog.requireType('Blockly.Input'); +const InputConnection = goog.require('Blockly.blockRendering.InputConnection'); +const Types = goog.require('Blockly.blockRendering.Types'); +const object = goog.require('Blockly.utils.object'); /** * An object containing information about the space an inline input takes up * during rendering - * @param {!Blockly.blockRendering.ConstantProvider} constants The rendering + * @param {!ConstantProvider} constants The rendering * constants provider. - * @param {!Blockly.Input} input The inline input to measure and store + * @param {!Input} input The inline input to measure and store * information for. * @package * @constructor - * @extends {Blockly.blockRendering.InputConnection} + * @extends {InputConnection} */ const InlineInput = function(constants, input) { InlineInput.superClass_.constructor.call(this, constants, input); - this.type |= Blockly.blockRendering.Types.INLINE_INPUT; + this.type |= Types.INLINE_INPUT; if (!this.connectedBlock) { this.height = this.constants_.EMPTY_INLINE_INPUT_HEIGHT; @@ -60,7 +61,7 @@ const InlineInput = function(constants, input) { this.connectionOffsetX = this.isDynamicShape ? this.shape.connectionOffsetX(this.connectionWidth) : 0; }; -Blockly.utils.object.inherits(InlineInput, - Blockly.blockRendering.InputConnection); +object.inherits(InlineInput, + InputConnection); exports = InlineInput; diff --git a/core/renderers/measurables/input_connection.js b/core/renderers/measurables/input_connection.js index 67ed3c361..80efc5d15 100644 --- a/core/renderers/measurables/input_connection.js +++ b/core/renderers/measurables/input_connection.js @@ -12,29 +12,30 @@ goog.module('Blockly.blockRendering.InputConnection'); goog.module.declareLegacyNamespace(); -goog.require('Blockly.blockRendering.Connection'); -goog.require('Blockly.blockRendering.Types'); -goog.require('Blockly.utils.object'); - -goog.requireType('Blockly.blockRendering.ConstantProvider'); -goog.requireType('Blockly.Input'); +const Connection = goog.require('Blockly.blockRendering.Connection'); +/* eslint-disable-next-line no-unused-vars */ +const ConstantProvider = goog.requireType('Blockly.blockRendering.ConstantProvider'); +/* eslint-disable-next-line no-unused-vars */ +const Input = goog.requireType('Blockly.Input'); +const Types = goog.require('Blockly.blockRendering.Types'); +const object = goog.require('Blockly.utils.object'); /** * The base class to represent an input that takes up space on a block * during rendering - * @param {!Blockly.blockRendering.ConstantProvider} constants The rendering + * @param {!ConstantProvider} constants The rendering * constants provider. - * @param {!Blockly.Input} input The input to measure and store information for. + * @param {!Input} input The input to measure and store information for. * @package * @constructor - * @extends {Blockly.blockRendering.Connection} + * @extends {Connection} */ const InputConnection = function(constants, input) { InputConnection.superClass_.constructor.call(this, constants, input.connection); - this.type |= Blockly.blockRendering.Types.INPUT; + this.type |= Types.INPUT; this.input = input; this.align = input.align; this.connectedBlock = input.connection && input.connection.targetBlock() ? @@ -52,7 +53,7 @@ const InputConnection = function(constants, input) { this.connectionOffsetX = 0; this.connectionOffsetY = 0; }; -Blockly.utils.object.inherits(InputConnection, - Blockly.blockRendering.Connection); +object.inherits(InputConnection, + Connection); exports = InputConnection; diff --git a/core/renderers/measurables/statement_input.js b/core/renderers/measurables/statement_input.js index 9c3252216..d094bc342 100644 --- a/core/renderers/measurables/statement_input.js +++ b/core/renderers/measurables/statement_input.js @@ -13,29 +13,30 @@ goog.module('Blockly.blockRendering.StatementInput'); goog.module.declareLegacyNamespace(); -goog.require('Blockly.blockRendering.InputConnection'); -goog.require('Blockly.blockRendering.Types'); -goog.require('Blockly.utils.object'); - -goog.requireType('Blockly.blockRendering.ConstantProvider'); -goog.requireType('Blockly.Input'); +/* eslint-disable-next-line no-unused-vars */ +const ConstantProvider = goog.requireType('Blockly.blockRendering.ConstantProvider'); +/* eslint-disable-next-line no-unused-vars */ +const Input = goog.requireType('Blockly.Input'); +const InputConnection = goog.require('Blockly.blockRendering.InputConnection'); +const Types = goog.require('Blockly.blockRendering.Types'); +const object = goog.require('Blockly.utils.object'); /** * An object containing information about the space a statement input takes up * during rendering - * @param {!Blockly.blockRendering.ConstantProvider} constants The rendering + * @param {!ConstantProvider} constants The rendering * constants provider. - * @param {!Blockly.Input} input The statement input to measure and store + * @param {!Input} input The statement input to measure and store * information for. * @package * @constructor - * @extends {Blockly.blockRendering.InputConnection} + * @extends {InputConnection} */ const StatementInput = function(constants, input) { StatementInput.superClass_.constructor.call(this, constants, input); - this.type |= Blockly.blockRendering.Types.STATEMENT_INPUT; + this.type |= Types.STATEMENT_INPUT; if (!this.connectedBlock) { this.height = this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT; @@ -47,7 +48,7 @@ const StatementInput = function(constants, input) { } this.width = this.constants_.STATEMENT_INPUT_NOTCH_OFFSET + this.shape.width; }; -Blockly.utils.object.inherits(StatementInput, - Blockly.blockRendering.InputConnection); +object.inherits(StatementInput, + InputConnection); exports = StatementInput;