@blockly/plugin-modal

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

215

Version

6.0.13

License

Apache 2.0

Unpacked Size

51.5 kB

Total Files

8

Last publish

Collaborators

  • google-wombot
  • samelhusseini