pxt-core 7.4.12 → 7.4.16

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 (61) hide show
  1. package/built/cli.js +29 -6
  2. package/built/nodeutil.d.ts +1 -1
  3. package/built/nodeutil.js +2 -2
  4. package/built/pxt.js +30 -6
  5. package/built/pxtblockly.js +153 -60
  6. package/built/pxtblocks.d.ts +8 -0
  7. package/built/pxtblocks.js +96 -60
  8. package/built/pxtlib.js +1 -0
  9. package/built/target.js +1 -1
  10. package/built/web/blockly.css +1 -1
  11. package/built/web/main.js +1 -1
  12. package/built/web/pxtapp.js +1 -1
  13. package/built/web/pxtasseteditor.js +1 -1
  14. package/built/web/pxtblockly.js +53 -1
  15. package/built/web/pxtblocks.js +1 -1
  16. package/built/web/pxtembed.js +53 -1
  17. package/built/web/pxtlib.js +1 -1
  18. package/built/web/pxtworker.js +1 -1
  19. package/built/web/react-common-skillmap.css +13 -1
  20. package/built/web/rtlblockly.css +1 -1
  21. package/built/web/rtlreact-common-skillmap.css +13 -1
  22. package/built/web/rtlsemantic.css +14 -2
  23. package/built/web/semantic.css +14 -2
  24. package/built/web/skillmap/css/main.51937f05.chunk.css +1 -0
  25. package/built/web/skillmap/js/2.261d5eab.chunk.js +2 -0
  26. package/built/web/skillmap/js/main.1f690147.chunk.js +1 -0
  27. package/docfiles/tracking.html +1 -1
  28. package/localtypings/pxtarget.d.ts +1 -0
  29. package/localtypings/pxtblockly.d.ts +37 -0
  30. package/package.json +6 -3
  31. package/react-common/components/controls/Button.tsx +85 -0
  32. package/react-common/components/controls/Checkbox.tsx +47 -0
  33. package/react-common/components/controls/FocusTrap.tsx +92 -0
  34. package/react-common/components/controls/Input.tsx +117 -0
  35. package/react-common/components/controls/List.tsx +28 -0
  36. package/react-common/components/controls/MenuBar.tsx +94 -0
  37. package/react-common/components/controls/MenuDropdown.tsx +108 -0
  38. package/react-common/components/controls/Modal.tsx +108 -0
  39. package/react-common/components/profile/Profile.tsx +1 -1
  40. package/react-common/components/profile/UserPane.tsx +12 -8
  41. package/react-common/components/util.tsx +35 -0
  42. package/react-common/styles/controls/Button.less +178 -0
  43. package/react-common/styles/controls/Checkbox.less +13 -0
  44. package/react-common/styles/controls/Icon.less +11 -0
  45. package/react-common/styles/controls/Input.less +95 -0
  46. package/react-common/styles/controls/List.less +12 -0
  47. package/react-common/styles/controls/MenuDropdown.less +36 -0
  48. package/react-common/styles/controls/Modal.less +105 -0
  49. package/react-common/styles/controls/Spinner.less +24 -0
  50. package/react-common/styles/profile/profile.less +12 -0
  51. package/react-common/styles/react-common-skillmap.less +1 -1
  52. package/react-common/styles/react-common-variables.less +57 -0
  53. package/react-common/styles/react-common.less +13 -1
  54. package/theme/asset-editor.less +13 -29
  55. package/theme/blockly-core.less +16 -0
  56. package/webapp/public/blockly/plugins.js +57 -0
  57. package/webapp/public/skillmap.html +2 -2
  58. package/built/web/skillmap/css/main.96b1b3f1.chunk.css +0 -1
  59. package/built/web/skillmap/js/2.7dd06a3a.chunk.js +0 -2
  60. package/built/web/skillmap/js/main.b96caef3.chunk.js +0 -1
  61. package/react-common/components/Checkbox.tsx +0 -25
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"];
@@ -1743,7 +1743,9 @@ async function buildSemanticUIAsync(parsed) {
1743
1743
  "theme/foo/bar",
1744
1744
  "theme",
1745
1745
  "node_modules/pxt-core/react-common/styles",
1746
- "react-common/styles"
1746
+ "react-common/styles",
1747
+ "node_modules/@fortawesome",
1748
+ "node_modules/pxt-core/node_modules/@fortawesome" // for locally linked dev environment
1747
1749
  ].join(":");
1748
1750
  // Build semantic css
1749
1751
  await nodeutil.spawnAsync({
@@ -1789,6 +1791,14 @@ async function buildSemanticUIAsync(parsed) {
1789
1791
  "--include-path=" + lessIncludePaths
1790
1792
  ]
1791
1793
  });
1794
+ let fontAwesomeSource = "node_modules/@fortawesome/fontawesome-free/webfonts/";
1795
+ if (!fs.existsSync(fontAwesomeSource)) {
1796
+ fontAwesomeSource = "node_modules/pxt-core/" + fontAwesomeSource;
1797
+ }
1798
+ let skillmapCss = await readFileAsync(`built/web/react-common-skillmap.css`, "utf8");
1799
+ skillmapCss = await linkFontAsync("fa-solid-900", skillmapCss, fontAwesomeSource, "\\.\\.\\/webfonts\\/");
1800
+ skillmapCss = await linkFontAsync("fa-regular-400", skillmapCss, fontAwesomeSource, "\\.\\.\\/webfonts\\/");
1801
+ await writeFileAsync(`built/web/react-common-skillmap.css`, skillmapCss, "utf8");
1792
1802
  // Run postcss with autoprefixer and rtlcss
1793
1803
  pxt.debug("running postcss");
1794
1804
  const postcss = require('postcss');
@@ -1818,13 +1828,19 @@ async function buildSemanticUIAsync(parsed) {
1818
1828
  .process(processed.css, { from: `built/web/${cssFile}`, to: `built/web/rtl${cssFile}` });
1819
1829
  await writeFileAsync(`built/web/rtl${cssFile}`, processedRtl.css, "utf8");
1820
1830
  }
1831
+ if (!isPxtCore) {
1832
+ // This is just to support the local skillmap serve for development
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");
1835
+ }
1821
1836
  }
1822
- async function linkFontAsync(font, semCss) {
1823
- const fontFile = await readFileAsync("node_modules/semantic-ui-less/themes/default/assets/fonts/" + font + ".woff");
1837
+ async function linkFontAsync(font, semCss, sourceDir = "node_modules/semantic-ui-less/themes/default/assets/fonts/", refDir = "fonts\\/") {
1838
+ const fontFile = await readFileAsync(sourceDir + font + ".woff");
1824
1839
  const url = "url(data:application/font-woff;charset=utf-8;base64,"
1825
1840
  + fontFile.toString("base64") + ") format('woff')";
1826
- const r = new RegExp(`src:.*url\\("fonts\/${font}\\.woff.*`, "g");
1827
- semCss = semCss.replace('src: url("fonts/' + font + '.eot");', "")
1841
+ const r = new RegExp(`src:.*url\\((?:"|')${refDir + font}\\.woff.*`, "g");
1842
+ semCss = semCss.replace('src: url("' + refDir + font + '.eot");', "")
1843
+ .replace('src: url(' + refDir + font + '.eot);', "")
1828
1844
  .replace(r, "src: " + url + ";");
1829
1845
  return semCss;
1830
1846
  }
@@ -1837,6 +1853,7 @@ function buildWebStringsAsync() {
1837
1853
  function buildSkillMapAsync(parsed) {
1838
1854
  // local serve
1839
1855
  const skillmapRoot = "node_modules/pxt-core/skillmap";
1856
+ const reactScriptsConfigRoot = `${skillmapRoot}/node_modules/react-scripts/config`;
1840
1857
  const docsPath = parsed.flags["docs"];
1841
1858
  return rimrafAsync(`${skillmapRoot}/public/blb`, {})
1842
1859
  .then(() => rimrafAsync(`${skillmapRoot}/build/assets`, {}))
@@ -1852,6 +1869,12 @@ function buildSkillMapAsync(parsed) {
1852
1869
  nodeutil.cp("node_modules/pxt-core/built/web/react-common-skillmap.css", `${skillmapRoot}/public/blb`);
1853
1870
  // copy 'assets' over from docs/static
1854
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");
1855
1878
  if (docsPath) {
1856
1879
  // copy docs over from specified path
1857
1880
  nodeutil.cpR(`docs/${docsPath}`, `${skillmapRoot}/public/docs/${docsPath}`);
@@ -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: "Ελληνικά" },
@@ -156715,7 +156716,7 @@ function uploadToGitRepoAsync(opts, uplReqs) {
156715
156716
  if (U.startsWith(label, tid + "/"))
156716
156717
  label = label.slice(tid.length + 1);
156717
156718
  if (!/^v\d/.test(label)) {
156718
- console.log('label is not a version; skipping release upload');
156719
+ console.log(`label "${label}" is not a version; skipping release upload`);
156719
156720
  return Promise.resolve();
156720
156721
  }
156721
156722
  let repoUrl = process.env["PXT_RELEASE_REPO"];
@@ -157693,7 +157694,9 @@ async function buildSemanticUIAsync(parsed) {
157693
157694
  "theme/foo/bar",
157694
157695
  "theme",
157695
157696
  "node_modules/pxt-core/react-common/styles",
157696
- "react-common/styles"
157697
+ "react-common/styles",
157698
+ "node_modules/@fortawesome",
157699
+ "node_modules/pxt-core/node_modules/@fortawesome" // for locally linked dev environment
157697
157700
  ].join(":");
157698
157701
  // Build semantic css
157699
157702
  await nodeutil.spawnAsync({
@@ -157739,6 +157742,14 @@ async function buildSemanticUIAsync(parsed) {
157739
157742
  "--include-path=" + lessIncludePaths
157740
157743
  ]
157741
157744
  });
157745
+ let fontAwesomeSource = "node_modules/@fortawesome/fontawesome-free/webfonts/";
157746
+ if (!fs.existsSync(fontAwesomeSource)) {
157747
+ fontAwesomeSource = "node_modules/pxt-core/" + fontAwesomeSource;
157748
+ }
157749
+ let skillmapCss = await readFileAsync(`built/web/react-common-skillmap.css`, "utf8");
157750
+ skillmapCss = await linkFontAsync("fa-solid-900", skillmapCss, fontAwesomeSource, "\\.\\.\\/webfonts\\/");
157751
+ skillmapCss = await linkFontAsync("fa-regular-400", skillmapCss, fontAwesomeSource, "\\.\\.\\/webfonts\\/");
157752
+ await writeFileAsync(`built/web/react-common-skillmap.css`, skillmapCss, "utf8");
157742
157753
  // Run postcss with autoprefixer and rtlcss
157743
157754
  pxt.debug("running postcss");
157744
157755
  const postcss = require('postcss');
@@ -157768,13 +157779,19 @@ async function buildSemanticUIAsync(parsed) {
157768
157779
  .process(processed.css, { from: `built/web/${cssFile}`, to: `built/web/rtl${cssFile}` });
157769
157780
  await writeFileAsync(`built/web/rtl${cssFile}`, processedRtl.css, "utf8");
157770
157781
  }
157782
+ if (!isPxtCore) {
157783
+ // This is just to support the local skillmap serve for development
157784
+ nodeutil.cp("built/web/react-common-skillmap.css", "node_modules/pxt-core/skillmap/public/blb");
157785
+ nodeutil.cp("built/web/semantic.css", "node_modules/pxt-core/skillmap/public/blb");
157786
+ }
157771
157787
  }
157772
- async function linkFontAsync(font, semCss) {
157773
- const fontFile = await readFileAsync("node_modules/semantic-ui-less/themes/default/assets/fonts/" + font + ".woff");
157788
+ async function linkFontAsync(font, semCss, sourceDir = "node_modules/semantic-ui-less/themes/default/assets/fonts/", refDir = "fonts\\/") {
157789
+ const fontFile = await readFileAsync(sourceDir + font + ".woff");
157774
157790
  const url = "url(data:application/font-woff;charset=utf-8;base64,"
157775
157791
  + fontFile.toString("base64") + ") format('woff')";
157776
- const r = new RegExp(`src:.*url\\("fonts\/${font}\\.woff.*`, "g");
157777
- semCss = semCss.replace('src: url("fonts/' + font + '.eot");', "")
157792
+ const r = new RegExp(`src:.*url\\((?:"|')${refDir + font}\\.woff.*`, "g");
157793
+ semCss = semCss.replace('src: url("' + refDir + font + '.eot");', "")
157794
+ .replace('src: url(' + refDir + font + '.eot);', "")
157778
157795
  .replace(r, "src: " + url + ";");
157779
157796
  return semCss;
157780
157797
  }
@@ -157787,6 +157804,7 @@ function buildWebStringsAsync() {
157787
157804
  function buildSkillMapAsync(parsed) {
157788
157805
  // local serve
157789
157806
  const skillmapRoot = "node_modules/pxt-core/skillmap";
157807
+ const reactScriptsConfigRoot = `${skillmapRoot}/node_modules/react-scripts/config`;
157790
157808
  const docsPath = parsed.flags["docs"];
157791
157809
  return rimrafAsync(`${skillmapRoot}/public/blb`, {})
157792
157810
  .then(() => rimrafAsync(`${skillmapRoot}/build/assets`, {}))
@@ -157802,6 +157820,12 @@ function buildSkillMapAsync(parsed) {
157802
157820
  nodeutil.cp("node_modules/pxt-core/built/web/react-common-skillmap.css", `${skillmapRoot}/public/blb`);
157803
157821
  // copy 'assets' over from docs/static
157804
157822
  nodeutil.cpR("docs/static/skillmap/assets", `${skillmapRoot}/public/assets`);
157823
+ // copy default react-scripts webpack config into a webpack.config.base file if necessary
157824
+ if (!fs.existsSync(`${reactScriptsConfigRoot}/webpack.config.base.js`)) {
157825
+ nodeutil.cp(`${reactScriptsConfigRoot}/webpack.config.js`, reactScriptsConfigRoot, "webpack.config.base.js");
157826
+ }
157827
+ // wrap the config in our webpack.config.override for build customization
157828
+ nodeutil.cp(`${skillmapRoot}/webpack.config.override.js`, reactScriptsConfigRoot, "webpack.config.js");
157805
157829
  if (docsPath) {
157806
157830
  // copy docs over from specified path
157807
157831
  nodeutil.cpR(`docs/${docsPath}`, `${skillmapRoot}/public/docs/${docsPath}`);