pxt-core 7.5.52 → 7.5.71
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 +9 -68
- package/built/pxtblockly.js +15 -23
- package/built/pxtblocks.d.ts +0 -1
- package/built/pxtblocks.js +1 -9
- package/built/pxtlib.d.ts +0 -7
- package/built/pxtlib.js +5 -49
- package/built/pxtpy.js +2 -19
- package/built/pxtrunner.d.ts +1 -0
- package/built/pxtrunner.js +2 -1
- package/built/pxtsim.d.ts +1 -1
- package/built/pxtsim.js +2 -0
- package/built/server.js +1 -1
- package/built/target.js +1 -1
- package/built/web/main.js +1 -1
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxtblockly.js +2 -2
- package/built/web/pxtblocks.js +1 -1
- package/built/web/pxtembed.js +2 -2
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtpy.js +1 -1
- package/built/web/pxtrunner.js +1 -1
- package/built/web/pxtsim.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/react-common-authcode.css +2 -123
- 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/built/web/skillmap/js/main.9d7e815e.chunk.js +1 -0
- package/package.json +2 -2
- package/react-common/components/controls/Input.tsx +2 -3
- package/react-common/components/controls/LazyImage.tsx +0 -6
- package/react-common/components/extensions/ExtensionCard.tsx +9 -16
- package/react-common/styles/controls/LazyImage.less +0 -27
- package/react-common/styles/extensions/ExtensionCard.less +3 -12
- package/react-common/styles/react-common-variables.less +17 -2
- package/theme/highcontrast.less +0 -13
- package/theme/serial.less +1 -49
- package/theme/soundeffecteditor.less +3 -7
- package/theme/tutorial-sidebar.less +0 -1
- package/theme/tutorial.less +0 -1
- package/webapp/public/blockly/blockly_compressed.js +14 -14
- package/webapp/public/run.html +3 -1
- package/webapp/public/skillmap.html +1 -1
- package/built/web/skillmap/js/main.f09edeb7.chunk.js +0 -1
- package/react-common/styles/react-common-breakpoints.less +0 -136
package/built/pxt.js
CHANGED
|
@@ -102151,10 +102151,6 @@ var pxt;
|
|
|
102151
102151
|
(function (pxt) {
|
|
102152
102152
|
var BrowserUtils;
|
|
102153
102153
|
(function (BrowserUtils) {
|
|
102154
|
-
function isDocumentVisible() {
|
|
102155
|
-
return typeof window !== "undefined" && document.visibilityState === 'visible';
|
|
102156
|
-
}
|
|
102157
|
-
BrowserUtils.isDocumentVisible = isDocumentVisible;
|
|
102158
102154
|
function isIFrame() {
|
|
102159
102155
|
try {
|
|
102160
102156
|
return window && window.self !== window.top;
|
|
@@ -107994,12 +107990,6 @@ var pxt;
|
|
|
107994
107990
|
GitRepoStatus[GitRepoStatus["Approved"] = 1] = "Approved";
|
|
107995
107991
|
GitRepoStatus[GitRepoStatus["Banned"] = 2] = "Banned";
|
|
107996
107992
|
})(GitRepoStatus = github.GitRepoStatus || (github.GitRepoStatus = {}));
|
|
107997
|
-
function isDefaultBranch(branch, repo) {
|
|
107998
|
-
if (repo && repo.defaultBranch)
|
|
107999
|
-
return branch === repo.defaultBranch;
|
|
108000
|
-
return /^(main|master)$/.test(branch);
|
|
108001
|
-
}
|
|
108002
|
-
github.isDefaultBranch = isDefaultBranch;
|
|
108003
107993
|
function listUserReposAsync() {
|
|
108004
107994
|
const q = `{
|
|
108005
107995
|
viewer {
|
|
@@ -108017,12 +108007,12 @@ var pxt;
|
|
|
108017
108007
|
defaultBranchRef {
|
|
108018
108008
|
name
|
|
108019
108009
|
}
|
|
108020
|
-
pxtjson: object(expression: "
|
|
108010
|
+
pxtjson: object(expression: "master:pxt.json") {
|
|
108021
108011
|
... on Blob {
|
|
108022
108012
|
text
|
|
108023
108013
|
}
|
|
108024
108014
|
}
|
|
108025
|
-
readme: object(expression: "
|
|
108015
|
+
readme: object(expression: "master:README.md") {
|
|
108026
108016
|
... on Blob {
|
|
108027
108017
|
text
|
|
108028
108018
|
}
|
|
@@ -111928,22 +111918,15 @@ var pxt;
|
|
|
111928
111918
|
// this may be an issue if the user does not create releases
|
|
111929
111919
|
// and pulls from master
|
|
111930
111920
|
const modtag = (modid === null || modid === void 0 ? void 0 : modid.tag) || ((_a = mod.config) === null || _a === void 0 ? void 0 : _a.version);
|
|
111931
|
-
const vertag = verid.tag;
|
|
111932
|
-
// if there is no tag on the current dependency,
|
|
111933
|
-
// assume same as existing module version if any
|
|
111934
|
-
if (modtag && !vertag) {
|
|
111935
|
-
pxt.debug(`unversioned ${ver}, using ${modtag}`);
|
|
111936
|
-
return;
|
|
111937
|
-
}
|
|
111938
111921
|
const c = pxt.semver.strcmp(modtag, verid.tag);
|
|
111939
111922
|
if (c == 0) {
|
|
111940
111923
|
// turns out to be the same versions
|
|
111941
111924
|
pxt.debug(`resolved version are ${modtag}`);
|
|
111942
111925
|
return;
|
|
111943
111926
|
}
|
|
111944
|
-
else if (c
|
|
111945
|
-
// already loaded version of dependencies
|
|
111946
|
-
// than current version
|
|
111927
|
+
else if (c < 0) {
|
|
111928
|
+
// already loaded version of dependencies is greater
|
|
111929
|
+
// than current version, use it instead
|
|
111947
111930
|
pxt.debug(`auto-upgraded ${ver} to ${modtag}`);
|
|
111948
111931
|
return;
|
|
111949
111932
|
}
|
|
@@ -111969,28 +111952,6 @@ var pxt;
|
|
|
111969
111952
|
pxt.debug(`dep: load ${from.id}.${id}${isCpp ? "++" : ""}: ${ver}`);
|
|
111970
111953
|
if (id == "hw" && pxt.hwVariant)
|
|
111971
111954
|
id = "hw---" + pxt.hwVariant;
|
|
111972
|
-
// for github references, make sure the version is compatible with previously
|
|
111973
|
-
// loaded references, regardless of the id
|
|
111974
|
-
const ghver = pxt.github.parseRepoId(ver);
|
|
111975
|
-
if (ghver === null || ghver === void 0 ? void 0 : ghver.slug) {
|
|
111976
|
-
// let's start by resolving the maximum version
|
|
111977
|
-
// number of the parent repo already loaded
|
|
111978
|
-
const repoVersions = Object.values(from.parent.deps)
|
|
111979
|
-
.map(p => pxt.github.parseRepoId(p._verspec))
|
|
111980
|
-
.filter(v => (v === null || v === void 0 ? void 0 : v.slug) === ghver.slug)
|
|
111981
|
-
.map(v => v.tag);
|
|
111982
|
-
const repoVersion = repoVersions
|
|
111983
|
-
.reduce((v1, v2) => pxt.semver.strcmp(v1, v2) > 0 ? v1 : v2, "0.0.0");
|
|
111984
|
-
pxt.debug(`dep: common repo ${ghver.slug} version found ${repoVersion}`);
|
|
111985
|
-
if (pxt.semver.strcmp(repoVersion, "0.0.0") > 0) {
|
|
111986
|
-
// now let's check if we have a higher version to use
|
|
111987
|
-
if (!ghver.tag || pxt.semver.strcmp(repoVersion, ghver.tag) > 0) {
|
|
111988
|
-
pxt.debug(`dep: upgrade from ${ghver.tag} to ${repoVersion}`);
|
|
111989
|
-
ghver.tag = repoVersion;
|
|
111990
|
-
ver = pxt.github.stringifyRepo(ghver);
|
|
111991
|
-
}
|
|
111992
|
-
}
|
|
111993
|
-
}
|
|
111994
111955
|
let mod = from.resolveDep(id);
|
|
111995
111956
|
if (mod) {
|
|
111996
111957
|
// check if the current dependecy matches the ones
|
|
@@ -112863,11 +112824,6 @@ var pxt;
|
|
|
112863
112824
|
return aa.major - bb.major;
|
|
112864
112825
|
}
|
|
112865
112826
|
semver.majorCmp = majorCmp;
|
|
112866
|
-
/**
|
|
112867
|
-
* Compares two semver version strings and returns -1 if a < b, 1 if a > b and 0
|
|
112868
|
-
* if versions are equivalent. If a and b are invalid versions, classic strcmp is called.
|
|
112869
|
-
* If a (or b) is an invalid version, it is considered greater than any version (strmp(undefined, "0.0.0") = 1)
|
|
112870
|
-
*/
|
|
112871
112827
|
function strcmp(a, b) {
|
|
112872
112828
|
let aa = tryParse(a);
|
|
112873
112829
|
let bb = tryParse(b);
|
|
@@ -140411,7 +140367,6 @@ var pxt;
|
|
|
140411
140367
|
return mkType({ primType: tp });
|
|
140412
140368
|
}
|
|
140413
140369
|
function getOrSetSymbolType(sym) {
|
|
140414
|
-
var _a;
|
|
140415
140370
|
if (!sym.pySymbolType) {
|
|
140416
140371
|
currErrorCtx = sym.pyQName;
|
|
140417
140372
|
if (sym.parameters) {
|
|
@@ -140433,24 +140388,8 @@ var pxt;
|
|
|
140433
140388
|
sym.pyRetType = mkType({ moduleType: sym });
|
|
140434
140389
|
}
|
|
140435
140390
|
else {
|
|
140436
|
-
if (sym.retType)
|
|
140437
|
-
|
|
140438
|
-
// This must be a TS class. Because python treats constructors as functions,
|
|
140439
|
-
// set the return type to be the class instead of void
|
|
140440
|
-
const classSym = lookupGlobalSymbol(sym.qName.substring(0, sym.qName.lastIndexOf(".")));
|
|
140441
|
-
if (classSym) {
|
|
140442
|
-
sym.pyRetType = mkType({
|
|
140443
|
-
classType: classSym
|
|
140444
|
-
});
|
|
140445
|
-
}
|
|
140446
|
-
else {
|
|
140447
|
-
sym.pyRetType = mapTsType(sym.retType);
|
|
140448
|
-
}
|
|
140449
|
-
}
|
|
140450
|
-
else {
|
|
140451
|
-
sym.pyRetType = mapTsType(sym.retType);
|
|
140452
|
-
}
|
|
140453
|
-
}
|
|
140391
|
+
if (sym.retType)
|
|
140392
|
+
sym.pyRetType = mapTsType(sym.retType);
|
|
140454
140393
|
else if (sym.pyRetType) {
|
|
140455
140394
|
// nothing to do
|
|
140456
140395
|
}
|
|
@@ -153185,6 +153124,8 @@ var pxsim;
|
|
|
153185
153124
|
frame.frameBorder = "0";
|
|
153186
153125
|
frame.dataset['runid'] = this.runId;
|
|
153187
153126
|
frame.dataset['origin'] = new URL(furl).origin || "*";
|
|
153127
|
+
if (this._runOptions.autofocus)
|
|
153128
|
+
frame.setAttribute("autofocus", "true");
|
|
153188
153129
|
wrapper.appendChild(frame);
|
|
153189
153130
|
const i = document.createElement("i");
|
|
153190
153131
|
i.className = "videoplay xicon icon";
|
package/built/pxtblockly.js
CHANGED
|
@@ -190,9 +190,9 @@ Blockly.Xml.domToBlock(l,b);c.push(m.id);var n=l.hasAttribute("x")?parseInt(l.ge
|
|
|
190
190
|
Blockly.WorkspaceComment.fromXml(l,b):console.warn("Missing require for Blockly.WorkspaceComment, ignoring workspace comment.");else if("variables"==k){if(f)Blockly.Xml.domToVariables(l,b);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");f=!1}}}}finally{e||Blockly.Events.setGroup(!1),Blockly.utils.dom.stopTextWidthCache()}b.setResizesEnabled&&b.setResizesEnabled(!0);b.loadingEventsDisabled=!1;b.getAllBlocks(!1).forEach(function(a){a.onLoadedIntoWorkspace()});
|
|
191
191
|
Blockly.Events.fire(new (Blockly.Events.get(Blockly.Events.FINISHED_LOADING))(b));return c};
|
|
192
192
|
Blockly.Xml.appendDomToWorkspace=function(a,b){var c;Object.prototype.hasOwnProperty.call(b,"scale")&&(c=b.getBlocksBoundingBox());a=Blockly.Xml.domToWorkspace(a,b);if(c&&c.top!=c.bottom){var d=c.bottom;var e=b.RTL?c.right:c.left;var f=Infinity,g=-Infinity,h=Infinity;for(c=0;c<a.length;c++){var k=b.getBlockById(a[c]).getRelativeToSurfaceXY();k.y<h&&(h=k.y);k.x<f&&(f=k.x);k.x>g&&(g=k.x)}d=d-h+10;e=b.RTL?e-g:e-f;for(c=0;c<a.length;c++)b.getBlockById(a[c]).moveBy(e,d)}return a};
|
|
193
|
-
Blockly.Xml.domToBlock=function(a,b){if(a instanceof Blockly.Workspace){var c=a;a=b;b=c;console.warn("Deprecated call to Blockly.Xml.domToBlock, swap the arguments.")}Blockly.Events.disable();c=b.getAllVariables();try{var d=Blockly.Xml.domToBlockHeadless_(a,b),e=d.getDescendants(!1);if(b.rendered){d.setConnectionTracking(!1);for(var f=e.length-1;0<=f;f--)e[f].initSvg();for(f=e.length-1;0<=f;f--)e[f].render(!1);setTimeout(function(){d.disposed||d.
|
|
194
|
-
|
|
195
|
-
Blockly.
|
|
193
|
+
Blockly.Xml.domToBlock=function(a,b){if(a instanceof Blockly.Workspace){var c=a;a=b;b=c;console.warn("Deprecated call to Blockly.Xml.domToBlock, swap the arguments.")}Blockly.Events.disable();c=b.getAllVariables();try{var d=Blockly.Xml.domToBlockHeadless_(a,b),e=d.getDescendants(!1);if(b.rendered){d.setConnectionTracking(!1);for(var f=e.length-1;0<=f;f--)e[f].initSvg();for(f=e.length-1;0<=f;f--)e[f].render(!1);setTimeout(function(){d.disposed||d.setConnectionTracking(!0)},1);d.updateDisabled();b.resizeContents()}else for(f=
|
|
194
|
+
e.length-1;0<=f;f--)e[f].initModel()}finally{Blockly.Events.enable()}if(Blockly.Events.isEnabled()){a=Blockly.Variables.getAddedVariables(b,c);for(f=0;f<a.length;f++)b=a[f],Blockly.Events.fire(new (Blockly.Events.get(Blockly.Events.VAR_CREATE))(b));Blockly.Events.fire(new (Blockly.Events.get(Blockly.Events.CREATE))(d))}return d};
|
|
195
|
+
Blockly.Xml.domToVariables=function(a,b){for(var c=0,d;d=a.childNodes[c];c++)if(d.nodeType==Blockly.utils.dom.NodeType.ELEMENT_NODE){var e=d.getAttribute("type"),f=d.getAttribute("id");b.createVariable(d.textContent,e,f)}};
|
|
196
196
|
Blockly.Xml.mapSupportedXmlTags_=function(a){for(var b={mutation:[],comment:[],data:[],field:[],input:[],next:[],breakpoint:[]},c=0,d;d=a.childNodes[c];c++)if(d.nodeType!=Blockly.utils.dom.NodeType.TEXT_NODE)switch(d.nodeName.toLowerCase()){case "mutation":b.mutation.push(d);break;case "comment":if(!Blockly.Comment){console.warn("Missing require for Blockly.Comment, ignoring block comment.");break}b.comment.push(d);break;case "data":b.data.push(d);break;case "title":case "field":b.field.push(d);break;
|
|
197
197
|
case "value":case "statement":b.input.push(d);break;case "next":b.next.push(d);break;case "breakpoint":b.breakpoint.push(d);break;default:console.warn("Ignoring unknown tag: "+d.nodeName)}return b};Blockly.Xml.applyMutationTagNodes_=function(a,b){for(var c=!1,d=0,e;e=a[d];d++)b.domToMutation&&(b.domToMutation(e),b.initSvg&&(c=!0));return c};
|
|
198
198
|
Blockly.Xml.applyCommentTagNodes_=function(a,b){for(var c=0,d;d=a[c];c++){var e=d.textContent,f="true"==d.getAttribute("pinned"),g=parseInt(d.getAttribute("w"),10),h=parseInt(d.getAttribute("h"),10);b.setCommentText(e);b.commentModel.pinned=f;isNaN(g)||isNaN(h)||(b.commentModel.size=new Blockly.utils.Size(g,h));e=parseInt(d.getAttribute("relx"),10);d=parseInt(d.getAttribute("rely"),10);isNaN(e)||isNaN(d)||(b.commentModel.xy=new Blockly.utils.Coordinate(e,d));f&&b.getCommentIcon&&!b.isInFlyout&&setTimeout(function(){b.getCommentIcon().setVisible(!0)},
|
|
@@ -738,13 +738,13 @@ Blockly.Block.prototype.getSurroundParent=function(){var a=this;do{var b=a;a=a.g
|
|
|
738
738
|
Blockly.Block.prototype.getFirstStatementConnection=function(){for(var a=0,b;b=this.inputList[a];a++)if(b.connection&&b.connection.type==Blockly.connectionTypes.NEXT_STATEMENT)return b.connection;return null};Blockly.Block.prototype.getRootBlock=function(){var a=this;do{var b=a;a=b.parentBlock_}while(a);return b};Blockly.Block.prototype.getTopStackBlock=function(){var a=this;do var b=a.getPreviousBlock();while(b&&b.getNextBlock()==a&&(a=b));return a};
|
|
739
739
|
Blockly.Block.prototype.getChildren=function(a){if(!a)return this.childBlocks_;a=[];for(var b=0,c;c=this.inputList[b];b++)c.connection&&(c=c.connection.targetBlock())&&a.push(c);(b=this.getNextBlock())&&a.push(b);return a};
|
|
740
740
|
Blockly.Block.prototype.setParent=function(a){if(a!=this.parentBlock_){if(this.parentBlock_){Blockly.utils.arrayRemove(this.parentBlock_.childBlocks_,this);if(this.previousConnection&&this.previousConnection.isConnected())throw Error("Still connected to previous block.");if(this.outputConnection&&this.outputConnection.isConnected())throw Error("Still connected to parent block.");this.parentBlock_=null}else this.workspace.removeTopBlock(this);(this.parentBlock_=a)?a.childBlocks_.push(this):this.workspace.addTopBlock(this)}};
|
|
741
|
-
Blockly.Block.prototype.getDescendants=function(a,b){for(var c=[this],d=this.getChildren(a),e,f=0;e=d[f];f++)b&&e.isShadow()||c.push.apply(c,e.getDescendants(a));return c};Blockly.Block.prototype.isDeletable=function(){return this.deletable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)
|
|
742
|
-
Blockly.Block.prototype.
|
|
743
|
-
Blockly.Block.prototype.
|
|
744
|
-
Blockly.Block.prototype.
|
|
745
|
-
Blockly.Block.prototype.
|
|
746
|
-
Blockly.Block.prototype.
|
|
747
|
-
Blockly.Block.prototype.
|
|
741
|
+
Blockly.Block.prototype.getDescendants=function(a,b){for(var c=[this],d=this.getChildren(a),e,f=0;e=d[f];f++)b&&e.isShadow()||c.push.apply(c,e.getDescendants(a));return c};Blockly.Block.prototype.isDeletable=function(){return this.deletable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.inDebugWorkspace=function(){return!(!this.workspace||!this.workspace.options.debugMode)};Blockly.Block.prototype.setDeletable=function(a){this.deletable_=a};
|
|
742
|
+
Blockly.Block.prototype.isMovable=function(){return this.isMovablePersisted()&&!this.inDebugWorkspace()};Blockly.Block.prototype.isMovablePersisted=function(){return this.movable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.setMovable=function(a){this.movable_=a};Blockly.Block.prototype.isDuplicatable=function(){return this.workspace.hasBlockLimits()?this.workspace.isCapacityAvailable(Blockly.utils.getBlockTypeCounts(this,!0)):!0};
|
|
743
|
+
Blockly.Block.prototype.isShadow=function(){return this.isShadow_};Blockly.Block.prototype.setShadow=function(a){this.isShadow_=a};Blockly.Block.prototype.isInsertionMarker=function(){return this.isInsertionMarker_};Blockly.Block.prototype.setInsertionMarker=function(a){this.isInsertionMarker_!=a&&(this.isInsertionMarker_=a)&&(this.setColour(Blockly.Colours.insertionMarker),this.setOpacity(Blockly.Colours.insertionMarkerOpacity),Blockly.utils.dom.addClass(this.svgGroup_,"blocklyInsertionMarker"))};
|
|
744
|
+
Blockly.Block.prototype.isEditable=function(){return this.isEditablePersisted()&&!this.inDebugWorkspace()};Blockly.Block.prototype.isEditablePersisted=function(){return this.editable_&&!(this.workspace&&this.workspace.options.readOnly)};Blockly.Block.prototype.setEditable=function(a){this.editable_=a;a=0;for(var b;b=this.inputList[a];a++)for(var c=0,d;d=b.fieldRow[c];c++)d.updateEditable()};Blockly.Block.prototype.isDisposed=function(){return this.disposed};
|
|
745
|
+
Blockly.Block.prototype.getMatchingConnection=function(a,b){var c=this.getConnections_(!0);a=a.getConnections_(!0);if(c.length!=a.length)throw Error("Connection lists did not match in length.");for(var d=0;d<a.length;d++)if(a[d]==b)return c[d];return null};Blockly.Block.prototype.setHelpUrl=function(a){this.helpUrl=a};Blockly.Block.prototype.setTooltip=function(a){this.tooltip=a};Blockly.Block.prototype.getTooltip=function(){return Blockly.Tooltip.getTooltipOfObject(this)};
|
|
746
|
+
Blockly.Block.prototype.getColour=function(){return this.colour_};Blockly.Block.prototype.getStyleName=function(){return this.styleName_};Blockly.Block.prototype.getHue=function(){return this.hue_};Blockly.Block.prototype.setColour=function(a){a=Blockly.utils.parseBlockColour(a);this.hue_=a.hue;this.colour_=a.hex};Blockly.Block.prototype.setStyle=function(a){this.styleName_=a};
|
|
747
|
+
Blockly.Block.prototype.setOnChange=function(a){if(a&&"function"!=typeof a)throw Error("onchange must be a function.");this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_);if(this.onchange=a)this.onchangeWrapper_=a.bind(this),this.workspace.addChangeListener(this.onchangeWrapper_)};
|
|
748
748
|
Blockly.Block.prototype.getField=function(a){if("string"!==typeof a)throw TypeError("Blockly.Block.prototype.getField expects a string with the field name but received "+(void 0===a?"nothing":a+" of type "+typeof a)+" instead");for(var b=0,c;c=this.inputList[b];b++)for(var d=0,e;e=c.fieldRow[d];d++)if(e.name===a)return e;return null};
|
|
749
749
|
Blockly.Block.prototype.getVars=function(){for(var a=[],b=0,c;c=this.inputList[b];b++)for(var d=0,e;e=c.fieldRow[d];d++)e.referencesVariables()&&a.push(e.getValue());return a};Blockly.Block.prototype.getVarModels=function(){for(var a=[],b=0,c;c=this.inputList[b];b++)for(var d=0,e;e=c.fieldRow[d];d++)e.referencesVariables()&&(e=this.workspace.getVariableById(e.getValue()))&&a.push(e);return a};
|
|
750
750
|
Blockly.Block.prototype.updateVarName=function(a){for(var b=0,c;c=this.inputList[b];b++)for(var d=0,e;e=c.fieldRow[d];d++)e.referencesVariables()&&a.getId()==e.getValue()&&e.forceRerender()};Blockly.Block.prototype.renameVarById=function(a,b){for(var c=0,d;d=this.inputList[c];c++)for(var e=0,f;f=d.fieldRow[e];e++)f.referencesVariables()&&a==f.getValue()&&f.setValue(b)};Blockly.Block.prototype.getFieldValue=function(a){return(a=this.getField(a))?a.getValue():null};
|
|
@@ -891,7 +891,7 @@ Blockly.BlockSvg.prototype.setStyle=function(a){var b=this.workspace.getRenderer
|
|
|
891
891
|
Blockly.BlockSvg.prototype.setPreviousStatement=function(a,b){Blockly.BlockSvg.superClass_.setPreviousStatement.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours())};Blockly.BlockSvg.prototype.setNextStatement=function(a,b){Blockly.BlockSvg.superClass_.setNextStatement.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours())};Blockly.BlockSvg.prototype.setOutput=function(a,b){Blockly.BlockSvg.superClass_.setOutput.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours())};
|
|
892
892
|
Blockly.BlockSvg.prototype.setInputsInline=function(a){Blockly.BlockSvg.superClass_.setInputsInline.call(this,a);this.rendered&&(this.render(),this.bumpNeighbours())};Blockly.BlockSvg.prototype.removeInput=function(a,b){a=Blockly.BlockSvg.superClass_.removeInput.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours());return a};
|
|
893
893
|
Blockly.BlockSvg.prototype.moveNumberedInputBefore=function(a,b){Blockly.BlockSvg.superClass_.moveNumberedInputBefore.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours())};Blockly.BlockSvg.prototype.appendInput_=function(a,b){a=Blockly.BlockSvg.superClass_.appendInput_.call(this,a,b);this.rendered&&(this.render(),this.bumpNeighbours());return a};
|
|
894
|
-
Blockly.BlockSvg.prototype.setConnectionTracking=function(a){this.previousConnection&&this.previousConnection.setTracking(a);this.outputConnection&&this.outputConnection.setTracking(a);if(this.nextConnection){this.nextConnection.setTracking(a);var b=this.nextConnection.targetBlock();b&&b.setConnectionTracking(a)}if(!this.collapsed_)for(b=0;b<this.inputList.length;b++)
|
|
894
|
+
Blockly.BlockSvg.prototype.setConnectionTracking=function(a){this.previousConnection&&this.previousConnection.setTracking(a);this.outputConnection&&this.outputConnection.setTracking(a);if(this.nextConnection){this.nextConnection.setTracking(a);var b=this.nextConnection.targetBlock();b&&b.setConnectionTracking(a)}if(!this.collapsed_)for(b=0;b<this.inputList.length;b++){var c=this.inputList[b].connection;c&&(c.setTracking(a),(c=c.targetBlock())&&c.setConnectionTracking(a))}};
|
|
895
895
|
Blockly.BlockSvg.prototype.getConnections_=function(a){var b=[];if(a||this.rendered)if(this.outputConnection&&b.push(this.outputConnection),this.previousConnection&&b.push(this.previousConnection),this.nextConnection&&b.push(this.nextConnection),a||!this.collapsed_){a=0;for(var c;c=this.inputList[a];a++)c.connection&&b.push(c.connection)}return b};Blockly.BlockSvg.prototype.lastConnectionInStack=function(a){return Blockly.BlockSvg.superClass_.lastConnectionInStack.call(this,a)};
|
|
896
896
|
Blockly.BlockSvg.prototype.getMatchingConnection=function(a,b){return Blockly.BlockSvg.superClass_.getMatchingConnection.call(this,a,b)};Blockly.BlockSvg.prototype.makeConnection_=function(a){return new Blockly.RenderedConnection(this,a)};
|
|
897
897
|
Blockly.BlockSvg.prototype.bumpNeighbours=function(){if(this.workspace&&!this.workspace.isDragging()){var a=this.getRootBlock();if(!a.isInFlyout)for(var b=this.getConnections_(!1),c=0,d;d=b[c];c++){d.isConnected()&&d.isSuperior()&&d.targetBlock().bumpNeighbours();for(var e=d.neighbours(Blockly.SNAP_RADIUS),f=0,g;g=e[f];f++)d.isConnected()&&g.isConnected()||g.getSourceBlock().getRootBlock()!=a&&(d.isSuperior()?g.bumpAwayFrom(d):d.bumpAwayFrom(g))}}};
|
|
@@ -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.10";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};
|
|
@@ -2356,7 +2356,7 @@ Blockly.FieldNumber.prototype.updateDisplay_=function(a){this.htmlInput_.value=a
|
|
|
2356
2356
|
Blockly.FieldNumber.prototype.doClassValidation_=function(a){if(null===a)return null;a=String(a);a=a.replace(/O/ig,"0");a=a.replace(/,/g,"");a=a.replace(/infinity/i,"Infinity");a=Number(a||0);if(isNaN(a))return null;this.precision_&&isFinite(a)&&(a=Math.round(a/this.precision_)*this.precision_);null!=this.decimalPlaces_&&(a=Number(a.toFixed(this.decimalPlaces_)));return a};
|
|
2357
2357
|
Blockly.FieldNumber.prototype.widgetCreate_=function(a,b,c){a=Blockly.FieldNumber.superClass_.widgetCreate_.call(this,a,b,c);-Infinity<this.min_&&Blockly.utils.aria.setState(a,Blockly.utils.aria.State.VALUEMIN,this.min_);Infinity>this.max_&&Blockly.utils.aria.setState(a,Blockly.utils.aria.State.VALUEMAX,this.max_);return a};Blockly.fieldRegistry.register("field_number",Blockly.FieldNumber);Blockly.FieldNumberDropdown=function(a,b,c,d,e,f){this.setConstraints=Blockly.FieldNumber.prototype.setConstraints;this.setMinInternal_=Blockly.FieldNumber.prototype.setMinInternal_;this.setMaxInternal_=Blockly.FieldNumber.prototype.setMaxInternal_;this.setPrecisionInternal_=Blockly.FieldNumber.prototype.setPrecisionInternal_;c=Blockly.FieldNumber.prototype.getNumRestrictor.call(this,c,d,e);Blockly.FieldNumberDropdown.superClass_.constructor.call(this,a,b,f,c);this.addArgType("numberdropdown")};
|
|
2358
2358
|
Blockly.utils.object.inherits(Blockly.FieldNumberDropdown,Blockly.FieldTextDropdown);Blockly.FieldNumberDropdown.fromJson=function(a){return new Blockly.FieldNumberDropdown(a.value,a.options,a.min,a.max,a.precision)};Blockly.FieldNumberDropdown.prototype.classValidator=Blockly.FieldNumber.prototype.classValidator;Blockly.fieldRegistry.register("field_numberdropdown",Blockly.FieldNumberDropdown);Blockly.FieldVariable=function(a,b,c,d,e){this.menuGenerator_=Blockly.FieldVariable.dropdownCreate;this.defaultVariableName="string"===typeof a?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.FieldVariable,Blockly.FieldDropdown);Blockly.FieldVariable.fromJson=function(a){var b=Blockly.utils.replaceMessageReferences(a.variable);return new Blockly.FieldVariable(b,void 0,void 0,void 0,a)};
|
|
2359
|
-
Blockly.FieldVariable.prototype.SERIALIZABLE=!0;Blockly.FieldVariable.prototype.configure_=function(a){Blockly.FieldVariable.superClass_.configure_.call(this,a);this.setTypes_(a.variableTypes,a.defaultType)};Blockly.FieldVariable.prototype.initModel=function(){if(!
|
|
2359
|
+
Blockly.FieldVariable.prototype.SERIALIZABLE=!0;Blockly.FieldVariable.prototype.configure_=function(a){Blockly.FieldVariable.superClass_.configure_.call(this,a);this.setTypes_(a.variableTypes,a.defaultType)};Blockly.FieldVariable.prototype.initModel=function(){if(!this.variable_){var a=Blockly.Variables.getOrCreateVariablePackage(this.sourceBlock_.workspace,null,this.defaultVariableName,this.defaultType_);this.doValueUpdate_(a.getId())}};
|
|
2360
2360
|
Blockly.FieldVariable.prototype.shouldAddBorderRect_=function(){return Blockly.FieldVariable.superClass_.shouldAddBorderRect_.call(this)&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||!("variables_get"==this.sourceBlock_.type||"variables_get_reporter"==this.sourceBlock_.type))};
|
|
2361
2361
|
Blockly.FieldVariable.prototype.fromXml=function(a){a.getAttribute("id");var b=a.textContent,c=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";b=Blockly.Variables.getOrCreateVariablePackage(this.sourceBlock_.workspace,null,b,c);if(null!=c&&c!==b.type)throw Error("Serialized variable type with id '"+b.getId()+"' had type "+b.type+", and does not match variable field that references it: "+Blockly.Xml.domToText(a)+".");this.setValue(b.getId())};
|
|
2362
2362
|
Blockly.FieldVariable.prototype.toXml=function(a){this.initModel();a.id=this.variable_.getId();a.textContent=this.variable_.name;this.variable_.type&&a.setAttribute("variabletype",this.variable_.type);return a};Blockly.FieldVariable.prototype.setSourceBlock=function(a){if(a.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");Blockly.FieldVariable.superClass_.setSourceBlock.call(this,a)};
|
|
@@ -2643,7 +2643,7 @@ Blockly.zelos.ConstantProvider.prototype.makeRounded=function(){function a(a,b,f
|
|
|
2643
2643
|
connectionOffsetY:function(a){return a/2},connectionOffsetX:function(a){return-a},pathDown:function(b){return a(b,!1,!1)},pathUp:function(b){return a(b,!0,!1)},pathRightDown:function(b){return a(b,!1,!0)},pathRightUp:function(b){return a(b,!1,!0)}}};
|
|
2644
2644
|
Blockly.zelos.ConstantProvider.prototype.makeSquared=function(){function a(a,d,e){a-=2*b;return Blockly.utils.svgPaths.arc("a","0 0,1",b,Blockly.utils.svgPaths.point((d?-1:1)*b,(d?-1:1)*b))+Blockly.utils.svgPaths.lineOnAxis("v",(e?1:-1)*a)+Blockly.utils.svgPaths.arc("a","0 0,1",b,Blockly.utils.svgPaths.point((d?1:-1)*b,(d?-1:1)*b))}var b=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width:function(a){return b},height:function(a){return a},connectionOffsetY:function(a){return a/2},
|
|
2645
2645
|
connectionOffsetX:function(a){return-a},pathDown:function(b){return a(b,!1,!1)},pathUp:function(b){return a(b,!0,!1)},pathRightDown:function(b){return a(b,!1,!0)},pathRightUp:function(b){return a(b,!1,!0)}}};
|
|
2646
|
-
Blockly.zelos.ConstantProvider.prototype.shapeFor=function(a){var b=a.getCheck();!b&&a.targetConnection&&(b=a.targetConnection.getCheck());switch(a.type){case Blockly.connectionTypes.OUTPUT_VALUE:
|
|
2646
|
+
Blockly.zelos.ConstantProvider.prototype.shapeFor=function(a){var b=a.getCheck();!b&&a.targetConnection&&(b=a.targetConnection.getCheck());switch(a.type){case Blockly.connectionTypes.INPUT_VALUE:case Blockly.connectionTypes.OUTPUT_VALUE:a=a.getSourceBlock().getOutputShape();if(null!=a)switch(a){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}if(b&&-1!=b.indexOf("Boolean"))return this.HEXAGONAL;if(b&&-1!=b.indexOf("Number"))return this.ROUNDED;
|
|
2647
2647
|
b&&b.indexOf("String");return this.ROUNDED;case Blockly.connectionTypes.PREVIOUS_STATEMENT:case Blockly.connectionTypes.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type");}};
|
|
2648
2648
|
Blockly.zelos.ConstantProvider.prototype.makeNotch=function(){function a(a){return Blockly.utils.svgPaths.curve("c",[Blockly.utils.svgPaths.point(a*e/2,0),Blockly.utils.svgPaths.point(a*e*3/4,g/2),Blockly.utils.svgPaths.point(a*e,g)])+Blockly.utils.svgPaths.line([Blockly.utils.svgPaths.point(a*e,f)])+Blockly.utils.svgPaths.curve("c",[Blockly.utils.svgPaths.point(a*e/4,g/2),Blockly.utils.svgPaths.point(a*e/2,g),Blockly.utils.svgPaths.point(a*e,g)])+Blockly.utils.svgPaths.lineOnAxis("h",a*d)+Blockly.utils.svgPaths.curve("c",
|
|
2649
2649
|
[Blockly.utils.svgPaths.point(a*e/2,0),Blockly.utils.svgPaths.point(a*e*3/4,-(g/2)),Blockly.utils.svgPaths.point(a*e,-g)])+Blockly.utils.svgPaths.line([Blockly.utils.svgPaths.point(a*e,-f)])+Blockly.utils.svgPaths.curve("c",[Blockly.utils.svgPaths.point(a*e/4,-(g/2)),Blockly.utils.svgPaths.point(a*e/2,-g),Blockly.utils.svgPaths.point(a*e,-g)])}var b=this.NOTCH_WIDTH,c=this.NOTCH_HEIGHT,d=b/3,e=d/3,f=c/2,g=f/2,h=a(1),k=a(-1);return{type:this.SHAPES.NOTCH,width:b,height:c,pathLeft:h,pathRight:k}};
|
|
@@ -12212,12 +12212,6 @@ var pxtblockly;
|
|
|
12212
12212
|
// This creates the little arrow for dropdown fields. Intentionally
|
|
12213
12213
|
// do nothing
|
|
12214
12214
|
}
|
|
12215
|
-
showPromptEditor_() {
|
|
12216
|
-
Blockly.prompt(Blockly.Msg['CHANGE_VALUE_TITLE'], this.parsedValue, (newValue) => {
|
|
12217
|
-
this.setValue(this.getValueFromEditorText_(newValue));
|
|
12218
|
-
this.forceRerender();
|
|
12219
|
-
});
|
|
12220
|
-
}
|
|
12221
12215
|
}
|
|
12222
12216
|
pxtblockly.FieldAutoComplete = FieldAutoComplete;
|
|
12223
12217
|
})(pxtblockly || (pxtblockly = {}));
|
|
@@ -15493,7 +15487,6 @@ var pxtblockly;
|
|
|
15493
15487
|
widgetDiv.style.height = "";
|
|
15494
15488
|
widgetDiv.style.opacity = "";
|
|
15495
15489
|
widgetDiv.style.transition = "";
|
|
15496
|
-
widgetDiv.style.alignItems = "";
|
|
15497
15490
|
Blockly.Events.enable();
|
|
15498
15491
|
Blockly.Events.setGroup(true);
|
|
15499
15492
|
this.fireNumberInputUpdate(this.options.durationInputName, initialSound.duration);
|
|
@@ -15535,8 +15528,7 @@ var pxtblockly;
|
|
|
15535
15528
|
widgetDiv.style.top = top + "px";
|
|
15536
15529
|
widgetDiv.style.width = "30rem";
|
|
15537
15530
|
widgetDiv.style.height = "40rem";
|
|
15538
|
-
widgetDiv.style.display = "
|
|
15539
|
-
widgetDiv.style.alignItems = "center";
|
|
15531
|
+
widgetDiv.style.display = "block";
|
|
15540
15532
|
widgetDiv.style.transition = "transform 0.25s ease 0s, opacity 0.25s ease 0s";
|
|
15541
15533
|
widgetDiv.style.borderRadius = "";
|
|
15542
15534
|
fv.onHide(() => {
|
package/built/pxtblocks.d.ts
CHANGED
package/built/pxtblocks.js
CHANGED
|
@@ -8650,12 +8650,6 @@ var pxtblockly;
|
|
|
8650
8650
|
// This creates the little arrow for dropdown fields. Intentionally
|
|
8651
8651
|
// do nothing
|
|
8652
8652
|
}
|
|
8653
|
-
showPromptEditor_() {
|
|
8654
|
-
Blockly.prompt(Blockly.Msg['CHANGE_VALUE_TITLE'], this.parsedValue, (newValue) => {
|
|
8655
|
-
this.setValue(this.getValueFromEditorText_(newValue));
|
|
8656
|
-
this.forceRerender();
|
|
8657
|
-
});
|
|
8658
|
-
}
|
|
8659
8653
|
}
|
|
8660
8654
|
pxtblockly.FieldAutoComplete = FieldAutoComplete;
|
|
8661
8655
|
})(pxtblockly || (pxtblockly = {}));
|
|
@@ -11931,7 +11925,6 @@ var pxtblockly;
|
|
|
11931
11925
|
widgetDiv.style.height = "";
|
|
11932
11926
|
widgetDiv.style.opacity = "";
|
|
11933
11927
|
widgetDiv.style.transition = "";
|
|
11934
|
-
widgetDiv.style.alignItems = "";
|
|
11935
11928
|
Blockly.Events.enable();
|
|
11936
11929
|
Blockly.Events.setGroup(true);
|
|
11937
11930
|
this.fireNumberInputUpdate(this.options.durationInputName, initialSound.duration);
|
|
@@ -11973,8 +11966,7 @@ var pxtblockly;
|
|
|
11973
11966
|
widgetDiv.style.top = top + "px";
|
|
11974
11967
|
widgetDiv.style.width = "30rem";
|
|
11975
11968
|
widgetDiv.style.height = "40rem";
|
|
11976
|
-
widgetDiv.style.display = "
|
|
11977
|
-
widgetDiv.style.alignItems = "center";
|
|
11969
|
+
widgetDiv.style.display = "block";
|
|
11978
11970
|
widgetDiv.style.transition = "transform 0.25s ease 0s, opacity 0.25s ease 0s";
|
|
11979
11971
|
widgetDiv.style.borderRadius = "";
|
|
11980
11972
|
fv.onHide(() => {
|
package/built/pxtlib.d.ts
CHANGED
|
@@ -689,7 +689,6 @@ declare namespace pxt.blocks {
|
|
|
689
689
|
function getBlockDefinition(blockId: string): BlockDefinition;
|
|
690
690
|
}
|
|
691
691
|
declare namespace pxt.BrowserUtils {
|
|
692
|
-
export function isDocumentVisible(): boolean;
|
|
693
692
|
export function isIFrame(): boolean;
|
|
694
693
|
export function hasNavigator(): boolean;
|
|
695
694
|
export function hasWindow(): boolean;
|
|
@@ -1306,7 +1305,6 @@ declare namespace pxt.github {
|
|
|
1306
1305
|
private?: boolean;
|
|
1307
1306
|
fork?: boolean;
|
|
1308
1307
|
}
|
|
1309
|
-
function isDefaultBranch(branch: string, repo?: GitRepo): boolean;
|
|
1310
1308
|
function listUserReposAsync(): Promise<GitRepo[]>;
|
|
1311
1309
|
function createRepoAsync(name: string, description: string, priv?: boolean): Promise<GitRepo>;
|
|
1312
1310
|
function enablePagesAsync(repo: string): Promise<void>;
|
|
@@ -1930,11 +1928,6 @@ declare namespace pxt.semver {
|
|
|
1930
1928
|
function normalize(v: string): string;
|
|
1931
1929
|
function stringify(v: Version): string;
|
|
1932
1930
|
function majorCmp(a: string, b: string): number;
|
|
1933
|
-
/**
|
|
1934
|
-
* Compares two semver version strings and returns -1 if a < b, 1 if a > b and 0
|
|
1935
|
-
* if versions are equivalent. If a and b are invalid versions, classic strcmp is called.
|
|
1936
|
-
* If a (or b) is an invalid version, it is considered greater than any version (strmp(undefined, "0.0.0") = 1)
|
|
1937
|
-
*/
|
|
1938
1931
|
function strcmp(a: string, b: string): number;
|
|
1939
1932
|
function inRange(rng: string, v: Version): boolean;
|
|
1940
1933
|
/**
|
package/built/pxtlib.js
CHANGED
|
@@ -4465,10 +4465,6 @@ var pxt;
|
|
|
4465
4465
|
(function (pxt) {
|
|
4466
4466
|
var BrowserUtils;
|
|
4467
4467
|
(function (BrowserUtils) {
|
|
4468
|
-
function isDocumentVisible() {
|
|
4469
|
-
return typeof window !== "undefined" && document.visibilityState === 'visible';
|
|
4470
|
-
}
|
|
4471
|
-
BrowserUtils.isDocumentVisible = isDocumentVisible;
|
|
4472
4468
|
function isIFrame() {
|
|
4473
4469
|
try {
|
|
4474
4470
|
return window && window.self !== window.top;
|
|
@@ -10308,12 +10304,6 @@ var pxt;
|
|
|
10308
10304
|
GitRepoStatus[GitRepoStatus["Approved"] = 1] = "Approved";
|
|
10309
10305
|
GitRepoStatus[GitRepoStatus["Banned"] = 2] = "Banned";
|
|
10310
10306
|
})(GitRepoStatus = github.GitRepoStatus || (github.GitRepoStatus = {}));
|
|
10311
|
-
function isDefaultBranch(branch, repo) {
|
|
10312
|
-
if (repo && repo.defaultBranch)
|
|
10313
|
-
return branch === repo.defaultBranch;
|
|
10314
|
-
return /^(main|master)$/.test(branch);
|
|
10315
|
-
}
|
|
10316
|
-
github.isDefaultBranch = isDefaultBranch;
|
|
10317
10307
|
function listUserReposAsync() {
|
|
10318
10308
|
const q = `{
|
|
10319
10309
|
viewer {
|
|
@@ -10331,12 +10321,12 @@ var pxt;
|
|
|
10331
10321
|
defaultBranchRef {
|
|
10332
10322
|
name
|
|
10333
10323
|
}
|
|
10334
|
-
pxtjson: object(expression: "
|
|
10324
|
+
pxtjson: object(expression: "master:pxt.json") {
|
|
10335
10325
|
... on Blob {
|
|
10336
10326
|
text
|
|
10337
10327
|
}
|
|
10338
10328
|
}
|
|
10339
|
-
readme: object(expression: "
|
|
10329
|
+
readme: object(expression: "master:README.md") {
|
|
10340
10330
|
... on Blob {
|
|
10341
10331
|
text
|
|
10342
10332
|
}
|
|
@@ -14242,22 +14232,15 @@ var pxt;
|
|
|
14242
14232
|
// this may be an issue if the user does not create releases
|
|
14243
14233
|
// and pulls from master
|
|
14244
14234
|
const modtag = (modid === null || modid === void 0 ? void 0 : modid.tag) || ((_a = mod.config) === null || _a === void 0 ? void 0 : _a.version);
|
|
14245
|
-
const vertag = verid.tag;
|
|
14246
|
-
// if there is no tag on the current dependency,
|
|
14247
|
-
// assume same as existing module version if any
|
|
14248
|
-
if (modtag && !vertag) {
|
|
14249
|
-
pxt.debug(`unversioned ${ver}, using ${modtag}`);
|
|
14250
|
-
return;
|
|
14251
|
-
}
|
|
14252
14235
|
const c = pxt.semver.strcmp(modtag, verid.tag);
|
|
14253
14236
|
if (c == 0) {
|
|
14254
14237
|
// turns out to be the same versions
|
|
14255
14238
|
pxt.debug(`resolved version are ${modtag}`);
|
|
14256
14239
|
return;
|
|
14257
14240
|
}
|
|
14258
|
-
else if (c
|
|
14259
|
-
// already loaded version of dependencies
|
|
14260
|
-
// than current version
|
|
14241
|
+
else if (c < 0) {
|
|
14242
|
+
// already loaded version of dependencies is greater
|
|
14243
|
+
// than current version, use it instead
|
|
14261
14244
|
pxt.debug(`auto-upgraded ${ver} to ${modtag}`);
|
|
14262
14245
|
return;
|
|
14263
14246
|
}
|
|
@@ -14283,28 +14266,6 @@ var pxt;
|
|
|
14283
14266
|
pxt.debug(`dep: load ${from.id}.${id}${isCpp ? "++" : ""}: ${ver}`);
|
|
14284
14267
|
if (id == "hw" && pxt.hwVariant)
|
|
14285
14268
|
id = "hw---" + pxt.hwVariant;
|
|
14286
|
-
// for github references, make sure the version is compatible with previously
|
|
14287
|
-
// loaded references, regardless of the id
|
|
14288
|
-
const ghver = pxt.github.parseRepoId(ver);
|
|
14289
|
-
if (ghver === null || ghver === void 0 ? void 0 : ghver.slug) {
|
|
14290
|
-
// let's start by resolving the maximum version
|
|
14291
|
-
// number of the parent repo already loaded
|
|
14292
|
-
const repoVersions = Object.values(from.parent.deps)
|
|
14293
|
-
.map(p => pxt.github.parseRepoId(p._verspec))
|
|
14294
|
-
.filter(v => (v === null || v === void 0 ? void 0 : v.slug) === ghver.slug)
|
|
14295
|
-
.map(v => v.tag);
|
|
14296
|
-
const repoVersion = repoVersions
|
|
14297
|
-
.reduce((v1, v2) => pxt.semver.strcmp(v1, v2) > 0 ? v1 : v2, "0.0.0");
|
|
14298
|
-
pxt.debug(`dep: common repo ${ghver.slug} version found ${repoVersion}`);
|
|
14299
|
-
if (pxt.semver.strcmp(repoVersion, "0.0.0") > 0) {
|
|
14300
|
-
// now let's check if we have a higher version to use
|
|
14301
|
-
if (!ghver.tag || pxt.semver.strcmp(repoVersion, ghver.tag) > 0) {
|
|
14302
|
-
pxt.debug(`dep: upgrade from ${ghver.tag} to ${repoVersion}`);
|
|
14303
|
-
ghver.tag = repoVersion;
|
|
14304
|
-
ver = pxt.github.stringifyRepo(ghver);
|
|
14305
|
-
}
|
|
14306
|
-
}
|
|
14307
|
-
}
|
|
14308
14269
|
let mod = from.resolveDep(id);
|
|
14309
14270
|
if (mod) {
|
|
14310
14271
|
// check if the current dependecy matches the ones
|
|
@@ -15177,11 +15138,6 @@ var pxt;
|
|
|
15177
15138
|
return aa.major - bb.major;
|
|
15178
15139
|
}
|
|
15179
15140
|
semver.majorCmp = majorCmp;
|
|
15180
|
-
/**
|
|
15181
|
-
* Compares two semver version strings and returns -1 if a < b, 1 if a > b and 0
|
|
15182
|
-
* if versions are equivalent. If a and b are invalid versions, classic strcmp is called.
|
|
15183
|
-
* If a (or b) is an invalid version, it is considered greater than any version (strmp(undefined, "0.0.0") = 1)
|
|
15184
|
-
*/
|
|
15185
15141
|
function strcmp(a, b) {
|
|
15186
15142
|
let aa = tryParse(a);
|
|
15187
15143
|
let bb = tryParse(b);
|
package/built/pxtpy.js
CHANGED
|
@@ -186,7 +186,6 @@ var pxt;
|
|
|
186
186
|
return mkType({ primType: tp });
|
|
187
187
|
}
|
|
188
188
|
function getOrSetSymbolType(sym) {
|
|
189
|
-
var _a;
|
|
190
189
|
if (!sym.pySymbolType) {
|
|
191
190
|
currErrorCtx = sym.pyQName;
|
|
192
191
|
if (sym.parameters) {
|
|
@@ -208,24 +207,8 @@ var pxt;
|
|
|
208
207
|
sym.pyRetType = mkType({ moduleType: sym });
|
|
209
208
|
}
|
|
210
209
|
else {
|
|
211
|
-
if (sym.retType)
|
|
212
|
-
|
|
213
|
-
// This must be a TS class. Because python treats constructors as functions,
|
|
214
|
-
// set the return type to be the class instead of void
|
|
215
|
-
const classSym = lookupGlobalSymbol(sym.qName.substring(0, sym.qName.lastIndexOf(".")));
|
|
216
|
-
if (classSym) {
|
|
217
|
-
sym.pyRetType = mkType({
|
|
218
|
-
classType: classSym
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
sym.pyRetType = mapTsType(sym.retType);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
sym.pyRetType = mapTsType(sym.retType);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
210
|
+
if (sym.retType)
|
|
211
|
+
sym.pyRetType = mapTsType(sym.retType);
|
|
229
212
|
else if (sym.pyRetType) {
|
|
230
213
|
// nothing to do
|
|
231
214
|
}
|
package/built/pxtrunner.d.ts
CHANGED
package/built/pxtrunner.js
CHANGED
|
@@ -1749,7 +1749,8 @@ var pxt;
|
|
|
1749
1749
|
highContrast: simOptions.highContrast,
|
|
1750
1750
|
storedState: storedState,
|
|
1751
1751
|
light: simOptions.light,
|
|
1752
|
-
single: simOptions.single
|
|
1752
|
+
single: simOptions.single,
|
|
1753
|
+
autofocus: simOptions.autofocus
|
|
1753
1754
|
};
|
|
1754
1755
|
if (pxt.appTarget.simulator && !simOptions.fullScreen)
|
|
1755
1756
|
runOptions.aspectRatio = parts.length && pxt.appTarget.simulator.partsAspectRatio
|
package/built/pxtsim.d.ts
CHANGED
|
@@ -401,7 +401,6 @@ declare namespace pxsim {
|
|
|
401
401
|
id: string;
|
|
402
402
|
data: string;
|
|
403
403
|
sim?: boolean;
|
|
404
|
-
csvType?: undefined | "headers" | "row";
|
|
405
404
|
receivedTime?: number;
|
|
406
405
|
}
|
|
407
406
|
interface SimulatorBulkSerialMessage extends SimulatorMessage {
|
|
@@ -1268,6 +1267,7 @@ declare namespace pxsim {
|
|
|
1268
1267
|
ipc?: boolean;
|
|
1269
1268
|
dependencies?: Map<string>;
|
|
1270
1269
|
single?: boolean;
|
|
1270
|
+
autofocus?: boolean;
|
|
1271
1271
|
}
|
|
1272
1272
|
interface HwDebugger {
|
|
1273
1273
|
postMessage: (msg: pxsim.SimulatorMessage) => void;
|
package/built/pxtsim.js
CHANGED
|
@@ -6308,6 +6308,8 @@ var pxsim;
|
|
|
6308
6308
|
frame.frameBorder = "0";
|
|
6309
6309
|
frame.dataset['runid'] = this.runId;
|
|
6310
6310
|
frame.dataset['origin'] = new URL(furl).origin || "*";
|
|
6311
|
+
if (this._runOptions.autofocus)
|
|
6312
|
+
frame.setAttribute("autofocus", "true");
|
|
6311
6313
|
wrapper.appendChild(frame);
|
|
6312
6314
|
const i = document.createElement("i");
|
|
6313
6315
|
i.className = "videoplay xicon icon";
|
package/built/server.js
CHANGED
|
@@ -1026,7 +1026,7 @@ function serveAsync(options) {
|
|
|
1026
1026
|
return;
|
|
1027
1027
|
}
|
|
1028
1028
|
let publicDir = path.join(nodeutil.pxtCoreDir, "webapp/public");
|
|
1029
|
-
if (pathname == "/--embed") {
|
|
1029
|
+
if (pathname == "/--embed" || pathname === "/---embed") {
|
|
1030
1030
|
sendFile(path.join(publicDir, 'embed.js'));
|
|
1031
1031
|
return;
|
|
1032
1032
|
}
|