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

0.6.2 • Public • Published

@blockly/block-dynamic-connection Built on Blockly

A group of Blockly blocks that add and remove connections dynamically.

Installation

npm install @blockly/block-dynamic-connection --save

Usage

import * as Blockly from 'blockly';
import * as BlockDynamicConnection from '@blockly/block-dynamic-connection';

const ws = Blockly.inject({
    // options...
    plugins: {
      connectionPreviewer:
        BlockDynamicConnection.decoratePreviewer(
          // Replace with a custom connection previewer, or remove to decorate
          // the default one.
          Blockly.InsertionMarkerPreviewer,
        ),
    },
  };

API

  • overrideOldBlockDefinitions: Replaces the Blockly default blocks with the dynamic connection blocks. This enables projects to use the dynamic block plugin without changing existing XML/JSON.

Blocks

  • dynamic_text_join replaces text_join
  • dynamic_list_create replaces lists_create_with
  • dynamic_if replaces controls_if

License

Apache 2.0

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i @blockly/block-dynamic-connection

    Weekly Downloads

    56

    Version

    0.6.2

    License

    Apache-2.0

    Unpacked Size

    130 kB

    Total Files

    22

    Last publish

    Collaborators

    • google-wombot
    • samelhusseini