blockly > blockRendering > ConstantProvider
blockRendering.ConstantProvider class
An object that provides constants for rendering blocks.
Signature:
export declare class ConstantProvider
Constructors
Constructor | Modifiers | Description |
|---|---|---|
Constructs a new instance of the |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
boolean | 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. | ||
number | Vertical padding between consecutive statement inputs. | ||
{ [key: string]: BlockStyle; } | |||
number | |||
number | |||
number | Rounded corner radius. | ||
number | Padding around a block. | ||
string | Cursor colour. | ||
number | Padding around a stack. | ||
number | Stroke of the cursor. | ||
number | Width of the horizontal cursor. | ||
string | The ID of the debug filter, or the empty string if no pattern is set. | ||
string | The ID of the disabled pattern, or the empty string if no pattern is set. | ||
number | |||
number | |||
string | The ID of the emboss filter, or the empty string if no filter is set. | ||
number | |||
number | |||
number | |||
number | |||
number | |||
string | The backing colour of a field's border rect. | ||
number | A field's border rect default height. | ||
number | A field's border rect corner radius. | ||
number | A field's border rect X padding. | ||
number | A field's border rect Y padding. | ||
number | |||
number | |||
number | A colour field's default width. | ||
boolean | Whether or not the colour field should display its colour value on the entire block. | ||
number | |||
boolean | Whether or not a dropdown field's div should be coloured to match the block colours. | ||
boolean | Whether or not a dropdown field should add a border rect when in a shadow block. | ||
string | |||
number | |||
number | A dropdown field's SVG arrow size. | ||
boolean | Whether or not a dropdown field uses a text or SVG arrow. | ||
boolean | |||
number | Text baseline. This constant is dynamically set in | ||
string | Text font family. | ||
number | Point size of text. | ||
string | Text font weight. | ||
number | Height of text. This constant is dynamically set in | ||
boolean | Whether or not to show a box shadow around the widget div. This is only a feature of full block fields. | ||
boolean | Whether text input and colour fields fill up the entire source block. | ||
string | The main colour of insertion markers, in hex. The block is rendered a transparent grey by changing the fill opacity in CSS. | ||
number | The insertion marker opacity. | ||
number | Height of SVG path for jagged teeth at the end of collapsed blocks. | ||
number | Width of SVG path for jagged teeth at the end of collapsed blocks. | ||
number | The size of large padding. | ||
string | Immovable marker colour. | ||
number | The size of medium-large padding. | ||
number | The size of medium padding. | ||
number | |||
number | The minimum width of the block. | ||
number | The size of an empty spacer. | ||
number | The height of the notch used for previous and next connections. | ||
number | Offset from the left side of a block or the inside of a statement input to the left side of the notch. | ||
number | The width of the notch used for previous and next connections. | ||
string | |||
{ [key: string]: number; } | |||
number | The size of small padding. | ||
number | |||
number | Height of the top hat. | ||
number | Width of the top hat. | ||
string | |||
number | |||
number | |||
number | |||
number | The height of the puzzle tab used for input and output connections. | ||
number | The offset from the top of the block at which a puzzle tab is positioned. | ||
number | Vertical overlap of the puzzle tab, used to make it look more like a puzzle piece. | ||
number | The width of the puzzle tab used for input and output connections. | ||
number | |||
number | |||
number | |||
number | Height of the horizontal cursor. |
Methods
Method | Modifiers | Description |
|---|---|---|
| Create a block style object based on the given colour. | |
Create any DOM elements that this renderer needs (filters, patterns, etc). | ||
Dispose of this constants provider. Delete all DOM elements that this provider created. | ||
| Generate a secondary colour from the passed in primary colour. | |
| Generate a tertiary colour from the passed in primary colour. | |
Gets the BlockStyle for the given block style name. | ||
Get or create a block style based on a single colour value. Generate a name for the style based on the colour. | ||
| Get any renderer specific CSS to inject when the renderer is initialized. | |
Initialize shape objects based on the constants set in the constructor. | ||
| Inject renderer specific CSS into the page. | |
| ||
| ||
| ||
| ||
| ||
| ||
| Set constants from a theme's component styles. | |
| Sets dynamic properties that depend on other values or theme properties. | |
| Set constants related to fonts. | |
Refresh constants properties that depend on the theme. | ||
Get an object with connection shape and sizing information based on the type of the connection. | ||
| Get a full block style object based on the input style object. Populate any missing values. |