pxt-core 8.1.5 → 8.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/pxt.js +13 -0
- package/built/pxtblockly.js +4 -4
- package/built/pxtlib.d.ts +1 -0
- package/built/pxtlib.js +13 -0
- package/built/target.js +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 +1 -1
- package/built/web/pxtembed.js +1 -1
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/react-common-authcode.css +2 -2
- package/built/web/react-common-skillmap.css +1 -1
- package/built/web/rtlreact-common-skillmap.css +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/package.json +2 -2
- package/react-common/components/controls/EditorToggle.tsx +1 -0
- package/react-common/components/share/ShareInfo.tsx +1 -7
- package/react-common/styles/controls/EditorToggle.less +6 -0
- package/theme/common.less +10 -0
- package/webapp/public/blockly/blockly_compressed.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pxt-core",
|
|
3
|
-
"version": "8.1
|
|
3
|
+
"version": "8.2.1",
|
|
4
4
|
"description": "Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"TypeScript",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"monaco-editor": "0.24.0",
|
|
134
134
|
"pouchdb": "7.2.1",
|
|
135
135
|
"pouchdb-adapter-memory": "7.2.1",
|
|
136
|
-
"pxt-blockly": "4.0.
|
|
136
|
+
"pxt-blockly": "4.0.15",
|
|
137
137
|
"react": "16.8.3",
|
|
138
138
|
"react-dom": "16.11.0",
|
|
139
139
|
"react-modal": "3.3.2",
|
|
@@ -100,6 +100,7 @@ const ToggleButton = (props: ToggleButtonProps) => {
|
|
|
100
100
|
const { label, title, onClick, icon, focusable } = item;
|
|
101
101
|
|
|
102
102
|
return <Button
|
|
103
|
+
className={icon ? undefined : "no-icon"}
|
|
103
104
|
role={focusable ? "tab" : undefined}
|
|
104
105
|
tabIndex={-1}
|
|
105
106
|
onKeydown={onKeydown}
|
|
@@ -64,13 +64,7 @@ export const ShareInfo = (props: ShareInfoProps) => {
|
|
|
64
64
|
|
|
65
65
|
const handleCopyClick = () => {
|
|
66
66
|
if (pxt.BrowserUtils.isIpcRenderer()) {
|
|
67
|
-
|
|
68
|
-
const selection = document.createRange();
|
|
69
|
-
selection.selectNode(inputRef);
|
|
70
|
-
window.getSelection().addRange(selection);
|
|
71
|
-
const success = document.execCommand("copy");
|
|
72
|
-
|
|
73
|
-
setCopySuccessful(success);
|
|
67
|
+
setCopySuccessful(pxt.BrowserUtils.legacyCopyText(inputRef));
|
|
74
68
|
}
|
|
75
69
|
else {
|
|
76
70
|
navigator.clipboard.writeText(shareData.url);
|
|
@@ -174,6 +174,9 @@
|
|
|
174
174
|
& > .common-editor-toggle-item > .common-button {
|
|
175
175
|
padding-left: 0.5rem;
|
|
176
176
|
padding-right: 0.5rem;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
& > .common-editor-toggle-item > .common-button:not(.no-icon) {
|
|
177
180
|
.common-button-label {
|
|
178
181
|
display: none;
|
|
179
182
|
}
|
|
@@ -225,6 +228,9 @@
|
|
|
225
228
|
& > .common-editor-toggle-item > .common-button {
|
|
226
229
|
padding-left: 0.5rem;
|
|
227
230
|
padding-right: 0.5rem;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
& > .common-editor-toggle-item > .common-button:not(.no-icon) {
|
|
228
234
|
.common-button-label {
|
|
229
235
|
display: none;
|
|
230
236
|
}
|
package/theme/common.less
CHANGED
|
@@ -1478,6 +1478,12 @@ p.ui.font.small {
|
|
|
1478
1478
|
i.green.icon {
|
|
1479
1479
|
color: rgba(0,0,0,.6)!important;
|
|
1480
1480
|
}
|
|
1481
|
+
|
|
1482
|
+
#boardview.headless-sim {
|
|
1483
|
+
height: 100%;
|
|
1484
|
+
padding: 1rem;
|
|
1485
|
+
width: @simulatorWidth;
|
|
1486
|
+
}
|
|
1481
1487
|
}
|
|
1482
1488
|
|
|
1483
1489
|
#root.headless.collapsedEditorTools {
|
|
@@ -1894,6 +1900,10 @@ p.ui.font.small {
|
|
|
1894
1900
|
max-width:@simulatorWidthSmall;
|
|
1895
1901
|
}
|
|
1896
1902
|
|
|
1903
|
+
#boardview.headless-sim {
|
|
1904
|
+
width: @simulatorWidthSmall;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1897
1907
|
#maineditor {
|
|
1898
1908
|
left:@simulatorWidthSmall;
|
|
1899
1909
|
}
|
|
@@ -401,8 +401,8 @@ Blockly.ConnectionChecker.prototype.getErrorMessage=function(a,b,c){switch(a){ca
|
|
|
401
401
|
Blockly.ConnectionChecker.prototype.doSafetyChecks=function(a,b){if(!a||!b)return Blockly.Connection.REASON_TARGET_NULL;if(a.isSuperior())var c=a.getSourceBlock(),d=b.getSourceBlock();else d=a.getSourceBlock(),c=b.getSourceBlock();return c==d?Blockly.Connection.REASON_SELF_CONNECTION:b.type!=Blockly.OPPOSITE_TYPE[a.type]?Blockly.Connection.REASON_WRONG_TYPE:c.workspace!==d.workspace?Blockly.Connection.REASON_DIFFERENT_WORKSPACES:Blockly.Connection.CAN_CONNECT};
|
|
402
402
|
Blockly.ConnectionChecker.prototype.doTypeChecks=function(a,b){a=a.getCheck();b=b.getCheck();if(!a||!b)return!0;for(var c=0;c<a.length;c++)if(-1!=b.indexOf(a[c]))return!0;return!1};
|
|
403
403
|
Blockly.ConnectionChecker.prototype.doDragChecks=function(a,b,c){if(a.distanceFrom(b)>c||b.getSourceBlock().isInsertionMarker())return!1;switch(b.type){case Blockly.connectionTypes.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(a,b);case Blockly.connectionTypes.OUTPUT_VALUE:if(b.isConnected()&&!b.targetBlock().isInsertionMarker()||a.isConnected())return!1;break;case Blockly.connectionTypes.INPUT_VALUE:if(b.isConnected()&&!b.targetBlock().isMovable()&&!b.targetBlock().isShadow()||b&&b.targetBlock()&&
|
|
404
|
-
(c=b.targetBlock(),c.isShadow()&&Blockly.pxtBlocklyUtils.isFunctionArgumentReporter(c))
|
|
405
|
-
Blockly.draggingConnections.indexOf(b)?!1:!0};Blockly.ConnectionChecker.prototype.canConnectToPrevious_=function(a,b){if(a.targetConnection||-1!=Blockly.draggingConnections.indexOf(b))return!1;var c=a.getSourceBlock(),d=c.getFirstStatementConnection(),e=a==d;a=a==c.nextConnection;if(null!=d&&!e&&!a)return!1;c=null!=c.previousConnection;if(e&&c||!b.targetConnection)return!0;b=b.targetBlock();return b.isInsertionMarker()?!b.getPreviousBlock():!1};
|
|
404
|
+
(c=b.targetBlock(),c.isShadow()&&Blockly.pxtBlocklyUtils.isFunctionArgumentReporter(c)))return!1;if(Blockly.pxtBlocklyUtils.isFunctionArgumentReporter(a.getSourceBlock())){c=b.getSourceBlock().getParent();for(var d=!1;c;){if(!c.isEnabled()||Blockly.pxtBlocklyUtils.hasMatchingArgumentReporter(c,a.getSourceBlock())){d=!0;break}c=c.getParent()}if(!d)return!1}break;case Blockly.connectionTypes.NEXT_STATEMENT:if(b.isConnected()&&!a.getSourceBlock().nextConnection&&!b.targetBlock().isShadow()&&b.targetBlock().nextConnection)return!1;
|
|
405
|
+
break;default:return!1}return-1!=Blockly.draggingConnections.indexOf(b)?!1:!0};Blockly.ConnectionChecker.prototype.canConnectToPrevious_=function(a,b){if(a.targetConnection||-1!=Blockly.draggingConnections.indexOf(b))return!1;var c=a.getSourceBlock(),d=c.getFirstStatementConnection(),e=a==d;a=a==c.nextConnection;if(null!=d&&!e&&!a)return!1;c=null!=c.previousConnection;if(e&&c||!b.targetConnection)return!0;b=b.targetBlock();return b.isInsertionMarker()?!b.getPreviousBlock():!1};
|
|
406
406
|
Blockly.registry.register(Blockly.registry.Type.CONNECTION_CHECKER,Blockly.registry.DEFAULT,Blockly.ConnectionChecker);Blockly.VariableMap=function(a){this.variableMap_=Object.create(null);this.workspace=a};Blockly.VariableMap.prototype.clear=function(){this.variableMap_=Object.create(null)};Blockly.VariableMap.prototype.renameVariable=function(a,b){var c=this.getVariable(b,a.type),d=this.workspace.getAllBlocks(!1);Blockly.Events.setGroup(!0);try{c&&c.getId()!=a.getId()?this.renameVariableWithConflict_(a,b,c,d):this.renameVariableAndUses_(a,b,d)}finally{Blockly.Events.setGroup(!1)}};
|
|
407
407
|
Blockly.VariableMap.prototype.renameVariableById=function(a,b){var c=this.getVariableById(a);if(!c)throw Error("Tried to rename a variable that didn't exist. ID: "+a);this.renameVariable(c,b)};Blockly.VariableMap.prototype.renameVariableAndUses_=function(a,b,c){Blockly.Events.fire(new (Blockly.Events.get(Blockly.Events.VAR_RENAME))(a,b));a.name=b;for(b=0;b<c.length;b++)c[b].updateVarName(a)};
|
|
408
408
|
Blockly.VariableMap.prototype.renameVariableWithConflict_=function(a,b,c,d){var e=a.type;b!=c.name&&this.renameVariableAndUses_(c,b,d);for(b=0;b<d.length;b++)d[b].renameVarById(a.getId(),c.getId());Blockly.Events.fire(new (Blockly.Events.get(Blockly.Events.VAR_DELETE))(a));a=this.getVariablesOfType(e).indexOf(a);this.variableMap_[e].splice(a,1)};
|
|
@@ -1084,7 +1084,7 @@ return Blockly.Functions.namesInUse(b,null,a)[c]?(Blockly.alert(Blockly.Msg.VARI
|
|
|
1084
1084
|
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,
|
|
1085
1085
|
!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")};
|
|
1086
1086
|
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);
|
|
1087
|
-
var d=c.createDom("svg");goog.dom.insertSiblingAfter(d,b);c.init(a);return c};Blockly.VERSION="4.0.
|
|
1087
|
+
var d=c.createDom("svg");goog.dom.insertSiblingAfter(d,b);c.init(a);return c};Blockly.VERSION="4.0.15";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()};
|
|
1088
1088
|
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()}};
|
|
1089
1089
|
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};
|
|
1090
1090
|
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};
|
|
@@ -1241,7 +1241,7 @@ weight:1,capabilities:[Blockly.ComponentManager.Capability.AUTOHIDEABLE,Blockly.
|
|
|
1241
1241
|
Blockly.Toolbox.prototype.createDom_=function(a){a=a.getParentSvg();var b=this.createContainer_();this.contentsDiv_=this.createContentsContainer_();this.contentsDiv_.tabIndex=0;Blockly.utils.aria.setRole(this.contentsDiv_,Blockly.utils.aria.Role.TREE);b.appendChild(this.contentsDiv_);a.parentNode.insertBefore(b,a);this.attachEvents_(b,this.contentsDiv_);return b};
|
|
1242
1242
|
Blockly.Toolbox.prototype.createContainer_=function(){var a=document.createElement("div");a.setAttribute("layout",this.isHorizontal()?"h":"v");Blockly.utils.dom.addClass(a,"blocklyToolboxDiv");Blockly.utils.dom.addClass(a,"blocklyNonSelectable");a.setAttribute("dir",this.RTL?"RTL":"LTR");return a};
|
|
1243
1243
|
Blockly.Toolbox.prototype.createContentsContainer_=function(){var a=document.createElement("div");Blockly.utils.dom.addClass(a,"blocklyToolboxContents");this.isHorizontal()&&(a.style.flexDirection="row");return a};Blockly.Toolbox.prototype.attachEvents_=function(a,b){a=Blockly.browserEvents.conditionalBind(a,"click",this,this.onClick_,!1,!0);this.boundEvents_.push(a);b=Blockly.browserEvents.conditionalBind(b,"keydown",this,this.onKeyDown_,!1,!0);this.boundEvents_.push(b)};
|
|
1244
|
-
Blockly.Toolbox.prototype.onClick_=function(a){if(Blockly.utils.isRightButton(a)||a.target==this.HtmlDiv)Blockly.hideChaff(!1);else{var b=a.target.getAttribute("id");b&&(b=this.getToolboxItemById(b)
|
|
1244
|
+
Blockly.Toolbox.prototype.onClick_=function(a){if(Blockly.utils.isRightButton(a)||a.target==this.HtmlDiv)Blockly.hideChaff(!1);else{var b=a.target.getAttribute("id");b&&(b=this.getToolboxItemById(b))&&b.isSelectable()&&(this.setSelectedItem(b),b.onClick(a));Blockly.hideChaff(!0)}Blockly.Touch.clearTouchIdentifier()};
|
|
1245
1245
|
Blockly.Toolbox.prototype.onKeyDown_=function(a){var b=!1;switch(a.keyCode){case Blockly.utils.KeyCodes.DOWN:b=this.selectNext_();break;case Blockly.utils.KeyCodes.UP:b=this.selectPrevious_();break;case Blockly.utils.KeyCodes.LEFT:b=this.selectParent_();break;case Blockly.utils.KeyCodes.RIGHT:b=this.selectChild_();break;case Blockly.utils.KeyCodes.ENTER:case Blockly.utils.KeyCodes.SPACE:this.selectedItem_&&this.selectedItem_.isCollapsible()&&(this.selectedItem_.toggleExpanded(),b=!0);break;default:b=
|
|
1246
1246
|
!1}!b&&this.selectedItem_&&this.selectedItem_.onKeyDown&&(b=this.selectedItem_.onKeyDown(a));b&&a.preventDefault()};
|
|
1247
1247
|
Blockly.Toolbox.prototype.createFlyout_=function(){var a=this.workspace_,b=new Blockly.Options({parentWorkspace:a,rtl:a.RTL,oneBasedIndex:a.options.oneBasedIndex,horizontalLayout:a.horizontalLayout,renderer:a.options.renderer,rendererOverrides:a.options.rendererOverrides,move:{scrollbars:!0}});b.toolboxPosition=a.options.toolboxPosition;return new (a.horizontalLayout?Blockly.registry.getClassFromOptions(Blockly.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,a.options,!0):Blockly.registry.getClassFromOptions(Blockly.registry.Type.FLYOUTS_VERTICAL_TOOLBOX,
|