A Blockly plugin that renders a modal.
yarn add @blockly/plugin-modal
npm install @blockly/plugin-modal --save
import * as Blockly from 'blockly';
import {Modal} from '@blockly/plugin-modal';
// Inject Blockly.
const workspace = Blockly.inject('blocklyDiv', {
toolbox: toolboxCategories,
});
// Initialize plugin.
const modal = new Modal(workspace);
modal.init();
-
init
: Create a modal. -
dispose
: Dispose of the modal. -
show
: Show the modal and focus on the first interactable element. -
hide
: Hide the modal. -
render
: Create all the dom elements for the modal.
-
shouldCloseOnOverlayClick
: (default true) If set to true will close the overlay when a user clicks outside of the modal. -
shouldCloseOnEsc
: (default true) If set to true will close the modal when the user hits escape.
Apache 2.0