blockly-fluid 1.0.15 → 1.0.17

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 +9 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -107,7 +107,7 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
107
107
  this.setOutput(true, (output === true) ? null : (([String, Number, Boolean, Array, Object].includes(output)) ? output.name : output));
108
108
  };
109
109
 
110
- this.setColour((color != null) ? ((typeof color === "function") ? color() : color) : (Blockly.getMainWorkspace().getToolbox().contents_.find((category) => category.toolboxItemDef_.contents?.some((block) => block.type === name))?.toolboxItemDef_?.colour || "#000000"));
110
+ this.setColour((color != null) ? ((typeof color === "function") ? color() : color) : (((toolbox) => toolbox.contents || toolbox.contents_)(Blockly.getMainWorkspace().getToolbox()).find((category) => category.toolboxItemDef_.contents?.some((block) => block.type === name))?.toolboxItemDef_?.colour || "#000000"));
111
111
  this.setInputsInline((typeof inline === "function") ? inline() : inline);
112
112
  this.setDeletable((typeof deletable === "function") ? deletable() : deletable);
113
113
  this.setTooltip(translate((typeof tooltip === "function") ? tooltip() : tooltip));
@@ -221,9 +221,10 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
221
221
  },
222
222
  output: true,
223
223
 
224
- generator({ TEXT = `""` }) {
225
- return [`"${TEXT}"`, "atomic"];
226
- }
224
+ generator: ({ TEXT = `""` }) => [
225
+ `"${TEXT}"`,
226
+ "atomic"
227
+ ]
227
228
  };
228
229
 
229
230
  Blocks["number"] = {
@@ -240,9 +241,10 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
240
241
  },
241
242
  output: Number,
242
243
 
243
- generator({ NUMBER = 0 }) {
244
- return [`${parseFloat(NUMBER)}`, "atomic"];
245
- }
244
+ generator: ({ NUMBER = 0 }) => [
245
+ NUMBER,
246
+ "atomic"
247
+ ]
246
248
  };
247
249
 
248
250
  return Blocks;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blockly-fluid",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "A flexible proxy wrapper for Blockly blocks.",
5
5
  "main": "index.js",
6
6
  "scripts": {