diff --git a/core/renderers/geras/measurables/inputs.js b/core/renderers/geras/measurables/inline_input.js similarity index 54% rename from core/renderers/geras/measurables/inputs.js rename to core/renderers/geras/measurables/inline_input.js index 6aca47b77..3a3cd861c 100644 --- a/core/renderers/geras/measurables/inputs.js +++ b/core/renderers/geras/measurables/inline_input.js @@ -5,17 +5,15 @@ */ /** - * @fileoverview Objects representing inputs with connections on a rendered - * block. + * @fileoverview Objects representing inline inputs with connections on a + * rendered block. * @author kozbial@google.com (Monica Kozbial) */ 'use strict'; goog.provide('Blockly.geras.InlineInput'); -goog.provide('Blockly.geras.StatementInput'); goog.require('Blockly.blockRendering.InlineInput'); -goog.require('Blockly.blockRendering.StatementInput'); goog.require('Blockly.utils.object'); goog.requireType('Blockly.blockRendering.ConstantProvider'); @@ -46,27 +44,3 @@ Blockly.geras.InlineInput = function(constants, input) { }; Blockly.utils.object.inherits(Blockly.geras.InlineInput, Blockly.blockRendering.InlineInput); - -/** - * An object containing information about the space a statement input takes up - * during rendering - * @param {!Blockly.blockRendering.ConstantProvider} constants The rendering - * constants provider. - * @param {!Blockly.Input} input The statement input to measure and store - * information for. - * @package - * @constructor - * @extends {Blockly.blockRendering.StatementInput} - */ -Blockly.geras.StatementInput = function(constants, input) { - Blockly.geras.StatementInput.superClass_.constructor.call( - this, constants, input); - - if (this.connectedBlock) { - // We allow the dark path to show on the parent block so that the child - // block looks embossed. This takes up an extra pixel in both x and y. - this.height += this.constants_.DARK_PATH_OFFSET; - } -}; -Blockly.utils.object.inherits(Blockly.geras.StatementInput, - Blockly.blockRendering.StatementInput); diff --git a/core/renderers/geras/measurables/statement_input.js b/core/renderers/geras/measurables/statement_input.js new file mode 100644 index 000000000..e309b3207 --- /dev/null +++ b/core/renderers/geras/measurables/statement_input.js @@ -0,0 +1,45 @@ +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @fileoverview Objects representing statement inputs with connections on a + * rendered block. + * @author kozbial@google.com (Monica Kozbial) + */ +'use strict'; + +goog.provide('Blockly.geras.StatementInput'); + +goog.require('Blockly.blockRendering.StatementInput'); +goog.require('Blockly.utils.object'); + +goog.requireType('Blockly.blockRendering.ConstantProvider'); +goog.requireType('Blockly.Input'); + + +/** + * An object containing information about the space a statement input takes up + * during rendering + * @param {!Blockly.blockRendering.ConstantProvider} constants The rendering + * constants provider. + * @param {!Blockly.Input} input The statement input to measure and store + * information for. + * @package + * @constructor + * @extends {Blockly.blockRendering.StatementInput} + */ +Blockly.geras.StatementInput = function(constants, input) { + Blockly.geras.StatementInput.superClass_.constructor.call( + this, constants, input); + + if (this.connectedBlock) { + // We allow the dark path to show on the parent block so that the child + // block looks embossed. This takes up an extra pixel in both x and y. + this.height += this.constants_.DARK_PATH_OFFSET; + } +}; +Blockly.utils.object.inherits(Blockly.geras.StatementInput, + Blockly.blockRendering.StatementInput); diff --git a/tests/deps.js b/tests/deps.js index f5ad9dd09..7d7c19c1d 100644 --- a/tests/deps.js +++ b/tests/deps.js @@ -143,7 +143,8 @@ goog.addDependency('../../core/renderers/geras/drawer.js', ['Blockly.geras.Drawe goog.addDependency('../../core/renderers/geras/highlight_constants.js', ['Blockly.geras.HighlightConstantProvider'], ['Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/geras/highlighter.js', ['Blockly.geras.Highlighter'], ['Blockly.blockRendering.Types', 'Blockly.utils.svgPaths'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/geras/info.js', ['Blockly.geras.RenderInfo'], ['Blockly.blockRendering.ExternalValueInput', 'Blockly.blockRendering.InRowSpacer', 'Blockly.blockRendering.RenderInfo', 'Blockly.blockRendering.Types', 'Blockly.geras.InlineInput', 'Blockly.geras.StatementInput', 'Blockly.inputTypes', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); -goog.addDependency('../../core/renderers/geras/measurables/inputs.js', ['Blockly.geras.InlineInput', 'Blockly.geras.StatementInput'], ['Blockly.blockRendering.InlineInput', 'Blockly.blockRendering.StatementInput', 'Blockly.utils.object']); +goog.addDependency('../../core/renderers/geras/measurables/inline_input.js', ['Blockly.geras.InlineInput'], ['Blockly.blockRendering.InlineInput', 'Blockly.utils.object']); +goog.addDependency('../../core/renderers/geras/measurables/statement_input.js', ['Blockly.geras.StatementInput'], ['Blockly.blockRendering.StatementInput', 'Blockly.utils.object']); goog.addDependency('../../core/renderers/geras/path_object.js', ['Blockly.geras.PathObject'], ['Blockly.blockRendering.PathObject', 'Blockly.utils.Svg', 'Blockly.utils.colour', 'Blockly.utils.dom', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/geras/renderer.js', ['Blockly.geras.Renderer'], ['Blockly.blockRendering', 'Blockly.blockRendering.Renderer', 'Blockly.geras.ConstantProvider', 'Blockly.geras.Drawer', 'Blockly.geras.HighlightConstantProvider', 'Blockly.geras.PathObject', 'Blockly.geras.RenderInfo', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'}); goog.addDependency('../../core/renderers/measurables/base.js', ['Blockly.blockRendering.Measurable'], ['Blockly.blockRendering.Types'], {'lang': 'es6', 'module': 'goog'});