pxt-core 7.4.9 → 7.4.13
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/built/cli.js +94 -83
- package/built/pxt.js +180 -135
- package/built/pxtblockly.js +1509 -1508
- package/built/pxtblocks.d.ts +11 -4
- package/built/pxtblocks.js +126 -138
- package/built/pxtlib.d.ts +6 -2
- package/built/pxtlib.js +86 -52
- package/built/target.js +1 -1
- package/built/web/blockly.css +1 -1
- package/built/web/main.js +1 -1
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxtasseteditor.js +1 -1
- package/built/web/pxtblockly.js +53 -1
- package/built/web/pxtblocks.js +1 -1
- package/built/web/pxtembed.js +53 -1
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/react-common-skillmap.css +1 -0
- package/built/web/rtlblockly.css +1 -1
- package/built/web/rtlreact-common-skillmap.css +1 -0
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/built/web/skillmap/js/main.b96caef3.chunk.js +1 -0
- package/docfiles/tracking.html +1 -1
- package/localtypings/blockly.d.ts +12268 -7535
- package/localtypings/pxtarget.d.ts +1 -0
- package/localtypings/pxtblockly.d.ts +37 -0
- package/package.json +6 -3
- package/react-common/components/Checkbox.tsx +25 -0
- package/react-common/components/Notification.tsx +82 -0
- package/react-common/components/profile/Badge.tsx +33 -0
- package/react-common/components/profile/BadgeInfo.tsx +74 -0
- package/react-common/components/profile/BadgeList.tsx +67 -0
- package/react-common/components/profile/Profile.tsx +42 -0
- package/react-common/components/profile/UserNotification.tsx +32 -0
- package/react-common/components/profile/UserPane.tsx +64 -0
- package/react-common/components/types.d.ts +29 -0
- package/react-common/components/util.tsx +35 -0
- package/{built/web/react-common.css → react-common/styles/profile/profile.less} +1 -0
- package/react-common/styles/react-common-skillmap-core.less +10 -0
- package/react-common/styles/react-common-skillmap.less +12 -0
- package/react-common/styles/react-common.less +1 -0
- package/react-common/tsconfig.json +36 -0
- package/theme/blockly-core.less +38 -13
- package/theme/common-components.less +7 -0
- package/theme/common.less +1 -1
- package/theme/highcontrast.less +4 -0
- package/theme/melodyeditor.less +2 -2
- package/theme/print.less +1 -1
- package/theme/pxt.less +2 -0
- package/theme/toolbox.less +1 -0
- package/theme/tutorial-sidebar.less +64 -6
- package/webapp/public/blockly/blockly_compressed.js +1271 -1288
- package/webapp/public/blockly/blocks_compressed.js +47 -65
- package/webapp/public/blockly/msg/js/en.js +8 -17
- package/webapp/public/blockly/msg/json/en.json +6 -15
- package/webapp/public/blockly/plugins.js +57 -0
- package/webapp/public/skillmap.html +2 -2
- package/built/web/skillmap/js/main.ea4b3e23.chunk.js +0 -1
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
// Do not edit this file; automatically generated by gulp.
|
|
2
|
-
/*
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
See the License for the specific language governing permissions and
|
|
16
|
-
limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
'use strict';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Blockly.Blocks.colour={};Blockly.constants={};Blockly.Constants={};Blockly.Constants.Colour={};Blockly.Constants.Colour.HUE=20;
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
;(function(root, factory) {
|
|
5
|
+
if (typeof define === 'function' && define.amd) { // AMD
|
|
6
|
+
define(['./blockly_compressed.js'], factory);
|
|
7
|
+
} else if (typeof exports === 'object') { // Node.js
|
|
8
|
+
module.exports = factory(require('./blockly_compressed.js'));
|
|
9
|
+
} else { // Browser
|
|
10
|
+
root.Blockly.Blocks = factory(root.Blockly);
|
|
11
|
+
}
|
|
12
|
+
}(this, function(Blockly) {
|
|
13
|
+
'use strict';Blockly.Blocks.colour={};Blockly.Constants={};Blockly.Constants.Colour={};Blockly.Constants.Colour.HUE=20;
|
|
22
14
|
Blockly.defineBlocksWithJsonArray([{type:"colour_picker",message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",outputShape:Blockly.OUTPUT_SHAPE_ROUND,helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"field_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"colour_random",message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",outputShape:Blockly.OUTPUT_SHAPE_ROUND,helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",
|
|
23
15
|
tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"},{type:"colour_rgb",message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"LEFT"},{type:"input_value",name:"GREEN",check:"Number",align:"LEFT"},{type:"input_value",name:"BLUE",check:"Number",align:"LEFT"}],output:"Colour",outputShape:Blockly.OUTPUT_SHAPE_ROUND,helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"},
|
|
24
16
|
{type:"colour_blend",message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"LEFT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"LEFT"},{type:"input_value",name:"RATIO",check:"Number",align:"LEFT"}],output:"Colour",outputShape:Blockly.OUTPUT_SHAPE_ROUND,helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"}]);/*
|
|
@@ -36,7 +28,7 @@ Blockly.PXTBlockly.Extensions.INLINE_SVGS=function(){this.ADD_IMAGE_DATAURI="dat
|
|
|
36
28
|
Blockly.PXTBlockly.Extensions.FUNCTION_CONTEXTMENU_EDIT={customContextMenu:function(a){a.push(Blockly.Functions.makeGoToDefinitionOption(this))}};Blockly.PXTBlockly.Extensions.OUTPUT_NUMBER=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.setOutput(!0,"Number")};Blockly.PXTBlockly.Extensions.OUTPUT_STRING=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.setOutput(!0,"String")};
|
|
37
29
|
Blockly.PXTBlockly.Extensions.OUTPUT_BOOLEAN=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_HEXAGONAL);this.setOutput(!0,"Boolean")};Blockly.PXTBlockly.Extensions.OUTPUT_ARRAY=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.setOutput(!0,"Array")};
|
|
38
30
|
Blockly.PXTBlockly.Extensions.registerAll=function(){Blockly.Extensions.register("inline-svgs",this.INLINE_SVGS);Blockly.Extensions.registerMixin("function_contextmenu_edit",Blockly.PXTBlockly.Extensions.FUNCTION_CONTEXTMENU_EDIT);Blockly.Extensions.register("output_number",Blockly.PXTBlockly.Extensions.OUTPUT_NUMBER);Blockly.Extensions.register("output_string",Blockly.PXTBlockly.Extensions.OUTPUT_STRING);Blockly.Extensions.register("output_boolean",Blockly.PXTBlockly.Extensions.OUTPUT_BOOLEAN);Blockly.Extensions.register("output_array",
|
|
39
|
-
Blockly.PXTBlockly.Extensions.OUTPUT_ARRAY)};Blockly.PXTBlockly.Extensions.registerAll();Blockly.
|
|
31
|
+
Blockly.PXTBlockly.Extensions.OUTPUT_ARRAY)};Blockly.PXTBlockly.Extensions.registerAll();Blockly.Constants.Lists={};Blockly.Constants.Lists.HUE=260;
|
|
40
32
|
Blockly.defineBlocksWithJsonArray([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",
|
|
41
33
|
helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",outputShape:Blockly.OUTPUT_SHAPE_ROUND,inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",outputShape:Blockly.OUTPUT_SHAPE_HEXAGONAL,
|
|
42
34
|
style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]);
|
|
@@ -95,15 +87,15 @@ Blockly.defineBlocksWithJsonArray([{type:"controls_if_if",message0:"%{BKY_CONTRO
|
|
|
95
87
|
enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]);Blockly.Constants.Logic.TOOLTIPS_BY_OP={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};
|
|
96
88
|
Blockly.Extensions.register("logic_op_tooltip",Blockly.Extensions.buildTooltipForDropdown("OP",Blockly.Constants.Logic.TOOLTIPS_BY_OP));
|
|
97
89
|
Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN={elseifCount_:0,elseCount_:0,suppressPrefixSuffix:!0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var a=Blockly.utils.xml.createElement("mutation");this.elseifCount_&&a.setAttribute("elseif",this.elseifCount_);this.elseCount_&&a.setAttribute("else",1);return a},domToMutation:function(a){this.elseifCount_=parseInt(a.getAttribute("elseif"),10)||0;this.elseCount_=parseInt(a.getAttribute("else"),10)||0;this.rebuildShape_()},
|
|
98
|
-
decompose:function(a){var b=a.newBlock("controls_if_if");b.initSvg();for(var c=b.nextConnection,d=1;d<=this.elseifCount_;d++){var e=a.newBlock("controls_if_elseif");e.initSvg();c.connect(e.previousConnection);c=e.nextConnection}this.elseCount_&&(a=a.newBlock("controls_if_else"),a.initSvg(),c.connect(a.previousConnection));return b},compose:function(a){a=a.nextConnection.targetBlock();this.elseCount_=this.elseifCount_=0;for(var b=[null],c=[null],d=null;a;){switch(a.type){case "controls_if_elseif":this.elseifCount_++;
|
|
90
|
+
decompose:function(a){var b=a.newBlock("controls_if_if");b.initSvg();for(var c=b.nextConnection,d=1;d<=this.elseifCount_;d++){var e=a.newBlock("controls_if_elseif");e.initSvg();c.connect(e.previousConnection);c=e.nextConnection}this.elseCount_&&(a=a.newBlock("controls_if_else"),a.initSvg(),c.connect(a.previousConnection));return b},compose:function(a){a=a.nextConnection.targetBlock();this.elseCount_=this.elseifCount_=0;for(var b=[null],c=[null],d=null;a&&!a.isInsertionMarker();){switch(a.type){case "controls_if_elseif":this.elseifCount_++;
|
|
99
91
|
b.push(a.valueConnection_);c.push(a.statementConnection_);break;case "controls_if_else":this.elseCount_++;d=a.statementConnection_;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.nextConnection&&a.nextConnection.targetBlock()}this.updateShape_();this.reconnectChildBlocks_(b,c,d)},saveConnections:function(a){a=a.nextConnection.targetBlock();for(var b=1;a;){switch(a.type){case "controls_if_elseif":var c=this.getInput("IF"+b),d=this.getInput("DO"+b);a.valueConnection_=c&&c.connection.targetConnection;
|
|
100
92
|
a.statementConnection_=d&&d.connection.targetConnection;b++;break;case "controls_if_else":d=this.getInput("ELSE");a.statementConnection_=d&&d.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.nextConnection&&a.nextConnection.targetBlock()}},rebuildShape_:function(){var a=[null],b=[null],c=null;this.getInput("ELSE")&&(c=this.getInput("ELSE").connection.targetConnection);for(var d=1;this.getInput("IF"+d);){var e=this.getInput("IF"+d),f=this.getInput("DO"+
|
|
101
93
|
d);a.push(e.connection.targetConnection);b.push(f.connection.targetConnection);d++}this.updateShape_();this.reconnectChildBlocks_(a,b,c)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var a=1;this.getInput("IF"+a);)this.removeInput("IF"+a),this.removeInput("DO"+a),a++;for(a=1;a<=this.elseifCount_;a++)this.appendValueInput("IF"+a).setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+a).appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN);
|
|
102
94
|
this.elseCount_&&this.appendStatementInput("ELSE").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(a,b,c){for(var d=1;d<=this.elseifCount_;d++)Blockly.Mutator.reconnect(a[d],this,"IF"+d),Blockly.Mutator.reconnect(b[d],this,"DO"+d);Blockly.Mutator.reconnect(c,this,"ELSE")}};
|
|
103
95
|
Blockly.Constants.Logic.CONTROLS_IF_TOOLTIP_EXTENSION=function(){this.setTooltip(function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return Blockly.Msg.CONTROLS_IF_TOOLTIP_4}else return Blockly.Msg.CONTROLS_IF_TOOLTIP_1;return""}.bind(this))};Blockly.Extensions.register("controls_if_tooltip",Blockly.Constants.Logic.CONTROLS_IF_TOOLTIP_EXTENSION);
|
|
104
|
-
Blockly.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN={onchange:function(a){this.prevBlocks_||(this.prevBlocks_=[null,null]);var b=this.getInputTargetBlock("A"),c=this.getInputTargetBlock("B");b&&c&&!b.outputConnection
|
|
105
|
-
this.bumpNeighbours(),Blockly.Events.setGroup(!1));this.prevBlocks_[0]=this.getInputTargetBlock("A");this.prevBlocks_[1]=this.getInputTargetBlock("B")}};Blockly.Constants.Logic.LOGIC_COMPARE_EXTENSION=function(){this.mixin(Blockly.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN)};Blockly.Extensions.register("logic_compare",Blockly.Constants.Logic.LOGIC_COMPARE_EXTENSION);
|
|
106
|
-
Blockly.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN={prevParentConnection_:null,onchange:function(a){var b=this.getInputTargetBlock("THEN"),c=this.getInputTargetBlock("ELSE"),d=this.outputConnection.targetConnection;if((b||c)&&d)for(var e=0;2>e;e++){var f=1==e?b:c;f&&!f.
|
|
96
|
+
Blockly.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN={onchange:function(a){this.prevBlocks_||(this.prevBlocks_=[null,null]);var b=this.getInputTargetBlock("A"),c=this.getInputTargetBlock("B");b&&c&&!this.workspace.connectionChecker.doTypeChecks(b.outputConnection,c.outputConnection)&&(Blockly.Events.setGroup(a.group),a=this.prevBlocks_[0],a!==b&&(b.unplug(),!a||a.isDisposed()||a.isShadow()||this.getInput("A").connection.connect(a.outputConnection)),b=this.prevBlocks_[1],b!==c&&(c.unplug(),!b||b.isDisposed()||
|
|
97
|
+
b.isShadow()||this.getInput("B").connection.connect(b.outputConnection)),this.bumpNeighbours(),Blockly.Events.setGroup(!1));this.prevBlocks_[0]=this.getInputTargetBlock("A");this.prevBlocks_[1]=this.getInputTargetBlock("B")}};Blockly.Constants.Logic.LOGIC_COMPARE_EXTENSION=function(){this.mixin(Blockly.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN)};Blockly.Extensions.register("logic_compare",Blockly.Constants.Logic.LOGIC_COMPARE_EXTENSION);
|
|
98
|
+
Blockly.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN={prevParentConnection_:null,onchange:function(a){var b=this.getInputTargetBlock("THEN"),c=this.getInputTargetBlock("ELSE"),d=this.outputConnection.targetConnection;if((b||c)&&d)for(var e=0;2>e;e++){var f=1==e?b:c;f&&!f.workspace.connectionChecker.doTypeChecks(f.outputConnection,d)&&(Blockly.Events.setGroup(a.group),d===this.prevParentConnection_?(this.unplug(),d.getSourceBlock().bumpNeighbours()):(f.unplug(),f.bumpNeighbours()),Blockly.Events.setGroup(!1))}this.prevParentConnection_=
|
|
107
99
|
d}};Blockly.Extensions.registerMixin("logic_ternary",Blockly.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN);Blockly.Blocks.loops={};Blockly.Constants.Loops={};Blockly.Constants.Loops.HUE=120;
|
|
108
100
|
Blockly.defineBlocksWithJsonArray([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10,
|
|
109
101
|
min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}","UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}],
|
|
@@ -114,8 +106,8 @@ name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loo
|
|
|
114
106
|
Blockly.Extensions.register("controls_flow_tooltip",Blockly.Extensions.buildTooltipForDropdown("FLOW",Blockly.Constants.Loops.BREAK_CONTINUE_TOOLTIPS));
|
|
115
107
|
Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN={customContextMenu:function(a){if(!this.isInFlyout){var b=this.getField("VAR").getVariable(),c=b.name;if(!this.isCollapsed()&&null!=c){var d={enabled:!this.inDebugWorkspace()};d.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",c);b=Blockly.Variables.generateVariableFieldDom(b);c=Blockly.utils.xml.createElement("block");c.setAttribute("type","variables_get");c.appendChild(b);d.callback=Blockly.ContextMenu.callbackFactory(this,
|
|
116
108
|
c);a.push(d)}}}};Blockly.Extensions.registerMixin("contextMenu_newGetVariableBlock",Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN);Blockly.Extensions.register("controls_for_tooltip",Blockly.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR"));Blockly.Extensions.register("controls_forEach_tooltip",Blockly.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR"));
|
|
117
|
-
Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN={LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],suppressPrefixSuffix:!0,getSurroundLoop:function(a){do{if(-1!=Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.LOOP_TYPES.indexOf(a.type))return a;a=a.getSurroundParent()}while(a);return null},onchange:function(a){this.workspace.isDragging&&!this.workspace.isDragging()&&
|
|
118
|
-
|
|
109
|
+
Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN={LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],suppressPrefixSuffix:!0,getSurroundLoop:function(a){do{if(-1!=Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.LOOP_TYPES.indexOf(a.type))return a;a=a.getSurroundParent()}while(a);return null},onchange:function(a){if(this.workspace.isDragging&&!this.workspace.isDragging()&&a.type==Blockly.Events.BLOCK_MOVE){var b=Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.getSurroundLoop(this);
|
|
110
|
+
this.setWarningText(b?null:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);if(!this.isInFlyout){var c=Blockly.Events.getGroup();Blockly.Events.setGroup(a.group);this.setEnabled(b);Blockly.Events.setGroup(c)}}}};Blockly.Extensions.registerMixin("controls_flow_in_loop_check",Blockly.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN);Blockly.Blocks.math={};Blockly.Constants.Math={};Blockly.Constants.Math.HUE=230;
|
|
119
111
|
Blockly.defineBlocksWithJsonArray([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"field_blocks",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_integer",message0:"%1",args0:[{type:"field_number",name:"NUM",precision:1}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"field_blocks",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",
|
|
120
112
|
tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_whole_number",message0:"%1",args0:[{type:"field_number",name:"NUM",min:0,precision:1}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"field_blocks",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_positive_number",message0:"%1",args0:[{type:"field_number",name:"NUM",min:0}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,
|
|
121
113
|
style:"field_blocks",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_number_minmax",message0:"%1",args0:[{type:"field_slider",name:"SLIDER",value:0,step:1,labelText:"Number"}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,style:"field_blocks",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",mutator:"math_number_minmax_mutator",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",
|
|
@@ -140,38 +132,38 @@ Blockly.Extensions.registerMutator("math_modes_of_list_mutator",Blockly.Constant
|
|
|
140
132
|
Blockly.Constants.Math.MATH_NUMBER_MINMAX_MIXIN={mutationToDom:function(){var a=Blockly.utils.xml.createElement("mutation");void 0!=this.inputList[0].fieldRow[0].min_&&a.setAttribute("min",this.inputList[0].fieldRow[0].min_);void 0!=this.inputList[0].fieldRow[0].max_&&a.setAttribute("max",this.inputList[0].fieldRow[0].max_);void 0!=this.inputList[0].fieldRow[0].labelText_&&a.setAttribute("label",this.inputList[0].fieldRow[0].labelText_);void 0!=this.inputList[0].fieldRow[0].step_&&a.setAttribute("step",
|
|
141
133
|
this.inputList[0].fieldRow[0].step_);void 0!=this.inputList[0].fieldRow[0].sliderColor_&&a.setAttribute("color",this.inputList[0].fieldRow[0].sliderColor_);void 0!=this.inputList[0].fieldRow[0].precision_&&a.setAttribute("precision",this.inputList[0].fieldRow[0].precision_);return a},domToMutation:function(a){var b=a.getAttribute("min"),c=a.getAttribute("max"),d=a.getAttribute("step"),e=a.getAttribute("label"),f=a.getAttribute("color");a=a.getAttribute("precision");this.inputList[0].fieldRow[0].setLabel(e);
|
|
142
134
|
this.inputList[0].fieldRow[0].setOptions(b,c,d,a);this.inputList[0].fieldRow[0].setColor(f)}};Blockly.Extensions.registerMutator("math_number_minmax_mutator",Blockly.Constants.Math.MATH_NUMBER_MINMAX_MIXIN);Blockly.Blocks.procedures={};
|
|
143
|
-
Blockly.Blocks.procedures_defnoreturn={init:function(){var a=new Blockly.FieldTextInput(
|
|
144
|
-
this.setStyle("procedure_blocks");this.setTooltip(Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.setStatements_(!0);this.statementConnection_=null},setStatements_:function(a){this.hasStatements_!==a&&(a?(this.appendStatementInput("STACK").appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK",
|
|
145
|
-
a)},updateParams_:function(){var a="";this.arguments_.length&&(a=Blockly.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", "));Blockly.Events.disable();try{this.setFieldValue(a,"PARAMS")}finally{Blockly.Events.enable()}},mutationToDom:function(a){var b=Blockly.utils.xml.createElement("mutation");a&&b.setAttribute("name",this.getFieldValue("NAME"));for(var c=0;c<this.argumentVarModels_.length;c++){var d=Blockly.utils.xml.createElement("arg"),
|
|
146
|
-
e.name);d.setAttribute("varid",e.getId());a&&this.paramIds_&&d.setAttribute("paramId",this.paramIds_[c]);b.appendChild(d)}this.hasStatements_||b.setAttribute("statements","false");return b},domToMutation:function(a){this.arguments_=[];this.argumentVarModels_=[];for(var b=0,c;c=a.childNodes[b];b++)if("arg"==c.nodeName.toLowerCase()){var d=c.getAttribute("name");c=c.getAttribute("varid")||c.getAttribute("varId");this.arguments_.push(d);c=Blockly.Variables.getOrCreateVariablePackage(this.workspace,
|
|
147
|
-
d,"");null!=c?this.argumentVarModels_.push(c):console.log("Failed to create a variable with name "+d+", ignoring.")}this.updateParams_();Blockly.Procedures.mutateCallers(this);this.setStatements_("false"!==a.getAttribute("statements"))},decompose:function(a){var b=Blockly.utils.xml.createElement("block");b.setAttribute("type","procedures_mutatorcontainer");var c=Blockly.utils.xml.createElement("statement");c.setAttribute("name","STACK");b.appendChild(c);for(var d=0;d<this.arguments_.length;d++){var e=
|
|
135
|
+
Blockly.Blocks.procedures_defnoreturn={init:function(){var a=Blockly.Procedures.findLegalName("",this);a=new Blockly.FieldTextInput(a,Blockly.Procedures.rename);a.setSpellcheck(!1);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE).appendField(a,"NAME").appendField("","PARAMS");this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"]));(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT&&
|
|
136
|
+
this.setCommentText(Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT);this.setStyle("procedure_blocks");this.setTooltip(Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.setStatements_(!0);this.statementConnection_=null},setStatements_:function(a){this.hasStatements_!==a&&(a?(this.appendStatementInput("STACK").appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK",
|
|
137
|
+
"RETURN")):this.removeInput("STACK",!0),this.hasStatements_=a)},updateParams_:function(){var a="";this.arguments_.length&&(a=Blockly.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", "));Blockly.Events.disable();try{this.setFieldValue(a,"PARAMS")}finally{Blockly.Events.enable()}},mutationToDom:function(a){var b=Blockly.utils.xml.createElement("mutation");a&&b.setAttribute("name",this.getFieldValue("NAME"));for(var c=0;c<this.argumentVarModels_.length;c++){var d=Blockly.utils.xml.createElement("arg"),
|
|
138
|
+
e=this.argumentVarModels_[c];d.setAttribute("name",e.name);d.setAttribute("varid",e.getId());a&&this.paramIds_&&d.setAttribute("paramId",this.paramIds_[c]);b.appendChild(d)}this.hasStatements_||b.setAttribute("statements","false");return b},domToMutation:function(a){this.arguments_=[];this.argumentVarModels_=[];for(var b=0,c;c=a.childNodes[b];b++)if("arg"==c.nodeName.toLowerCase()){var d=c.getAttribute("name");c=c.getAttribute("varid")||c.getAttribute("varId");this.arguments_.push(d);c=Blockly.Variables.getOrCreateVariablePackage(this.workspace,
|
|
139
|
+
c,d,"");null!=c?this.argumentVarModels_.push(c):console.log("Failed to create a variable with name "+d+", ignoring.")}this.updateParams_();Blockly.Procedures.mutateCallers(this);this.setStatements_("false"!==a.getAttribute("statements"))},decompose:function(a){var b=Blockly.utils.xml.createElement("block");b.setAttribute("type","procedures_mutatorcontainer");var c=Blockly.utils.xml.createElement("statement");c.setAttribute("name","STACK");b.appendChild(c);for(var d=0;d<this.arguments_.length;d++){var e=
|
|
148
140
|
Blockly.utils.xml.createElement("block");e.setAttribute("type","procedures_mutatorarg");var f=Blockly.utils.xml.createElement("field");f.setAttribute("name","NAME");var g=Blockly.utils.xml.createTextNode(this.arguments_[d]);f.appendChild(g);e.appendChild(f);f=Blockly.utils.xml.createElement("next");e.appendChild(f);c.appendChild(e);c=f}a=Blockly.Xml.domToBlock(b,a);"procedures_defreturn"==this.type?a.setFieldValue(this.hasStatements_,"STATEMENTS"):a.removeInput("STATEMENT_INPUT");Blockly.Procedures.mutateCallers(this);
|
|
149
|
-
return a},compose:function(a){this.arguments_=[];this.paramIds_=[];this.argumentVarModels_=[];for(var b=a.getInputTargetBlock("STACK");b;){var c=b.getFieldValue("NAME");this.arguments_.push(c);c=this.workspace.getVariable(c,"");this.argumentVarModels_.push(c);this.paramIds_.push(b.id);b=b.nextConnection&&b.nextConnection.targetBlock()}this.updateParams_();Blockly.Procedures.mutateCallers(this);a=a.getFieldValue("STATEMENTS");if(null!==a&&(a="TRUE"==a,this.hasStatements_!=a))if(a)this.setStatements_(!0),
|
|
141
|
+
return a},compose:function(a){this.arguments_=[];this.paramIds_=[];this.argumentVarModels_=[];for(var b=a.getInputTargetBlock("STACK");b&&!b.isInsertionMarker();){var c=b.getFieldValue("NAME");this.arguments_.push(c);c=this.workspace.getVariable(c,"");this.argumentVarModels_.push(c);this.paramIds_.push(b.id);b=b.nextConnection&&b.nextConnection.targetBlock()}this.updateParams_();Blockly.Procedures.mutateCallers(this);a=a.getFieldValue("STATEMENTS");if(null!==a&&(a="TRUE"==a,this.hasStatements_!=a))if(a)this.setStatements_(!0),
|
|
150
142
|
Blockly.Mutator.reconnect(this.statementConnection_,this,"STACK"),this.statementConnection_=null;else{a=this.getInput("STACK").connection;if(this.statementConnection_=a.targetConnection)a=a.targetBlock(),a.unplug(),a.bumpNeighbours();this.setStatements_(!1)}},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(a,b){var c=this.workspace.getVariableById(a);
|
|
151
143
|
if(""==c.type){c=c.name;b=this.workspace.getVariableById(b);for(var d=!1,e=0;e<this.argumentVarModels_.length;e++)this.argumentVarModels_[e].getId()==a&&(this.arguments_[e]=b.name,this.argumentVarModels_[e]=b,d=!0);d&&(this.displayRenamedVar_(c,b.name),Blockly.Procedures.mutateCallers(this))}},updateVarName:function(a){for(var b=a.name,c=!1,d=0;d<this.argumentVarModels_.length;d++)if(this.argumentVarModels_[d].getId()==a.getId()){var e=this.arguments_[d];this.arguments_[d]=b;c=!0}c&&(this.displayRenamedVar_(e,
|
|
152
144
|
b),Blockly.Procedures.mutateCallers(this))},displayRenamedVar_:function(a,b){this.updateParams_();if(this.mutator&&this.mutator.isVisible())for(var c=this.mutator.workspace_.getAllBlocks(!1),d=0,e;e=c[d];d++)"procedures_mutatorarg"==e.type&&Blockly.Names.equals(a,e.getFieldValue("NAME"))&&e.setFieldValue(b,"NAME")},customContextMenu:function(a){if(!this.isInFlyout){var b={enabled:!this.options.debugMode},c=this.getFieldValue("NAME");b.text=Blockly.Msg.PROCEDURES_CREATE_DO.replace("%1",c);var d=Blockly.utils.xml.createElement("mutation");
|
|
153
145
|
d.setAttribute("name",c);for(c=0;c<this.arguments_.length;c++){var e=Blockly.utils.xml.createElement("arg");e.setAttribute("name",this.arguments_[c]);d.appendChild(e)}c=Blockly.utils.xml.createElement("block");c.setAttribute("type",this.callType_);c.appendChild(d);b.callback=Blockly.ContextMenu.callbackFactory(this,c);a.push(b);if(!this.isCollapsed())for(c=0;c<this.argumentVarModels_.length;c++)b={enabled:!this.inDebugWorkspace()},d=this.argumentVarModels_[c],b.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",
|
|
154
146
|
d.name),d=Blockly.Variables.generateVariableFieldDom(d),e=Blockly.utils.xml.createElement("block"),e.setAttribute("type","variables_get"),e.appendChild(d),b.callback=Blockly.ContextMenu.callbackFactory(this,e),a.push(b)}},callType_:"procedures_callnoreturn"};
|
|
155
|
-
Blockly.Blocks.procedures_defreturn={init:function(){var a=new Blockly.FieldTextInput(
|
|
156
|
-
this.workspace.options.parentWorkspace.options.comments)&&Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT);this.setStyle("procedure_blocks");this.setTooltip(Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.setStatements_(!0);this.statementConnection_=null},setStatements_:Blockly.Blocks.procedures_defnoreturn.setStatements_,
|
|
157
|
-
mutationToDom:Blockly.Blocks.procedures_defnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_defnoreturn.domToMutation,decompose:Blockly.Blocks.procedures_defnoreturn.decompose,compose:Blockly.Blocks.procedures_defnoreturn.compose,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:Blockly.Blocks.procedures_defnoreturn.getVars,getVarModels:Blockly.Blocks.procedures_defnoreturn.getVarModels,
|
|
158
|
-
updateVarName:Blockly.Blocks.procedures_defnoreturn.updateVarName,displayRenamedVar_:Blockly.Blocks.procedures_defnoreturn.displayRenamedVar_,customContextMenu:Blockly.Blocks.procedures_defnoreturn.customContextMenu,callType_:"procedures_callreturn"};
|
|
147
|
+
Blockly.Blocks.procedures_defreturn={init:function(){var a=Blockly.Procedures.findLegalName("",this);a=new Blockly.FieldTextInput(a,Blockly.Procedures.rename);a.setSpellcheck(!1);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFRETURN_TITLE).appendField(a,"NAME").appendField("","PARAMS");this.appendValueInput("RETURN").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"]));(this.workspace.options.comments||
|
|
148
|
+
this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT);this.setStyle("procedure_blocks");this.setTooltip(Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.setStatements_(!0);this.statementConnection_=null},setStatements_:Blockly.Blocks.procedures_defnoreturn.setStatements_,
|
|
149
|
+
updateParams_:Blockly.Blocks.procedures_defnoreturn.updateParams_,mutationToDom:Blockly.Blocks.procedures_defnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_defnoreturn.domToMutation,decompose:Blockly.Blocks.procedures_defnoreturn.decompose,compose:Blockly.Blocks.procedures_defnoreturn.compose,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:Blockly.Blocks.procedures_defnoreturn.getVars,getVarModels:Blockly.Blocks.procedures_defnoreturn.getVarModels,
|
|
150
|
+
renameVarById:Blockly.Blocks.procedures_defnoreturn.renameVarById,updateVarName:Blockly.Blocks.procedures_defnoreturn.updateVarName,displayRenamedVar_:Blockly.Blocks.procedures_defnoreturn.displayRenamedVar_,customContextMenu:Blockly.Blocks.procedures_defnoreturn.customContextMenu,callType_:"procedures_callreturn"};
|
|
159
151
|
Blockly.Blocks.procedures_mutatorcontainer={init:function(){this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE);this.appendStatementInput("STACK");this.appendDummyInput("STATEMENT_INPUT").appendField(Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS).appendField(new Blockly.FieldCheckbox("TRUE"),"STATEMENTS");this.setStyle("procedure_blocks");this.setTooltip(Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP);this.contextMenu=!1}};
|
|
160
152
|
Blockly.Blocks.procedures_mutatorarg={init:function(){var a=new Blockly.FieldTextInput(Blockly.Procedures.DEFAULT_ARG,this.validator_);a.oldShowEditorFn_=a.showEditor_;a.showEditor_=function(){this.createdVariables_=[];this.oldShowEditorFn_()};this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_MUTATORARG_TITLE).appendField(a,"NAME");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setStyle("procedure_blocks");this.setTooltip(Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP);this.contextMenu=
|
|
161
|
-
!1;a.onFinishEditing_=this.deleteIntermediateVars_;a.createdVariables_=[];a.onFinishEditing_("x")},validator_:function(a){var b=this.getSourceBlock(),c=Blockly.Mutator.findParentWs(b.workspace);a=a.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,"");if(!a)return null;for(var d=(b.workspace.targetWorkspace||b.workspace).getAllBlocks(!1),e=0;
|
|
162
|
-
a);b||(b=c.createVariable(a,""))&&this.createdVariables_&&this.createdVariables_.push(b);return a},deleteIntermediateVars_:function(a){var b=Blockly.Mutator.findParentWs(this.getSourceBlock().workspace);if(b)for(var c=0;c<this.createdVariables_.length;c++){var d=this.createdVariables_[c];d.name!=a&&b.deleteVariableById(d.getId())}}};
|
|
163
|
-
Blockly.Blocks.procedures_callnoreturn={init:function(){this.appendDummyInput("TOPROW").appendField(
|
|
153
|
+
!1;a.onFinishEditing_=this.deleteIntermediateVars_;a.createdVariables_=[];a.onFinishEditing_("x")},validator_:function(a){var b=this.getSourceBlock(),c=Blockly.Mutator.findParentWs(b.workspace);a=a.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,"");if(!a)return null;for(var d=(b.workspace.targetWorkspace||b.workspace).getAllBlocks(!1),e=a.toLowerCase(),f=0;f<d.length;f++)if(d[f].id!=this.getSourceBlock().id){var g=d[f].getFieldValue("NAME");if(g&&g.toLowerCase()==e)return null}if(b.isInFlyout)return a;
|
|
154
|
+
(b=c.getVariable(a,""))&&b.name!=a&&c.renameVariableById(b.getId(),a);b||(b=c.createVariable(a,""))&&this.createdVariables_&&this.createdVariables_.push(b);return a},deleteIntermediateVars_:function(a){var b=Blockly.Mutator.findParentWs(this.getSourceBlock().workspace);if(b)for(var c=0;c<this.createdVariables_.length;c++){var d=this.createdVariables_[c];d.name!=a&&b.deleteVariableById(d.getId())}}};
|
|
155
|
+
Blockly.Blocks.procedures_callnoreturn={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setStyle("procedure_blocks");this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.quarkConnections_={};this.quarkIds_=null;this.previousEnabledState_=!0},getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(a,b){Blockly.Names.equals(a,
|
|
164
156
|
this.getProcedureCall())&&(this.setFieldValue(b,"NAME"),this.setTooltip((this.outputConnection?Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP:Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",b)))},setProcedureParameters_:function(a,b){var c=Blockly.Procedures.getDefinition(this.getProcedureCall(),this.workspace),d=c&&c.mutator&&c.mutator.isVisible();d||(this.quarkConnections_={},this.quarkIds_=null);if(b)if(a.join("\n")==this.arguments_.join("\n"))this.quarkIds_=b;else{if(b.length!=a.length)throw RangeError("paramNames and paramIds must be the same length.");
|
|
165
157
|
this.setCollapsed(!1);this.quarkIds_||(this.quarkConnections_={},this.quarkIds_=[]);c=this.rendered;this.rendered=!1;for(var e=0;e<this.arguments_.length;e++){var f=this.getInput("ARG"+e);f&&(f=f.connection.targetConnection,this.quarkConnections_[this.quarkIds_[e]]=f,d&&f&&-1==b.indexOf(this.quarkIds_[e])&&(f.disconnect(),f.getSourceBlock().bumpNeighbours()))}this.arguments_=[].concat(a);this.argumentVarModels_=[];for(e=0;e<this.arguments_.length;e++)a=Blockly.Variables.getOrCreateVariablePackage(this.workspace,
|
|
166
158
|
null,this.arguments_[e],""),this.argumentVarModels_.push(a);this.updateShape_();if(this.quarkIds_=b)for(e=0;e<this.arguments_.length;e++)b=this.quarkIds_[e],b in this.quarkConnections_&&(f=this.quarkConnections_[b],Blockly.Mutator.reconnect(f,this,"ARG"+e)||delete this.quarkConnections_[b]);(this.rendered=c)&&this.render()}},updateShape_:function(){for(var a=0;a<this.arguments_.length;a++){var b=this.getField("ARGNAME"+a);if(b){Blockly.Events.disable();try{b.setValue(this.arguments_[a])}finally{Blockly.Events.enable()}}else b=
|
|
167
159
|
new Blockly.FieldLabel(this.arguments_[a]),this.appendValueInput("ARG"+a).setAlign(Blockly.ALIGN_RIGHT).appendField(b,"ARGNAME"+a).init()}for(;this.getInput("ARG"+a);)this.removeInput("ARG"+a),a++;if(a=this.getInput("TOPROW"))this.arguments_.length?this.getField("WITH")||(a.appendField(Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),a.init()):this.getField("WITH")&&a.removeField("WITH")},mutationToDom:function(){var a=Blockly.utils.xml.createElement("mutation");a.setAttribute("name",this.getProcedureCall());
|
|
168
|
-
for(var b=0;b<this.arguments_.length;b++){var c=Blockly.utils.xml.createElement("arg");c.setAttribute("name",this.arguments_[b]);a.appendChild(c)}return a},domToMutation:function(a){var b=a.getAttribute("name");this.renameProcedure(this.getProcedureCall(),b);b=[];for(var c=[],d=0,e;e=a.childNodes[d];d++)"arg"==e.nodeName.toLowerCase()&&(b.push(e.getAttribute("name")),c.push(e.getAttribute("paramId")));this.setProcedureParameters_(b,c)},
|
|
169
|
-
|
|
170
|
-
b.setAttribute("x",c.x+Blockly.SNAP_RADIUS*(this.RTL?-1:1));b.setAttribute("y",d);c=this.mutationToDom();b.appendChild(c);c=Blockly.utils.xml.createElement("field");c.setAttribute("name","NAME");c.appendChild(Blockly.utils.xml.createTextNode(
|
|
171
|
-
this.dispose(!0),Blockly.Events.setGroup(!1))):a.type==Blockly.Events.CHANGE&&"disabled"==a.element&&(b=this.getProcedureCall(),(b=Blockly.Procedures.getDefinition(b,this.workspace))&&b.id==a.blockId&&((b=Blockly.Events.getGroup())&&console.log("Saw an existing group while responding to a definition change"),Blockly.Events.setGroup(a.group),a.newValue?(this.previousEnabledState_=this.isEnabled(),
|
|
172
|
-
{enabled:!0};b.text=Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF;var c=this.getProcedureCall(),d=this.workspace;b.callback=function(){var a=Blockly.Procedures.getDefinition(c,d);a&&(d.centerOnBlock(a.id),a.select())};a.push(b)}},defType_:"procedures_defnoreturn"};
|
|
173
|
-
Blockly.Blocks.procedures_callreturn={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME");this.setOutput(!0);this.setStyle("procedure_blocks");this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL);this.arguments_=[];this.quarkConnections_={};this.quarkIds_=null;this.previousEnabledState_=!0},getProcedureCall:Blockly.Blocks.procedures_callnoreturn.getProcedureCall,renameProcedure:Blockly.Blocks.procedures_callnoreturn.renameProcedure,setProcedureParameters_:Blockly.Blocks.procedures_callnoreturn.setProcedureParameters_,
|
|
174
|
-
updateShape_:Blockly.Blocks.procedures_callnoreturn.updateShape_,mutationToDom:Blockly.Blocks.procedures_callnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_callnoreturn.domToMutation,getVarModels:Blockly.Blocks.procedures_callnoreturn.getVarModels,onchange:Blockly.Blocks.procedures_callnoreturn.onchange,customContextMenu:Blockly.Blocks.procedures_callnoreturn.customContextMenu,defType_:"procedures_defreturn"};
|
|
160
|
+
for(var b=0;b<this.arguments_.length;b++){var c=Blockly.utils.xml.createElement("arg");c.setAttribute("name",this.arguments_[b]);a.appendChild(c)}return a},domToMutation:function(a){var b=a.getAttribute("name");this.renameProcedure(this.getProcedureCall(),b);b=[];for(var c=[],d=0,e;e=a.childNodes[d];d++)"arg"==e.nodeName.toLowerCase()&&(b.push(e.getAttribute("name")),c.push(e.getAttribute("paramId")));this.setProcedureParameters_(b,c)},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},
|
|
161
|
+
onchange:function(a){if(this.workspace&&!this.workspace.isFlyout&&a.recordUndo)if(a.type==Blockly.Events.BLOCK_CREATE&&-1!=a.ids.indexOf(this.id)){var b=this.getProcedureCall();b=Blockly.Procedures.getDefinition(b,this.workspace);!b||b.type==this.defType_&&JSON.stringify(b.getVars())==JSON.stringify(this.arguments_)||(b=null);if(!b){Blockly.Events.setGroup(a.group);a=Blockly.utils.xml.createElement("xml");b=Blockly.utils.xml.createElement("block");b.setAttribute("type",this.defType_);var c=this.getRelativeToSurfaceXY(),
|
|
162
|
+
d=c.y+2*Blockly.SNAP_RADIUS;b.setAttribute("x",c.x+Blockly.SNAP_RADIUS*(this.RTL?-1:1));b.setAttribute("y",d);c=this.mutationToDom();b.appendChild(c);c=Blockly.utils.xml.createElement("field");c.setAttribute("name","NAME");d=this.getProcedureCall();d||(d=Blockly.Procedures.findLegalName("",this),this.renameProcedure("",d));c.appendChild(Blockly.utils.xml.createTextNode(d));b.appendChild(c);a.appendChild(b);Blockly.Xml.domToWorkspace(a,this.workspace);Blockly.Events.setGroup(!1)}}else a.type==Blockly.Events.BLOCK_DELETE?
|
|
163
|
+
(b=this.getProcedureCall(),b=Blockly.Procedures.getDefinition(b,this.workspace),b||(Blockly.Events.setGroup(a.group),this.dispose(!0),Blockly.Events.setGroup(!1))):a.type==Blockly.Events.CHANGE&&"disabled"==a.element&&(b=this.getProcedureCall(),(b=Blockly.Procedures.getDefinition(b,this.workspace))&&b.id==a.blockId&&((b=Blockly.Events.getGroup())&&console.log("Saw an existing group while responding to a definition change"),Blockly.Events.setGroup(a.group),a.newValue?(this.previousEnabledState_=this.isEnabled(),
|
|
164
|
+
this.setEnabled(!1)):this.setEnabled(this.previousEnabledState_),Blockly.Events.setGroup(b)))},customContextMenu:function(a){if(this.workspace.isMovable()){var b={enabled:!0};b.text=Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF;var c=this.getProcedureCall(),d=this.workspace;b.callback=function(){var a=Blockly.Procedures.getDefinition(c,d);a&&(d.centerOnBlock(a.id),a.select())};a.push(b)}},defType_:"procedures_defnoreturn"};
|
|
165
|
+
Blockly.Blocks.procedures_callreturn={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME");this.setOutput(!0);this.setStyle("procedure_blocks");this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.quarkConnections_={};this.quarkIds_=null;this.previousEnabledState_=!0},getProcedureCall:Blockly.Blocks.procedures_callnoreturn.getProcedureCall,renameProcedure:Blockly.Blocks.procedures_callnoreturn.renameProcedure,setProcedureParameters_:Blockly.Blocks.procedures_callnoreturn.setProcedureParameters_,
|
|
166
|
+
updateShape_:Blockly.Blocks.procedures_callnoreturn.updateShape_,mutationToDom:Blockly.Blocks.procedures_callnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_callnoreturn.domToMutation,getVars:Blockly.Blocks.procedures_callnoreturn.getVars,getVarModels:Blockly.Blocks.procedures_callnoreturn.getVarModels,onchange:Blockly.Blocks.procedures_callnoreturn.onchange,customContextMenu:Blockly.Blocks.procedures_callnoreturn.customContextMenu,defType_:"procedures_defreturn"};
|
|
175
167
|
Blockly.Blocks.procedures_ifreturn={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_IF);this.appendValueInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setStyle("procedure_blocks");this.setTooltip(Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP);this.setHelpUrl(Blockly.Msg.PROCEDURES_IFRETURN_HELPURL);this.hasReturnValue_=!0},mutationToDom:function(){var a=
|
|
176
168
|
Blockly.utils.xml.createElement("mutation");a.setAttribute("value",Number(this.hasReturnValue_));return a},domToMutation:function(a){this.hasReturnValue_=1==a.getAttribute("value");this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(a){if(this.workspace.isDragging&&!this.workspace.isDragging()){a=!1;var b=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(b.type)){a=!0;break}b=b.getSurroundParent()}while(b);
|
|
177
169
|
a?("procedures_defnoreturn"==b.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=b.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null),this.isInFlyout||this.setEnabled(!0)):(this.setWarningText(Blockly.Msg.PROCEDURES_IFRETURN_WARNING),
|
|
@@ -211,7 +203,8 @@ a&&!a.height&&!a.width?this.updateDisplay_():!this.getFieldValue("function_name"
|
|
|
211
203
|
Blockly.PXTBlockly.FunctionUtils.ensureIds_=function(){switch(this.type){case Blockly.FUNCTION_DEFINITION_BLOCK_TYPE:this.functionId_&&"null"!=this.functionId_||(this.functionId_=Blockly.utils.genUid());for(var a=0;a<this.arguments_.length;++a)this.arguments_[a].id||(this.arguments_[a].id=Blockly.utils.genUid());break;case Blockly.FUNCTION_CALL_OUTPUT_BLOCK_TYPE:case Blockly.FUNCTION_CALL_BLOCK_TYPE:if(a=Blockly.Functions.getDefinition(this.name_,this.workspace)){this.functionId_=a.getFunctionId();
|
|
212
204
|
var b=a.getArguments();for(a=0;a<this.arguments_.length;++a)for(var c=0;c<b.length;++c)if(b[c].name==this.arguments_[a].name){this.arguments_[a].id=b[c].id;break}}}};Blockly.PXTBlockly.FunctionUtils.getName=function(){return this.name_};Blockly.PXTBlockly.FunctionUtils.getFunctionId=function(){return this.functionId_};Blockly.PXTBlockly.FunctionUtils.getArguments=function(){return this.arguments_};
|
|
213
205
|
Blockly.PXTBlockly.FunctionUtils.setStatements_=function(a){this.hasStatements_!==a&&(a?this.appendStatementInput("STACK"):this.removeInput("STACK",!0),this.hasStatements_=a)};Blockly.PXTBlockly.FunctionUtils.updateDisplay_=function(){var a=this.rendered;this.rendered=!1;var b=this.disconnectOldBlocks_();this.removeValueInputs_();this.createAllInputs_(b);this.deleteShadows_(b);(this.rendered=a)&&!this.isInsertionMarker()&&this.initSvg&&(this.initSvg(),this.render())};
|
|
214
|
-
Blockly.PXTBlockly.FunctionUtils.disconnectOldBlocks_=function(){for(var a={},b=0,c;c=this.inputList[b];b++)if("STACK"!==c.name&&c.connection){var d=c.connection.targetBlock()
|
|
206
|
+
Blockly.PXTBlockly.FunctionUtils.disconnectOldBlocks_=function(){for(var a={},b=0,c;c=this.inputList[b];b++)if("STACK"!==c.name&&c.connection){var d=c.connection.targetBlock();d={shadow:c.connection.getShadowDom(),block:d};a[c.name]=d;c.connection.setShadowDom(null,!0);c.connection.targetConnection&&c.connection.disconnect()}return a};
|
|
207
|
+
Blockly.PXTBlockly.FunctionUtils.removeValueInputs_=function(){for(var a=[],b=0,c;c=this.inputList[b];b++)c.type==Blockly.INPUT_VALUE?c.dispose():a.push(c);this.inputList=a};
|
|
215
208
|
Blockly.PXTBlockly.FunctionUtils.createAllInputs_=function(a){var b=!1,c=!1,d=!1;this.inputList.forEach(function(a){"function_title"==a.name?b=!0:"function_name"==a.name?c=!0:"function_collapse"==a.name&&(d=!0)});if(!b){var e="";switch(this.type){case Blockly.FUNCTION_CALL_OUTPUT_BLOCK_TYPE:case Blockly.FUNCTION_CALL_BLOCK_TYPE:e=Blockly.Msg.FUNCTIONS_CALL_TITLE;break;case Blockly.FUNCTION_DEFINITION_BLOCK_TYPE:case Blockly.FUNCTION_DECLARATION_BLOCK_TYPE:e=Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE}this.appendDummyInput("function_title").appendField(e,
|
|
216
209
|
"function_title")}c?this.updateFunctionLabel_(this.getName()):this.addFunctionLabel_(this.getName());var f=this;this.arguments_.forEach(function(b){var c=f.appendValueInput(b.id);Blockly.Functions.isCustomType(b.type)?c.setCheck(b.type):c.setCheck(b.type.charAt(0).toUpperCase()+b.type.slice(1));f.isInsertionMarker()||f.populateArgument_(b,a,c)});d&&this.moveInputBefore("function_collapse",null);this.hasStatements_&&this.moveInputBefore("STACK",null)};
|
|
217
210
|
Blockly.PXTBlockly.FunctionUtils.deleteShadows_=function(a){if(a)for(var b in a){var c=a[b];c&&(c=c.block)&&c.isShadow()&&(c.dispose(),delete a[b])}};Blockly.PXTBlockly.FunctionUtils.updateLabelEditor_=function(a){Blockly.Events.disable();this.getField("function_name").setValue(a);Blockly.Events.enable()};Blockly.PXTBlockly.FunctionUtils.updateLabelField_=function(a){this.getField("function_name").setValue(a)};
|
|
@@ -221,7 +214,7 @@ Blockly.PXTBlockly.FunctionUtils.getShadowBlockInfoFromType_=function(a,b){switc
|
|
|
221
214
|
Blockly.PXTBlockly.FunctionUtils.attachShadow_=function(a,b){var c=Blockly.PXTBlockly.FunctionUtils.getShadowBlockInfoFromType_(b,this.workspace);b=c[0];var d=c[1];c=c[2];Blockly.Events.disable();var e=null;try{e=this.workspace.newBlock(b),e.setFieldValue(c,d),e.setShadow(!0),!this.isInsertionMarker()&&e.initSvg&&(e.initSvg(),e.render(!1))}finally{Blockly.Events.enable()}e&&e.outputConnection.connect(a.connection)};
|
|
222
215
|
Blockly.PXTBlockly.FunctionUtils.createArgumentReporter_=function(a){switch(a.type){case "boolean":var b="argument_reporter_boolean";break;case "number":b="argument_reporter_number";break;case "string":b="argument_reporter_string";break;case "Array":b="argument_reporter_array";break;default:b="argument_reporter_custom"}Blockly.Events.disable();try{var c="argument_reporter_custom"==b?Blockly.PXTBlockly.FunctionUtils.createCustomArgumentReporter(a.type,this.workspace):this.workspace.newBlock(b);c.setShadow(!0);
|
|
223
216
|
c.setFieldValue(a.name,"VALUE");!this.isInsertionMarker()&&c.initSvg&&(c.initSvg(),c.render(!1))}finally{Blockly.Events.enable()}return c};Blockly.PXTBlockly.FunctionUtils.createCollapseIcon_=function(){var a=this;if(a.workspace&&a.workspace.getRenderer){var b=a.workspace.getRenderer().getConstants().COLLAPSE_IMAGE_DATAURI;b&&a.appendDummyInput("function_collapse").appendField(new Blockly.FieldImage(b,24,24,"",function(){a.setCollapsed(!0)},!1))}};
|
|
224
|
-
Blockly.PXTBlockly.FunctionUtils.populateArgumentOnCaller_=function(a,b,c){var d=null,e=null;b&&a.id in b&&(e=b[a.id],d=e.block,e=e.shadow);b&&d?(b[c.name]=null,d.outputConnection.connect(c.connection),a=e||this.buildShadowDom_(a.type),c.connection.setShadowDom(a)):this.attachShadow_(c,a.type)};
|
|
217
|
+
Blockly.PXTBlockly.FunctionUtils.populateArgumentOnCaller_=function(a,b,c){var d=null,e=null;b&&a.id in b&&(e=b[a.id],d=e.block,e=e.shadow);b&&d&&d.outputConnection.canConnectWithReason(c.connection)===Blockly.Connection.CAN_CONNECT?(b[c.name]=null,d.outputConnection.connect(c.connection),a=e||this.buildShadowDom_(a.type),c.connection.setShadowDom(a)):(this.attachShadow_(c,a.type),d&&d.isShadow_&&d.setShadow(!1))};
|
|
225
218
|
Blockly.PXTBlockly.FunctionUtils.populateArgumentOnDefinition_=function(a,b,c){var d=null;b&&a.id in b&&(d=b[a.id].block);b&&d?(d.setFieldValue(a.name,"VALUE"),b[c.name]=null):d=this.createArgumentReporter_(a);c.connection.connect(d.outputConnection)};Blockly.PXTBlockly.FunctionUtils.populateArgumentOnDeclaration_=function(a,b,c){a=this.createArgumentEditor_(a.type,a.name);c.connection.connect(a.outputConnection)};
|
|
226
219
|
Blockly.PXTBlockly.FunctionUtils.createArgumentEditor_=function(a,b){Blockly.Events.disable();try{var c="";switch(a){case "boolean":c="argument_editor_boolean";break;case "number":c="argument_editor_number";break;case "string":c="argument_editor_string";break;case "Array":c="argument_editor_array";break;default:c="argument_editor_custom"}var d="argument_editor_custom"==c?Blockly.PXTBlockly.FunctionUtils.createCustomArgumentEditor(a,this.workspace):this.workspace.newBlock(c);d.setFieldValue(b,"TEXT");
|
|
227
220
|
d.setShadow(!0);!this.isInsertionMarker()&&d.initSvg&&(d.initSvg(),d.render(!1))}finally{Blockly.Events.enable()}return d};
|
|
@@ -305,26 +298,15 @@ c.setAttribute("name","VAR");c.appendChild(Blockly.utils.xml.createTextNode(e));
|
|
|
305
298
|
e),enabled:!this.inDebugWorkspace(),callback:Blockly.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY(this)},a.unshift(b),a.unshift(d)}};
|
|
306
299
|
Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_REPORTER_MIXIN={customContextMenu:function(a){if(!this.isCollapsed()){var b={text:Blockly.Msg.RENAME_VARIABLE,enabled:!this.inDebugWorkspace(),callback:Blockly.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY(this)};a.unshift(b);if(!this.isInFlyout){b=this.workspace.getVariablesOfType("");0<b.length&&a.unshift({separator:!0});for(var c=b.length-1;0<=c;c--){var d={enabled:!this.inDebugWorkspace()};d.text=b[c].name;d.callback=Blockly.Constants.Variables.VARIABLE_OPTION_CALLBACK_FACTORY(this,
|
|
307
300
|
d.text,b[c].getId());a.unshift(d)}}}}};Blockly.Constants.Variables.VARIABLE_OPTION_CALLBACK_FACTORY=function(a,b,c){return function(){var b=a.getField("VAR");b||console.log("Tried to get a variable field on the wrong type of block.");b.setValue(c)}};Blockly.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY=function(a){return function(){var b=a.workspace,c=a.getField("VAR").getVariable();Blockly.Variables.renameVariable(b,c)}};
|
|
308
|
-
Blockly.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY=function(a){return function(){var b=a.workspace,c=a.getField("VAR").getVariable();b.deleteVariableById(c.getId());b.refreshToolboxSelection()}};Blockly.Extensions.registerMixin("contextMenu_variableSetterGetter",Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN);Blockly.Extensions.registerMixin("contextMenu_variableReporter",Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_REPORTER_MIXIN)
|
|
309
|
-
|
|
310
|
-
Copyright 2017 Google LLC
|
|
311
|
-
|
|
312
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
313
|
-
you may not use this file except in compliance with the License.
|
|
314
|
-
You may obtain a copy of the License at
|
|
315
|
-
|
|
316
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
317
|
-
|
|
318
|
-
Unless required by applicable law or agreed to in writing, software
|
|
319
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
320
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
321
|
-
See the License for the specific language governing permissions and
|
|
322
|
-
limitations under the License.
|
|
323
|
-
*/
|
|
324
|
-
Blockly.Constants.VariablesDynamic={};Blockly.Constants.VariablesDynamic.HUE=310;
|
|
301
|
+
Blockly.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY=function(a){return function(){var b=a.workspace,c=a.getField("VAR").getVariable();b.deleteVariableById(c.getId());b.refreshToolboxSelection()}};Blockly.Extensions.registerMixin("contextMenu_variableSetterGetter",Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN);Blockly.Extensions.registerMixin("contextMenu_variableReporter",Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_REPORTER_MIXIN);Blockly.Constants.VariablesDynamic={};Blockly.Constants.VariablesDynamic.HUE=310;
|
|
325
302
|
Blockly.defineBlocksWithJsonArray([{type:"variables_get_dynamic",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_dynamic_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableDynamicSetterGetter"]},{type:"variables_set_dynamic",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",
|
|
326
303
|
name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_dynamic_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableDynamicSetterGetter"]}]);
|
|
327
304
|
Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN={customContextMenu:function(a){if(this.inDebugWorkspace())if(!this.isInFlyout){var b=this.getFieldValue("VAR");var c=this.workspace.getVariableById(b).type;if("variables_get_dynamic"==this.type){b="variables_set_dynamic";var d=Blockly.Msg.VARIABLES_GET_CREATE_SET}else b="variables_get_dynamic",d=Blockly.Msg.VARIABLES_SET_CREATE_GET;var e={enabled:0<this.workspace.remainingCapacity()},f=this.getField("VAR").getText();
|
|
328
305
|
e.text=d.replace("%1",f);d=Blockly.utils.xml.createElement("field");d.setAttribute("name","VAR");d.setAttribute("variabletype",c);d.appendChild(Blockly.utils.xml.createTextNode(f));f=Blockly.utils.xml.createElement("block");f.setAttribute("type",b);f.appendChild(d);e.callback=Blockly.ContextMenu.callbackFactory(this,f);a.push(e)}else if("variables_get_dynamic"==this.type||"variables_get_reporter_dynamic"==this.type)b={text:Blockly.Msg.RENAME_VARIABLE,enabled:!this.inDebugWorkspace(),callback:Blockly.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY(this)},
|
|
329
306
|
f=this.getField("VAR").getText(),e={text:Blockly.Msg.DELETE_VARIABLE.replace("%1",f),enabled:!this.inDebugWorkspace(),callback:Blockly.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY(this)},a.unshift(b),a.unshift(e)},onchange:function(a){a=this.getFieldValue("VAR");a=Blockly.Variables.getVariable(this.workspace,a);"variables_get_dynamic"==this.type?this.outputConnection.setCheck(a.type):this.getInput("VALUE").connection.setCheck(a.type)}};
|
|
330
307
|
Blockly.Constants.VariablesDynamic.RENAME_OPTION_CALLBACK_FACTORY=function(a){return function(){var b=a.workspace,c=a.getField("VAR").getVariable();Blockly.Variables.renameVariable(b,c)}};Blockly.Constants.VariablesDynamic.DELETE_OPTION_CALLBACK_FACTORY=function(a){return function(){var b=a.workspace,c=a.getField("VAR").getVariable();b.deleteVariableById(c.getId());b.refreshToolboxSelection()}};Blockly.Extensions.registerMixin("contextMenu_variableDynamicSetterGetter",Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN);
|
|
308
|
+
return Blockly.Blocks;
|
|
309
|
+
}));
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
//# sourceMappingURL=blocks_compressed.js.map
|
|
@@ -63,6 +63,8 @@ Blockly.Msg["DELETE_BLOCK"] = "Delete Block";
|
|
|
63
63
|
Blockly.Msg["DELETE_VARIABLE"] = "Delete the '%1' variable";
|
|
64
64
|
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "Delete %1 uses of the '%2' variable?";
|
|
65
65
|
Blockly.Msg["DELETE_X_BLOCKS"] = "Delete %1 Blocks";
|
|
66
|
+
Blockly.Msg["DIALOG_CANCEL"] = "Cancel";
|
|
67
|
+
Blockly.Msg["DIALOG_OK"] = "OK";
|
|
66
68
|
Blockly.Msg["DISABLE_BLOCK"] = "Disable Block";
|
|
67
69
|
Blockly.Msg["DUPLICATE_BLOCK"] = "Duplicate";
|
|
68
70
|
Blockly.Msg["DUPLICATE_COMMENT"] = "Duplicate Comment";
|
|
@@ -71,6 +73,8 @@ Blockly.Msg["EXPAND_ALL"] = "Expand Blocks";
|
|
|
71
73
|
Blockly.Msg["EXPAND_BLOCK"] = "Expand Block";
|
|
72
74
|
Blockly.Msg["EXTERNAL_INPUTS"] = "External Inputs";
|
|
73
75
|
Blockly.Msg["FUNCTIONS_CALL_TITLE"] = "call";
|
|
76
|
+
Blockly.Msg["FUNCTIONS_CREATE_CALL_OPTION"] = "Create 'call %1'";
|
|
77
|
+
Blockly.Msg["FUNCTIONS_DEFAULT_ARRAY_ARG_NAME"] = "list";
|
|
74
78
|
Blockly.Msg["FUNCTIONS_DEFAULT_BOOLEAN_ARG_NAME"] = "bool";
|
|
75
79
|
Blockly.Msg["FUNCTIONS_DEFAULT_CUSTOM_ARG_NAME"] = "arg";
|
|
76
80
|
Blockly.Msg["FUNCTIONS_DEFAULT_FUNCTION_NAME"] = "do_something";
|
|
@@ -85,19 +89,6 @@ Blockly.Msg["FUNCTION_WARNING_DUPLICATE_ARG"] = "Functions cannot use the same a
|
|
|
85
89
|
Blockly.Msg["FUNCTION_WARNING_EMPTY_NAME"] = "Function and argument names cannot be empty.";
|
|
86
90
|
Blockly.Msg["HELP"] = "Help";
|
|
87
91
|
Blockly.Msg["INLINE_INPUTS"] = "Inline Inputs";
|
|
88
|
-
Blockly.Msg["IOS_CANCEL"] = "Cancel";
|
|
89
|
-
Blockly.Msg["IOS_ERROR"] = "Error";
|
|
90
|
-
Blockly.Msg["IOS_OK"] = "OK";
|
|
91
|
-
Blockly.Msg["IOS_PROCEDURES_ADD_INPUT"] = "+ Add Input";
|
|
92
|
-
Blockly.Msg["IOS_PROCEDURES_ALLOW_STATEMENTS"] = "Allow statements";
|
|
93
|
-
Blockly.Msg["IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR"] = "This function has duplicate inputs.";
|
|
94
|
-
Blockly.Msg["IOS_PROCEDURES_INPUTS"] = "INPUTS";
|
|
95
|
-
Blockly.Msg["IOS_VARIABLES_ADD_BUTTON"] = "Add";
|
|
96
|
-
Blockly.Msg["IOS_VARIABLES_ADD_VARIABLE"] = "+ Add Variable";
|
|
97
|
-
Blockly.Msg["IOS_VARIABLES_DELETE_BUTTON"] = "Delete";
|
|
98
|
-
Blockly.Msg["IOS_VARIABLES_EMPTY_NAME_ERROR"] = "You can't use an empty variable name.";
|
|
99
|
-
Blockly.Msg["IOS_VARIABLES_RENAME_BUTTON"] = "Rename";
|
|
100
|
-
Blockly.Msg["IOS_VARIABLES_VARIABLE_NAME"] = "Variable name";
|
|
101
92
|
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list";
|
|
102
93
|
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "create empty list";
|
|
103
94
|
Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Returns a list, of length 0, containing no data records";
|
|
@@ -435,13 +426,13 @@ Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_
|
|
|
435
426
|
Blockly.Msg["TEXT_APPEND_VARIABLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
436
427
|
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
|
|
437
428
|
|
|
438
|
-
Blockly.Msg["
|
|
429
|
+
Blockly.Msg["LOGIC_HUE"] = "210";
|
|
439
430
|
Blockly.Msg["LOOPS_HUE"] = "120";
|
|
431
|
+
Blockly.Msg["MATH_HUE"] = "230";
|
|
432
|
+
Blockly.Msg["TEXTS_HUE"] = "160";
|
|
440
433
|
Blockly.Msg["LISTS_HUE"] = "260";
|
|
441
|
-
Blockly.Msg["
|
|
434
|
+
Blockly.Msg["COLOUR_HUE"] = "20";
|
|
442
435
|
Blockly.Msg["VARIABLES_HUE"] = "330";
|
|
443
436
|
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310";
|
|
444
|
-
Blockly.Msg["TEXTS_HUE"] = "160";
|
|
445
437
|
Blockly.Msg["PROCEDURES_HUE"] = "290";
|
|
446
|
-
Blockly.Msg["COLOUR_HUE"] = "20";
|
|
447
438
|
Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "item";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@metadata": {
|
|
3
3
|
"author": "Ellen Spertus <ellen.spertus@gmail.com>",
|
|
4
|
-
"lastupdated": "
|
|
4
|
+
"lastupdated": "2021-10-29 15:38:07.999934",
|
|
5
5
|
"locale": "en",
|
|
6
6
|
"messagedocumentation" : "qqq"
|
|
7
7
|
},
|
|
@@ -89,19 +89,6 @@
|
|
|
89
89
|
"CONTROLS_IF_IF_TOOLTIP": "Add, remove, or reorder sections to reconfigure this if block.",
|
|
90
90
|
"CONTROLS_IF_ELSEIF_TOOLTIP": "Add a condition to the if block.",
|
|
91
91
|
"CONTROLS_IF_ELSE_TOOLTIP": "Add a final, catch-all condition to the if block.",
|
|
92
|
-
"IOS_OK": "OK",
|
|
93
|
-
"IOS_CANCEL": "Cancel",
|
|
94
|
-
"IOS_ERROR": "Error",
|
|
95
|
-
"IOS_PROCEDURES_INPUTS": "INPUTS",
|
|
96
|
-
"IOS_PROCEDURES_ADD_INPUT": "+ Add Input",
|
|
97
|
-
"IOS_PROCEDURES_ALLOW_STATEMENTS": "Allow statements",
|
|
98
|
-
"IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR": "This function has duplicate inputs.",
|
|
99
|
-
"IOS_VARIABLES_ADD_VARIABLE": "+ Add Variable",
|
|
100
|
-
"IOS_VARIABLES_ADD_BUTTON": "Add",
|
|
101
|
-
"IOS_VARIABLES_RENAME_BUTTON": "Rename",
|
|
102
|
-
"IOS_VARIABLES_DELETE_BUTTON": "Delete",
|
|
103
|
-
"IOS_VARIABLES_VARIABLE_NAME": "Variable name",
|
|
104
|
-
"IOS_VARIABLES_EMPTY_NAME_ERROR": "You can't use an empty variable name.",
|
|
105
92
|
"LOGIC_COMPARE_HELPURL": "https://en.wikipedia.org/wiki/Inequality_(mathematics)",
|
|
106
93
|
"LOGIC_COMPARE_TOOLTIP_EQ": "Return true if both inputs equal each other.",
|
|
107
94
|
"LOGIC_COMPARE_TOOLTIP_NEQ": "Return true if both inputs are not equal to each other.",
|
|
@@ -402,6 +389,7 @@
|
|
|
402
389
|
"PROCEDURES_IFRETURN_HELPURL": "http://c2.com/cgi/wiki?GuardClause",
|
|
403
390
|
"PROCEDURES_IFRETURN_WARNING": "Warning: This block may be used only within a function definition.",
|
|
404
391
|
"FUNCTIONS_EDIT_OPTION": "Edit",
|
|
392
|
+
"FUNCTIONS_CREATE_CALL_OPTION": "Create 'call %1'",
|
|
405
393
|
"FUNCTIONS_GO_TO_DEFINITION_OPTION": "Go to definition",
|
|
406
394
|
"FUNCTIONS_CALL_TITLE": "call",
|
|
407
395
|
"FUNCTION_CREATE_NEW": "Create a Function",
|
|
@@ -413,8 +401,11 @@
|
|
|
413
401
|
"FUNCTIONS_DEFAULT_BOOLEAN_ARG_NAME": "bool",
|
|
414
402
|
"FUNCTIONS_DEFAULT_STRING_ARG_NAME": "text",
|
|
415
403
|
"FUNCTIONS_DEFAULT_NUMBER_ARG_NAME": "num",
|
|
404
|
+
"FUNCTIONS_DEFAULT_ARRAY_ARG_NAME": "list",
|
|
416
405
|
"FUNCTIONS_DEFAULT_CUSTOM_ARG_NAME": "arg",
|
|
417
406
|
"WORKSPACE_COMMENT_DEFAULT_TEXT": "Say something...",
|
|
418
407
|
"WORKSPACE_ARIA_LABEL": "Blockly Workspace",
|
|
419
|
-
"COLLAPSED_WARNINGS_WARNING": "Collapsed blocks contain warnings."
|
|
408
|
+
"COLLAPSED_WARNINGS_WARNING": "Collapsed blocks contain warnings.",
|
|
409
|
+
"DIALOG_OK": "OK",
|
|
410
|
+
"DIALOG_CANCEL": "Cancel"
|
|
420
411
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("blockly/core"));else if("function"==typeof define&&define.amd)define(["blockly/core"],t);else{var o="object"==typeof exports?t(require("blockly/core")):t(e.Blockly);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(function(e){return function(e){var t={};function o(r){if(t[r])return t[r].exports;var s=t[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)o.d(r,s,function(t){return e[t]}.bind(null,s));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/dist/",o(o.s=1)}([function(t,o){t.exports=e},function(e,t,o){"use strict";o.r(t),o.d(t,"Constants",(function(){return r})),o.d(t,"FlyoutCursor",(function(){return a})),o.d(t,"FlyoutCursorPluginInfo",(function(){return l})),o.d(t,"LineCursor",(function(){return d})),o.d(t,"LineCursorPluginInfo",(function(){return y})),o.d(t,"Navigation",(function(){return h})),o.d(t,"NavigationController",(function(){return S}));var r={};o.r(r),o.d(r,"STATE",(function(){return s})),o.d(r,"SHORTCUT_NAMES",(function(){return i})),o.d(r,"LOGGING_MSG_TYPE",(function(){return n}));
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2021 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
const s={WORKSPACE:"workspace",FLYOUT:"flyout",TOOLBOX:"toolbox"},i={PREVIOUS:"previous",NEXT:"next",IN:"in",OUT:"out",INSERT:"insert",MARK:"mark",DISCONNECT:"disconnect",TOOLBOX:"toolbox",EXIT:"exit",TOGGLE_KEYBOARD_NAV:"toggle_keyboard_nav",COPY:"keyboard_nav_copy",CUT:"keyboard_nav_cut",PASTE:"keyboard_nav_paste",DELETE:"keyboard_nav_delete",MOVE_WS_CURSOR_UP:"workspace_up",MOVE_WS_CURSOR_DOWN:"workspace_down",MOVE_WS_CURSOR_LEFT:"workspace_left",MOVE_WS_CURSOR_RIGHT:"workspace_right"},n={ERROR:"error",WARN:"warn",LOG:"log"};var c=o(0);
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2021 Google LLC
|
|
11
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
12
|
+
*/class a extends c.Cursor{constructor(){super()}next(){const e=this.getCurNode();if(!e)return null;const t=e.next();return t&&this.setCurNode(t),t}in(){return null}prev(){const e=this.getCurNode();if(!e)return null;const t=e.prev();return t&&this.setCurNode(t),t}out(){return null}}const u=c.registry.Type.CURSOR;c.registry.register(u,"FlyoutCursor",a);const l={[u]:"FlyoutCursor"};
|
|
13
|
+
/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright 2020 Google LLC
|
|
16
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
*/class d extends c.BasicCursor{constructor(){super()}next(){const e=this.getCurNode();if(!e)return null;let t=this.getNextNode_(e,this.validLineNode);return t&&(t.getType()==c.ASTNode.types.INPUT||t.getType()==c.ASTNode.types.NEXT)&&t.getLocation().targetBlock()&&(t=this.getNextNode_(t,this.validLineNode)),t&&this.setCurNode(t),t}in(){const e=this.getCurNode();if(!e)return null;const t=this.getNextNode_(e,this.validInLineNode);return t&&this.setCurNode(t),t}prev(){const e=this.getCurNode();if(!e)return null;let t=this.getPreviousNode_(e,this.validLineNode);return t&&(t.getType()==c.ASTNode.types.INPUT||t.getType()==c.ASTNode.types.NEXT)&&t.getLocation().targetBlock()&&(t=this.getPreviousNode_(t,this.validLineNode)),t&&this.setCurNode(t),t}out(){const e=this.getCurNode();if(!e)return null;const t=this.getPreviousNode_(e,this.validInLineNode);return t&&this.setCurNode(t),t}validLineNode(e){if(!e)return!1;let t=!1;const o=e.getLocation(),r=e&&e.getType();return r==c.ASTNode.types.BLOCK?null===o.outputConnection&&(t=!0):(r==c.ASTNode.types.INPUT&&o.type==c.NEXT_STATEMENT||r==c.ASTNode.types.NEXT)&&(t=!0),t}validInLineNode(e){if(!e)return!1;let t=!1;const o=e.getLocation(),r=e&&e.getType();return(r==c.ASTNode.types.FIELD||r==c.ASTNode.types.INPUT&&o.type==c.INPUT_VALUE)&&(t=!0),t}}const g=c.registry.Type.CURSOR;c.registry.register(g,"LineCursor",d);const y={[g]:"LineCursor"};
|
|
18
|
+
/**
|
|
19
|
+
* @license
|
|
20
|
+
* Copyright 2021 Google LLC
|
|
21
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22
|
+
*/class h{constructor(){this.workspaceStates={},this.loggingCallback=null,this.WS_MOVE_DISTANCE=40,this.MARKER_NAME="local_marker_1",this.DEFAULT_WS_COORDINATE=new c.utils.Coordinate(100,100),this.WS_COORDINATE_ON_DELETE=new c.utils.Coordinate(100,100),this.wsChangeWrapper=this.workspaceChangeListener.bind(this),this.flyoutChangeWrapper=this.flyoutChangeListener.bind(this),this.workspaces=[]}addWorkspace(e){this.workspaces.push(e);const t=e.getFlyout();e.getMarkerManager().registerMarker(this.MARKER_NAME,new c.Marker),e.addChangeListener(this.wsChangeWrapper),t&&this.addFlyout(t)}removeWorkspace(e){const t=this.workspaces.indexOf(e),o=e.getFlyout();e.getCursor()&&this.disableKeyboardAccessibility(e),t>-1&&this.workspaces.splice(t,1),e.getMarkerManager()&&e.getMarkerManager().unregisterMarker(this.MARKER_NAME),e.removeChangeListener(this.wsChangeWrapper),o&&this.removeFlyout(o)}setState(e,t){this.workspaceStates[e.id]=t}getState(e){return this.workspaceStates[e.id]}getMarker(e){return e.getMarker(this.MARKER_NAME)}addFlyout(e){const t=e.getWorkspace();t.addChangeListener(this.flyoutChangeWrapper);const o=c.registry.getClass(u,"FlyoutCursor");t.getMarkerManager().setCursor(new o)}removeFlyout(e){e.getWorkspace().removeChangeListener(this.flyoutChangeWrapper)}workspaceChangeListener(e){const t=c.Workspace.getById(e.workspaceId);if(t&&t.keyboardAccessibilityMode)switch(e.type){case c.Events.DELETE:this.handleBlockDeleteByDrag(t,e);break;case c.Events.BLOCK_CHANGE:"mutation"===e.element&&this.handleBlockMutation(t,e);break;case c.Events.CLICK:this.handleWorkspaceClick(t,e);break;case c.Events.TOOLBOX_ITEM_SELECT:this.handleToolboxCategoryClick(t,e);break;case c.Events.BLOCK_CREATE:this.handleBlockCreate(t,e)}}flyoutChangeListener(e){const t=c.Workspace.getById(e.workspaceId),o=t.targetWorkspace,r=o.getFlyout();if(o&&o.keyboardAccessibilityMode&&!r.autoClose)if(e.type===c.Events.CLICK&&"block"===e.targetType){const r=t.getBlockById(e.blockId);this.handleBlockClickInFlyout(o,r)}else if(e.type===c.Events.SELECTED){const r=t.getBlockById(e.newElementId);this.handleBlockClickInFlyout(o,r)}}handleBlockCreate(e,t){this.getState(e)===s.FLYOUT&&(this.resetFlyout(e,!!e.getToolbox()),this.setState(e,s.WORKSPACE))}handleBlockMutation(e,t){const o=t.blockId,r=e.getCursor();if(r){const e=r.getCurNode(),t=e?e.getSourceBlock():null;t&&t.id===o&&r.setCurNode(c.ASTNode.createBlockNode(t))}}handleWorkspaceClick(e,t){this.getState(e)!==s.WORKSPACE&&(this.resetFlyout(e,!!e.getToolbox()),this.setState(e,s.WORKSPACE))}handleToolboxCategoryClick(e,t){const o=this.getState(e);t.newItem&&o!==s.TOOLBOX?this.focusToolbox(e):t.newItem||(this.resetFlyout(e,!!e.getToolbox()),this.setState(e,s.WORKSPACE))}handleBlockDeleteByDrag(e,t){const o=t.blockId,r=t.ids,s=e.getCursor();if(!s||!s.getCurNode()||!s.getCurNode().getSourceBlock())return;const i=s.getCurNode().getSourceBlock();(i.id===o||r.indexOf(i.id)>-1)&&s.setCurNode(c.ASTNode.createWorkspaceNode(e,this.WS_COORDINATE_ON_DELETE))}handleBlockClickInFlyout(e,t){t&&(t.isShadow()&&(t=t.getParent()),this.getFlyoutCursor(e).setCurNode(c.ASTNode.createStackNode(t)),this.setState(e,s.FLYOUT))}moveCursorOnBlockDelete(e,t){if(!e||!e.getCursor())return;const o=e.getCursor(),r=o.getCurNode(),s=r?r.getSourceBlock():null;if(s===t)if(s.getParent()){const e=s.previousConnection||s.outputConnection;e&&o.setCurNode(c.ASTNode.createConnectionNode(e.targetConnection))}else o.setCurNode(c.ASTNode.createWorkspaceNode(s.workspace,s.getRelativeToSurfaceXY()));else s&&t.getChildren(!1).indexOf(s)>-1&&o.setCurNode(c.ASTNode.createWorkspaceNode(s.workspace,s.getRelativeToSurfaceXY()))}focusToolbox(e){const t=e.getToolbox();if(t&&(this.setState(e,s.TOOLBOX),this.resetFlyout(e,!1),this.getMarker(e).getCurNode()||this.markAtCursor(e),!t.getSelectedItem())){const e=t.getToolboxItems();for(let o,r=0;o=e[r];r++)if(o.isSelectable()){t.selectItemByPosition(r);break}}}focusFlyout(e){const t=e.getFlyout();if(this.setState(e,s.FLYOUT),this.getMarker(e).getCurNode()||this.markAtCursor(e),t&&t.getWorkspace()){const o=t.getWorkspace().getTopBlocks(!0);if(o.length>0){const t=c.ASTNode.createStackNode(o[0]);this.getFlyoutCursor(e).setCurNode(t)}}}focusWorkspace(e){c.hideChaff();const t=!!e.getToolbox();this.resetFlyout(e,t),this.setState(e,s.WORKSPACE),this.setCursorOnWorkspaceFocus(e)}setCursorOnWorkspaceFocus(e){const t=e.getTopBlocks(!0),o=e.getCursor(),r=new c.utils.Coordinate(this.DEFAULT_WS_COORDINATE.x/e.scale,this.DEFAULT_WS_COORDINATE.y/e.scale);if(t.length>0)o.setCurNode(c.ASTNode.createTopNode(t[0]));else{const t=c.ASTNode.createWorkspaceNode(e,r);o.setCurNode(t)}}getFlyoutCursor(e){const t=e.getFlyout();return t?t.getWorkspace().getCursor():null}insertFromFlyout(e){const t=this.createNewBlock(e);if(!t)return;const o=this.getMarker(e).getCurNode();this.tryToConnectMarkerAndCursor(e,o,c.ASTNode.createBlockNode(t))||this.warn("Something went wrong while inserting a block from the flyout."),this.focusWorkspace(e),e.getCursor().setCurNode(c.ASTNode.createTopNode(t)),this.removeMark(e)}createNewBlock(e){const t=e.getFlyout();if(!t||!t.isVisible())return this.warn("Trying to insert from the flyout when the flyout does not exist or is not visible"),null;const o=this.getFlyoutCursor(e).getCurNode().getLocation();if(!o.isEnabled())return this.warn("Can't insert a disabled block."),null;const r=t.createBlock(o);return r.render(),r.setConnectionTracking(!0),r}resetFlyout(e,t){this.getFlyoutCursor(e)&&(this.getFlyoutCursor(e).hide(),t&&e.getFlyout().hide())}connectMarkerAndCursor(e){const t=this.getMarker(e).getCurNode(),o=e.getCursor().getCurNode();return!(!t||!o)&&this.tryToConnectMarkerAndCursor(e,t,o)}tryToConnectMarkerAndCursor(e,t,o){if(!this.logConnectionWarning(t,o))return!1;const r=t.getType(),s=o.getType(),i=o.getLocation(),n=t.getLocation();if(t.isConnection()&&o.isConnection()){const e=i,t=n;return this.connect(e,t)}if(t.isConnection()&&(s==c.ASTNode.types.BLOCK||s==c.ASTNode.types.STACK)){const e=i,t=n;return this.insertBlock(e,t)}if(r==c.ASTNode.types.WORKSPACE){const e=o?o.getSourceBlock():null;return this.moveBlockToWorkspace(e,t)}return this.warn("Unexpected state in tryToConnectMarkerAndCursor."),!1}logConnectionWarning(e,t){if(!e)return this.warn("Cannot insert with no marked node."),!1;if(!t)return this.warn("Cannot insert with no cursor node."),!1;const o=e.getType(),r=t.getType();return o==c.ASTNode.types.FIELD?(this.warn("Should not have been able to mark a field."),!1):o==c.ASTNode.types.BLOCK?(this.warn("Should not have been able to mark a block."),!1):o==c.ASTNode.types.STACK?(this.warn("Should not have been able to mark a stack."),!1):r==c.ASTNode.types.FIELD?(this.warn("Cannot attach a field to anything else."),!1):r!=c.ASTNode.types.WORKSPACE||(this.warn("Cannot attach a workspace to anything else."),!1)}moveBlockToWorkspace(e,t){return!!e&&(e.isShadow()?(this.warn("Cannot move a shadow block to the workspace."),!1):(e.getParent()&&e.unplug(!1),e.moveTo(t.getWsCoordinate()),!0))}disconnectChild(e,t){const o=e.getSourceBlock(),r=t.getSourceBlock();let s;o.getRootBlock()===r.getRootBlock()&&(o.getDescendants(!1).indexOf(r)>-1?(s=this.getInferiorConnection(t),s&&s.disconnect()):(s=this.getInferiorConnection(e),s&&s.disconnect()))}connect(e,t){if(!e||!t)return!1;const o=this.getInferiorConnection(e),r=this.getSuperiorConnection(t),s=this.getSuperiorConnection(e),i=this.getInferiorConnection(t);if(o&&r&&this.moveAndConnect(o,r))return!0;if(s&&i&&this.moveAndConnect(s,i))return!0;if(this.moveAndConnect(e,t))return!0;{const o=e.getConnectionChecker(),r=o.canConnectWithReason(e,t,!1);return this.warn("Connection failed with error: "+o.getErrorMessage(r,e,t)),!1}}getInferiorConnection(e){const t=e.getSourceBlock();return e.isSuperior()?t.previousConnection?t.previousConnection:t.outputConnection?t.outputConnection:null:e}getSuperiorConnection(e){return e.isSuperior()?e:e.targetConnection?e.targetConnection:null}moveAndConnect(e,t){if(!e||!t)return!1;const o=e.getSourceBlock();if(e.getConnectionChecker().canConnect(e,t,!1)&&!t.getSourceBlock().isShadow()){if(this.disconnectChild(e,t),!t.isSuperior()){o.getRootBlock().positionNearConnection(e,t)}return t.connect(e),!0}return!1}insertBlock(e,t){switch(t.type){case c.PREVIOUS_STATEMENT:if(this.connect(e.nextConnection,t))return!0;break;case c.NEXT_STATEMENT:if(this.connect(e.previousConnection,t))return!0;break;case c.INPUT_VALUE:if(this.connect(e.outputConnection,t))return!0;break;case c.OUTPUT_VALUE:for(let o=0;o<e.inputList.length;o++){const r=e.inputList[o].connection;if(r&&r.type===c.INPUT_VALUE&&this.connect(r,t))return!0}if(e.outputConnection&&this.connect(e.outputConnection,t))return!0}return this.warn("This block can not be inserted at the marked location."),!1}disconnectBlocks(e){const t=e.getCursor().getCurNode();if(!t.isConnection())return void this.log("Cannot disconnect blocks when the cursor is not on a connection");const o=t.getLocation();if(!o.isConnected())return void this.log("Cannot disconnect unconnected connection");const r=o.isSuperior()?o:o.targetConnection,s=o.isSuperior()?o.targetConnection:o;if(s.getSourceBlock().isShadow())return void this.log("Cannot disconnect a shadow block");r.disconnect(),s.bumpAwayFrom(r),r.getSourceBlock().getRootBlock().bringToFront();const i=c.ASTNode.createConnectionNode(r);e.getCursor().setCurNode(i)}markAtCursor(e){this.getMarker(e).setCurNode(e.getCursor().getCurNode())}removeMark(e){const t=this.getMarker(e);t.setCurNode(null),t.hide()}enableKeyboardAccessibility(e){this.workspaces.indexOf(e)>-1&&!e.keyboardAccessibilityMode&&(e.keyboardAccessibilityMode=!0,this.focusWorkspace(e))}disableKeyboardAccessibility(e){this.workspaces.indexOf(e)>-1&&e.keyboardAccessibilityMode&&(e.keyboardAccessibilityMode=!1,e.getCursor().hide(),this.getMarker(e).hide(),this.getFlyoutCursor(e)&&this.getFlyoutCursor(e).hide())}log(e){this.loggingCallback?this.loggingCallback(n.LOG,e):console.log(e)}warn(e){this.loggingCallback?this.loggingCallback(n.WARN,e):console.warn(e)}error(e){this.loggingCallback?this.loggingCallback(n.ERROR,e):console.error(e)}moveWSCursor(e,t,o){const r=e.getCursor(),s=e.getCursor().getCurNode();if(s.getType()!==c.ASTNode.types.WORKSPACE)return!1;const i=s.getWsCoordinate(),n=t*this.WS_MOVE_DISTANCE+i.x,a=o*this.WS_MOVE_DISTANCE+i.y;return r.setCurNode(c.ASTNode.createWorkspaceNode(e,new c.utils.Coordinate(n,a))),!0}handleEnterForWS(e){const t=e.getCursor().getCurNode(),o=t.getType();o==c.ASTNode.types.FIELD?t.getLocation().showEditor():t.isConnection()||o==c.ASTNode.types.WORKSPACE?this.markAtCursor(e):o==c.ASTNode.types.BLOCK?this.warn("Cannot mark a block."):o==c.ASTNode.types.STACK&&this.warn("Cannot mark a stack.")}paste(){if(!c.clipboardXml_)return!1;let e=c.clipboardSource_,t=!1;if(e.isFlyout&&(e=e.targetWorkspace),c.clipboardTypeCounts_&&e.isCapacityAvailable(c.clipboardTypeCounts_)){c.Events.setGroup(!0);const o=c.Xml.domToBlock(c.clipboardXml_,e);o&&(this.insertPastedBlock(e,o),c.Events.isEnabled()&&!o.isShadow()&&c.Events.fire(new c.Events.BlockCreate(o)),t=!0),c.Events.setGroup(!1)}return t}insertPastedBlock(e,t){let o=!1;const r=e.getMarker(this.MARKER_NAME).getCurNode();return r&&(o=this.tryToConnectMarkerAndCursor(e,r,c.ASTNode.createBlockNode(t))),o}dispose(){for(const e of this.workspaces)this.removeWorkspace(e)}}
|
|
23
|
+
/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2021 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
27
|
+
*/const C=c.Gesture.prototype.doWorkspaceClick_;c.Gesture.prototype.doWorkspaceClick_=function(e){C.call(this,e);const t=this.creatorWorkspace_;if(e.shiftKey&&t.keyboardAccessibilityMode){const o=new c.utils.Coordinate(e.clientX,e.clientY),r=c.utils.screenToWsCoordinates(t,o),s=c.ASTNode.createWorkspaceNode(t,r);t.getCursor().setCurNode(s)}};const p=c.Gesture.prototype.doBlockClick_;c.Gesture.prototype.doBlockClick_=function(e){p.call(this,e),!this.targetBlock_.isInFlyout&&this.mostRecentEvent_.shiftKey&&this.targetBlock_.workspace.keyboardAccessibilityMode&&this.creatorWorkspace_.getCursor().setCurNode(c.ASTNode.createTopNode(this.targetBlock_))};
|
|
28
|
+
/**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2021 Google LLC
|
|
31
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
32
|
+
*/
|
|
33
|
+
class S{constructor(e){this.navigation=e||new h}init(){this.addShortcutHandlers(),this.registerDefaults()}addShortcutHandlers(){c.FieldColour&&(c.FieldColour.prototype.onShortcut=this.fieldColourHandler),c.FieldDropdown&&(c.FieldDropdown.prototype.onShortcut=this.fieldDropdownHandler),c.Toolbox&&(c.Toolbox.prototype.onShortcut=this.toolboxHandler)}removeShortcutHandlers(){c.FieldColour&&(c.FieldColour.prototype.onShortcut=null),c.FieldDropdown&&(c.FieldDropdown.prototype.onShortcut=null),c.Toolbox&&(c.Toolbox.prototype.onShortcut=null)}fieldColourHandler(e){if(this.picker_)switch(e.name){case i.PREVIOUS:return this.moveHighlightBy_(0,-1),!0;case i.NEXT:return this.moveHighlightBy_(0,1),!0;case i.OUT:return this.moveHighlightBy_(-1,0),!0;case i.IN:return this.moveHighlightBy_(1,0),!0;default:return!1}return c.FieldColour.superClass_.onShortcut.call(this,e)}fieldDropdownHandler(e){if(this.menu_)switch(e.name){case i.PREVIOUS:return this.menu_.highlightPrevious(),!0;case i.NEXT:return this.menu_.highlightNext(),!0;default:return!1}return c.FieldDropdown.superClass_.onShortcut.call(this,e)}toolboxHandler(e){if(!this.selectedItem_)return!1;switch(e.name){case i.PREVIOUS:return this.selectPrevious_();case i.OUT:return this.selectParent_();case i.NEXT:return this.selectNext_();case i.IN:return this.selectChild_();default:return!1}}addWorkspace(e){this.navigation.addWorkspace(e)}removeWorkspace(e){this.navigation.removeWorkspace(e)}enable(e){this.navigation.enableKeyboardAccessibility(e)}disable(e){this.navigation.disableKeyboardAccessibility(e)}fieldShortcutHandler(e,t){const o=e.getCursor();if(!o||!o.getCurNode())return;const r=o.getCurNode();return r.getType()===c.ASTNode.types.FIELD&&r.getLocation().onShortcut(t)}registerPrevious(){const e={name:i.PREVIOUS,preconditionFn:e=>e.keyboardAccessibilityMode,callback:(e,t,o)=>{const r=e.getFlyout(),i=e.getToolbox();let n=!1;switch(this.navigation.getState(e)){case s.WORKSPACE:return n=this.fieldShortcutHandler(e,o),n||(e.getCursor().prev(),n=!0),n;case s.FLYOUT:return n=this.fieldShortcutHandler(e,o),n||(r.getWorkspace().getCursor().prev(),n=!0),n;case s.TOOLBOX:return!(!i||"function"!=typeof i.onShortcut)&&i.onShortcut(o);default:return!1}}};c.ShortcutRegistry.registry.register(e),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.W,e.name)}registerToggleKeyboardNav(){const e={name:i.TOGGLE_KEYBOARD_NAV,callback:e=>(e.keyboardAccessibilityMode?this.navigation.disableKeyboardAccessibility(e):this.navigation.enableKeyboardAccessibility(e),!0)};c.ShortcutRegistry.registry.register(e);const t=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.K,[c.utils.KeyCodes.CTRL,c.utils.KeyCodes.SHIFT]);c.ShortcutRegistry.registry.addKeyMapping(t,e.name)}registerOut(){const e={name:i.OUT,preconditionFn:e=>e.keyboardAccessibilityMode,callback:(e,t,o)=>{const r=e.getToolbox();let i=!1;switch(this.navigation.getState(e)){case s.WORKSPACE:return i=this.fieldShortcutHandler(e,o),i||(e.getCursor().out(),i=!0),i;case s.FLYOUT:return this.navigation.focusToolbox(e),!0;case s.TOOLBOX:return!(!r||"function"!=typeof r.onShortcut)&&r.onShortcut(o);default:return!1}}};c.ShortcutRegistry.registry.register(e),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.A,e.name)}registerNext(){const e={name:i.NEXT,preconditionFn:e=>e.keyboardAccessibilityMode,callback:(e,t,o)=>{const r=e.getToolbox(),i=e.getFlyout();let n=!1;switch(this.navigation.getState(e)){case s.WORKSPACE:return n=this.fieldShortcutHandler(e,o),n||(e.getCursor().next(),n=!0),n;case s.FLYOUT:return n=this.fieldShortcutHandler(e,o),n||(i.getWorkspace().getCursor().next(),n=!0),n;case s.TOOLBOX:return!(!r||"function"!=typeof r.onShortcut)&&r.onShortcut(o);default:return!1}}};c.ShortcutRegistry.registry.register(e),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.S,e.name)}registerIn(){const e={name:i.IN,preconditionFn:e=>e.keyboardAccessibilityMode,callback:(e,t,o)=>{const r=e.getToolbox();let i=!1;switch(this.navigation.getState(e)){case s.WORKSPACE:return i=this.fieldShortcutHandler(e,o),i||(e.getCursor().in(),i=!0),i;case s.TOOLBOX:return i=!(!r||"function"!=typeof r.onShortcut)&&r.onShortcut(o),i||this.navigation.focusFlyout(e),!0;default:return!1}}};c.ShortcutRegistry.registry.register(e),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.D,e.name)}registerInsert(){const e={name:i.INSERT,preconditionFn:e=>e.keyboardAccessibilityMode&&!e.options.readOnly,callback:e=>{switch(this.navigation.getState(e)){case s.WORKSPACE:return this.navigation.connectMarkerAndCursor(e);default:return!1}}};c.ShortcutRegistry.registry.register(e),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.I,e.name)}registerMark(){const e={name:i.MARK,preconditionFn:e=>e.keyboardAccessibilityMode&&!e.options.readOnly,callback:e=>{switch(this.navigation.getState(e)){case s.WORKSPACE:return this.navigation.handleEnterForWS(e),!0;case s.FLYOUT:return this.navigation.insertFromFlyout(e),!0;default:return!1}}};c.ShortcutRegistry.registry.register(e),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.ENTER,e.name)}registerDisconnect(){const e={name:i.DISCONNECT,preconditionFn:e=>e.keyboardAccessibilityMode&&!e.options.readOnly,callback:e=>{switch(this.navigation.getState(e)){case s.WORKSPACE:return this.navigation.disconnectBlocks(e),!0;default:return!1}}};c.ShortcutRegistry.registry.register(e),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.X,e.name)}registerToolboxFocus(){const e={name:i.TOOLBOX,preconditionFn:e=>e.keyboardAccessibilityMode&&!e.options.readOnly,callback:e=>{switch(this.navigation.getState(e)){case s.WORKSPACE:return e.getToolbox()?this.navigation.focusToolbox(e):this.navigation.focusFlyout(e),!0;default:return!1}}};c.ShortcutRegistry.registry.register(e),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.T,e.name)}registerExit(){const e={name:i.EXIT,preconditionFn:e=>e.keyboardAccessibilityMode,callback:e=>{switch(this.navigation.getState(e)){case s.FLYOUT:case s.TOOLBOX:return this.navigation.focusWorkspace(e),!0;default:return!1}}};c.ShortcutRegistry.registry.register(e,!0),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.ESC,e.name,!0),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.E,e.name,!0)}registerWorkspaceMoveLeft(){const e={name:i.MOVE_WS_CURSOR_LEFT,preconditionFn:e=>e.keyboardAccessibilityMode&&!e.options.readOnly,callback:e=>this.navigation.moveWSCursor(e,-1,0)};c.ShortcutRegistry.registry.register(e);const t=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.A,[c.utils.KeyCodes.SHIFT]);c.ShortcutRegistry.registry.addKeyMapping(t,e.name)}registerWorkspaceMoveRight(){const e={name:i.MOVE_WS_CURSOR_RIGHT,preconditionFn:e=>e.keyboardAccessibilityMode&&!e.options.readOnly,callback:e=>this.navigation.moveWSCursor(e,1,0)};c.ShortcutRegistry.registry.register(e);const t=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.D,[c.utils.KeyCodes.SHIFT]);c.ShortcutRegistry.registry.addKeyMapping(t,e.name)}registerWorkspaceMoveUp(){const e={name:i.MOVE_WS_CURSOR_UP,preconditionFn:e=>e.keyboardAccessibilityMode&&!e.options.readOnly,callback:e=>this.navigation.moveWSCursor(e,0,-1)};c.ShortcutRegistry.registry.register(e);const t=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.W,[c.utils.KeyCodes.SHIFT]);c.ShortcutRegistry.registry.addKeyMapping(t,e.name)}registerWorkspaceMoveDown(){const e={name:i.MOVE_WS_CURSOR_DOWN,preconditionFn:e=>e.keyboardAccessibilityMode&&!e.options.readOnly,callback:e=>this.navigation.moveWSCursor(e,0,1)};c.ShortcutRegistry.registry.register(e);const t=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.S,[c.utils.KeyCodes.SHIFT]);c.ShortcutRegistry.registry.addKeyMapping(t,e.name)}registerCopy(){const e={name:i.COPY,preconditionFn:e=>{if(e.keyboardAccessibilityMode&&!e.options.readOnly){const t=e.getCursor().getCurNode();if(t&&t.getSourceBlock()){const e=t.getSourceBlock();return!c.Gesture.inProgress()&&e&&e.isDeletable()&&e.isMovable()}}return!1},callback:e=>{const t=e.getCursor().getCurNode().getSourceBlock();c.hideChaff(),c.copy(t)}};c.ShortcutRegistry.registry.register(e);const t=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.C,[c.utils.KeyCodes.CTRL]);c.ShortcutRegistry.registry.addKeyMapping(t,e.name,!0);const o=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.C,[c.utils.KeyCodes.ALT]);c.ShortcutRegistry.registry.addKeyMapping(o,e.name,!0);const r=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.C,[c.utils.KeyCodes.META]);c.ShortcutRegistry.registry.addKeyMapping(r,e.name,!0)}registerPaste(){const e={name:i.PASTE,preconditionFn:e=>e.keyboardAccessibilityMode&&!e.options.readOnly&&!c.Gesture.inProgress(),callback:()=>this.navigation.paste()};c.ShortcutRegistry.registry.register(e);const t=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.V,[c.utils.KeyCodes.CTRL]);c.ShortcutRegistry.registry.addKeyMapping(t,e.name,!0);const o=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.V,[c.utils.KeyCodes.ALT]);c.ShortcutRegistry.registry.addKeyMapping(o,e.name,!0);const r=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.V,[c.utils.KeyCodes.META]);c.ShortcutRegistry.registry.addKeyMapping(r,e.name,!0)}registerCut(){const e={name:i.CUT,preconditionFn:e=>{if(e.keyboardAccessibilityMode&&!e.options.readOnly){const t=e.getCursor().getCurNode();if(t&&t.getSourceBlock()){const e=t.getSourceBlock();return!c.Gesture.inProgress()&&e&&e.isDeletable()&&e.isMovable()&&!e.workspace.isFlyout}}return!1},callback:e=>{const t=e.getCursor().getCurNode().getSourceBlock();return c.copy(t),this.navigation.moveCursorOnBlockDelete(e,t),c.deleteBlock(t),!0}};c.ShortcutRegistry.registry.register(e);const t=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.X,[c.utils.KeyCodes.CTRL]);c.ShortcutRegistry.registry.addKeyMapping(t,e.name,!0);const o=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.X,[c.utils.KeyCodes.ALT]);c.ShortcutRegistry.registry.addKeyMapping(o,e.name,!0);const r=c.ShortcutRegistry.registry.createSerializedKey(c.utils.KeyCodes.X,[c.utils.KeyCodes.META]);c.ShortcutRegistry.registry.addKeyMapping(r,e.name,!0)}registerDelete(){const e={name:i.DELETE,preconditionFn:function(e){if(e.keyboardAccessibilityMode&&!e.options.readOnly){const t=e.getCursor().getCurNode();if(t&&t.getSourceBlock()){const e=t.getSourceBlock();return e&&e.isDeletable()}}return!1},callback:(e,t)=>{const o=e.getCursor().getCurNode().getSourceBlock();return t.preventDefault(),!c.Gesture.inProgress()&&(this.navigation.moveCursorOnBlockDelete(e,o),c.deleteBlock(o),!0)}};c.ShortcutRegistry.registry.register(e),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.DELETE,e.name,!0),c.ShortcutRegistry.registry.addKeyMapping(c.utils.KeyCodes.BACKSPACE,e.name,!0)}registerDefaults(){this.registerPrevious(),this.registerNext(),this.registerIn(),this.registerOut(),this.registerDisconnect(),this.registerExit(),this.registerInsert(),this.registerMark(),this.registerToolboxFocus(),this.registerToggleKeyboardNav(),this.registerWorkspaceMoveDown(),this.registerWorkspaceMoveLeft(),this.registerWorkspaceMoveUp(),this.registerWorkspaceMoveRight(),this.registerCopy(),this.registerPaste(),this.registerCut(),this.registerDelete()}dispose(){const e=Object.values(i);for(const t of e)c.ShortcutRegistry.registry.unregister(t);this.removeShortcutHandlers(),this.navigation.dispose()}}
|
|
34
|
+
/**
|
|
35
|
+
* @license
|
|
36
|
+
* Copyright 2021 Google LLC
|
|
37
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
38
|
+
*/}])}));
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
40
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("blockly/core"));else if("function"==typeof define&&define.amd)define(["blockly/core"],e);else{var i="object"==typeof exports?e(require("blockly/core")):e(t.Blockly);for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(this,(function(t){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/",i(i.s=1)}([function(e,i){e.exports=t},function(t,e,i){"use strict";i.r(e),i.d(e,"WorkspaceSearch",(function(){return l}));
|
|
41
|
+
/**
|
|
42
|
+
* @license
|
|
43
|
+
* Copyright 2020 Google LLC
|
|
44
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
45
|
+
*/
|
|
46
|
+
const s=["path.blocklyPath.blockly-ws-search-highlight {","fill: black;","}","path.blocklyPath.blockly-ws-search-highlight.blockly-ws-search-current {","fill: grey;","}",".blockly-ws-search-close-btn {","background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aCBkPSJNMTkgNi40MUwxNy41OSA1IDEyIDEwLjU5IDYuNDEgNSA1IDYuNDEgMTAuNTkgMTIgNSAxNy41OSA2LjQxIDE5IDEyIDEzLjQxIDE3LjU5IDE5IDE5IDE3LjU5IDEzLjQxIDEyeiIvPjxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48L3N2Zz4=) no-repeat top left;","}",".blockly-ws-search-next-btn {","background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aCBkPSJNNy40MSA4LjU5TDEyIDEzLjE3bDQuNTktNC41OEwxOCAxMGwtNiA2LTYtNiAxLjQxLTEuNDF6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PC9zdmc+) no-repeat top left;","}",".blockly-ws-search-previous-btn {","background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aCBkPSJNNy40MSAxNS40MUwxMiAxMC44M2w0LjU5IDQuNThMMTggMTRsLTYtNi02IDZ6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==) no-repeat top left;","}",".blockly-ws-search {","background: white;","border: solid lightgrey .5px;","box-shadow: 0px 10px 20px grey;","justify-content: center;","padding: .25em;","position: absolute;","z-index: 70;","}",".blockly-ws-search-input input {","border: none;","}",".blockly-ws-search button {","border: none;","}",".blockly-ws-search-actions {","display: flex;","}",".blockly-ws-search-container {","display: flex;","}",".blockly-ws-search-content {","display: flex;","}"],n=function(){let t=!1;return function(){if(t)return;t=!0;const e=s.join("\n"),i=document.createElement("style");i.id="blockly-ws-search-style";const n=document.createTextNode(e);i.appendChild(n),document.head.insertBefore(i,document.head.firstChild)}}();var o=i(0);
|
|
47
|
+
/**
|
|
48
|
+
* @license
|
|
49
|
+
* Copyright 2020 Google LLC
|
|
50
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
51
|
+
*/class l{constructor(t){this.workspace_=t,this.id="workspaceSearch",this.htmlDiv_=null,this.actionDiv_=null,this.inputElement_=null,this.textInputPlaceholder_="Search",this.blocks_=[],this.currentBlockIndex_=-1,this.searchText_="",this.searchOnInput=!0,this.caseSensitive=!1,this.preserveSelected=!0,this.boundEvents_=[]}init(){this.workspace_.getComponentManager().addComponent({component:this,weight:0,capabilities:[o.ComponentManager.Capability.POSITIONABLE]}),n(),this.createDom_(),this.setVisible_(!1),this.workspace_.resize()}dispose(){for(const t of this.boundEvents_)o.unbindEvent_(t);this.boundEvents_=null,this.htmlDiv_&&(this.htmlDiv_.remove(),this.htmlDiv_=null),this.actionDiv_=null,this.inputElement_=null}createDom_(){const t=this.workspace_.getInjectionDiv();this.addEvent_(t,"keydown",this,t=>this.onWorkspaceKeyDown_(t)),this.htmlDiv_=document.createElement("div"),o.utils.dom.addClass(this.htmlDiv_,"blockly-ws-search");const e=document.createElement("div");o.utils.dom.addClass(e,"blockly-ws-search-container");const i=document.createElement("div");o.utils.dom.addClass(i,"blockly-ws-search-content"),e.appendChild(i);const s=document.createElement("div");o.utils.dom.addClass(s,"blockly-ws-search-input"),this.inputElement_=this.createTextInput_(),this.addEvent_(this.inputElement_,"keydown",this,t=>this.onKeyDown_(t)),this.addEvent_(this.inputElement_,"input",this,()=>this.onInput_()),this.addEvent_(this.inputElement_,"click",this,()=>this.searchAndHighlight(this.searchText_,this.preserveSelected)),s.appendChild(this.inputElement_),i.appendChild(s),this.actionDiv_=document.createElement("div"),o.utils.dom.addClass(this.actionDiv_,"blockly-ws-search-actions"),i.appendChild(this.actionDiv_);const n=this.createNextBtn_();n&&this.addActionBtn(n,()=>this.next());const l=this.createPreviousBtn_();l&&this.addActionBtn(l,()=>this.previous());const c=this.createCloseBtn_();c&&(this.addBtnListener_(c,()=>this.close()),e.appendChild(c)),this.htmlDiv_.appendChild(e),t.insertBefore(this.htmlDiv_,this.workspace_.getParentSvg())}addEvent_(t,e,i,s){const n=o.bindEventWithChecks_(t,e,i,s);this.boundEvents_.push(n)}addActionBtn(t,e){this.addBtnListener_(t,e),this.actionDiv_.appendChild(t)}createTextInput_(){const t=document.createElement("input");return t.type="text",t.setAttribute("placeholder",this.textInputPlaceholder_),t}createNextBtn_(){return this.createBtn_("blockly-ws-search-next-btn","Find next")}createPreviousBtn_(){return this.createBtn_("blockly-ws-search-previous-btn","Find previous")}createCloseBtn_(){return this.createBtn_("blockly-ws-search-close-btn","Close search bar")}createBtn_(t,e){const i=document.createElement("button");return o.utils.dom.addClass(i,t),i.setAttribute("aria-label",e),i}addBtnListener_(t,e){this.addEvent_(t,"click",this,e),this.addEvent_(t,"keydown",this,t=>{t.keyCode===o.utils.KeyCodes.ENTER?(e(t),t.preventDefault()):t.keyCode===o.utils.KeyCodes.ESC&&this.close(),t.stopPropagation()})}getBoundingRectangle(){const t=this.htmlDiv_.style.top,e=this.htmlDiv_.style.left;return new o.utils.Rect(t,t+this.htmlDiv_.style.height,e,e+this.htmlDiv_.style.width)}position(t,e){this.workspace_.RTL?this.htmlDiv_.style.left=t.absoluteMetrics.left+"px":t.toolboxMetrics.position===o.TOOLBOX_AT_RIGHT?this.htmlDiv_.style.right=t.toolboxMetrics.width+"px":this.htmlDiv_.style.right="0",this.htmlDiv_.style.top=t.absoluteMetrics.top+"px"}onInput_(){if(this.searchOnInput){const t=this.inputElement_.value.trim();t!==this.searchText_&&this.searchAndHighlight(t,this.preserveSelected)}}onKeyDown_(t){if(t.keyCode===o.utils.KeyCodes.ESC)this.close();else if(t.keyCode===o.utils.KeyCodes.ENTER)if(this.searchOnInput)this.next();else{const t=this.inputElement_.value.trim();t!==this.searchText_&&this.searchAndHighlight(t,this.preserveSelected)}}onWorkspaceKeyDown_(t){(t.ctrlKey||t.metaKey)&&t.keyCode===o.utils.KeyCodes.F&&(this.open(),t.preventDefault(),t.stopPropagation())}previous(){this.setCurrentBlock_(this.currentBlockIndex_-1)}next(){this.setCurrentBlock_(this.currentBlockIndex_+1)}setSearchPlaceholder(t){this.textInputPlaceholder_=t,this.inputElement_&&this.inputElement_.setAttribute("placeholder",this.textInputPlaceholder_)}setCurrentBlock_(t){if(!this.blocks_.length)return;let e=this.blocks_[this.currentBlockIndex_];e&&this.unhighlightCurrentSelection_(e),this.currentBlockIndex_=(t%this.blocks_.length+this.blocks_.length)%this.blocks_.length,e=this.blocks_[this.currentBlockIndex_],this.highlightCurrentSelection_(e),this.scrollToVisible_(e)}open(){this.setVisible_(!0),this.inputElement_.focus(),this.searchText_&&this.searchAndHighlight(this.searchText_)}close(){this.setVisible_(!1),this.workspace_.markFocused(),this.clearBlocks()}setVisible_(t){this.htmlDiv_.style.display=t?"flex":"none"}searchAndHighlight(t,e){const i=this.blocks_[this.currentBlockIndex_];this.searchText_=t.trim(),this.clearBlocks(),this.blocks_=this.getMatchingBlocks_(this.workspace_,this.searchText_,this.caseSensitive),this.highlightSearchGroup_(this.blocks_);let s=0;e&&(s=this.blocks_.indexOf(i),s=s>-1?s:0),this.setCurrentBlock_(s)}getSearchPool_(t){return t.getAllBlocks(!0).filter(t=>{const e=t.getSurroundParent();return!e||!e.isCollapsed()})}isBlockMatch_(t,e,i){let s="";if(t.isCollapsed())s=t.toString();else{const e=[];t.inputList.forEach(t=>{t.fieldRow.forEach(t=>{e.push(t.getText())})}),s=e.join(" ").trim()}return i||(s=s.toLowerCase()),s.indexOf(e)>-1}getMatchingBlocks_(t,e,i){if(!e)return[];return this.caseSensitive||(e=e.toLowerCase()),this.getSearchPool_(t).filter(t=>this.isBlockMatch_(t,e,i))}clearBlocks(){this.unhighlightSearchGroup_(this.blocks_);const t=this.blocks_[this.currentBlockIndex_];t&&this.unhighlightCurrentSelection_(t),this.currentBlockIndex_=-1,this.blocks_=[]}highlightCurrentSelection_(t){const e=t.pathObject.svgPath;o.utils.dom.addClass(e,"blockly-ws-search-current")}unhighlightCurrentSelection_(t){const e=t.pathObject.svgPath;o.utils.dom.removeClass(e,"blockly-ws-search-current")}highlightSearchGroup_(t){t.forEach(t=>{const e=t.pathObject.svgPath;o.utils.dom.addClass(e,"blockly-ws-search-highlight")})}unhighlightSearchGroup_(t){t.forEach(t=>{const e=t.pathObject.svgPath;o.utils.dom.removeClass(e,"blockly-ws-search-highlight")})}scrollToVisible_(t){if(!this.workspace_.isMovable())return;const e=t.getRelativeToSurfaceXY(),i=this.workspace_.scale,s=t.width*i,n=t.height*i,o=e.y*i,l=(e.y+t.height)*i,c=this.workspace_.RTL?e.x*i-s:e.x*i,h=this.workspace_.RTL?e.x*i:e.x*i+s,r=this.workspace_.getMetrics();let a=r.viewLeft;const d=c<r.viewLeft,u=h>r.viewLeft+r.viewWidth,p=s>r.viewWidth;!p&&d||p&&!this.workspace_.RTL?a=c:(!p&&u||p&&this.workspace_.RTL)&&(a=h-r.viewWidth);let _=r.viewTop;const g=o<r.viewTop,b=l>r.viewTop+r.viewHeight,y=n>r.viewHeight;if(g||y&&b?_=o:b&&(_=l-r.viewHeight),a!==r.viewLeft||_!==r.viewTop){const t=document.activeElement;this.workspace_.scroll(-a,-_),t&&t.focus()}}}
|
|
52
|
+
/**
|
|
53
|
+
* @license
|
|
54
|
+
* Copyright 2020 Google LLC
|
|
55
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
56
|
+
*/}])}));
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>MakeCode Skill Map</title>
|
|
7
7
|
<link rel="stylesheet" data-rtl="/blb/rtlsemantic.css" href="/blb/semantic.css">
|
|
8
8
|
<link rel="stylesheet" href="/blb/icons.css">
|
|
9
|
-
<link rel="stylesheet" href="/blb/react-common.css">
|
|
9
|
+
<link rel="stylesheet" href="/blb/react-common-skillmap.css">
|
|
10
10
|
<link href="/blb/skillmap/css/main.96b1b3f1.chunk.css" rel="stylesheet"></head>
|
|
11
11
|
<body>
|
|
12
12
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
<!-- end usabilla live embed code -->
|
|
29
29
|
|
|
30
30
|
<!-- @include thin-footer.html -->
|
|
31
|
-
<script>!function(e){function r(r){for(var n,l,i=r[0],a=r[1],p=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var a=t[i];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this.webpackJsonpskillsmap=this.webpackJsonpskillsmap||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var p=0;p<i.length;p++)r(i[p]);var f=a;t()}([])</script><script src="/blb/skillmap/js/2.7dd06a3a.chunk.js"></script><script src="/blb/skillmap/js/main.
|
|
31
|
+
<script>!function(e){function r(r){for(var n,l,i=r[0],a=r[1],p=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var a=t[i];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this.webpackJsonpskillsmap=this.webpackJsonpskillsmap||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var p=0;p<i.length;p++)r(i[p]);var f=a;t()}([])</script><script src="/blb/skillmap/js/2.7dd06a3a.chunk.js"></script><script src="/blb/skillmap/js/main.b96caef3.chunk.js"></script></body>
|
|
32
32
|
</html>
|