mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Migrate core/renderers/measurables/inputs.js named requires
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user