pxt-core 7.5.46 → 7.5.47

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 CHANGED
@@ -107990,6 +107990,12 @@ var pxt;
107990
107990
  GitRepoStatus[GitRepoStatus["Approved"] = 1] = "Approved";
107991
107991
  GitRepoStatus[GitRepoStatus["Banned"] = 2] = "Banned";
107992
107992
  })(GitRepoStatus = github.GitRepoStatus || (github.GitRepoStatus = {}));
107993
+ function isDefaultBranch(branch, repo) {
107994
+ if (repo && repo.defaultBranch)
107995
+ return branch === repo.defaultBranch;
107996
+ return /^(main|master)$/.test(branch);
107997
+ }
107998
+ github.isDefaultBranch = isDefaultBranch;
107993
107999
  function listUserReposAsync() {
107994
108000
  const q = `{
107995
108001
  viewer {
@@ -108007,12 +108013,12 @@ var pxt;
108007
108013
  defaultBranchRef {
108008
108014
  name
108009
108015
  }
108010
- pxtjson: object(expression: "master:pxt.json") {
108016
+ pxtjson: object(expression: "HEAD:pxt.json") {
108011
108017
  ... on Blob {
108012
108018
  text
108013
108019
  }
108014
108020
  }
108015
- readme: object(expression: "master:README.md") {
108021
+ readme: object(expression: "HEAD:README.md") {
108016
108022
  ... on Blob {
108017
108023
  text
108018
108024
  }
@@ -140367,6 +140373,7 @@ var pxt;
140367
140373
  return mkType({ primType: tp });
140368
140374
  }
140369
140375
  function getOrSetSymbolType(sym) {
140376
+ var _a;
140370
140377
  if (!sym.pySymbolType) {
140371
140378
  currErrorCtx = sym.pyQName;
140372
140379
  if (sym.parameters) {
@@ -140388,8 +140395,24 @@ var pxt;
140388
140395
  sym.pyRetType = mkType({ moduleType: sym });
140389
140396
  }
140390
140397
  else {
140391
- if (sym.retType)
140392
- sym.pyRetType = mapTsType(sym.retType);
140398
+ if (sym.retType) {
140399
+ if (((_a = sym.qName) === null || _a === void 0 ? void 0 : _a.endsWith(".__constructor")) && sym.retType === "void") {
140400
+ // This must be a TS class. Because python treats constructors as functions,
140401
+ // set the return type to be the class instead of void
140402
+ const classSym = lookupGlobalSymbol(sym.qName.substring(0, sym.qName.lastIndexOf(".")));
140403
+ if (classSym) {
140404
+ sym.pyRetType = mkType({
140405
+ classType: classSym
140406
+ });
140407
+ }
140408
+ else {
140409
+ sym.pyRetType = mapTsType(sym.retType);
140410
+ }
140411
+ }
140412
+ else {
140413
+ sym.pyRetType = mapTsType(sym.retType);
140414
+ }
140415
+ }
140393
140416
  else if (sym.pyRetType) {
140394
140417
  // nothing to do
140395
140418
  }
@@ -12212,6 +12212,12 @@ 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
+ }
12215
12221
  }
12216
12222
  pxtblockly.FieldAutoComplete = FieldAutoComplete;
12217
12223
  })(pxtblockly || (pxtblockly = {}));
@@ -15487,6 +15493,7 @@ var pxtblockly;
15487
15493
  widgetDiv.style.height = "";
15488
15494
  widgetDiv.style.opacity = "";
15489
15495
  widgetDiv.style.transition = "";
15496
+ widgetDiv.style.alignItems = "";
15490
15497
  Blockly.Events.enable();
15491
15498
  Blockly.Events.setGroup(true);
15492
15499
  this.fireNumberInputUpdate(this.options.durationInputName, initialSound.duration);
@@ -15528,7 +15535,8 @@ var pxtblockly;
15528
15535
  widgetDiv.style.top = top + "px";
15529
15536
  widgetDiv.style.width = "30rem";
15530
15537
  widgetDiv.style.height = "40rem";
15531
- widgetDiv.style.display = "block";
15538
+ widgetDiv.style.display = "flex";
15539
+ widgetDiv.style.alignItems = "center";
15532
15540
  widgetDiv.style.transition = "transform 0.25s ease 0s, opacity 0.25s ease 0s";
15533
15541
  widgetDiv.style.borderRadius = "";
15534
15542
  fv.onHide(() => {
@@ -558,6 +558,7 @@ declare namespace pxtblockly {
558
558
  positionRight(x: number): number;
559
559
  positionLeft(x: number): number;
560
560
  createSVGArrow_(): void;
561
+ showPromptEditor_(): void;
561
562
  }
562
563
  }
563
564
  declare namespace pxtblockly {
@@ -8650,6 +8650,12 @@ 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
+ }
8653
8659
  }
8654
8660
  pxtblockly.FieldAutoComplete = FieldAutoComplete;
8655
8661
  })(pxtblockly || (pxtblockly = {}));
@@ -11925,6 +11931,7 @@ var pxtblockly;
11925
11931
  widgetDiv.style.height = "";
11926
11932
  widgetDiv.style.opacity = "";
11927
11933
  widgetDiv.style.transition = "";
11934
+ widgetDiv.style.alignItems = "";
11928
11935
  Blockly.Events.enable();
11929
11936
  Blockly.Events.setGroup(true);
11930
11937
  this.fireNumberInputUpdate(this.options.durationInputName, initialSound.duration);
@@ -11966,7 +11973,8 @@ var pxtblockly;
11966
11973
  widgetDiv.style.top = top + "px";
11967
11974
  widgetDiv.style.width = "30rem";
11968
11975
  widgetDiv.style.height = "40rem";
11969
- widgetDiv.style.display = "block";
11976
+ widgetDiv.style.display = "flex";
11977
+ widgetDiv.style.alignItems = "center";
11970
11978
  widgetDiv.style.transition = "transform 0.25s ease 0s, opacity 0.25s ease 0s";
11971
11979
  widgetDiv.style.borderRadius = "";
11972
11980
  fv.onHide(() => {
package/built/pxtlib.d.ts CHANGED
@@ -1305,6 +1305,7 @@ declare namespace pxt.github {
1305
1305
  private?: boolean;
1306
1306
  fork?: boolean;
1307
1307
  }
1308
+ function isDefaultBranch(branch: string, repo?: GitRepo): boolean;
1308
1309
  function listUserReposAsync(): Promise<GitRepo[]>;
1309
1310
  function createRepoAsync(name: string, description: string, priv?: boolean): Promise<GitRepo>;
1310
1311
  function enablePagesAsync(repo: string): Promise<void>;
package/built/pxtlib.js CHANGED
@@ -10304,6 +10304,12 @@ var pxt;
10304
10304
  GitRepoStatus[GitRepoStatus["Approved"] = 1] = "Approved";
10305
10305
  GitRepoStatus[GitRepoStatus["Banned"] = 2] = "Banned";
10306
10306
  })(GitRepoStatus = github.GitRepoStatus || (github.GitRepoStatus = {}));
10307
+ function isDefaultBranch(branch, repo) {
10308
+ if (repo && repo.defaultBranch)
10309
+ return branch === repo.defaultBranch;
10310
+ return /^(main|master)$/.test(branch);
10311
+ }
10312
+ github.isDefaultBranch = isDefaultBranch;
10307
10313
  function listUserReposAsync() {
10308
10314
  const q = `{
10309
10315
  viewer {
@@ -10321,12 +10327,12 @@ var pxt;
10321
10327
  defaultBranchRef {
10322
10328
  name
10323
10329
  }
10324
- pxtjson: object(expression: "master:pxt.json") {
10330
+ pxtjson: object(expression: "HEAD:pxt.json") {
10325
10331
  ... on Blob {
10326
10332
  text
10327
10333
  }
10328
10334
  }
10329
- readme: object(expression: "master:README.md") {
10335
+ readme: object(expression: "HEAD:README.md") {
10330
10336
  ... on Blob {
10331
10337
  text
10332
10338
  }
package/built/pxtpy.js CHANGED
@@ -186,6 +186,7 @@ var pxt;
186
186
  return mkType({ primType: tp });
187
187
  }
188
188
  function getOrSetSymbolType(sym) {
189
+ var _a;
189
190
  if (!sym.pySymbolType) {
190
191
  currErrorCtx = sym.pyQName;
191
192
  if (sym.parameters) {
@@ -207,8 +208,24 @@ var pxt;
207
208
  sym.pyRetType = mkType({ moduleType: sym });
208
209
  }
209
210
  else {
210
- if (sym.retType)
211
- sym.pyRetType = mapTsType(sym.retType);
211
+ if (sym.retType) {
212
+ if (((_a = sym.qName) === null || _a === void 0 ? void 0 : _a.endsWith(".__constructor")) && sym.retType === "void") {
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
+ }
212
229
  else if (sym.pyRetType) {
213
230
  // nothing to do
214
231
  }