blockly-fluid 1.3.0 → 1.3.1
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 +10 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -61,8 +61,10 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
|
|
|
61
61
|
if (typeof input.default === "function") (input.default = input.default());
|
|
62
62
|
if (typeof input.options === "function") (input.options = input.options());
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
const shadowDropdownName = `shadow_dropdown_${name.length}_${name}_${token.length}_${token}`;
|
|
65
|
+
|
|
66
|
+
if (!Blocks[shadowDropdownName]) {
|
|
67
|
+
Blocks[shadowDropdownName] = {
|
|
66
68
|
layout: "DROPDOWN",
|
|
67
69
|
fields: {
|
|
68
70
|
DROPDOWN: {
|
|
@@ -81,14 +83,16 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
|
|
|
81
83
|
};
|
|
82
84
|
};
|
|
83
85
|
|
|
84
|
-
valueInput.connection.setShadowDom(new DOMParser().parseFromString(`<shadow type="
|
|
86
|
+
valueInput.connection.setShadowDom(new DOMParser().parseFromString(`<shadow type="${escapeXml(shadowDropdownName)}}"></shadow>`, "text/xml").firstChild);
|
|
85
87
|
};
|
|
86
88
|
|
|
87
89
|
if (input.variable) {
|
|
88
90
|
if (typeof input.variable === "function") (input.variable = input.variable());
|
|
89
91
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
const shadowVariableName = `shadow_variable_${name.length}_${name}_${token.length}_${token}`;
|
|
93
|
+
|
|
94
|
+
if (!Blocks[shadowVariableName]) {
|
|
95
|
+
Blocks[shadowVariableName] = {
|
|
92
96
|
layout: "VARIABLE",
|
|
93
97
|
fields: {
|
|
94
98
|
VARIABLE: {
|
|
@@ -105,7 +109,7 @@ module.exports = (Blockly, { generator: languageGeneratorFallback, generators: l
|
|
|
105
109
|
};
|
|
106
110
|
};
|
|
107
111
|
|
|
108
|
-
valueInput.connection.setShadowDom(new DOMParser().parseFromString(`<shadow type="
|
|
112
|
+
valueInput.connection.setShadowDom(new DOMParser().parseFromString(`<shadow type="${escapeXml(shadowVariableName)}"><field name="VARIABLE">${input.variable}</field></shadow>`, "text/xml").firstChild);
|
|
109
113
|
};
|
|
110
114
|
|
|
111
115
|
if (input.shadow) {
|