Files
blockly/core/renderers/zelos/measurables/inputs.ts
Christopher Allen ce22f42868 chore: Organise imports (#8527)
* 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
2024-08-15 03:16:14 +01:00

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;
}
}
}
}