blockly v13.5.0
Classes
| Class | Description |
|---|---|
| Block | Class for one block. Not normally called directly, workspace.newBlock() is preferred. |
| BlockFlyoutInflater | Class responsible for creating blocks for flyouts. |
| BlockSvg | Class for a block's SVG representation. Not normally called directly, workspace.newBlock() is preferred. |
| ButtonFlyoutInflater | Class responsible for creating buttons for flyouts. |
| ComponentManager | Manager for all items registered with the workspace. |
| Connection | Class for a connection between blocks. |
| ConnectionChecker | Class for connection type checking logic. |
| ConnectionDB | Database of connections. Connections are stored in order of their vertical component. This way connections in an area may be looked up quickly using a binary search. |
| ContextMenuRegistry | Class for the registry of context menu items. This is intended to be a singleton. You should not create a new instance, and only access this class from ContextMenuRegistry.registry. |
| DeleteArea | Abstract class for a component that can delete a block or bubble that is dropped on top of it. |
| DragTarget | Abstract class for a component with custom behaviour when a block or bubble is dragged over or dropped on top of it. |
| Field | Abstract class for an editable field. |
| UnattachedFieldError | Represents an error where the field is trying to access its block or information about its block before it has actually been attached to said block. |
| FieldCheckbox | Class for a checkbox field. |
| FieldDropdown | Class for an editable dropdown field. |
| FieldImage | Class for an image on a block. |
| FieldLabel | Class for a non-editable, non-serializable text field. |
| FieldLabelSerializable | Class for a non-editable, serializable text field. |
| FieldNumber | Class for an editable number field. |
| FieldTextInput | Class for an editable text field. |
| FieldVariable | Class for a variable's dropdown field. |
| Flyout | Class for a flyout. |
| FlyoutButton | Class for a button or label in the flyout. |
| HorizontalFlyout | Class for a flyout. |
| FlyoutItem | Representation of an item displayed in a flyout. |
| FlyoutMetricsManager | Calculates metrics for a flyout's workspace. The metrics are mainly used to size scrollbars for the flyout. |
| FlyoutSeparator | Representation of a gap between elements in a flyout. |
| VerticalFlyout | Class for a flyout. |
| FocusManager | A per-page singleton that manages Blockly focus across one or more IFocusableTrees, and bidirectionally synchronizes this focus with the DOM. |
| CodeGenerator | Class for a code generator that translates the blocks into a language. |
| Gesture | Class for one gesture. |
| Grid | Class for a workspace's grid. |
| Input | Class for an input with optional fields. |
| InsertionMarkerPreviewer | Displays visual "previews" of where a block will be connected if it is dropped. |
| KeyboardMover | Class responsible for coordinating keyboard-driven moves with the workspace and dragging system. |
| MoveIndicator | Four-way arrow indicator attached to a workspace element to indicate that it is being moved. |
| BlockNavigationPolicy | Set of rules controlling keyboard navigation from a block. |
| BubbleNavigationPolicy | Set of rules controlling keyboard navigation from a Bubble. |
| CommentBarButtonNavigationPolicy | Set of rules controlling keyboard navigation from a CommentBarButton. |
| CommentEditorNavigationPolicy | Set of rules controlling keyboard navigation from a comment editor. This is a no-op placeholder (other than isNavigable/isApplicable) since comment editors handle their own navigation when editing ends. |
| ConnectionNavigationPolicy | Set of rules controlling keyboard navigation from a connection. |
| FieldNavigationPolicy | Set of rules controlling keyboard navigation from a field. |
| FlyoutButtonNavigationPolicy | Set of rules controlling keyboard navigation from a flyout button. |
| FlyoutSeparatorNavigationPolicy | Set of rules controlling keyboard navigation from a flyout separator. This is a no-op placeholder, since flyout separators can't be navigated to. |
| IconNavigationPolicy | Set of rules controlling keyboard navigation from an icon. |
| ToolboxItemNavigationPolicy | Set of rules controlling keyboard navigation from a toolbox item. |
| WorkspaceCommentNavigationPolicy | Set of rules controlling keyboard navigation from an RenderedWorkspaceComment. |
| WorkspaceNavigationPolicy | Set of rules controlling keyboard navigation from a workspace. |
| FlyoutNavigator | Navigator that handles keyboard navigation within a flyout. |
| Navigator | Class responsible for determining where focus should move in response to keyboard navigation commands. |
| ToolboxNavigator | Navigator that handles keyboard navigation within a toolbox. |
| KeyboardNavigationController | The KeyboardNavigationController handles coordinating Blockly-wide keyboard navigation behavior, such as enabling/disabling full cursor visualization. |
| LabelFlyoutInflater | Class responsible for creating labels for flyouts. |
| Menu | A basic menu class. |
| MenuItem | Class representing an item in a menu. |
| MetricsManager | The manager for all workspace metrics calculations. |
| Names | Class for a database of entity names (variables, procedures, etc). |
| Options | Parse the user-specified options, using reasonable defaults where behaviour is unspecified. |
| RenderedConnection | Class for a connection between blocks that may be rendered on screen. |
| Scrollbar | Class for a pure SVG scrollbar. This technique offers a scrollbar that is guaranteed to work, but may not look or behave like the system's scrollbars. |
| ScrollbarPair | Class for a pair of scrollbars. Horizontal and vertical. |
| SeparatorFlyoutInflater | Class responsible for creating separators for flyouts. |
| ShortcutRegistry | Class for the registry of keyboard shortcuts. This is intended to be a singleton. You should not create a new instance, and only access this class from ShortcutRegistry.registry. |
| Theme | Class for a theme. |
| ThemeManager | Class for storing and updating a workspace's theme and UI components. |
| Toast | Class that allows for showing and dismissing temporary notifications. |
| ToolboxCategory | Class for a category in a toolbox. |
| CollapsibleToolboxCategory | Class for a category in a toolbox that can be collapsed. |
| ToolboxSeparator | Class for a toolbox separator. This is the thin visual line that appears on the toolbox. This item is not interactable. |
| Toolbox | Class for a Toolbox. Creates the toolbox's DOM. |
| ToolboxItem | Class for an item in the toolbox. |
| Trashcan | Class for a trash can. |
| FocusableTreeTraverser | A helper utility for IFocusableTree implementations to aid with common tree traversals. |
| VariableMap | Class for a variable map. This contains a dictionary data structure with variable types as keys and lists of variables as values. The list of variables are the type indicated by the key. |
| VariableModel | Class for a variable model. Holds information for the variable including name, ID, and type. |
| Workspace | Class for a workspace. This is a data structure that contains blocks. There is no UI, and can be created headlessly. |
| WorkspaceAudio | Class for loading, storing, and playing audio for a workspace. |
| WorkspaceDragger | Class for a workspace dragger. It moves the workspace around when it is being dragged by a mouse or touch. |
| WorkspaceSvg | Class for a workspace. This is an onscreen area with optional trashcan, scrollbars, bubbles, and dragging. |
| ZoomControls | Class for a zoom controls. |
Enumerations
| Enumeration | Description |
|---|---|
| ConnectionType | Enum for the type of a connection or input. |
| DragDisposition | - |
| Direction | Cardinal directions in which a move can proceed. |
| NavigationDirection | Representation of the direction of travel within a navigation context. |
Functions
| Function | Description |
|---|---|
| hideChaff | Close tooltips, context menus, dropdown selections, etc. |
| getFocusManager | Convenience function for FocusManager.getFocusManager. |
| inject | Inject a Blockly editor into the specified container element (usually a div). |
| isBoundedElement | Returns whether or not the given object conforms to IBoundedElement. |
| isCopyable | Returns true if the given object is an ICopyable. |
| isDeletable | Returns whether the given object is an IDeletable. |
| isDraggable | Returns whether the given object is an IDraggable or not. |
| hasBubble | Type guard that checks whether the given object is a IHasBubble. |
| isIcon | Type guard that checks whether the given object is an IIcon. |
| isPaster | Returns true if the given object is a paster. |
| isRenderedElement | Returns true if the given object is an IRenderedElement. |
| isSelectable | Checks whether the given object is an ISelectable. |
| isSerializable | Type guard that checks whether the given object is a ISerializable. |
| isVariableBackedParameterModel | Returns whether the given object is a variable holder or not. |
| navigateBlock | Returns the next navigable item relative to the provided block child. |
| setLocale | Sets the locale (i.e. the localized messages/block-text/etc) to the given locale. |
Interfaces
| Interface | Description |
|---|---|
| BlocklyOptions | Blockly options. |
| FieldConfig | Extra configuration options for the base field. |
| FieldCheckboxConfig | Config options for the checkbox field. |
| FieldCheckboxFromJsonConfig | fromJson config options for the checkbox field. |
| ImageProperties | Definition of a human-readable image dropdown option. |
| FieldDropdownFromJsonConfig | fromJson config for the dropdown field. |
| FieldImageConfig | Config options for the image field. |
| FieldImageFromJsonConfig | fromJson config options for the image field. |
| FieldLabelConfig | Config options for the label field. |
| FieldLabelFromJsonConfig | fromJson config options for the label field. |
| FieldNumberConfig | Config options for the number field. |
| FieldNumberFromJsonConfig | fromJson config options for the number field. |
| FieldTextInputFromJsonConfig | fromJson config options for the text input field. |
| FieldVariableConfig | Config options for the variable field. |
| FieldVariableFromJsonConfig | fromJson config options for the variable field. |
| IAutoHideable | Interface for a component that can be automatically hidden. |
| IBoundedElement | A bounded element interface. |
| IBubble | A bubble interface. |
| ICollapsibleToolboxItem | Interface for an item in the toolbox that can be collapsed. |
| IComponent | The interface for a workspace component that can be registered with the ComponentManager. |
| IConnectionChecker | Class for connection type checking logic. |
| IConnectionPreviewer | Displays visual "previews" of where a block will be connected if it is dropped. |
| IContextMenu | - |
| ICopyable | The interface for an object that is selectable. |
| IDeletable | The interface for an object that can be deleted. |
| IDeleteArea | Interface for a component that can delete a block or bubble that is dropped on top of it. |
| IDragTarget | Interface for a component with custom behaviour when a block or bubble is dragged over or dropped on top of it. |
| IDraggable | Represents an object that can be dragged. |
| IDragStrategy | - |
| IDragger | - |
| IFlyout | Interface for a flyout. |
| IFlyoutInflater | - |
| IFocusableNode | Represents anything that can have input focus. |
| IFocusableTree | Represents a tree of focusable elements with its own active/passive focus context. |
| IHasBubble | - |
| IIcon | Represents anything that can have input focus. |
| JsonBlockDefinition | Defines the JSON structure for a block definition. |
| IKeyboardAccessible | An interface for an object that handles keyboard shortcuts. |
| IMetricsManager | Interface for a metrics manager. |
| IMovable | The interface for an object that is movable. |
| INavigationPolicy | A set of rules that specify where keyboard navigation should proceed. |
| IPaster | An object that can paste data into a workspace. |
| IPositionable | Interface for a component that is positioned on top of the workspace. |
| IRegistrable | The interface for a Blockly component that can be registered. |
| IRenderedElement | - |
| ISelectable | The interface for an object that is selectable. |
| ISelectableToolboxItem | Interface for an item in the toolbox that can be selected. |
| ISerializable | - |
| IStyleable | Interface for an object that a style can be added to. |
| IToolbox | Interface for a toolbox. |
| IToolboxItem | Interface for an item in the toolbox. |
| IVariableBackedParameterModel | Interface for a parameter model that holds a variable model. |
| IVariableMap | Variable maps are container objects responsible for storing and managing the set of variables referenced on a workspace. |
| IVariableModel | - |
| IVariableState | Represents the state of a given variable. |
| ToastOptions | Display/configuration options for a toast notification. |
Namespaces
Variables
| Variable | Description |
|---|---|
| VERSION | Blockly core version. This constant is overridden by the build script (npm run build) to the value of the version in package.json. This is done by the Closure Compiler in the buildCompiled task. |
| INPUT_VALUE | - |
| OUTPUT_VALUE | - |
| NEXT_STATEMENT | - |
| PREVIOUS_STATEMENT | - |
| TOOLBOX_AT_TOP | - |
| TOOLBOX_AT_BOTTOM | - |
| TOOLBOX_AT_LEFT | - |
| TOOLBOX_AT_RIGHT | - |
| svgResize | Size the SVG image to completely fill its container. Call this when the view actually changes sizes (e.g. on a window resize/device orientation change). See workspace.resizeContents to resize the workspace when the contents change (e.g. when a block is added or removed). Record the height/width of the SVG image. |
| getMainWorkspace | Returns the main workspace. Returns the last used main workspace (based on focus). Try not to use this function, particularly if there are multiple Blockly instances on a page. |
| getSelected | Returns the currently selected copyable object. |
| defineBlocksWithJsonArray | Define blocks from an array of JSON block definitions, as might be generated by the Blockly Developer Tools. |
| setParentContainer | Set the parent container. This is the container element that the WidgetDiv, dropDownDiv, and Tooltip are rendered into the first time Blockly.inject is called. This method is a NOP if called after the first Blockly.inject. |
| COLLAPSE_CHARS | - |
| OPPOSITE_TYPE | - |
| RENAME_VARIABLE_ID | - |
| DELETE_VARIABLE_ID | - |
| COLLAPSED_INPUT_NAME | - |
| COLLAPSED_FIELD_NAME | - |
| VARIABLE_CATEGORY_NAME | String for use in the "custom" attribute of a category in toolbox XML. This string indicates that the category should be dynamically populated with variable blocks. |
| VARIABLE_DYNAMIC_CATEGORY_NAME | String for use in the "custom" attribute of a category in toolbox XML. This string indicates that the category should be dynamically populated with variable blocks. |
| PROCEDURE_CATEGORY_NAME | String for use in the "custom" attribute of a category in toolbox XML. This string indicates that the category should be dynamically populated with procedure blocks. |
| DropDownDiv | - |
| Blocks | A mapping of block type names to block prototype objects. |
| config | Object holding all the values on Blockly that we expect developers to be able to change. |
| keyboardNavigationController | Singleton instance of the keyboard navigation controller. |
| Msg | A dictionary of localised messages. |
Type Aliases
| Type Alias | Description |
|---|---|
| FieldValidator | A function that is called to validate changes to the field's value before they are set. |
| FieldCheckboxValidator | A function that is called to validate changes to the field's value before they are set. |
| MenuOption | An individual option in the dropdown menu. Can be either the string literal separator for a menu separator item, or an array for normal action menu items. In the latter case, the first element is the human-readable value (text, ImageProperties object, or HTML element), and the second element is the language-neutral value. |
| MenuGeneratorFunction | A function that generates an array of menu options for FieldDropdown or its descendants. |
| MenuGenerator | Either an array of menu options or a function that generates an array of menu options for FieldDropdown or its descendants. |
| FieldDropdownConfig | Config options for the dropdown field. |
| FieldDropdownValidator | A function that is called to validate changes to the field's value before they are set. |
| FieldNumberValidator | A function that is called to validate changes to the field's value before they are set. |
| FieldTextInputConfig | Config options for the text input field. |
| FieldTextInputValidator | A function that is called to validate changes to the field's value before they are set. |
| FieldVariableValidator | A function that is called to validate changes to the field's value before they are set. |
| ReturnEphemeralFocus | Type declaration for returning focus to FocusManager upon completing an ephemeral UI flow (such as a dialog). Normally, the FocusManager will refocus the previously-focused element. If callers do not wish for the FocusManager to do so, they may call this method with restoreFocus set to false to prevent automatic refocusing and leave focus where it is. |
| ICopyData | - |
| JsonBlockArg | - |
References
procedures
Renames and re-exports Procedures
Generator
Renames and re-exports CodeGenerator