blockly-fluid 1.2.15 → 1.2.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 +4 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -75,7 +75,7 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
75
75
  output: true,
76
76
 
77
77
  generator: ({ DROPDOWN }) => [
78
- `"${DROPDOWN.replaceAll(`"`, `\\"`).replaceAll("\\", "\\\\")}"`,
78
+ `"${DROPDOWN.replaceAll("\\", "\\\\").replaceAll(`"`, `\\"`)}"`,
79
79
  "atomic"
80
80
  ]
81
81
  };
@@ -141,6 +141,8 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
141
141
  ...(field.validator) ? [field.validator] : []
142
142
  ]), token);
143
143
 
144
+ if (field.default) this.setFieldValue((typeof field.default === "function") ? field.default() : field.default, token);
145
+
144
146
  break;
145
147
  case "variable":
146
148
  dummy.appendField(new Blockly.FieldVariable(...[
@@ -298,7 +300,7 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
298
300
  output: true,
299
301
 
300
302
  generator: ({ TEXT }) => [
301
- `"${TEXT.replaceAll(`"`, `\\"`).replaceAll("\\", "\\\\")}"`,
303
+ `"${TEXT.replaceAll("\\", "\\\\").replaceAll(`"`, `\\"`)}"`,
302
304
  "atomic"
303
305
  ]
304
306
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blockly-fluid",
3
- "version": "1.2.15",
3
+ "version": "1.2.17",
4
4
  "description": "A flexible proxy wrapper for Blockly blocks.",
5
5
  "main": "index.js",
6
6
  "scripts": {