Skip to main content

Class: ConstantProvider

Defined in: packages/blockly/core/renderers/zelos/constants.ts:34

An object that provides constants for rendering blocks in Zelos mode.

Extends​

Properties index​

PropertyDescription
NO_PADDINGThe size of an empty spacer.
SMALL_PADDINGThe size of small padding.
MEDIUM_PADDINGThe size of medium padding.
MEDIUM_LARGE_PADDINGThe size of medium-large padding.
LARGE_PADDINGThe size of large padding.
TALL_INPUT_FIELD_OFFSET_Y-
TAB_HEIGHTThe height of the puzzle tab used for input and output connections.
TAB_OFFSET_FROM_TOPThe offset from the top of the block at which a puzzle tab is positioned.
TAB_VERTICAL_OVERLAPVertical overlap of the puzzle tab, used to make it look more like a puzzle piece.
TAB_WIDTHThe width of the puzzle tab used for input and output connections.
NOTCH_WIDTHThe width of the notch used for previous and next connections.
NOTCH_HEIGHTThe height of the notch used for previous and next connections.
MIN_BLOCK_WIDTHThe minimum width of the block.
EMPTY_BLOCK_SPACER_HEIGHT-
DUMMY_INPUT_MIN_HEIGHT-
DUMMY_INPUT_SHADOW_MIN_HEIGHT-
CORNER_RADIUSRounded corner radius.
NOTCH_OFFSET_LEFTOffset from the left side of a block or the inside of a statement input to the left side of the notch.
STATEMENT_INPUT_NOTCH_OFFSET-
STATEMENT_BOTTOM_SPACER-
STATEMENT_INPUT_PADDING_LEFT-
BETWEEN_STATEMENT_PADDING_YVertical padding between consecutive statement inputs.
TOP_ROW_MIN_HEIGHT-
TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT-
BOTTOM_ROW_MIN_HEIGHT-
BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT-
ADD_START_HATSWhether to add a 'hat' on top of all blocks with no previous or output connections. Can be overridden by 'hat' property on Theme.BlockStyle.
SPACER_DEFAULT_HEIGHT-
MIN_BLOCK_HEIGHT-
EMPTY_INLINE_INPUT_PADDING-
EMPTY_INLINE_INPUT_HEIGHT-
EXTERNAL_VALUE_INPUT_PADDING-
EMPTY_STATEMENT_INPUT_HEIGHT-
START_POINT-
FIELD_TEXT_FONTSIZEPoint size of text.
FIELD_TEXT_HEIGHTHeight of text. This constant is dynamically set in setFontConstants_ to be the height of the text based on the font used.
FIELD_TEXT_BASELINEText baseline. This constant is dynamically set in setFontConstants_ to be the baseline of the text based on the font used.
FIELD_BORDER_RECT_RADIUSA field's border rect corner radius.
FIELD_BORDER_RECT_HEIGHTA field's border rect default height.
FIELD_BORDER_RECT_X_PADDINGA field's border rect X padding.
FIELD_BORDER_RECT_Y_PADDINGA field's border rect Y padding.
FIELD_BORDER_RECT_COLOURThe backing colour of a field's border rect.
FIELD_TEXT_BASELINE_CENTER-
FIELD_DROPDOWN_BORDER_RECT_HEIGHT-
FIELD_DROPDOWN_SVG_ARROW_PADDING-
FIELD_DROPDOWN_SVG_ARROW_SIZEA dropdown field's SVG arrow size.
FIELD_DROPDOWN_SVG_ARROW_DATAURI-
FIELD_COLOUR_DEFAULT_WIDTHA colour field's default width.
FIELD_COLOUR_DEFAULT_HEIGHT-
FIELD_CHECKBOX_X_OFFSET-
randomIdentifier-
embossFilterIdThe ID of the emboss filter, or the empty string if no filter is set.
disabledPatternIdThe ID of the disabled pattern, or the empty string if no pattern is set.
debugFilterIdThe ID of the debug filter, or the empty string if no pattern is set.
MARKER_COLOURImmovable marker colour.
CURSOR_WS_WIDTHWidth of the horizontal cursor.
WS_CURSOR_HEIGHTHeight of the horizontal cursor.
CURSOR_STACK_PADDINGPadding around a stack.
CURSOR_BLOCK_PADDINGPadding around a block.
CURSOR_STROKE_WIDTHStroke of the cursor.
INSERTION_MARKER_COLOURThe main colour of insertion markers, in hex. The block is rendered a transparent grey by changing the fill opacity in CSS.
INSERTION_MARKER_OPACITYThe insertion marker opacity.
JAGGED_TEETH-
NOTCH-
START_HAT-
PUZZLE_TAB-
INSIDE_CORNERS-
OUTSIDE_CORNERS-
blockStyles-
GRID_UNIT-
STATEMENT_INPUT_SPACER_MIN_WIDTH-
CURSOR_COLOURCursor colour.
CURSOR_RADIUSRadius of the cursor for input and output connections.
JAGGED_TEETH_HEIGHTHeight of SVG path for jagged teeth at the end of collapsed blocks.
JAGGED_TEETH_WIDTHWidth of SVG path for jagged teeth at the end of collapsed blocks.
START_HAT_HEIGHTHeight of the top hat.
START_HAT_WIDTHWidth of the top hat.
SHAPES-
SHAPE_IN_SHAPE_PADDINGMap of output/input shapes and the amount they should cause a block to be padded. Outer key is the outer shape, inner key is the inner shape. When a block with the outer shape contains an input block with the inner shape on its left or right edge, the block elements are aligned such that the padding specified is reached.
FULL_BLOCK_FIELDSWhether text input and colour fields fill up the entire source block.
FIELD_TEXT_FONTWEIGHTText font weight.
FIELD_TEXT_FONTFAMILYText font family.
FIELD_DROPDOWN_NO_BORDER_RECT_SHADOWWhether or not a dropdown field should add a border rect when in a shadow block.
FIELD_DROPDOWN_COLOURED_DIVWhether or not a dropdown field's div should be coloured to match the block colours.
FIELD_DROPDOWN_SVG_ARROWWhether or not a dropdown field uses a text or SVG arrow.
FIELD_TEXTINPUT_BOX_SHADOWWhether or not to show a box shadow around the widget div. This is only a feature of full block fields.
FIELD_COLOUR_FULL_BLOCKWhether or not the colour field should display its colour value on the entire block.
MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH-
SELECTED_GLOW_COLOURThe selected glow colour.
SELECTED_GLOW_SIZEThe size of the selected glow.
selectedGlowFilterIdThe ID of the selected glow filter, or the empty string if no filter is set.
HEXAGONALThe object containing information about the hexagon used for a boolean reporter block. Null before init is called.
ROUNDEDThe object containing information about the hexagon used for a number or string reporter block. Null before init is called.
SQUAREDThe object containing information about the hexagon used for a rectangular reporter block. Null before init is called.

Methods index​

MethodDescription
setThemeRefresh constants properties that depend on the theme.
setComponentConstants_Set constants from a theme's component styles.
getBlockStyleForColourGet or create a block style based on a single colour value. Generate a name for the style based on the colour.
getBlockStyleGets the BlockStyle for the given block style name.
createBlockStyle_Create a block style object based on the given colour.
validatedBlockStyle_Get a full block style object based on the input style object. Populate any missing values.
makeJaggedTeethReturns an object containing sizing and path information about collapsed block indicators.
makePuzzleTabReturns an object containing sizing and path information about puzzle tabs.
makeOutsideCornersReturns an object containing sizing and path information about outside corners.
injectCSS_Inject renderer specific CSS into the page.
setFontConstants_Set constants related to fonts.
initInitialize shape objects based on the constants set in the constructor.
setDynamicProperties_Sets dynamic properties that depend on other values or theme properties.
disposeDispose of this constants provider. Delete all DOM elements that this provider created.
makeStartHatReturns an object containing sizing and path information about start hats.
makeHexagonalCreate sizing and path information about a hexagonal shape.
makeRoundedCreate sizing and path information about a rounded shape.
makeSquaredCreate sizing and path information about a squared shape.
shapeForGet an object with connection shape and sizing information based on the type of the connection.
makeNotchReturns an object containing sizing and path information about notches.
makeInsideCornersReturns an object containing sizing and path information about inside corners.
generateSecondaryColour_Generate a secondary colour from the passed in primary colour.
generateTertiaryColour_Generate a tertiary colour from the passed in primary colour.
createDomCreate any DOM elements that this renderer needs (filters, patterns, etc).
getCSS_Get any renderer specific CSS to inject when the renderer is initialized.

Constructors​

Constructor​

new ConstantProvider(gridUnit?): ConstantProvider;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:143

Creates a new ConstantProvider.

Parameters​

ParameterTypeDescription
gridUnit?numberIf set, defines the base unit used to calculate other constants.

Returns​

ConstantProvider

Overrides​

ConstantProvider.constructor

Properties​

NO_PADDING​

NO_PADDING: number = 0;

Defined in: packages/blockly/core/renderers/common/constants.ts:126

The size of an empty spacer.

Inherited from​

ConstantProvider.NO_PADDING


SMALL_PADDING​

SMALL_PADDING: number = 3;

Defined in: packages/blockly/core/renderers/common/constants.ts:129

The size of small padding.

Inherited from​

ConstantProvider.SMALL_PADDING


MEDIUM_PADDING​

MEDIUM_PADDING: number = 5;

Defined in: packages/blockly/core/renderers/common/constants.ts:132

The size of medium padding.

Inherited from​

ConstantProvider.MEDIUM_PADDING


MEDIUM_LARGE_PADDING​

MEDIUM_LARGE_PADDING: number = 8;

Defined in: packages/blockly/core/renderers/common/constants.ts:135

The size of medium-large padding.

Inherited from​

ConstantProvider.MEDIUM_LARGE_PADDING


LARGE_PADDING​

LARGE_PADDING: number = 10;

Defined in: packages/blockly/core/renderers/common/constants.ts:138

The size of large padding.

Inherited from​

ConstantProvider.LARGE_PADDING


TALL_INPUT_FIELD_OFFSET_Y​

TALL_INPUT_FIELD_OFFSET_Y: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:139

Inherited from​

ConstantProvider.TALL_INPUT_FIELD_OFFSET_Y


TAB_HEIGHT​

TAB_HEIGHT: number = 15;

Defined in: packages/blockly/core/renderers/common/constants.ts:142

The height of the puzzle tab used for input and output connections.

Inherited from​

ConstantProvider.TAB_HEIGHT


TAB_OFFSET_FROM_TOP​

TAB_OFFSET_FROM_TOP: number = 5;

Defined in: packages/blockly/core/renderers/common/constants.ts:147

The offset from the top of the block at which a puzzle tab is positioned.

Inherited from​

ConstantProvider.TAB_OFFSET_FROM_TOP


TAB_VERTICAL_OVERLAP​

TAB_VERTICAL_OVERLAP: number = 2.5;

Defined in: packages/blockly/core/renderers/common/constants.ts:153

Vertical overlap of the puzzle tab, used to make it look more like a puzzle piece.

Inherited from​

ConstantProvider.TAB_VERTICAL_OVERLAP


TAB_WIDTH​

TAB_WIDTH: number = 8;

Defined in: packages/blockly/core/renderers/common/constants.ts:156

The width of the puzzle tab used for input and output connections.

Inherited from​

ConstantProvider.TAB_WIDTH


NOTCH_WIDTH​

NOTCH_WIDTH: number = 15;

Defined in: packages/blockly/core/renderers/common/constants.ts:159

The width of the notch used for previous and next connections.

Inherited from​

ConstantProvider.NOTCH_WIDTH


NOTCH_HEIGHT​

NOTCH_HEIGHT: number = 4;

Defined in: packages/blockly/core/renderers/common/constants.ts:162

The height of the notch used for previous and next connections.

Inherited from​

ConstantProvider.NOTCH_HEIGHT


MIN_BLOCK_WIDTH​

MIN_BLOCK_WIDTH: number = 12;

Defined in: packages/blockly/core/renderers/common/constants.ts:165

The minimum width of the block.

Inherited from​

ConstantProvider.MIN_BLOCK_WIDTH


EMPTY_BLOCK_SPACER_HEIGHT​

EMPTY_BLOCK_SPACER_HEIGHT: number = 16;

Defined in: packages/blockly/core/renderers/common/constants.ts:166

Inherited from​

ConstantProvider.EMPTY_BLOCK_SPACER_HEIGHT


DUMMY_INPUT_MIN_HEIGHT​

DUMMY_INPUT_MIN_HEIGHT: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:167

Inherited from​

ConstantProvider.DUMMY_INPUT_MIN_HEIGHT


DUMMY_INPUT_SHADOW_MIN_HEIGHT​

DUMMY_INPUT_SHADOW_MIN_HEIGHT: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:168

Inherited from​

ConstantProvider.DUMMY_INPUT_SHADOW_MIN_HEIGHT


CORNER_RADIUS​

CORNER_RADIUS: number = 8;

Defined in: packages/blockly/core/renderers/common/constants.ts:171

Rounded corner radius.

Inherited from​

ConstantProvider.CORNER_RADIUS


NOTCH_OFFSET_LEFT​

NOTCH_OFFSET_LEFT: number = 15;

Defined in: packages/blockly/core/renderers/common/constants.ts:177

Offset from the left side of a block or the inside of a statement input to the left side of the notch.

Inherited from​

ConstantProvider.NOTCH_OFFSET_LEFT


STATEMENT_INPUT_NOTCH_OFFSET​

STATEMENT_INPUT_NOTCH_OFFSET: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:178

Inherited from​

ConstantProvider.STATEMENT_INPUT_NOTCH_OFFSET


STATEMENT_BOTTOM_SPACER​

STATEMENT_BOTTOM_SPACER: number = 0;

Defined in: packages/blockly/core/renderers/common/constants.ts:180

Inherited from​

ConstantProvider.STATEMENT_BOTTOM_SPACER


STATEMENT_INPUT_PADDING_LEFT​

STATEMENT_INPUT_PADDING_LEFT: number = 20;

Defined in: packages/blockly/core/renderers/common/constants.ts:181

Inherited from​

ConstantProvider.STATEMENT_INPUT_PADDING_LEFT


BETWEEN_STATEMENT_PADDING_Y​

BETWEEN_STATEMENT_PADDING_Y: number = 4;

Defined in: packages/blockly/core/renderers/common/constants.ts:184

Vertical padding between consecutive statement inputs.

Inherited from​

ConstantProvider.BETWEEN_STATEMENT_PADDING_Y


TOP_ROW_MIN_HEIGHT​

TOP_ROW_MIN_HEIGHT: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:185

Inherited from​

ConstantProvider.TOP_ROW_MIN_HEIGHT


TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT​

TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:186

Inherited from​

ConstantProvider.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT


BOTTOM_ROW_MIN_HEIGHT​

BOTTOM_ROW_MIN_HEIGHT: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:187

Inherited from​

ConstantProvider.BOTTOM_ROW_MIN_HEIGHT


BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT​

BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:188

Inherited from​

ConstantProvider.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT


ADD_START_HATS​

ADD_START_HATS: boolean = false;

Defined in: packages/blockly/core/renderers/common/constants.ts:194

Whether to add a 'hat' on top of all blocks with no previous or output connections. Can be overridden by 'hat' property on Theme.BlockStyle.

Inherited from​

ConstantProvider.ADD_START_HATS


SPACER_DEFAULT_HEIGHT​

SPACER_DEFAULT_HEIGHT: number = 15;

Defined in: packages/blockly/core/renderers/common/constants.ts:202

Inherited from​

ConstantProvider.SPACER_DEFAULT_HEIGHT


MIN_BLOCK_HEIGHT​

MIN_BLOCK_HEIGHT: number = 24;

Defined in: packages/blockly/core/renderers/common/constants.ts:204

Inherited from​

ConstantProvider.MIN_BLOCK_HEIGHT


EMPTY_INLINE_INPUT_PADDING​

EMPTY_INLINE_INPUT_PADDING: number = 14.5;

Defined in: packages/blockly/core/renderers/common/constants.ts:206

Inherited from​

ConstantProvider.EMPTY_INLINE_INPUT_PADDING


EMPTY_INLINE_INPUT_HEIGHT​

EMPTY_INLINE_INPUT_HEIGHT: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:207

Inherited from​

ConstantProvider.EMPTY_INLINE_INPUT_HEIGHT


EXTERNAL_VALUE_INPUT_PADDING​

EXTERNAL_VALUE_INPUT_PADDING: number = 2;

Defined in: packages/blockly/core/renderers/common/constants.ts:209

Inherited from​

ConstantProvider.EXTERNAL_VALUE_INPUT_PADDING


EMPTY_STATEMENT_INPUT_HEIGHT​

EMPTY_STATEMENT_INPUT_HEIGHT: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:210

Inherited from​

ConstantProvider.EMPTY_STATEMENT_INPUT_HEIGHT


START_POINT​

START_POINT: string;

Defined in: packages/blockly/core/renderers/common/constants.ts:211

Inherited from​

ConstantProvider.START_POINT


FIELD_TEXT_FONTSIZE​

FIELD_TEXT_FONTSIZE: number = 11;

Defined in: packages/blockly/core/renderers/common/constants.ts:220

Point size of text.

Inherited from​

ConstantProvider.FIELD_TEXT_FONTSIZE


FIELD_TEXT_HEIGHT​

FIELD_TEXT_HEIGHT: number = -1;

Defined in: packages/blockly/core/renderers/common/constants.ts:233

Height of text. This constant is dynamically set in setFontConstants_ to be the height of the text based on the font used.

Inherited from​

ConstantProvider.FIELD_TEXT_HEIGHT


FIELD_TEXT_BASELINE​

FIELD_TEXT_BASELINE: number = -1;

Defined in: packages/blockly/core/renderers/common/constants.ts:239

Text baseline. This constant is dynamically set in setFontConstants_ to be the baseline of the text based on the font used.

Inherited from​

ConstantProvider.FIELD_TEXT_BASELINE


FIELD_BORDER_RECT_RADIUS​

FIELD_BORDER_RECT_RADIUS: number = 4;

Defined in: packages/blockly/core/renderers/common/constants.ts:242

A field's border rect corner radius.

Inherited from​

ConstantProvider.FIELD_BORDER_RECT_RADIUS


FIELD_BORDER_RECT_HEIGHT​

FIELD_BORDER_RECT_HEIGHT: number = 16;

Defined in: packages/blockly/core/renderers/common/constants.ts:245

A field's border rect default height.

Inherited from​

ConstantProvider.FIELD_BORDER_RECT_HEIGHT


FIELD_BORDER_RECT_X_PADDING​

FIELD_BORDER_RECT_X_PADDING: number = 5;

Defined in: packages/blockly/core/renderers/common/constants.ts:248

A field's border rect X padding.

Inherited from​

ConstantProvider.FIELD_BORDER_RECT_X_PADDING


FIELD_BORDER_RECT_Y_PADDING​

FIELD_BORDER_RECT_Y_PADDING: number = 3;

Defined in: packages/blockly/core/renderers/common/constants.ts:251

A field's border rect Y padding.

Inherited from​

ConstantProvider.FIELD_BORDER_RECT_Y_PADDING


FIELD_BORDER_RECT_COLOUR​

FIELD_BORDER_RECT_COLOUR: string = '#fff';

Defined in: packages/blockly/core/renderers/common/constants.ts:256

The backing colour of a field's border rect.

Inherited from​

ConstantProvider.FIELD_BORDER_RECT_COLOUR


FIELD_TEXT_BASELINE_CENTER​

FIELD_TEXT_BASELINE_CENTER: boolean;

Defined in: packages/blockly/core/renderers/common/constants.ts:257

Inherited from​

ConstantProvider.FIELD_TEXT_BASELINE_CENTER


FIELD_DROPDOWN_BORDER_RECT_HEIGHT​

FIELD_DROPDOWN_BORDER_RECT_HEIGHT: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:258

Inherited from​

ConstantProvider.FIELD_DROPDOWN_BORDER_RECT_HEIGHT


FIELD_DROPDOWN_SVG_ARROW_PADDING​

FIELD_DROPDOWN_SVG_ARROW_PADDING: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:274

Inherited from​

ConstantProvider.FIELD_DROPDOWN_SVG_ARROW_PADDING


FIELD_DROPDOWN_SVG_ARROW_SIZE​

FIELD_DROPDOWN_SVG_ARROW_SIZE: number = 12;

Defined in: packages/blockly/core/renderers/common/constants.ts:277

A dropdown field's SVG arrow size.

Inherited from​

ConstantProvider.FIELD_DROPDOWN_SVG_ARROW_SIZE


FIELD_DROPDOWN_SVG_ARROW_DATAURI​

FIELD_DROPDOWN_SVG_ARROW_DATAURI: string;

Defined in: packages/blockly/core/renderers/common/constants.ts:278

Inherited from​

ConstantProvider.FIELD_DROPDOWN_SVG_ARROW_DATAURI


FIELD_COLOUR_DEFAULT_WIDTH​

FIELD_COLOUR_DEFAULT_WIDTH: number = 26;

Defined in: packages/blockly/core/renderers/common/constants.ts:293

A colour field's default width.

Inherited from​

ConstantProvider.FIELD_COLOUR_DEFAULT_WIDTH


FIELD_COLOUR_DEFAULT_HEIGHT​

FIELD_COLOUR_DEFAULT_HEIGHT: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:294

Inherited from​

ConstantProvider.FIELD_COLOUR_DEFAULT_HEIGHT


FIELD_CHECKBOX_X_OFFSET​

FIELD_CHECKBOX_X_OFFSET: number;

Defined in: packages/blockly/core/renderers/common/constants.ts:295

Inherited from​

ConstantProvider.FIELD_CHECKBOX_X_OFFSET


randomIdentifier​

randomIdentifier: string;

Defined in: packages/blockly/core/renderers/common/constants.ts:296

Inherited from​

ConstantProvider.randomIdentifier


embossFilterId​

embossFilterId: string = '';

Defined in: packages/blockly/core/renderers/common/constants.ts:307

The ID of the emboss filter, or the empty string if no filter is set.

Inherited from​

ConstantProvider.embossFilterId


disabledPatternId​

disabledPatternId: string = '';

Defined in: packages/blockly/core/renderers/common/constants.ts:315

The ID of the disabled pattern, or the empty string if no pattern is set.

Inherited from​

ConstantProvider.disabledPatternId


debugFilterId​

debugFilterId: string = '';

Defined in: packages/blockly/core/renderers/common/constants.ts:325

The ID of the debug filter, or the empty string if no pattern is set.

Inherited from​

ConstantProvider.debugFilterId


MARKER_COLOUR​

MARKER_COLOUR: string = '#4286f4';

Defined in: packages/blockly/core/renderers/common/constants.ts:340

Immovable marker colour.

Inherited from​

ConstantProvider.MARKER_COLOUR


CURSOR_WS_WIDTH​

CURSOR_WS_WIDTH: number = 100;

Defined in: packages/blockly/core/renderers/common/constants.ts:345

Width of the horizontal cursor.

Inherited from​

ConstantProvider.CURSOR_WS_WIDTH


WS_CURSOR_HEIGHT​

WS_CURSOR_HEIGHT: number = 5;

Defined in: packages/blockly/core/renderers/common/constants.ts:350

Height of the horizontal cursor.

Inherited from​

ConstantProvider.WS_CURSOR_HEIGHT


CURSOR_STACK_PADDING​

CURSOR_STACK_PADDING: number = 10;

Defined in: packages/blockly/core/renderers/common/constants.ts:355

Padding around a stack.

Inherited from​

ConstantProvider.CURSOR_STACK_PADDING


CURSOR_BLOCK_PADDING​

CURSOR_BLOCK_PADDING: number = 2;

Defined in: packages/blockly/core/renderers/common/constants.ts:360

Padding around a block.

Inherited from​

ConstantProvider.CURSOR_BLOCK_PADDING


CURSOR_STROKE_WIDTH​

CURSOR_STROKE_WIDTH: number = 4;

Defined in: packages/blockly/core/renderers/common/constants.ts:365

Stroke of the cursor.

Inherited from​

ConstantProvider.CURSOR_STROKE_WIDTH


INSERTION_MARKER_COLOUR​

INSERTION_MARKER_COLOUR: string = '#000000';

Defined in: packages/blockly/core/renderers/common/constants.ts:376

The main colour of insertion markers, in hex. The block is rendered a transparent grey by changing the fill opacity in CSS.

Inherited from​

ConstantProvider.INSERTION_MARKER_COLOUR


INSERTION_MARKER_OPACITY​

INSERTION_MARKER_OPACITY: number = 0.2;

Defined in: packages/blockly/core/renderers/common/constants.ts:381

The insertion marker opacity.

Inherited from​

ConstantProvider.INSERTION_MARKER_OPACITY


JAGGED_TEETH​

JAGGED_TEETH: JaggedTeeth;

Defined in: packages/blockly/core/renderers/common/constants.ts:385

Inherited from​

ConstantProvider.JAGGED_TEETH


NOTCH​

NOTCH: Notch;

Defined in: packages/blockly/core/renderers/common/constants.ts:387

Inherited from​

ConstantProvider.NOTCH


START_HAT​

START_HAT: StartHat;

Defined in: packages/blockly/core/renderers/common/constants.ts:389

Inherited from​

ConstantProvider.START_HAT


PUZZLE_TAB​

PUZZLE_TAB: PuzzleTab;

Defined in: packages/blockly/core/renderers/common/constants.ts:391

Inherited from​

ConstantProvider.PUZZLE_TAB


INSIDE_CORNERS​

INSIDE_CORNERS: InsideCorners;

Defined in: packages/blockly/core/renderers/common/constants.ts:393

Inherited from​

ConstantProvider.INSIDE_CORNERS


OUTSIDE_CORNERS​

OUTSIDE_CORNERS: OutsideCorners;

Defined in: packages/blockly/core/renderers/common/constants.ts:395

Inherited from​

ConstantProvider.OUTSIDE_CORNERS


blockStyles​

blockStyles: object;

Defined in: packages/blockly/core/renderers/common/constants.ts:398

Index Signature​

[key: string]: BlockStyle

Inherited from​

ConstantProvider.blockStyles


GRID_UNIT​

GRID_UNIT: number = 4;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:35


STATEMENT_INPUT_SPACER_MIN_WIDTH​

STATEMENT_INPUT_SPACER_MIN_WIDTH: number;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:36


CURSOR_COLOUR​

CURSOR_COLOUR: string = '#ffa200';

Defined in: packages/blockly/core/renderers/zelos/constants.ts:38

Cursor colour.

Overrides​

ConstantProvider.CURSOR_COLOUR


CURSOR_RADIUS​

CURSOR_RADIUS: number = 5;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:43

Radius of the cursor for input and output connections.


JAGGED_TEETH_HEIGHT​

JAGGED_TEETH_HEIGHT: number = 0;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:45

Height of SVG path for jagged teeth at the end of collapsed blocks.

Overrides​

ConstantProvider.JAGGED_TEETH_HEIGHT


JAGGED_TEETH_WIDTH​

JAGGED_TEETH_WIDTH: number = 0;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:47

Width of SVG path for jagged teeth at the end of collapsed blocks.

Overrides​

ConstantProvider.JAGGED_TEETH_WIDTH


START_HAT_HEIGHT​

START_HAT_HEIGHT: number = 22;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:48

Height of the top hat.

Overrides​

ConstantProvider.START_HAT_HEIGHT


START_HAT_WIDTH​

START_HAT_WIDTH: number = 96;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:50

Width of the top hat.

Overrides​

ConstantProvider.START_HAT_WIDTH


SHAPES​

SHAPES: object;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:52

HEXAGONAL​

HEXAGONAL: number = 1;

ROUND​

ROUND: number = 2;

SQUARE​

SQUARE: number = 3;

PUZZLE​

PUZZLE: number = 4;

NOTCH​

NOTCH: number = 5;

Overrides​

ConstantProvider.SHAPES


SHAPE_IN_SHAPE_PADDING​

SHAPE_IN_SHAPE_PADDING: object;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:61

Map of output/input shapes and the amount they should cause a block to be padded. Outer key is the outer shape, inner key is the inner shape. When a block with the outer shape contains an input block with the inner shape on its left or right edge, the block elements are aligned such that the padding specified is reached.

Index Signature​

[key: number]: object

FULL_BLOCK_FIELDS​

FULL_BLOCK_FIELDS: boolean = true;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:85

Whether text input and colour fields fill up the entire source block.

Overrides​

ConstantProvider.FULL_BLOCK_FIELDS


FIELD_TEXT_FONTWEIGHT​

FIELD_TEXT_FONTWEIGHT: string = 'bold';

Defined in: packages/blockly/core/renderers/zelos/constants.ts:87

Text font weight.

Overrides​

ConstantProvider.FIELD_TEXT_FONTWEIGHT


FIELD_TEXT_FONTFAMILY​

FIELD_TEXT_FONTFAMILY: string = '"Helvetica Neue", "Segoe UI", Helvetica, sans-serif';

Defined in: packages/blockly/core/renderers/zelos/constants.ts:89

Text font family.

Overrides​

ConstantProvider.FIELD_TEXT_FONTFAMILY


FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW​

FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW: boolean = true;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:92

Whether or not a dropdown field should add a border rect when in a shadow block.

Overrides​

ConstantProvider.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW


FIELD_DROPDOWN_COLOURED_DIV​

FIELD_DROPDOWN_COLOURED_DIV: boolean = true;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:94

Whether or not a dropdown field's div should be coloured to match the block colours.

Overrides​

ConstantProvider.FIELD_DROPDOWN_COLOURED_DIV


FIELD_DROPDOWN_SVG_ARROW​

FIELD_DROPDOWN_SVG_ARROW: boolean = true;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:96

Whether or not a dropdown field uses a text or SVG arrow.

Overrides​

ConstantProvider.FIELD_DROPDOWN_SVG_ARROW


FIELD_TEXTINPUT_BOX_SHADOW​

FIELD_TEXTINPUT_BOX_SHADOW: boolean = true;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:97

Whether or not to show a box shadow around the widget div. This is only a feature of full block fields.

Overrides​

ConstantProvider.FIELD_TEXTINPUT_BOX_SHADOW


FIELD_COLOUR_FULL_BLOCK​

FIELD_COLOUR_FULL_BLOCK: boolean = true;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:99

Whether or not the colour field should display its colour value on the entire block.

Overrides​

ConstantProvider.FIELD_COLOUR_FULL_BLOCK


MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH​

MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH: number;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:100


SELECTED_GLOW_COLOUR​

SELECTED_GLOW_COLOUR: string = '#fff200';

Defined in: packages/blockly/core/renderers/zelos/constants.ts:103

The selected glow colour.


SELECTED_GLOW_SIZE​

SELECTED_GLOW_SIZE: number = 0.5;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:106

The size of the selected glow.


selectedGlowFilterId​

selectedGlowFilterId: string = '';

Defined in: packages/blockly/core/renderers/zelos/constants.ts:112

The ID of the selected glow filter, or the empty string if no filter is set.


HEXAGONAL​

HEXAGONAL: Shape | null = null;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:123

The object containing information about the hexagon used for a boolean reporter block. Null before init is called.


ROUNDED​

ROUNDED: Shape | null = null;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:129

The object containing information about the hexagon used for a number or string reporter block. Null before init is called.


SQUARED​

SQUARED: Shape | null = null;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:135

The object containing information about the hexagon used for a rectangular reporter block. Null before init is called.

Methods​

setTheme()​

setTheme(theme): void;

Defined in: packages/blockly/core/renderers/common/constants.ts:521

Refresh constants properties that depend on the theme.

Parameters​

ParameterTypeDescription
themeThemeThe current workspace theme.

Returns​

void

Inherited from​

ConstantProvider.setTheme


setComponentConstants_()​

protected setComponentConstants_(theme): void;

Defined in: packages/blockly/core/renderers/common/constants.ts:580

Set constants from a theme's component styles.

Parameters​

ParameterTypeDescription
themeThemeThe current workspace theme.

Returns​

void

Inherited from​

ConstantProvider.setComponentConstants_


getBlockStyleForColour()​

getBlockStyleForColour(colour): object;

Defined in: packages/blockly/core/renderers/common/constants.ts:601

Get or create a block style based on a single colour value. Generate a name for the style based on the colour.

Parameters​

ParameterTypeDescription
colourstring#RRGGBB colour string.

Returns​

object

An object containing the style and an autogenerated name for that style.

style​
style: BlockStyle;
name​
name: string;

Inherited from​

ConstantProvider.getBlockStyleForColour


getBlockStyle()​

getBlockStyle(blockStyleName): BlockStyle;

Defined in: packages/blockly/core/renderers/common/constants.ts:616

Gets the BlockStyle for the given block style name.

Parameters​

ParameterTypeDescription
blockStyleNamestring | nullThe name of the block style.

Returns​

BlockStyle

The named block style, or a default style if no style with the given name was found.

Inherited from​

ConstantProvider.getBlockStyle


createBlockStyle_()​

protected createBlockStyle_(colour): BlockStyle;

Defined in: packages/blockly/core/renderers/common/constants.ts:631

Create a block style object based on the given colour.

Parameters​

ParameterTypeDescription
colourstring#RRGGBB colour string.

Returns​

BlockStyle

A populated block style based on the given colour.

Inherited from​

ConstantProvider.createBlockStyle_


validatedBlockStyle_()​

protected validatedBlockStyle_(blockStyle): BlockStyle;

Defined in: packages/blockly/core/renderers/common/constants.ts:642

Get a full block style object based on the input style object. Populate any missing values.

Parameters​

ParameterTypeDescription
blockStylePartial<BlockStyle>A full or partial block style object.

Returns​

BlockStyle

A full block style object, with all required properties populated.

Inherited from​

ConstantProvider.validatedBlockStyle_


makeJaggedTeeth()​

protected makeJaggedTeeth(): JaggedTeeth;

Defined in: packages/blockly/core/renderers/common/constants.ts:704

Returns​

JaggedTeeth

An object containing sizing and path information about collapsed block indicators.

Inherited from​

ConstantProvider.makeJaggedTeeth


makePuzzleTab()​

protected makePuzzleTab(): PuzzleTab;

Defined in: packages/blockly/core/renderers/common/constants.ts:738

Returns​

PuzzleTab

An object containing sizing and path information about puzzle tabs.

Inherited from​

ConstantProvider.makePuzzleTab


makeOutsideCorners()​

protected makeOutsideCorners(): OutsideCorners;

Defined in: packages/blockly/core/renderers/common/constants.ts:861

Returns​

OutsideCorners

An object containing sizing and path information about outside corners.

Inherited from​

ConstantProvider.makeOutsideCorners


injectCSS_()​

protected injectCSS_(root, selector): void;

Defined in: packages/blockly/core/renderers/common/constants.ts:1127

Inject renderer specific CSS into the page.

Parameters​

ParameterTypeDescription
rootDocument | ShadowRootThe document root to inject the CSS into.
selectorstringThe CSS selector to interpolate into the stylesheet.

Returns​

void

Inherited from​

ConstantProvider.injectCSS_


setFontConstants_()​

setFontConstants_(theme): void;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:223

Set constants related to fonts.

Parameters​

ParameterTypeDescription
themeThemeThe current workspace theme.

Returns​

void

Overrides​

ConstantProvider.setFontConstants_


init()​

init(): void;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:231

Initialize shape objects based on the constants set in the constructor.

Returns​

void

Overrides​

ConstantProvider.init


setDynamicProperties_()​

setDynamicProperties_(theme): void;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:242

Sets dynamic properties that depend on other values or theme properties.

Parameters​

ParameterTypeDescription
themeThemeThe current workspace theme.

Returns​

void

Overrides​

ConstantProvider.setDynamicProperties_


dispose()​

dispose(): void;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:257

Dispose of this constants provider. Delete all DOM elements that this provider created.

Returns​

void

Overrides​

ConstantProvider.dispose


makeStartHat()​

makeStartHat(): object;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:264

Returns​

object

An object containing sizing and path information about start hats.

height​
height: number;
width​
width: number;
path​
path: string = mainPath;

Overrides​

ConstantProvider.makeStartHat


makeHexagonal()​

protected makeHexagonal(): Shape;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:285

Create sizing and path information about a hexagonal shape.

Returns​

Shape

An object containing sizing and path information about a hexagonal shape for connections.


makeRounded()​

protected makeRounded(): Shape;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:350

Create sizing and path information about a rounded shape.

Returns​

Shape

An object containing sizing and path information about a rounded shape for connections.


makeSquared()​

protected makeSquared(): Shape;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:433

Create sizing and path information about a squared shape.

Returns​

Shape

An object containing sizing and path information about a squared shape for connections.


shapeFor()​

shapeFor(connection): Shape;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:500

Get an object with connection shape and sizing information based on the type of the connection.

Parameters​

ParameterTypeDescription
connectionRenderedConnectionThe connection to find a shape object for

Returns​

Shape

The shape object for the connection.

Overrides​

ConstantProvider.shapeFor


makeNotch()​

makeNotch(): object;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:540

Returns​

object

An object containing sizing and path information about notches.

type​
type: number;
width​
width: number;
height​
height: number;
pathLeft​
pathLeft: string;
pathRight​
pathRight: string;

Overrides​

ConstantProvider.makeNotch


makeInsideCorners()​

makeInsideCorners(): object;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:597

Returns​

object

An object containing sizing and path information about inside corners.

width​
width: number = radius;
height​
height: number = radius;
pathTop​
pathTop: string = innerTopLeftCorner;
pathBottom​
pathBottom: string = innerBottomLeftCorner;
rightWidth​
rightWidth: number = radius;
rightHeight​
rightHeight: number = radius;
pathTopRight​
pathTopRight: string = innerTopRightCorner;
pathBottomRight​
pathBottomRight: string = innerBottomRightCorner;

Overrides​

ConstantProvider.makeInsideCorners


generateSecondaryColour_()​

generateSecondaryColour_(colour): string;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:640

Generate a secondary colour from the passed in primary colour.

Parameters​

ParameterTypeDescription
colourstringPrimary colour.

Returns​

string

The generated secondary colour.

Overrides​

ConstantProvider.generateSecondaryColour_


generateTertiaryColour_()​

generateTertiaryColour_(colour): string;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:644

Generate a tertiary colour from the passed in primary colour.

Parameters​

ParameterTypeDescription
colourstringPrimary colour.

Returns​

string

The generated tertiary colour.

Overrides​

ConstantProvider.generateTertiaryColour_


createDom()​

createDom(
svg,
selector,
injectionDivIfIsParent?
): void;

Defined in: packages/blockly/core/renderers/zelos/constants.ts:648

Create any DOM elements that this renderer needs (filters, patterns, etc).

Parameters​

ParameterTypeDescription
svgSVGElementThe root of the workspace's SVG.
selectorstringThe CSS selector to use.
injectionDivIfIsParent?HTMLElementThe div containing the parent workspace and all related workspaces and block containers, if this renderer is for the parent workspace. CSS variables representing SVG patterns will be scoped to this container. Child workspaces should not override the CSS variables created by the parent and thus do not need access to the injection div.

Returns​

void

Overrides​

ConstantProvider.createDom


getCSS_()​

getCSS_(selector): string[];

Defined in: packages/blockly/core/renderers/zelos/constants.ts:723

Get any renderer specific CSS to inject when the renderer is initialized.

Parameters​

ParameterTypeDescription
selectorstringCSS selector to use.

Returns​

string[]

Array of CSS strings.

Overrides​

ConstantProvider.getCSS_