@blockly/plugin-modal

7.0.12 • Public • Published

@blockly/plugin-modal Built on Blockly

A Blockly plugin that renders a modal.

Installation

Yarn

yarn add @blockly/plugin-modal

npm

npm install @blockly/plugin-modal --save

Usage

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();

API

Methods

  • 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.

Properties

  • 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.

License

Apache 2.0

Package Sidebar

Install

npm i @blockly/plugin-modal

Weekly Downloads

726

Version

7.0.12

License

Apache 2.0

Unpacked Size

35.4 kB

Total Files

6

Last publish

Collaborators

  • google-wombot
  • samelhusseini