pxt-core 7.4.18 → 7.4.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/built/pxtblockly.js +29 -17
  2. package/built/pxtblocks.js +17 -5
  3. package/built/pxteditor.d.ts +1 -0
  4. package/built/target.js +1 -1
  5. package/built/web/main.js +1 -1
  6. package/built/web/pxtasseteditor.js +1 -1
  7. package/built/web/pxtblockly.js +2 -2
  8. package/built/web/pxtblocks.js +1 -1
  9. package/built/web/pxtembed.js +2 -2
  10. package/built/web/react-common-skillmap.css +1 -1
  11. package/built/web/rtlreact-common-skillmap.css +1 -1
  12. package/built/web/rtlsemantic.css +1 -1
  13. package/built/web/semantic.css +1 -1
  14. package/built/web/skillmap/css/main.4939cd1e.chunk.css +1 -0
  15. package/built/web/skillmap/js/2.a7ef6059.chunk.js +2 -0
  16. package/built/web/skillmap/js/main.75ffd6e1.chunk.js +1 -0
  17. package/localtypings/pxtarget.d.ts +1 -0
  18. package/package.json +2 -2
  19. package/react-common/components/controls/Button.tsx +4 -2
  20. package/react-common/components/controls/FocusTrap.tsx +25 -4
  21. package/react-common/components/controls/MenuBar.tsx +8 -1
  22. package/react-common/components/controls/Modal.tsx +5 -2
  23. package/react-common/styles/controls/Button.less +10 -8
  24. package/react-common/styles/controls/Modal.less +2 -2
  25. package/react-common/styles/react-common-variables.less +1 -0
  26. package/theme/highcontrast.less +8 -7
  27. package/theme/tutorial-sidebar.less +97 -14
  28. package/theme/tutorial.less +16 -8
  29. package/webapp/public/blockly/blockly_compressed.js +6 -6
  30. package/webapp/public/blockly/blocks_compressed.js +6 -6
  31. package/webapp/public/skillmap.html +2 -2
  32. package/built/web/skillmap/css/main.56e8c859.chunk.css +0 -1
  33. package/built/web/skillmap/js/2.261d5eab.chunk.js +0 -2
  34. package/built/web/skillmap/js/main.7c45ef9f.chunk.js +0 -1
@@ -701,7 +701,7 @@ Blockly.FieldLabel.prototype.setClass=function(a){this.textElement_&&(this.class
701
701
  */
702
702
  Blockly.FieldLabelHover=function(a,b){Blockly.FieldLabelHover.superClass_.constructor.call(this,a,b);this.arrowWidth_=0};Blockly.utils.object.inherits(Blockly.FieldLabelHover,Blockly.FieldLabel);
703
703
  Blockly.FieldLabelHover.prototype.initView=function(){Blockly.FieldLabelHover.superClass_.initView.call(this);this.sourceBlock_.isEditable()&&(this.mouseOverWrapper_=Blockly.bindEvent_(this.getClickTarget_(),"mouseover",this,this.onMouseOver_),this.mouseOutWrapper_=Blockly.bindEvent_(this.getClickTarget_(),"mouseout",this,this.onMouseOut_))};Blockly.FieldLabelHover.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.text);return new Blockly.FieldLabelHover(b,a["class"])};
704
- Blockly.FieldLabelHover.prototype.EDITABLE=!1;Blockly.FieldLabelHover.prototype.SERIALIZABLE=!0;Blockly.FieldLabelHover.prototype.updateWidth=function(){this.size_.width=Blockly.utils.dom.getFastTextWidth(this.textElement_,this.constants_.FIELD_TEXT_FONTSIZE,this.constants_.FIELD_TEXT_FONTWEIGHT,this.constants_.FIELD_TEXT_FONTFAMILY)};
704
+ Blockly.FieldLabelHover.prototype.EDITABLE=!1;Blockly.FieldLabelHover.prototype.SERIALIZABLE=!0;Blockly.FieldLabelHover.prototype.updateWidth=function(){this.size_.width=Blockly.utils.dom.getFastTextWidth(this.textElement_,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY)};
705
705
  Blockly.FieldLabelHover.prototype.onMouseOver_=function(a){!this.sourceBlock_.isInFlyout&&this.sourceBlock_.isShadow()&&(a=this.sourceBlock_.workspace.getGesture(a),a&&a.isDragging()||!this.sourceBlock_.pathObject.svgPath||(Blockly.utils.dom.addClass(this.sourceBlock_.pathObject.svgPath,"blocklyFieldHover"),this.sourceBlock_.pathObject.svgPath.style.strokeDasharray="2"))};
706
706
  Blockly.FieldLabelHover.prototype.clearHover=function(){this.sourceBlock_.pathObject.svgPath&&(Blockly.utils.dom.removeClass(this.sourceBlock_.pathObject.svgPath,"blocklyFieldHover"),this.sourceBlock_.pathObject.svgPath.style.strokeDasharray="")};Blockly.FieldLabelHover.prototype.onMouseOut_=function(a){!this.sourceBlock_.isInFlyout&&this.sourceBlock_.isShadow()&&((a=this.sourceBlock_.workspace.getGesture(a))&&a.isDragging()||this.clearHover())};
707
707
  Blockly.FieldLabelHover.dispose=function(){this.mouseOverWrapper_&&(Blockly.unbindEvent_(this.mouseOverWrapper_),this.mouseOverWrapper_=null);this.mouseOutWrapper_&&(Blockly.unbindEvent_(this.mouseOutWrapper_),this.mouseOutWrapper_=null);Blockly.FieldLabelHover.superClass_.dispose.call(this);this.variableMap_=this.workspace_=null};Blockly.fieldRegistry.register("field_label_hover",Blockly.FieldLabelHover);Blockly.FieldVariableGetter=function(a,b,c,d,e){this.defaultVariableName=a||"";this.size_=new Blockly.utils.Size(0,0);e&&this.configure_(e);b&&this.setValidator(b);e||this.setTypes_(c,d)};Blockly.utils.object.inherits(Blockly.FieldVariableGetter,Blockly.Field);Blockly.FieldVariableGetter.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.variable);return new Blockly.FieldVariableGetter(b,null,a.variableTypes,a.defaultType)};Blockly.FieldVariableGetter.prototype.workspace_=null;
@@ -1656,7 +1656,7 @@ return Blockly.Functions.namesInUse(b,null,a)[c]?(Blockly.alert(Blockly.Msg.VARI
1656
1656
  Blockly.Functions.mutateCallersAndDefinition=function(a,b,c){var d=Blockly.Functions.getDefinition(a,b);d?(a=Blockly.Functions.getCallers(a,d.workspace),a.push(d),Blockly.Events.setGroup(!0),a.forEach(function(a){var b=a.mutationToDom(),e=b&&Blockly.Xml.domToText(b);a.domToMutation(c);var h=a.mutationToDom(),k=h&&Blockly.Xml.domToText(h);if(e!=k)if(Blockly.Events.fire(new Blockly.Events.BlockChange(a,"mutation",null,e,k)),a.id==d.id){var l=Blockly.Functions.getArgMap(b),m=Blockly.Functions.getArgMap(h,
1657
1657
  !0);d.getDescendants().forEach(function(a){if(Blockly.pxtBlocklyUtils.isFunctionArgumentReporter(a)){var b=a.getFieldValue("VALUE"),c=l[b];m[c]?m[c]!==b&&a.setFieldValue(m[c],"VALUE"):a.dispose()}})}else setTimeout(function(){a.bumpNeighbours()},Blockly.BUMP_DELAY)}),Blockly.Events.setGroup(!1)):console.warn("Attempted to change function "+a+", but no definition block was found on the workspace")};
1658
1658
  Blockly.Functions.createFlyout=function(a,b){var c=new Blockly.Options({scrollbars:!0,disabledPatternId:a.options.disabledPatternId,parentWorkspace:a,rtl:a.RTL,oneBasedIndex:a.options.oneBasedIndex,horizontalLayout:a.horizontalLayout,toolboxPosition:a.options.toolboxPosition,zoomOptions:a.options.zoomOptions,renderer:a.options.renderer,rendererOverrides:a.options.rendererOverrides,newFunctions:a.options.newFunctions,move:{scrollbars:!0}});c=c.horizontalLayout?new Blockly.HorizontalFlyout(c):new Blockly.VerticalFlyout(c);
1659
- var d=c.createDom("svg");goog.dom.insertSiblingAfter(d,b);c.init(a);return c};Blockly.VERSION="4.0.6";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.draggingConnections=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.parentContainer=null;Blockly.svgSize=function(a){Blockly.utils.deprecation.warn("Blockly.svgSize","March 2021","March 2022","workspace.getCachedParentSvgSize");return new Blockly.utils.Size(a.cachedWidth_,a.cachedHeight_)};Blockly.resizeSvgContents=function(a){a.resizeContents()};
1659
+ var d=c.createDom("svg");goog.dom.insertSiblingAfter(d,b);c.init(a);return c};Blockly.VERSION="4.0.7";Blockly.mainWorkspace=null;Blockly.selected=null;Blockly.draggingConnections=[];Blockly.clipboardXml_=null;Blockly.clipboardSource_=null;Blockly.clipboardTypeCounts_=null;Blockly.cache3dSupported_=null;Blockly.parentContainer=null;Blockly.svgSize=function(a){Blockly.utils.deprecation.warn("Blockly.svgSize","March 2021","March 2022","workspace.getCachedParentSvgSize");return new Blockly.utils.Size(a.cachedWidth_,a.cachedHeight_)};Blockly.resizeSvgContents=function(a){a.resizeContents()};
1660
1660
  Blockly.svgResize=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;var b=a.getParentSvg(),c=a.getCachedParentSvgSize(),d=b.parentNode;if(d){var e=d.offsetWidth;d=d.offsetHeight;c.width!=e&&(b.setAttribute("width",e+"px"),a.setCachedParentSvgSize(e,null));c.height!=d&&(b.setAttribute("height",d+"px"),a.setCachedParentSvgSize(null,d));a.resize()}};
1661
1661
  Blockly.onKeyDown=function(a){var b=Blockly.mainWorkspace;if(b&&!(Blockly.utils.isTargetInput(a)||b.rendered&&!b.isVisible()))Blockly.ShortcutRegistry.registry.onKeyDown(b,a)};Blockly.deleteBlock=function(a){a.workspace.isFlyout||(Blockly.Events.setGroup(!0),Blockly.hideChaff(),a.outputConnection?a.dispose(!1,!0):a.dispose(!0,!0),Blockly.Events.setGroup(!1))};Blockly.copy=function(a){if(a=a.toCopyData())Blockly.clipboardXml_=a.xml,Blockly.clipboardSource_=a.source,Blockly.clipboardTypeCounts_=a.typeCounts};
1662
1662
  Blockly.paste=function(){if(!Blockly.clipboardXml_)return!1;var a=Blockly.clipboardSource_;a.isFlyout&&(a=a.targetWorkspace);return Blockly.clipboardTypeCounts_&&a.isCapacityAvailable(Blockly.clipboardTypeCounts_)?(Blockly.Events.setGroup(!0),a.paste(Blockly.clipboardXml_),Blockly.Events.setGroup(!1),!0):!1};
@@ -2320,7 +2320,7 @@ Blockly.FieldDropdown.IMAGE_Y_OFFSET=5;Blockly.FieldDropdown.IMAGE_Y_PADDING=2*B
2320
2320
  Blockly.FieldDropdown.prototype.initView=function(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot();this.createTextElement_();this.imageElement_=Blockly.utils.dom.createSvgElement(Blockly.utils.Svg.IMAGE,{},this.fieldGroup_);this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_();this.borderRect_&&Blockly.utils.dom.addClass(this.borderRect_,"blocklyDropdownRect")};
2321
2321
  Blockly.FieldDropdown.prototype.shouldAddBorderRect_=function(){return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!this.sourceBlock_.isShadow()};
2322
2322
  Blockly.FieldDropdown.prototype.createTextArrow_=function(){this.arrow_=Blockly.utils.dom.createSvgElement(Blockly.utils.Svg.TSPAN,{},this.textElement_);this.arrow_.appendChild(document.createTextNode(this.sourceBlock_.RTL?Blockly.FieldDropdown.ARROW_CHAR+" ":" "+Blockly.FieldDropdown.ARROW_CHAR));this.sourceBlock_.RTL?this.textElement_.insertBefore(this.arrow_,this.textContent_):this.textElement_.appendChild(this.arrow_)};
2323
- Blockly.FieldDropdown.prototype.createSVGArrow_=function(){var a=Blockly.utils.userAgent.IE||Blockly.utils.userAgent.IOS,b=a?"image":"use";a=a?this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI:"#"+(this.constants_.dropdownArrowImageId||"blocklyDropdownArrowSvg");this.svgArrow_=Blockly.utils.dom.createSvgElement(b,{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_);this.svgArrow_.setAttributeNS(Blockly.utils.dom.XLINK_NS,
2323
+ Blockly.FieldDropdown.prototype.createSVGArrow_=function(){var a=Blockly.utils.userAgent.IE||Blockly.utils.userAgent.IOS,b=a?"image":"use";a=a?this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI:"#"+(this.getConstants().dropdownArrowImageId||"blocklyDropdownArrowSvg");this.svgArrow_=Blockly.utils.dom.createSvgElement(b,{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_);this.svgArrow_.setAttributeNS(Blockly.utils.dom.XLINK_NS,
2324
2324
  "xlink:href",a)};
2325
2325
  Blockly.FieldDropdown.prototype.showEditor_=function(a){this.dropdownCreate_();this.menu_.openingCoords=a&&"number"===typeof a.clientX?new Blockly.utils.Coordinate(a.clientX,a.clientY):null;this.menu_.render(Blockly.DropDownDiv.getContentDiv());a=this.menu_.getElement();Blockly.utils.dom.addClass(a,"blocklyDropdownMenu");if(this.getConstants().FIELD_DROPDOWN_COLOURED_DIV){a=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().getColour():this.sourceBlock_.getColour();var b=this.sourceBlock_.isShadow()?
2326
2326
  this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;Blockly.DropDownDiv.setColour(a,b)}Blockly.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this));this.menu_.focus();this.selectedMenuItem_&&this.menu_.setHighlighted(this.selectedMenuItem_);this.applyColour()};
@@ -2380,10 +2380,10 @@ Blockly.FieldImage.prototype.showEditor_=function(){this.clickHandler_&&this.cli
2380
2380
  */
2381
2381
  Blockly.FieldTextDropdown=function(a,b,c,d){this.menuGenerator_=b;Blockly.FieldDropdown.prototype.trimOptions_.call(this);Blockly.FieldTextDropdown.superClass_.constructor.call(this,a,c,d);this.addArgType("textdropdown")};Blockly.utils.object.inherits(Blockly.FieldTextDropdown,Blockly.FieldTextInput);Blockly.FieldTextDropdown.fromJson=function(a){var b=new Blockly.FieldTextDropdown(a.text,a.options);"boolean"==typeof a.spellcheck&&b.setSpellcheck(a.spellcheck);return b};
2382
2382
  Blockly.FieldTextDropdown.DROPDOWN_SVG_DATAURI="data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaGVpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLWFycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuNDEsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTDAuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNzFDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMCwxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNzlhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYzAuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMzdBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiM1NzVFNzUiLz48L3N2Zz4K";
2383
- Blockly.FieldTextDropdown.prototype.initView=function(){Blockly.FieldTextDropdown.superClass_.initView.call(this);this.createSVGArrow_()};Blockly.FieldTextDropdown.prototype.updateSize_=function(){Blockly.FieldTextDropdown.superClass_.updateSize_.call(this);var a=this.positionSVGArrow_(this.size_.width,this.size_.height/2-this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE/2);this.size_.width+=a};
2383
+ Blockly.FieldTextDropdown.prototype.initView=function(){Blockly.FieldTextDropdown.superClass_.initView.call(this);this.createSVGArrow_()};Blockly.FieldTextDropdown.prototype.updateSize_=function(){Blockly.FieldTextDropdown.superClass_.updateSize_.call(this);var a=this.positionSVGArrow_(this.size_.width,this.size_.height/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2);this.size_.width+=a};
2384
2384
  Blockly.FieldTextDropdown.prototype.dispose=function(){this.mouseUpWrapper_&&(Blockly.unbindEvent_(this.mouseUpWrapper_),this.mouseUpWrapper_=null,Blockly.Touch.clearTouchIdentifier());Blockly.FieldTextDropdown.superClass_.dispose.call(this)};
2385
2385
  Blockly.FieldTextDropdown.prototype.showEditor_=function(a){Blockly.FieldTextDropdown.superClass_.showEditor_.call(this,a,!1,Blockly.utils.userAgent.MOBILE||Blockly.utils.userAgent.ANDROID||Blockly.utils.userAgent.IPAD,!0,function(){this.dropDownOpen_||this.showDropdown_();Blockly.Touch.clearTouchIdentifier()})};Blockly.FieldTextDropdown.prototype.isOptionListDynamic=Blockly.FieldDropdown.prototype.isOptionListDynamic;Blockly.FieldTextDropdown.prototype.getOptions=Blockly.FieldDropdown.prototype.getOptions;
2386
- Blockly.FieldTextDropdown.prototype.createSVGArrow_=function(){this.svgArrow_=Blockly.utils.dom.createSvgElement("image",{height:this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.constants_.FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_);this.svgArrow_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",Blockly.FieldTextDropdown.DROPDOWN_SVG_DATAURI)};Blockly.FieldTextDropdown.prototype.showDropdown_=Blockly.FieldDropdown.prototype.showEditor_;
2386
+ Blockly.FieldTextDropdown.prototype.createSVGArrow_=function(){this.svgArrow_=Blockly.utils.dom.createSvgElement("image",{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_);this.svgArrow_.setAttributeNS(Blockly.utils.dom.XLINK_NS,"xlink:href",Blockly.FieldTextDropdown.DROPDOWN_SVG_DATAURI)};Blockly.FieldTextDropdown.prototype.showDropdown_=Blockly.FieldDropdown.prototype.showEditor_;
2387
2387
  Blockly.FieldTextDropdown.prototype.dropdownCreate_=Blockly.FieldDropdown.prototype.dropdownCreate_;Blockly.FieldTextDropdown.prototype.dropdownDispose_=Blockly.FieldDropdown.prototype.dropdownDispose_;Blockly.FieldTextDropdown.prototype.positionSVGArrow_=Blockly.FieldDropdown.prototype.positionSVGArrow_;Blockly.FieldTextDropdown.prototype.handleMenuActionEvent_=Blockly.FieldDropdown.prototype.handleMenuActionEvent_;
2388
2388
  Blockly.FieldTextDropdown.prototype.onItemSelected_=function(a,b){a=b.getValue();null!==a&&(this.setValue(a),Blockly.WidgetDiv.hideIfOwner(this))};Blockly.fieldRegistry.register("field_textdropdown",Blockly.FieldTextDropdown);Blockly.FieldMultilineInput=function(a,b,c){Blockly.FieldMultilineInput.superClass_.constructor.call(this,a,b,c);this.textGroup_=null;this.maxLines_=Infinity;this.isOverflowedY_=!1};Blockly.utils.object.inherits(Blockly.FieldMultilineInput,Blockly.FieldTextInput);Blockly.FieldMultilineInput.prototype.configure_=function(a){Blockly.FieldMultilineInput.superClass_.configure_.call(this,a);a.maxLines&&this.setMaxLines(a.maxLines)};
2389
2389
  Blockly.FieldMultilineInput.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.text);return new Blockly.FieldMultilineInput(b,void 0,a)};Blockly.FieldMultilineInput.prototype.toXml=function(a){a.textContent=this.getValue().replace(/\n/g,"
");return a};Blockly.FieldMultilineInput.prototype.fromXml=function(a){this.setValue(a.textContent.replace(/
/g,"\n"))};
@@ -2450,7 +2450,7 @@ function(a){a=d.getVariable(a,e);c.setValue(a.getId())},e);return}}this.setValue
2450
2450
  limitations under the License.
2451
2451
  */
2452
2452
  Blockly.FieldVerticalSeparator=function(){Blockly.FieldVerticalSeparator.superClass_.constructor.call(this)};Blockly.utils.object.inherits(Blockly.FieldVerticalSeparator,Blockly.Field);Blockly.FieldVerticalSeparator.fromJson=function(a){return new Blockly.FieldVerticalSeparator};Blockly.FieldVerticalSeparator.prototype.EDITABLE=!1;
2453
- Blockly.FieldVerticalSeparator.prototype.initView=function(){var a=this.constants_.ICON_SEPARATOR_HEIGHT;this.lineElement_=Blockly.utils.dom.createSvgElement("line",{stroke:this.sourceBlock_.style.colourSecondary,"stroke-linecap":"round",x1:0,y1:0,x2:0,y2:a},this.fieldGroup_);this.size_=new Blockly.utils.Size(1,a);this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_)};Blockly.FieldVerticalSeparator.prototype.setLineHeight=function(a){this.lineElement_.setAttribute("y2",a)};
2453
+ Blockly.FieldVerticalSeparator.prototype.initView=function(){var a=this.getConstants().ICON_SEPARATOR_HEIGHT;this.lineElement_=Blockly.utils.dom.createSvgElement("line",{stroke:this.sourceBlock_.style.colourSecondary,"stroke-linecap":"round",x1:0,y1:0,x2:0,y2:a},this.fieldGroup_);this.size_=new Blockly.utils.Size(1,a);this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_)};Blockly.FieldVerticalSeparator.prototype.setLineHeight=function(a){this.lineElement_.setAttribute("y2",a)};
2454
2454
  Blockly.FieldVerticalSeparator.prototype.dispose=function(){Blockly.utils.dom.removeNode(this.fieldGroup_);this.lineElement_=this.fieldGroup_=null};Blockly.FieldVerticalSeparator.prototype.getValue=function(){return null};Blockly.FieldVerticalSeparator.prototype.setValue=function(a){};Blockly.FieldVerticalSeparator.prototype.setText=function(a){};Blockly.FieldVerticalSeparator.prototype.render_=function(){};Blockly.FieldVerticalSeparator.prototype.updateWidth=function(){};
2455
2455
  Blockly.fieldRegistry.register("field_vertical_separator",Blockly.FieldVerticalSeparator);Blockly.FieldSlider=function(a,b,c,d,e,f,g){Blockly.FieldSlider.superClass_.constructor.call(this,a,null,null,null,g);this.setConstraints(b,c,d);this.step_=parseFloat(e)||void 0;this.labelText_=f};Blockly.utils.object.inherits(Blockly.FieldSlider,Blockly.FieldNumber);Blockly.FieldSlider.prototype.min_=null;Blockly.FieldSlider.prototype.max_=null;Blockly.FieldSlider.prototype.step_=null;Blockly.FieldSlider.prototype.precision_=null;Blockly.FieldSlider.prototype.labelText_=null;
2456
2456
  Blockly.FieldSlider.fromJson=function(a){return new Blockly.FieldSlider(a.value,a.min,a.max,a.precision,a.step,a.labelText)};Blockly.FieldSlider.prototype.setOptions=function(a,b,c,d){this.setConstraints(a,b,d);this.step_=parseFloat(c)||void 0;a=this.getNumRestrictor(this.min_,this.max_,this.precision_);this.setRestrictor(a)};Blockly.FieldSlider.prototype.setLabel=function(a){void 0!=a&&(this.labelText_=a)};Blockly.FieldSlider.prototype.setColor=function(a){void 0!=a&&(this.sliderColor_=a)};
@@ -2852,10 +2852,10 @@ Blockly.Blocks.lists_create_with={init:function(){Blockly.Extensions.apply("inli
2852
2852
  this.horizontalAfter_&&a.setAttribute("horizontalafter",this.horizontalAfter_);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);if(a=a.getAttribute("horizontalafter"))this.horizontalAfter_=parseInt(a,10);this.updateShape_()},storeConnections_:function(){this.valueConnections_=[];for(var a=0;a<this.itemCount_;a++)this.valueConnections_.push(this.getInput("ADD"+a).connection.targetConnection)},restoreConnections_:function(){for(var a=0;a<this.itemCount_;a++)Blockly.Mutator.reconnect(this.valueConnections_[a],
2853
2853
  this,"ADD"+a)},addItem_:function(){function a(a,b){var c=[];if(!a||!a.children)return c;for(var d=0;d<a.children.length;d++){var e=a.children[d];e.tagName===b&&c.push(e)}return c}function b(a,b,d){if(b&&d){var e=Blockly.utils.xml.createElement("value");e.setAttribute("name",b);e.appendChild(c("shadow",d));a.appendChild(e)}}function c(a,b){a=Blockly.utils.xml.createElement(a);a.setAttribute("type",b);a.setAttribute("id",Blockly.utils.genUid());return a}this.storeConnections_();this.update_(function(){this.itemCount_++});
2854
2854
  this.restoreConnections_();if(1<this.itemCount_){var d=this.getInput("ADD0");if(d&&d.connection.targetConnection){var e=this.getInput("ADD"+(this.itemCount_-1)),f=d.connection.getShadowDom(),g=f&&f.getAttribute("type");if(g){var l=c("shadow",g),m=a(f,"value");for(f=0;f<m.length;f++){var k=m[f],n=k.getAttribute("name"),h=a(k,"shadow")[0];h=h&&h.getAttribute("type");b(l,n,h)}e.connection.setShadowDom(l)}if((f=(d=(f=d.connection.targetConnection)&&f.getSourceBlock())&&d.type)&&f!==g){g=c("block",f);
2855
- if(d&&d.inputList)for(f=0;f<d.inputList.length;f++)k=d.inputList[f],h=(h=k.connection&&k.connection.getShadowDom())&&h.getAttribute("type"),b(g,k.name,h);g=Blockly.Xml.domToBlock(g,this.workspace);e.connection.connect(g.outputConnection)}else e.connection.respawnShadow_()}}},removeItem_:function(){this.storeConnections_();this.update_(function(){this.itemCount_--});this.restoreConnections_()},update_:function(a){Blockly.Events.setGroup(!0);var b=this,c=b.mutationToDom();c=c&&Blockly.Xml.domToText(c);
2856
- var d=b.rendered;b.rendered=!1;a&&a.call(this);this.updateShape_();b.rendered=d;b.initSvg();var e=Blockly.Events.getGroup();a=(a=b.mutationToDom())&&Blockly.Xml.domToText(a);c!=a&&(Blockly.Events.fire(new Blockly.Events.BlockChange(b,"mutation",null,c,a)),setTimeout(function(){Blockly.Events.setGroup(e);b.bumpNeighbours();Blockly.Events.setGroup(!1)},Blockly.BUMP_DELAY));b.rendered&&b.render();Blockly.Events.setGroup(!1)},updateShape_:function(){var a=this,b=function(){a.removeItem_()};this.itemCount_?
2857
- (this.getInput("EMPTY")&&this.removeInput("EMPTY"),this.getInput("TITLE")||this.appendDummyInput("TITLE").appendField(Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH)):(this.getInput("TITLE")&&this.removeInput("TITLE"),this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE));var c=0;for(c=0;c<this.itemCount_;c++)this.getInput("ADD"+c)||this.appendValueInput("ADD"+c);for(;this.getInput("ADD"+c);)this.removeInput("ADD"+c),c++;this.getInput("BUTTONS")&&this.removeInput("BUTTONS");
2858
- c=this.appendDummyInput("BUTTONS");0<this.itemCount_&&c.appendField(new Blockly.FieldImage(this.REMOVE_IMAGE_DATAURI,24,24,"*",b,!1));c.appendField(new Blockly.FieldImage(this.ADD_IMAGE_DATAURI,24,24,"*",function(){a.addItem_()},!1));b=this.itemCount_<=this.horizontalAfter_;this.setInputsInline(b);this.setOutputShape(b?Blockly.OUTPUT_SHAPE_ROUND:Blockly.OUTPUT_SHAPE_SQUARE)}};
2855
+ if(d)if(f===Blockly.FUNCTION_CALL_OUTPUT_BLOCK_TYPE)f=goog.dom.createDom("mutation"),f.setAttribute("name",d.getName()),g.appendChild(f);else if(d.inputList)for(f=0;f<d.inputList.length;f++)k=d.inputList[f],h=(h=k.connection&&k.connection.getShadowDom())&&h.getAttribute("type"),b(g,k.name,h);g=Blockly.Xml.domToBlock(g,this.workspace);e.connection.connect(g.outputConnection)}else e.connection.respawnShadow_()}}},removeItem_:function(){this.storeConnections_();this.update_(function(){this.itemCount_--});
2856
+ this.restoreConnections_()},update_:function(a){Blockly.Events.setGroup(!0);var b=this,c=b.mutationToDom();c=c&&Blockly.Xml.domToText(c);var d=b.rendered;b.rendered=!1;a&&a.call(this);this.updateShape_();b.rendered=d;b.initSvg();var e=Blockly.Events.getGroup();a=(a=b.mutationToDom())&&Blockly.Xml.domToText(a);c!=a&&(Blockly.Events.fire(new Blockly.Events.BlockChange(b,"mutation",null,c,a)),setTimeout(function(){Blockly.Events.setGroup(e);b.bumpNeighbours();Blockly.Events.setGroup(!1)},Blockly.BUMP_DELAY));
2857
+ b.rendered&&b.render();Blockly.Events.setGroup(!1)},updateShape_:function(){var a=this,b=function(){a.removeItem_()};this.itemCount_?(this.getInput("EMPTY")&&this.removeInput("EMPTY"),this.getInput("TITLE")||this.appendDummyInput("TITLE").appendField(Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH)):(this.getInput("TITLE")&&this.removeInput("TITLE"),this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE));var c=0;for(c=0;c<this.itemCount_;c++)this.getInput("ADD"+
2858
+ c)||this.appendValueInput("ADD"+c);for(;this.getInput("ADD"+c);)this.removeInput("ADD"+c),c++;this.getInput("BUTTONS")&&this.removeInput("BUTTONS");c=this.appendDummyInput("BUTTONS");0<this.itemCount_&&c.appendField(new Blockly.FieldImage(this.REMOVE_IMAGE_DATAURI,24,24,"*",b,!1));c.appendField(new Blockly.FieldImage(this.ADD_IMAGE_DATAURI,24,24,"*",function(){a.addItem_()},!1));b=this.itemCount_<=this.horizontalAfter_;this.setInputsInline(b);this.setOutputShape(b?Blockly.OUTPUT_SHAPE_ROUND:Blockly.OUTPUT_SHAPE_SQUARE)}};
2859
2859
  Blockly.Blocks.lists_create_with_container={init:function(){this.setStyle("list_blocks");this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD);this.appendStatementInput("STACK");this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP);this.contextMenu=!1}};
2860
2860
  Blockly.Blocks.lists_create_with_item={init:function(){this.setStyle("list_blocks");this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP);this.contextMenu=!1}};
2861
2861
  Blockly.Blocks.lists_indexOf={init:function(){var a=[[Blockly.Msg.LISTS_INDEX_OF_FIRST,"FIRST"],[Blockly.Msg.LISTS_INDEX_OF_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.LISTS_INDEX_OF_HELPURL);this.setStyle("list_blocks");this.setOutput(!0,"Number");this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.appendValueInput("VALUE").setCheck("Array").appendField(Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST);this.appendValueInput("FIND").appendField(new Blockly.FieldDropdown(a),"END");this.setInputsInline(!0);
@@ -3026,11 +3026,11 @@ Blockly.PXTBlockly.FunctionUtils.createAllInputs_=function(a){var b=!1,c=!1,d=!1
3026
3026
  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)};
3027
3027
  Blockly.PXTBlockly.FunctionUtils.addLabelEditor_=function(a){a=this.type===Blockly.FUNCTION_DEFINITION_BLOCK_TYPE?new Blockly.FieldTextInput(a||"",Blockly.Functions.rename):new Blockly.FieldTextInput(a||"");a.setSpellcheck(!1);a.setAutoCapitalize(!1);this.appendDummyInput("function_name").appendField(a,"function_name")};Blockly.PXTBlockly.FunctionUtils.addLabelField_=function(a){this.appendDummyInput("function_name").appendField(new Blockly.FieldLabel(a,"functionNameText"),"function_name")};
3028
3028
  Blockly.PXTBlockly.FunctionUtils.getShadowBlockInfoFromType_=function(a,b){switch(a){case "boolean":var c="logic_boolean";var d="BOOL";a="TRUE";break;case "number":c="math_number";d="NUM";a="1";break;case "string":c="text";d="TEXT";a="abc";break;case "Array":c="variables_get";d="VAR";a=Blockly.Variables.getOrCreateVariablePackage(b,null,"list","").getId();break;default:c="variables_get",d="VAR",a=Blockly.Variables.getOrCreateVariablePackage(b,null,Blockly.PXTBlockly.FunctionUtils.getArgumentDefaultName(a),
3029
- "").getId()}return[c,d,a]};Blockly.PXTBlockly.FunctionUtils.buildShadowDom_=function(a){var b=Blockly.utils.xml.createElement("shadow"),c=Blockly.PXTBlockly.FunctionUtils.getShadowBlockInfoFromType_(a,this.workspace);a=c[1];var d=c[2];b.setAttribute("type",c[0]);c=goog.dom.createDom("field",null,d);c.setAttribute("name",a);b.appendChild(c);return b};
3029
+ "").getId()}return[c,d,a]};Blockly.PXTBlockly.FunctionUtils.buildShadowDom_=function(a){var b=Blockly.utils.xml.createElement("shadow"),c=Blockly.PXTBlockly.FunctionUtils.getShadowBlockInfoFromType_(a,this.workspace),d=c[0];a=c[1];c=c[2];var e="variables_get"===d;b.setAttribute("type",d);d=goog.dom.createDom("field",null,c);e&&(d.setAttribute("id",c),c=this.workspace.getVariableById(c),d.textContent=c?c.name:"");d.setAttribute("name",a);b.appendChild(d);return b};
3030
3030
  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)};
3031
3031
  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);
3032
3032
  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))}};
3033
- 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))};
3033
+ 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),d.isShadow()?c.connection.setShadowDom(Blockly.Xml.blockToDom(d)):(a=e||this.buildShadowDom_(a.type),c.connection.setShadowDom(a))):(this.attachShadow_(c,a.type),d&&d.isShadow_&&d.setShadow(!1))};
3034
3034
  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)};
3035
3035
  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");
3036
3036
  d.setShadow(!0);!this.isInsertionMarker()&&d.initSvg&&(d.initSvg(),d.render(!1))}finally{Blockly.Events.enable()}return d};
@@ -6480,11 +6480,12 @@ var pxt;
6480
6480
  workspace.getAllBlocks(false)
6481
6481
  .filter(b => !!b.getCommentText())
6482
6482
  .forEach(b => {
6483
+ var _a, _b;
6483
6484
  const c = b.getCommentText();
6484
6485
  if (/@highlight/.test(c)) {
6485
6486
  const cc = c.replace(/@highlight/g, '').trim();
6486
6487
  b.setCommentText(cc || null);
6487
- workspace.highlightBlock(b.id);
6488
+ (_b = (_a = workspace).highlightBlock) === null || _b === void 0 ? void 0 : _b.call(_a, b.id);
6488
6489
  }
6489
6490
  });
6490
6491
  }
@@ -8460,8 +8461,8 @@ var pxt;
8460
8461
  * moved from the position at the start of the drag, in pixel units.
8461
8462
  * @package
8462
8463
  */
8463
- const blockDrag = Blockly.BlockDragger.prototype.dragBlock;
8464
- Blockly.BlockDragger.prototype.dragBlock = function (e, currentDragDeltaXY) {
8464
+ const blockDrag = Blockly.BlockDragger.prototype.drag;
8465
+ Blockly.BlockDragger.prototype.drag = function (e, currentDragDeltaXY) {
8465
8466
  const blocklyToolboxDiv = document.getElementsByClassName('blocklyToolboxDiv')[0];
8466
8467
  const blocklyTreeRoot = document.getElementsByClassName('blocklyTreeRoot')[0]
8467
8468
  || document.getElementsByClassName('blocklyFlyout')[0];
@@ -8494,8 +8495,8 @@ var pxt;
8494
8495
  * moved from the position at the start of the drag, in pixel coordinates.
8495
8496
  * @package
8496
8497
  */
8497
- const blockEndDrag = Blockly.BlockDragger.prototype.endBlockDrag;
8498
- Blockly.BlockDragger.prototype.endBlockDrag = function (e, currentDragDeltaXY) {
8498
+ const blockEndDrag = Blockly.BlockDragger.prototype.endDrag;
8499
+ Blockly.BlockDragger.prototype.endDrag = function (e, currentDragDeltaXY) {
8499
8500
  blockEndDrag.call(this, e, currentDragDeltaXY);
8500
8501
  const blocklyToolboxDiv = document.getElementsByClassName('blocklyToolboxDiv')[0];
8501
8502
  const blocklyTreeRoot = document.getElementsByClassName('blocklyTreeRoot')[0]
@@ -8641,6 +8642,17 @@ var pxt;
8641
8642
  };
8642
8643
  options.push(screenshotOption);
8643
8644
  }
8645
+ if (pxt.appTarget.appTheme.workspaceSearch) {
8646
+ options.push({
8647
+ text: lf("Find..."),
8648
+ enabled: topBlocks.length > 0,
8649
+ callback: () => {
8650
+ var _a, _b;
8651
+ pxt.tickEvent("blocks.context.workspacesearch", undefined, { interactiveConsent: true });
8652
+ (_b = (_a = this.getComponentManager()) === null || _a === void 0 ? void 0 : _a.getComponent("workspaceSearch")) === null || _b === void 0 ? void 0 : _b.open();
8653
+ }
8654
+ });
8655
+ }
8644
8656
  // custom options...
8645
8657
  if (blocks_4.onShowContextMenu)
8646
8658
  blocks_4.onShowContextMenu(this, options);
@@ -2856,11 +2856,12 @@ var pxt;
2856
2856
  workspace.getAllBlocks(false)
2857
2857
  .filter(b => !!b.getCommentText())
2858
2858
  .forEach(b => {
2859
+ var _a, _b;
2859
2860
  const c = b.getCommentText();
2860
2861
  if (/@highlight/.test(c)) {
2861
2862
  const cc = c.replace(/@highlight/g, '').trim();
2862
2863
  b.setCommentText(cc || null);
2863
- workspace.highlightBlock(b.id);
2864
+ (_b = (_a = workspace).highlightBlock) === null || _b === void 0 ? void 0 : _b.call(_a, b.id);
2864
2865
  }
2865
2866
  });
2866
2867
  }
@@ -4836,8 +4837,8 @@ var pxt;
4836
4837
  * moved from the position at the start of the drag, in pixel units.
4837
4838
  * @package
4838
4839
  */
4839
- const blockDrag = Blockly.BlockDragger.prototype.dragBlock;
4840
- Blockly.BlockDragger.prototype.dragBlock = function (e, currentDragDeltaXY) {
4840
+ const blockDrag = Blockly.BlockDragger.prototype.drag;
4841
+ Blockly.BlockDragger.prototype.drag = function (e, currentDragDeltaXY) {
4841
4842
  const blocklyToolboxDiv = document.getElementsByClassName('blocklyToolboxDiv')[0];
4842
4843
  const blocklyTreeRoot = document.getElementsByClassName('blocklyTreeRoot')[0]
4843
4844
  || document.getElementsByClassName('blocklyFlyout')[0];
@@ -4870,8 +4871,8 @@ var pxt;
4870
4871
  * moved from the position at the start of the drag, in pixel coordinates.
4871
4872
  * @package
4872
4873
  */
4873
- const blockEndDrag = Blockly.BlockDragger.prototype.endBlockDrag;
4874
- Blockly.BlockDragger.prototype.endBlockDrag = function (e, currentDragDeltaXY) {
4874
+ const blockEndDrag = Blockly.BlockDragger.prototype.endDrag;
4875
+ Blockly.BlockDragger.prototype.endDrag = function (e, currentDragDeltaXY) {
4875
4876
  blockEndDrag.call(this, e, currentDragDeltaXY);
4876
4877
  const blocklyToolboxDiv = document.getElementsByClassName('blocklyToolboxDiv')[0];
4877
4878
  const blocklyTreeRoot = document.getElementsByClassName('blocklyTreeRoot')[0]
@@ -5017,6 +5018,17 @@ var pxt;
5017
5018
  };
5018
5019
  options.push(screenshotOption);
5019
5020
  }
5021
+ if (pxt.appTarget.appTheme.workspaceSearch) {
5022
+ options.push({
5023
+ text: lf("Find..."),
5024
+ enabled: topBlocks.length > 0,
5025
+ callback: () => {
5026
+ var _a, _b;
5027
+ pxt.tickEvent("blocks.context.workspacesearch", undefined, { interactiveConsent: true });
5028
+ (_b = (_a = this.getComponentManager()) === null || _a === void 0 ? void 0 : _a.getComponent("workspaceSearch")) === null || _b === void 0 ? void 0 : _b.open();
5029
+ }
5030
+ });
5031
+ }
5020
5032
  // custom options...
5021
5033
  if (blocks_4.onShowContextMenu)
5022
5034
  blocks_4.onShowContextMenu(this, options);
@@ -202,6 +202,7 @@ declare namespace pxt.editor {
202
202
  openProjectByHeaderIdAsync(headerId: string): Promise<void>;
203
203
  overrideTypescriptFile(text: string): void;
204
204
  overrideBlocksFile(text: string): void;
205
+ resetTutorialTemplateCode(keepAssets: boolean): Promise<void>;
205
206
  exportAsync(): Promise<string>;
206
207
  newEmptyProject(name?: string, documentation?: string, preferredEditor?: string): void;
207
208
  newProject(options?: ProjectCreationOptions): void;