blockly-fluid 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +8 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -155,7 +155,14 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
155
155
  })(blockGenerator({
156
156
  ...block.inputList.reduce((accumulator, input) => ({
157
157
  ...accumulator,
158
- ...Object.fromEntries(input.fieldRow.filter((field) => field.name).map((field) => [field.name, block.getFieldValue(field.name)])),
158
+ ...Object.fromEntries(input.fieldRow.filter((field) => field.name).map((field) => [
159
+ field.name,
160
+ ((value) => {
161
+ if (!(field instanceof Blockly.FieldVariable)) return value;
162
+
163
+ return languageGenerator.nameDB_.getName(value, Blockly.VARIABLE_CATEGORY_NAME);
164
+ })(block.getFieldValue(field.name))
165
+ ])),
159
166
  ...(input.name) ? {
160
167
  [input.name]: (({
161
168
  [Blockly.INPUT_VALUE]: () => languageGenerator.valueToCode(block, input.name, languageGenerator.ORDER_ATOMIC),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blockly-fluid",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "A flexible proxy wrapper for Blockly blocks.",
5
5
  "main": "index.js",
6
6
  "scripts": {