From 2c15d002ababcba7f34c526c05f231735e3e0169 Mon Sep 17 00:00:00 2001 From: Maribeth Bottorff Date: Thu, 24 Mar 2022 15:05:38 -0700 Subject: [PATCH] fix: export Blockly.Names.NameType and Blockly.Input.Align correctly (#6030) * fix: make NameType available externally * fix: export Input.Align --- core/input.js | 27 +++++++++++++++------------ core/names.js | 4 ++++ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/core/input.js b/core/input.js index 256f3ab8e..4427a5204 100644 --- a/core/input.js +++ b/core/input.js @@ -31,18 +31,6 @@ const {inputTypes} = goog.require('Blockly.inputTypes'); goog.require('Blockly.FieldLabel'); -/** - * Enum for alignment of inputs. - * @enum {number} - * @alias Blockly.Input.Align - */ -const Align = { - LEFT: -1, - CENTRE: 0, - RIGHT: 1, -}; -exports.Align = Align; - /** * Class for an input with an optional field. * @alias Blockly.Input @@ -329,4 +317,19 @@ class Input { } } +/** + * Enum for alignment of inputs. + * @enum {number} + * @alias Blockly.Input.Align + */ +const Align = { + LEFT: -1, + CENTRE: 0, + RIGHT: 1, +}; +exports.Align = Align; + +// Add Align to Input so that `Blockly.Input.Align` is publicly accessible. +Input.Align = Align; + exports.Input = Input; diff --git a/core/names.js b/core/names.js index afe4c7292..8424a417b 100644 --- a/core/names.js +++ b/core/names.js @@ -277,6 +277,10 @@ const NameType = { }; exports.NameType = NameType; +// We have to export NameType here so that it is accessible under the old name +// `Blockly.Names.NameType` +Names.NameType = NameType; + /** * Constant to separate developer variable names from user-defined variable * names when running generators.