Skip to content

Commit

Permalink
fix: export Blockly.Names.NameType and Blockly.Input.Align correctly (g…
Browse files Browse the repository at this point in the history
…oogle#6030)

* fix: make NameType available externally

* fix: export Input.Align
  • Loading branch information
maribethb authored Mar 24, 2022
1 parent 364bf14 commit 2c15d00
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
27 changes: 15 additions & 12 deletions core/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
4 changes: 4 additions & 0 deletions core/names.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2c15d00

Please sign in to comment.