@blockly/shadow-block-converter
TypeScript icon, indicating that this package has built-in type declarations

4.0.5 • Public • Published

@blockly/shadow-block-converter Built on Blockly

A Blockly plugin for automatically converting shadow blocks to real blocks when the user edits them.

Installation

Yarn

yarn add @blockly/shadow-block-converter

npm

npm install @blockly/shadow-block-converter --save

Usage

This plugin exports a function called shadowBlockConversionChangeListener. If you add it as a change listener to your blockly workspace then any shadow block the user edits will be converted to a real block. See below for an example using it with a workspace.

JavaScript

import * as Blockly from 'blockly';
import {shadowBlockConversionChangeListener} from '@blockly/shadow-block-converter';

function start() {
  const workspace = Blockly.inject('blocklyDiv', {toolbox: toolbox});
  workspace.addChangeListener(shadowBlockConversionChangeListener);
}

License

Apache 2.0

Readme

Keywords

Package Sidebar

Install

Weekly Downloads

291

Version

4.0.5

License

Apache-2.0

Unpacked Size

43.8 kB

Total Files

13

Last publish

Collaborators

  • google-wombot
  • samelhusseini