blockly
TypeScript icon, indicating that this package has built-in type declarations

12.0.0 • Public • Published

Blockly

Google's Blockly is a web-based, visual programming editor. Users can drag blocks together to build programs. All code is free and open source.

The source for this module is in the Blockly repo.

Example Usage

import * as Blockly from 'blockly/core';
Blockly.inject('blocklyDiv', {
    ...
})

Samples

For samples on how to integrate Blockly into your project, view the list of samples at blockly-samples.

Installation

You can install this package either via npm or unpkg.

unpkg

<script src="https://unpkg.com/blockly/blockly.min.js"></script>

When importing from unpkg, you can access imports from the global namespace.

// Access Blockly.
Blockly.thing;
// Access the default blocks.
Blockly.Blocks['block_type'];
// Access the javascript generator.
javascript.javascriptGenerator;

npm

npm install blockly

Imports

Note: Using import of our package targets requires you to use a bundler (like webpack), since Blockly is packaged as a UMD, rather than an ESM.

// Import Blockly core.
import * as Blockly from 'blockly/core';
// Import the default blocks.
import * as libraryBlocks from 'blockly/blocks';
// Import a generator.
import {javascriptGenerator} from 'blockly/javascript';
// Import a message file.
import * as En from 'blockly/msg/en';

Requires

// Require Blockly core.
const Blockly = require('blockly/core');
// Require the default blocks.
const libraryBlocks = require('blockly/blocks');
// Require a generator.
const {javascriptGenerator} = require('blockly/javascript');
// Require a message file.
const En = require('blockly/msg/en');

Applying messages

Once you have the message files, you also need to apply them.

Blockly.setLocal(En);

For a full list of supported Blockly locales, see: https://github.com/google/blockly/tree/master/msg/js

Docs

For more information about how to use Blockly, check out our devsite.

License

Apache 2.0

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
12.0.02,293latest
12.0.1-beta.1233beta

Version History

VersionDownloads (Last 7 Days)Published
12.0.1-beta.1233
12.0.02,293
12.0.0-beta.719
12.0.0-beta.67
12.0.0-beta.57
12.0.0-beta.4328
12.0.0-beta.33
12.0.0-beta.22
11.2.24,110
11.2.12,349
12.0.0-beta.1250
11.2.024
12.0.0-beta.04
11.2.0-beta.22
11.2.0-beta.12
11.2.0-beta.01
11.1.114,148
11.1.046
11.0.088
11.0.0-beta.120
11.0.0-beta.110
11.0.0-beta.100
11.0.0-beta.90
11.0.0-beta.80
11.0.0-beta.70
11.0.0-beta.60
11.0.0-beta.50
11.0.0-beta.40
10.4.37,208
10.5.0-beta.02
10.4.2138
10.4.139
10.4.019
10.4.0-beta.11
10.4.0-beta.01
11.0.0-beta.31
11.0.0-beta.23
10.3.1321
10.3.1-beta.11
10.3.1-beta.01
11.0.0-beta.12
11.0.0-beta.01
10.3.0300
10.3.0-beta.01
10.2.2229
10.2.110
10.2.024
10.2.0-beta.31
10.2.0-beta.21
10.1.346
10.2.0-beta.11
10.2.0-beta.01
10.1.2309
10.1.18
10.1.010
10.0.2347
10.0.114
10.0.0203
10.0.0-beta.01
9.3.3440
9.3.221
9.3.114
9.3.011
9.3.0-beta.01
9.2.1319
9.2.089
9.1.113
9.1.029
9.1.0-beta.01
9.0.13
9.0.021
9.0.0-beta.41
9.0.0-beta.31
9.0.0-beta.21
9.0.0-beta.11
9.0.0-beta.01
8.0.5-beta.01
8.0.5657
8.0.45
8.0.4-beta.11
8.0.4-beta.01
8.0.317
8.0.3-beta.11
8.0.3-beta.01
8.0.253
7.20211209.5153
8.0.127
8.0.1-beta.01
8.0.078
8.20220331.0-beta.11
8.20220331.0-beta.01
7.20211209.41
7.20211209.33
7.20211209.215
7.20211209.14
7.20211209.011
7.20211209.0-beta.41
7.20211209.0-beta.31
7.20211209.0-beta.21
7.20211209.0-beta.11
7.20211209.0-beta.03
7.20210930.0-beta.40
7.20210930.0-beta.30
7.20210930.0-beta.20
7.20210930.0-beta.10
7.20210930.0-beta.00
6.20210701.0705
5.20210624.0-beta.50
5.20210624.0-beta.40
5.20210624.0-beta.30
5.20210624.0-beta.20
5.20210624.0-beta.10
5.20210325.1200
5.20210624.0-beta.02
5.20210325.08
4.20210325.0-beta.70
4.20210325.0-beta.60
4.20210325.0-beta.50
4.20210325.0-beta.40
4.20210325.0-beta.30
4.20210325.0-beta.20
4.20210325.0-beta.10
3.20200325.0-beta.00
4.20210325.0-beta.00
4.20201217.030
3.20201217.0-beta.40
3.20201217.0-beta.30
3.20201217.0-beta.20
3.20201217.0-beta.10
3.20201217.0-beta.00
3.20200924.4486
3.20200924.319
3.20200924.20
3.20200924.137
3.20200924.03
3.20200625.2393
3.20200625.12
3.20200625.00
3.20200402.132
3.20200402.00
3.20200123.114
3.20200123.038
3.20191014.45
3.20191014.30
3.20191014.20
3.20191014.10
2.20190722.10

Package Sidebar

Install

npm i blockly

Weekly Downloads

37,145

Version

12.0.0

License

Apache-2.0

Unpacked Size

14.4 MB

Total Files

802

Last publish

Collaborators

  • google-wombot
  • samelhusseini