pxt-core 7.4.14 → 7.4.18

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 (58) hide show
  1. package/built/backendutils.js +5 -6
  2. package/built/buildengine.js +1 -1
  3. package/built/cli.js +9 -1
  4. package/built/gdb.js +1 -1
  5. package/built/nodeutil.d.ts +1 -1
  6. package/built/nodeutil.js +2 -2
  7. package/built/pxt.js +15 -7
  8. package/built/pxtblockly.js +5 -2
  9. package/built/pxtblocks.d.ts +1 -0
  10. package/built/pxtblocks.js +5 -2
  11. package/built/pxteditor.d.ts +6 -1
  12. package/built/pxteditor.js +5 -0
  13. package/built/pxtlib.js +6 -6
  14. package/built/target.js +1 -1
  15. package/built/web/main.js +1 -1
  16. package/built/web/pxtapp.js +1 -1
  17. package/built/web/pxtasseteditor.js +1 -1
  18. package/built/web/pxtblockly.js +1 -1
  19. package/built/web/pxtblocks.js +1 -1
  20. package/built/web/pxteditor.js +1 -1
  21. package/built/web/pxtembed.js +2 -2
  22. package/built/web/pxtlib.js +1 -1
  23. package/built/web/pxtworker.js +1 -1
  24. package/built/web/react-common-skillmap.css +1 -1
  25. package/built/web/rtlreact-common-skillmap.css +1 -1
  26. package/built/web/rtlsemantic.css +1 -1
  27. package/built/web/semantic.css +1 -1
  28. package/built/web/skillmap/css/main.56e8c859.chunk.css +1 -0
  29. package/built/web/skillmap/js/2.261d5eab.chunk.js +2 -0
  30. package/built/web/skillmap/js/main.7c45ef9f.chunk.js +1 -0
  31. package/package.json +3 -3
  32. package/react-common/components/controls/Button.tsx +29 -6
  33. package/react-common/components/controls/Checkbox.tsx +47 -0
  34. package/react-common/components/controls/FocusTrap.tsx +92 -0
  35. package/react-common/components/controls/Input.tsx +117 -0
  36. package/react-common/components/controls/List.tsx +2 -3
  37. package/react-common/components/controls/MenuBar.tsx +94 -0
  38. package/react-common/components/controls/MenuDropdown.tsx +108 -0
  39. package/react-common/components/controls/Modal.tsx +108 -0
  40. package/react-common/components/profile/Profile.tsx +1 -1
  41. package/react-common/components/profile/UserPane.tsx +12 -8
  42. package/react-common/components/util.tsx +18 -0
  43. package/react-common/styles/controls/Button.less +36 -1
  44. package/react-common/styles/controls/Checkbox.less +24 -0
  45. package/react-common/styles/controls/Input.less +113 -0
  46. package/react-common/styles/controls/MenuDropdown.less +55 -0
  47. package/react-common/styles/controls/Modal.less +134 -0
  48. package/react-common/styles/controls/Spinner.less +24 -0
  49. package/react-common/styles/profile/profile.less +32 -0
  50. package/react-common/styles/react-common-variables.less +58 -3
  51. package/react-common/styles/react-common.less +5 -0
  52. package/theme/asset-editor.less +13 -29
  53. package/theme/highcontrast.less +23 -2
  54. package/webapp/public/skillmap.html +2 -2
  55. package/built/web/skillmap/css/main.369ecead.chunk.css +0 -1
  56. package/built/web/skillmap/js/2.dc66e964.chunk.js +0 -2
  57. package/built/web/skillmap/js/main.e89a1af7.chunk.js +0 -1
  58. package/react-common/components/Checkbox.tsx +0 -25
@@ -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/cli.js CHANGED
@@ -765,7 +765,7 @@ function uploadToGitRepoAsync(opts, uplReqs) {
765
765
  if (U.startsWith(label, tid + "/"))
766
766
  label = label.slice(tid.length + 1);
767
767
  if (!/^v\d/.test(label)) {
768
- console.log('label is not a version; skipping release upload');
768
+ console.log(`label "${label}" is not a version; skipping release upload`);
769
769
  return Promise.resolve();
770
770
  }
771
771
  let repoUrl = process.env["PXT_RELEASE_REPO"];
@@ -1831,6 +1831,7 @@ async function buildSemanticUIAsync(parsed) {
1831
1831
  if (!isPxtCore) {
1832
1832
  // This is just to support the local skillmap serve for development
1833
1833
  nodeutil.cp("built/web/react-common-skillmap.css", "node_modules/pxt-core/skillmap/public/blb");
1834
+ nodeutil.cp("built/web/semantic.css", "node_modules/pxt-core/skillmap/public/blb");
1834
1835
  }
1835
1836
  }
1836
1837
  async function linkFontAsync(font, semCss, sourceDir = "node_modules/semantic-ui-less/themes/default/assets/fonts/", refDir = "fonts\\/") {
@@ -1852,6 +1853,7 @@ function buildWebStringsAsync() {
1852
1853
  function buildSkillMapAsync(parsed) {
1853
1854
  // local serve
1854
1855
  const skillmapRoot = "node_modules/pxt-core/skillmap";
1856
+ const reactScriptsConfigRoot = `${skillmapRoot}/node_modules/react-scripts/config`;
1855
1857
  const docsPath = parsed.flags["docs"];
1856
1858
  return rimrafAsync(`${skillmapRoot}/public/blb`, {})
1857
1859
  .then(() => rimrafAsync(`${skillmapRoot}/build/assets`, {}))
@@ -1867,6 +1869,12 @@ function buildSkillMapAsync(parsed) {
1867
1869
  nodeutil.cp("node_modules/pxt-core/built/web/react-common-skillmap.css", `${skillmapRoot}/public/blb`);
1868
1870
  // copy 'assets' over from docs/static
1869
1871
  nodeutil.cpR("docs/static/skillmap/assets", `${skillmapRoot}/public/assets`);
1872
+ // copy default react-scripts webpack config into a webpack.config.base file if necessary
1873
+ if (!fs.existsSync(`${reactScriptsConfigRoot}/webpack.config.base.js`)) {
1874
+ nodeutil.cp(`${reactScriptsConfigRoot}/webpack.config.js`, reactScriptsConfigRoot, "webpack.config.base.js");
1875
+ }
1876
+ // wrap the config in our webpack.config.override for build customization
1877
+ nodeutil.cp(`${skillmapRoot}/webpack.config.override.js`, reactScriptsConfigRoot, "webpack.config.js");
1870
1878
  if (docsPath) {
1871
1879
  // copy docs over from specified path
1872
1880
  nodeutil.cpR(`docs/${docsPath}`, `${skillmapRoot}/public/docs/${docsPath}`);
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;
@@ -42,7 +42,7 @@ export declare function getPxtTarget(): pxt.TargetBundle;
42
42
  export declare function pathToPtr(path: string): string;
43
43
  export declare function mkdirP(thePath: string): void;
44
44
  export declare function cpR(src: string, dst: string, maxDepth?: number): void;
45
- export declare function cp(srcFile: string, destDirectory: string): void;
45
+ export declare function cp(srcFile: string, destDirectory: string, destName?: string): void;
46
46
  export declare function allFiles(top: string, maxDepth?: number, allowMissing?: boolean, includeDirs?: boolean, ignoredFileMarker?: string): string[];
47
47
  export declare function existsDirSync(name: string): boolean;
48
48
  export declare function writeFileSync(p: string, data: any, options?: {
package/built/nodeutil.js CHANGED
@@ -328,9 +328,9 @@ function cpR(src, dst, maxDepth = 8) {
328
328
  }
329
329
  }
330
330
  exports.cpR = cpR;
331
- function cp(srcFile, destDirectory) {
331
+ function cp(srcFile, destDirectory, destName) {
332
332
  mkdirP(destDirectory);
333
- let dest = path.resolve(destDirectory, path.basename(srcFile));
333
+ let dest = path.resolve(destDirectory, destName || path.basename(srcFile));
334
334
  let buf = fs.readFileSync(path.resolve(srcFile));
335
335
  fs.writeFileSync(dest, buf);
336
336
  }
package/built/pxt.js CHANGED
@@ -99899,6 +99899,7 @@ var ts;
99899
99899
  "bn": { englishName: "Bengali", localizedName: "বাংলা" },
99900
99900
  "ca": { englishName: "Catalan", localizedName: "Català" },
99901
99901
  "cs": { englishName: "Czech", localizedName: "Čeština" },
99902
+ "cy": { englishName: "Welsh", localizedName: "Cymraeg" },
99902
99903
  "da": { englishName: "Danish", localizedName: "Dansk" },
99903
99904
  "de": { englishName: "German", localizedName: "Deutsch" },
99904
99905
  "el": { englishName: "Greek", localizedName: "Ελληνικά" },
@@ -106368,16 +106369,15 @@ var pxt;
106368
106369
  text = m[1];
106369
106370
  id = m[2];
106370
106371
  }
106371
- else {
106372
- id = raw.toLowerCase().replace(/[^\w]+/g, '-');
106373
- }
106374
106372
  // remove tutorial macros
106375
106373
  if (text)
106376
106374
  text = text.replace(/@(fullscreen|unplugged|showdialog|showhint)/gi, '');
106377
- text = text.trim();
106378
106375
  // remove brackets for hiding step title
106379
- if (text.match(/^\{([\s\S]+)\}$/))
106380
- 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
+ }
106381
106381
  return `<h${level} id="${this.options.headerPrefix}${id}">${text}</h${level}>`;
106382
106382
  };
106383
106383
  }
@@ -156715,7 +156715,7 @@ function uploadToGitRepoAsync(opts, uplReqs) {
156715
156715
  if (U.startsWith(label, tid + "/"))
156716
156716
  label = label.slice(tid.length + 1);
156717
156717
  if (!/^v\d/.test(label)) {
156718
- console.log('label is not a version; skipping release upload');
156718
+ console.log(`label "${label}" is not a version; skipping release upload`);
156719
156719
  return Promise.resolve();
156720
156720
  }
156721
156721
  let repoUrl = process.env["PXT_RELEASE_REPO"];
@@ -157781,6 +157781,7 @@ async function buildSemanticUIAsync(parsed) {
157781
157781
  if (!isPxtCore) {
157782
157782
  // This is just to support the local skillmap serve for development
157783
157783
  nodeutil.cp("built/web/react-common-skillmap.css", "node_modules/pxt-core/skillmap/public/blb");
157784
+ nodeutil.cp("built/web/semantic.css", "node_modules/pxt-core/skillmap/public/blb");
157784
157785
  }
157785
157786
  }
157786
157787
  async function linkFontAsync(font, semCss, sourceDir = "node_modules/semantic-ui-less/themes/default/assets/fonts/", refDir = "fonts\\/") {
@@ -157802,6 +157803,7 @@ function buildWebStringsAsync() {
157802
157803
  function buildSkillMapAsync(parsed) {
157803
157804
  // local serve
157804
157805
  const skillmapRoot = "node_modules/pxt-core/skillmap";
157806
+ const reactScriptsConfigRoot = `${skillmapRoot}/node_modules/react-scripts/config`;
157805
157807
  const docsPath = parsed.flags["docs"];
157806
157808
  return rimrafAsync(`${skillmapRoot}/public/blb`, {})
157807
157809
  .then(() => rimrafAsync(`${skillmapRoot}/build/assets`, {}))
@@ -157817,6 +157819,12 @@ function buildSkillMapAsync(parsed) {
157817
157819
  nodeutil.cp("node_modules/pxt-core/built/web/react-common-skillmap.css", `${skillmapRoot}/public/blb`);
157818
157820
  // copy 'assets' over from docs/static
157819
157821
  nodeutil.cpR("docs/static/skillmap/assets", `${skillmapRoot}/public/assets`);
157822
+ // copy default react-scripts webpack config into a webpack.config.base file if necessary
157823
+ if (!fs.existsSync(`${reactScriptsConfigRoot}/webpack.config.base.js`)) {
157824
+ nodeutil.cp(`${reactScriptsConfigRoot}/webpack.config.js`, reactScriptsConfigRoot, "webpack.config.base.js");
157825
+ }
157826
+ // wrap the config in our webpack.config.override for build customization
157827
+ nodeutil.cp(`${skillmapRoot}/webpack.config.override.js`, reactScriptsConfigRoot, "webpack.config.js");
157820
157828
  if (docsPath) {
157821
157829
  // copy docs over from specified path
157822
157830
  nodeutil.cpR(`docs/${docsPath}`, `${skillmapRoot}/public/docs/${docsPath}`);
@@ -6952,7 +6952,7 @@ var pxt;
6952
6952
  layout.serializeSvgString = serializeSvgString;
6953
6953
  function cleanUpBlocklySvg(svg) {
6954
6954
  pxt.BrowserUtils.removeClass(svg, "blocklySvg");
6955
- pxt.BrowserUtils.addClass(svg, "blocklyPreview pxt-renderer");
6955
+ pxt.BrowserUtils.addClass(svg, "blocklyPreview pxt-renderer classic-theme");
6956
6956
  // Remove background elements
6957
6957
  pxt.U.toArray(svg.querySelectorAll('.blocklyMainBackground,.blocklyScrollbarBackground'))
6958
6958
  .forEach(el => { if (el)
@@ -13085,7 +13085,6 @@ var pxtblockly;
13085
13085
  }
13086
13086
  initView() {
13087
13087
  super.initView();
13088
- this.initVariables();
13089
13088
  }
13090
13089
  onItemSelected_(menu, menuItem) {
13091
13090
  const value = menuItem.getValue();
@@ -13103,6 +13102,10 @@ var pxtblockly;
13103
13102
  this.getOptions();
13104
13103
  return super.doClassValidation_(value);
13105
13104
  }
13105
+ getOptions(opt_useCache) {
13106
+ this.initVariables();
13107
+ return super.getOptions(opt_useCache);
13108
+ }
13106
13109
  initVariables() {
13107
13110
  if (this.sourceBlock_ && this.sourceBlock_.workspace) {
13108
13111
  const ws = this.sourceBlock_.workspace;
@@ -776,6 +776,7 @@ declare namespace pxtblockly {
776
776
  initView(): void;
777
777
  onItemSelected_(menu: Blockly.Menu, menuItem: Blockly.MenuItem): void;
778
778
  doClassValidation_(value: any): string;
779
+ getOptions(opt_useCache?: boolean): any[][];
779
780
  private initVariables;
780
781
  }
781
782
  }
@@ -3328,7 +3328,7 @@ var pxt;
3328
3328
  layout.serializeSvgString = serializeSvgString;
3329
3329
  function cleanUpBlocklySvg(svg) {
3330
3330
  pxt.BrowserUtils.removeClass(svg, "blocklySvg");
3331
- pxt.BrowserUtils.addClass(svg, "blocklyPreview pxt-renderer");
3331
+ pxt.BrowserUtils.addClass(svg, "blocklyPreview pxt-renderer classic-theme");
3332
3332
  // Remove background elements
3333
3333
  pxt.U.toArray(svg.querySelectorAll('.blocklyMainBackground,.blocklyScrollbarBackground'))
3334
3334
  .forEach(el => { if (el)
@@ -9461,7 +9461,6 @@ var pxtblockly;
9461
9461
  }
9462
9462
  initView() {
9463
9463
  super.initView();
9464
- this.initVariables();
9465
9464
  }
9466
9465
  onItemSelected_(menu, menuItem) {
9467
9466
  const value = menuItem.getValue();
@@ -9479,6 +9478,10 @@ var pxtblockly;
9479
9478
  this.getOptions();
9480
9479
  return super.doClassValidation_(value);
9481
9480
  }
9481
+ getOptions(opt_useCache) {
9482
+ this.initVariables();
9483
+ return super.getOptions(opt_useCache);
9484
+ }
9482
9485
  initVariables() {
9483
9486
  if (this.sourceBlock_ && this.sourceBlock_.workspace) {
9484
9487
  const ws = this.sourceBlock_.workspace;
@@ -283,6 +283,7 @@ declare namespace pxt.editor {
283
283
  renderBlocksAsync(req: EditorMessageRenderBlocksRequest): Promise<EditorMessageRenderBlocksResponse>;
284
284
  renderPythonAsync(req: EditorMessageRenderPythonRequest): Promise<EditorMessageRenderPythonResponse>;
285
285
  toggleHighContrast(): void;
286
+ setHighContrast(on: boolean): void;
286
287
  toggleGreenScreen(): void;
287
288
  toggleAccessibleBlocks(): void;
288
289
  setAccessibleBlocks(enabled: boolean): void;
@@ -531,7 +532,7 @@ declare namespace pxt.editor {
531
532
  /**
532
533
  * Request action
533
534
  */
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;
535
+ 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
536
  }
536
537
  /**
537
538
  * Request sent by the editor when a tick/error/expection is registered
@@ -708,6 +709,10 @@ declare namespace pxt.editor {
708
709
  action: "setsimulatorfullscreen";
709
710
  enabled: boolean;
710
711
  }
712
+ interface EditorMessageSetHighContrastRequest extends EditorMessageRequest {
713
+ action: "sethighcontrast";
714
+ on: boolean;
715
+ }
711
716
  interface EditorMessageStartActivity extends EditorMessageRequest {
712
717
  action: "startactivity";
713
718
  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
@@ -2213,6 +2213,7 @@ var ts;
2213
2213
  "bn": { englishName: "Bengali", localizedName: "বাংলা" },
2214
2214
  "ca": { englishName: "Catalan", localizedName: "Català" },
2215
2215
  "cs": { englishName: "Czech", localizedName: "Čeština" },
2216
+ "cy": { englishName: "Welsh", localizedName: "Cymraeg" },
2216
2217
  "da": { englishName: "Danish", localizedName: "Dansk" },
2217
2218
  "de": { englishName: "German", localizedName: "Deutsch" },
2218
2219
  "el": { englishName: "Greek", localizedName: "Ελληνικά" },
@@ -8682,16 +8683,15 @@ var pxt;
8682
8683
  text = m[1];
8683
8684
  id = m[2];
8684
8685
  }
8685
- else {
8686
- id = raw.toLowerCase().replace(/[^\w]+/g, '-');
8687
- }
8688
8686
  // remove tutorial macros
8689
8687
  if (text)
8690
8688
  text = text.replace(/@(fullscreen|unplugged|showdialog|showhint)/gi, '');
8691
- text = text.trim();
8692
8689
  // remove brackets for hiding step title
8693
- if (text.match(/^\{([\s\S]+)\}$/))
8694
- 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
+ }
8695
8695
  return `<h${level} id="${this.options.headerPrefix}${id}">${text}</h${level}>`;
8696
8696
  };
8697
8697
  }