blockly-fluid 1.4.31 → 1.4.33

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 +14 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -256,12 +256,25 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
256
256
 
257
257
  if (!languageGenerator) return;
258
258
 
259
+ if (!languageGenerator.variables) {
260
+ languageGenerator.variables = new Proxy({}, {
261
+ get(_, property) {
262
+ return languageGenerator.nameDB_.getDistinctName(
263
+ property,
264
+ Blockly.VARIABLE_CATEGORY_NAME
265
+ );
266
+ }
267
+ });
268
+ };
269
+
259
270
  if (!languageGenerator.uniqueVariable) {
260
271
  languageGenerator.uniqueVariable = (variable) => {
261
- return languageGenerator.nameDB_.getDistinctName(
272
+ if (variable) return languageGenerator.nameDB_.getDistinctName(
262
273
  variable,
263
274
  Blockly.VARIABLE_CATEGORY_NAME
264
275
  );
276
+
277
+ return languageGenerator.variables;
265
278
  };
266
279
  };
267
280
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blockly-fluid",
3
- "version": "1.4.31",
3
+ "version": "1.4.33",
4
4
  "description": "A flexible proxy wrapper for Blockly blocks.",
5
5
  "main": "index.js",
6
6
  "scripts": {