mirror of
https://github.com/google/blockly.git
synced 2026-02-01 21:20:08 +01:00
* chore(deps): Add pretter-plugin-organize-imports * chore: Remove insignificant blank lines in import sections Since prettier-plugin-organize-imports sorts imports within sections separated by blank lines, but preserves the section divisions, remove any blank lines that are not dividing imports into meaningful sections. Do not remove blank lines separating side-effect-only imports from main imports. * chore: Remove unneded eslint-disable directives * chore: Organise imports
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2020 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
// Former goog.module ID: Blockly.zelos.StatementInput
|
|
|
|
import type {Input} from '../../../inputs/input.js';
|
|
import type {ConstantProvider} from '../../../renderers/common/constants.js';
|
|
import {StatementInput as BaseStatementInput} from '../../../renderers/measurables/statement_input.js';
|
|
|
|
/**
|
|
* An object containing information about the space a statement input takes up
|
|
* during rendering.
|
|
*/
|
|
export class StatementInput extends BaseStatementInput {
|
|
connectedBottomNextConnection = false;
|
|
|
|
/**
|
|
* @param constants The rendering constants provider.
|
|
* @param input The statement input to measure and store information for.
|
|
*/
|
|
constructor(constants: ConstantProvider, input: Input) {
|
|
super(constants, input);
|
|
|
|
if (this.connectedBlock) {
|
|
// Find the bottom-most connected block in the stack.
|
|
let block = this.connectedBlock;
|
|
let nextBlock;
|
|
while ((nextBlock = block.getNextBlock())) {
|
|
block = nextBlock;
|
|
}
|
|
if (!block.nextConnection) {
|
|
this.height = this.connectedBlockHeight;
|
|
this.connectedBottomNextConnection = true;
|
|
}
|
|
}
|
|
}
|
|
}
|