Files
blockly/tests/compile/test_blocks.js
Christopher Allen beefe361a3 fix!(blocks): Rename Blockly.Blocks.* modules to Blockly.blocks.* (#5696)
Use Blockly.blocks.* for blocks modules, leaving the Blockly.Blocks
name for the block dictionary object.

This resolves a problem with advanced compilation of Blockly Games,
 where, in the compressed output, (the minified name of)
 Blockly.Blocks gets overwritten, with the dictionary object defined in
 core/blocks.js being replaced by an empty namespace object
 created by the provides of Blockly.Blocks.* in blocks/*.js. Without
 this fix, some block definitions end up being created in the
 dictionary and some on the namespace object—with chaos
 predictably ensuing.
2021-11-08 18:35:38 +00:00

49 lines
984 B
JavaScript

/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Test blocks for advanced compilation.
*/
'use strict';
goog.provide('Blockly.Constants.TestBlocks');
goog.require('Blockly');
Blockly.defineBlocksWithJsonArray([
{
'type': 'test_style_hex1',
'message0': 'Block color: Bright purple %1 %2 %3 %4',
'args0': [
{
'type': 'field_input',
'name': 'TEXT',
'text': '#992aff',
},
{
'type': 'field_dropdown',
'name': 'DROPDOWN',
'options': [
['option', 'ONE'],
['option', 'TWO'],
],
},
{
'type': 'field_checkbox',
'name': 'NAME',
'checked': true,
},
{
'type': 'input_value',
'name': 'NAME',
},
],
'previousStatement': null,
'nextStatement': null,
'colour': '#992aff',
}
]);