Split classes from core/renderers/geras/measurables/input.js into multiple files

This commit is contained in:
kozbial
2021-08-10 14:44:42 -07:00
committed by Monica Kozbial
parent 88a7779cb2
commit 87568c5869
3 changed files with 49 additions and 29 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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'});