pxt-core 7.4.16 → 7.4.20

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 (54) hide show
  1. package/built/backendutils.js +5 -6
  2. package/built/buildengine.js +1 -1
  3. package/built/gdb.js +1 -1
  4. package/built/pxt.js +5 -6
  5. package/built/pxtblockly.js +29 -17
  6. package/built/pxtblocks.js +17 -5
  7. package/built/pxteditor.d.ts +7 -1
  8. package/built/pxteditor.js +5 -0
  9. package/built/pxtlib.js +5 -6
  10. package/built/target.js +1 -1
  11. package/built/web/main.js +1 -1
  12. package/built/web/pxtapp.js +1 -1
  13. package/built/web/pxtasseteditor.js +1 -1
  14. package/built/web/pxtblockly.js +2 -2
  15. package/built/web/pxtblocks.js +1 -1
  16. package/built/web/pxteditor.js +1 -1
  17. package/built/web/pxtembed.js +2 -2
  18. package/built/web/pxtlib.js +1 -1
  19. package/built/web/pxtworker.js +1 -1
  20. package/built/web/react-common-skillmap.css +1 -1
  21. package/built/web/rtlreact-common-skillmap.css +1 -1
  22. package/built/web/rtlsemantic.css +1 -1
  23. package/built/web/semantic.css +1 -1
  24. package/built/web/skillmap/css/main.4939cd1e.chunk.css +1 -0
  25. package/built/web/skillmap/js/2.f7cdfd75.chunk.js +2 -0
  26. package/built/web/skillmap/js/main.2a4cb15b.chunk.js +1 -0
  27. package/localtypings/pxtarget.d.ts +1 -0
  28. package/package.json +2 -2
  29. package/react-common/components/controls/Button.tsx +7 -3
  30. package/react-common/components/controls/FocusTrap.tsx +30 -4
  31. package/react-common/components/controls/MenuBar.tsx +8 -1
  32. package/react-common/components/controls/Modal.tsx +5 -2
  33. package/react-common/components/profile/BadgeInfo.tsx +9 -2
  34. package/react-common/components/profile/BadgeList.tsx +5 -5
  35. package/react-common/components/profile/Profile.tsx +5 -0
  36. package/react-common/components/profile/UserPane.tsx +1 -1
  37. package/react-common/components/types.d.ts +1 -0
  38. package/react-common/components/util.tsx +1 -0
  39. package/react-common/styles/controls/Button.less +16 -0
  40. package/react-common/styles/controls/Checkbox.less +11 -0
  41. package/react-common/styles/controls/Input.less +19 -1
  42. package/react-common/styles/controls/MenuDropdown.less +20 -1
  43. package/react-common/styles/controls/Modal.less +30 -1
  44. package/react-common/styles/profile/profile.less +20 -0
  45. package/react-common/styles/react-common-variables.less +11 -0
  46. package/theme/highcontrast.less +31 -9
  47. package/theme/tutorial-sidebar.less +97 -14
  48. package/theme/tutorial.less +16 -8
  49. package/webapp/public/blockly/blockly_compressed.js +6 -6
  50. package/webapp/public/blockly/blocks_compressed.js +6 -6
  51. package/webapp/public/skillmap.html +2 -2
  52. package/built/web/skillmap/css/main.51937f05.chunk.css +0 -1
  53. package/built/web/skillmap/js/2.261d5eab.chunk.js +0 -2
  54. package/built/web/skillmap/js/main.1f690147.chunk.js +0 -1
@@ -710,16 +710,15 @@ var pxt;
710
710
  text = m[1];
711
711
  id = m[2];
712
712
  }
713
- else {
714
- id = raw.toLowerCase().replace(/[^\w]+/g, '-');
715
- }
716
713
  // remove tutorial macros
717
714
  if (text)
718
715
  text = text.replace(/@(fullscreen|unplugged|showdialog|showhint)/gi, '');
719
- text = text.trim();
720
716
  // remove brackets for hiding step title
721
- if (text.match(/^\{([\s\S]+)\}$/))
722
- text = text.substr(1, text.length - 2);
717
+ if (text.match(/\{([\s\S]+)\}/))
718
+ text = text.match(/\{([\s\S]+)\}/)[1].trim();
719
+ if (id === "") {
720
+ id = text.toLowerCase().replace(/[^\w]+/g, '-');
721
+ }
723
722
  return `<h${level} id="${this.options.headerPrefix}${id}">${text}</h${level}>`;
724
723
  };
725
724
  }
@@ -138,7 +138,7 @@ function setThisBuild(b) {
138
138
  exports.setThisBuild = setThisBuild;
139
139
  function patchYottaHexInfo(extInfo) {
140
140
  let buildEngine = exports.thisBuild;
141
- let hexPath = buildEngine.buildPath + "/build/" + pxt.appTarget.compileService.yottaTarget
141
+ let hexPath = buildEngine.buildPath + "/build/" + pxt.appTarget.compileService.yottaTarget.split("@")[0]
142
142
  + "/source/" + pxt.appTarget.compileService.yottaBinary;
143
143
  return {
144
144
  hex: fs.readFileSync(hexPath, "utf8").split(/\r?\n/)
package/built/gdb.js CHANGED
@@ -215,7 +215,7 @@ function codalBin() {
215
215
  return be.buildPath + "/" + be.outputPath;
216
216
  if (cs.codalBinary)
217
217
  return be.buildPath + "/build/" + cs.codalBinary;
218
- return be.buildPath + "/build/" + cs.yottaTarget + "/source/" + cs.yottaBinary.replace(/\.hex$/, "").replace(/-combined$/, "");
218
+ return be.buildPath + "/build/" + (cs.yottaTarget.split("@")[0]) + "/source/" + cs.yottaBinary.replace(/\.hex$/, "").replace(/-combined$/, "");
219
219
  }
220
220
  let cachedMap = "";
221
221
  let addrCache;
package/built/pxt.js CHANGED
@@ -106369,16 +106369,15 @@ var pxt;
106369
106369
  text = m[1];
106370
106370
  id = m[2];
106371
106371
  }
106372
- else {
106373
- id = raw.toLowerCase().replace(/[^\w]+/g, '-');
106374
- }
106375
106372
  // remove tutorial macros
106376
106373
  if (text)
106377
106374
  text = text.replace(/@(fullscreen|unplugged|showdialog|showhint)/gi, '');
106378
- text = text.trim();
106379
106375
  // remove brackets for hiding step title
106380
- if (text.match(/^\{([\s\S]+)\}$/))
106381
- text = text.substr(1, text.length - 2);
106376
+ if (text.match(/\{([\s\S]+)\}/))
106377
+ text = text.match(/\{([\s\S]+)\}/)[1].trim();
106378
+ if (id === "") {
106379
+ id = text.toLowerCase().replace(/[^\w]+/g, '-');
106380
+ }
106382
106381
  return `<h${level} id="${this.options.headerPrefix}${id}">${text}</h${level}>`;
106383
106382
  };
106384
106383
  }
@@ -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,"&#10;");return a};Blockly.FieldMultilineInput.prototype.fromXml=function(a){this.setValue(a.textContent.replace(/&#10;/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;
@@ -283,6 +284,7 @@ declare namespace pxt.editor {
283
284
  renderBlocksAsync(req: EditorMessageRenderBlocksRequest): Promise<EditorMessageRenderBlocksResponse>;
284
285
  renderPythonAsync(req: EditorMessageRenderPythonRequest): Promise<EditorMessageRenderPythonResponse>;
285
286
  toggleHighContrast(): void;
287
+ setHighContrast(on: boolean): void;
286
288
  toggleGreenScreen(): void;
287
289
  toggleAccessibleBlocks(): void;
288
290
  setAccessibleBlocks(enabled: boolean): void;
@@ -531,7 +533,7 @@ declare namespace pxt.editor {
531
533
  /**
532
534
  * Request action
533
535
  */
534
- action: "switchblocks" | "switchjavascript" | "startsimulator" | "restartsimulator" | "stopsimulator" | "hidesimulator" | "showsimulator" | "closeflyout" | "newproject" | "importproject" | "importtutorial" | "openheader" | "proxytosim" | "undo" | "redo" | "renderblocks" | "renderpython" | "setscale" | "startactivity" | "saveproject" | "unloadproject" | "shareproject" | "savelocalprojectstocloud" | "projectcloudstatus" | "requestprojectcloudstatus" | "convertcloudprojectstolocal" | "setlanguagerestriction" | "toggletrace" | "togglehighcontrast" | "togglegreenscreen" | "settracestate" | "setsimulatorfullscreen" | "print" | "pair" | "workspacesync" | "workspacereset" | "workspacesave" | "workspaceloaded" | "workspaceevent" | "workspacediagnostics" | "event" | "simevent" | "info" | "tutorialevent" | ExtInitializeType | ExtDataStreamType | ExtUserCodeType | ExtReadCodeType | ExtWriteCodeType;
536
+ action: "switchblocks" | "switchjavascript" | "startsimulator" | "restartsimulator" | "stopsimulator" | "hidesimulator" | "showsimulator" | "closeflyout" | "newproject" | "importproject" | "importtutorial" | "openheader" | "proxytosim" | "undo" | "redo" | "renderblocks" | "renderpython" | "setscale" | "startactivity" | "saveproject" | "unloadproject" | "shareproject" | "savelocalprojectstocloud" | "projectcloudstatus" | "requestprojectcloudstatus" | "convertcloudprojectstolocal" | "setlanguagerestriction" | "toggletrace" | "togglehighcontrast" | "sethighcontrast" | "togglegreenscreen" | "settracestate" | "setsimulatorfullscreen" | "print" | "pair" | "workspacesync" | "workspacereset" | "workspacesave" | "workspaceloaded" | "workspaceevent" | "workspacediagnostics" | "event" | "simevent" | "info" | "tutorialevent" | ExtInitializeType | ExtDataStreamType | ExtUserCodeType | ExtReadCodeType | ExtWriteCodeType;
535
537
  }
536
538
  /**
537
539
  * Request sent by the editor when a tick/error/expection is registered
@@ -708,6 +710,10 @@ declare namespace pxt.editor {
708
710
  action: "setsimulatorfullscreen";
709
711
  enabled: boolean;
710
712
  }
713
+ interface EditorMessageSetHighContrastRequest extends EditorMessageRequest {
714
+ action: "sethighcontrast";
715
+ on: boolean;
716
+ }
711
717
  interface EditorMessageStartActivity extends EditorMessageRequest {
712
718
  action: "startactivity";
713
719
  activityType: "tutorial" | "example" | "recipe";
@@ -231,6 +231,11 @@ var pxt;
231
231
  return Promise.resolve()
232
232
  .then(() => projectView.toggleHighContrast());
233
233
  }
234
+ case "sethighcontrast": {
235
+ const hcmsg = data;
236
+ return Promise.resolve()
237
+ .then(() => projectView.setHighContrast(hcmsg.on));
238
+ }
234
239
  case "togglegreenscreen": {
235
240
  return Promise.resolve()
236
241
  .then(() => projectView.toggleGreenScreen());
package/built/pxtlib.js CHANGED
@@ -8683,16 +8683,15 @@ var pxt;
8683
8683
  text = m[1];
8684
8684
  id = m[2];
8685
8685
  }
8686
- else {
8687
- id = raw.toLowerCase().replace(/[^\w]+/g, '-');
8688
- }
8689
8686
  // remove tutorial macros
8690
8687
  if (text)
8691
8688
  text = text.replace(/@(fullscreen|unplugged|showdialog|showhint)/gi, '');
8692
- text = text.trim();
8693
8689
  // remove brackets for hiding step title
8694
- if (text.match(/^\{([\s\S]+)\}$/))
8695
- text = text.substr(1, text.length - 2);
8690
+ if (text.match(/\{([\s\S]+)\}/))
8691
+ text = text.match(/\{([\s\S]+)\}/)[1].trim();
8692
+ if (id === "") {
8693
+ id = text.toLowerCase().replace(/[^\w]+/g, '-');
8694
+ }
8696
8695
  return `<h${level} id="${this.options.headerPrefix}${id}">${text}</h${level}>`;
8697
8696
  };
8698
8697
  }