blockly-fluid 1.4.30 → 1.4.32
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.
- package/index.js +12 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -48,14 +48,14 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
|
|
|
48
48
|
|
|
49
49
|
if (input) {
|
|
50
50
|
if (input.check === "Color") (input.check = "Colour");
|
|
51
|
-
if ((typeof input.check === "function") && ![String, Number, Boolean, Array, Object].includes(input.check)) (input.check = input.check());
|
|
51
|
+
if ((typeof input.check === "function") && !["String", "Number", "Boolean", "Array", "Object"].includes(input.check.name)) (input.check = input.check());
|
|
52
52
|
|
|
53
53
|
const valueInput = this.appendValueInput(token)
|
|
54
54
|
|
|
55
55
|
if (input.check) {
|
|
56
56
|
if (!Array.isArray(input.check)) (input.check = [input.check]);
|
|
57
57
|
|
|
58
|
-
input.check = input.check.map((check) => [null, "null"].includes(check) ? "Null" : ((check === "undefined") ? "Undefined" : ([String, Number, Boolean, Array, Object].includes(check) ? check.name : check)));
|
|
58
|
+
input.check = input.check.map((check) => [null, "null"].includes(check) ? "Null" : ((check === "undefined") ? "Undefined" : (["String", "Number", "Boolean", "Array", "Object"].includes(check?.name) ? check.name : check)));
|
|
59
59
|
|
|
60
60
|
valueInput.setCheck(input.check);
|
|
61
61
|
} else {
|
|
@@ -258,10 +258,19 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
|
|
|
258
258
|
|
|
259
259
|
if (!languageGenerator.uniqueVariable) {
|
|
260
260
|
languageGenerator.uniqueVariable = (variable) => {
|
|
261
|
-
return languageGenerator.nameDB_.getDistinctName(
|
|
261
|
+
if (variable) return languageGenerator.nameDB_.getDistinctName(
|
|
262
262
|
variable,
|
|
263
263
|
Blockly.VARIABLE_CATEGORY_NAME
|
|
264
264
|
);
|
|
265
|
+
|
|
266
|
+
return new Proxy({}, {
|
|
267
|
+
get(_, property) {
|
|
268
|
+
return languageGenerator.nameDB_.getDistinctName(
|
|
269
|
+
property,
|
|
270
|
+
Blockly.VARIABLE_CATEGORY_NAME
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
265
274
|
};
|
|
266
275
|
};
|
|
267
276
|
|