Files
Beka Westberg 362ec011ce fix: re-add @package annotations as @internal annotations (#6232)
* fix: add ~70% of internal attributes

* fix: work on manually adding more @internal annotations

* fix: add more manual internal annotations

* fix: rename package typos to internal

* fix: final manual fixes for internal annotations

* chore: format

* chore: make unnecessary multiline jsdoc a single line

* fix: fix internal tags in serialization exceptions
2022-06-27 08:00:44 -07:00

62 lines
1.7 KiB
TypeScript

/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview An object that provides constants for rendering blocks in Geras
* mode.
*/
/**
* An object that provides constants for rendering blocks in Geras
* mode.
* @class
*/
import * as goog from '../../../closure/goog/goog.js';
goog.declareModuleId('Blockly.geras.ConstantProvider');
import {ConstantProvider as BaseConstantProvider} from '../common/constants.js';
/**
* An object that provides constants for rendering blocks in Geras mode.
* @alias Blockly.geras.ConstantProvider
*/
export class ConstantProvider extends BaseConstantProvider {
override FIELD_TEXT_BASELINE_CENTER = false;
// The dark/shadow path in classic rendering is the same as the normal block
// path, but translated down one and right one.
DARK_PATH_OFFSET = 1;
/**
* The maximum width of a bottom row that follows a statement input and has
* inputs inline.
*/
MAX_BOTTOM_WIDTH = 30;
override STATEMENT_BOTTOM_SPACER: AnyDuringMigration;
/** @internal */
constructor() {
super();
this.STATEMENT_BOTTOM_SPACER = -this.NOTCH_HEIGHT / 2;
}
override getCSS_(selector: string) {
return super.getCSS_(selector)
.concat(/* eslint-enable indent */
[
/* eslint-disable indent */
// Insertion marker.
selector + ' .blocklyInsertionMarker>.blocklyPathLight,',
selector + ' .blocklyInsertionMarker>.blocklyPathDark {',
'fill-opacity: ' + this.INSERTION_MARKER_OPACITY + ';',
'stroke: none;',
'}',
]);
}
}