pxt-core 9.3.8 → 9.3.9

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/cli.js CHANGED
@@ -308,7 +308,8 @@ function pxtFileList(pref) {
308
308
  .concat(nodeutil.allFiles(pref + "built/web/skillmap", { maxDepth: 4 }))
309
309
  .concat(nodeutil.allFiles(pref + "built/web/authcode", { maxDepth: 4 }))
310
310
  .concat(nodeutil.allFiles(pref + "built/web/multiplayer", { maxDepth: 4 }))
311
- .concat(nodeutil.allFiles(pref + "built/web/kiosk", { maxDepth: 4 }));
311
+ .concat(nodeutil.allFiles(pref + "built/web/kiosk", { maxDepth: 4 }))
312
+ .concat(nodeutil.allFiles(pref + "built/web/teachertool", { maxDepth: 4 }));
312
313
  }
313
314
  function semverCmp(a, b) {
314
315
  let parse = (s) => {
@@ -392,7 +393,8 @@ function ciAsync() {
392
393
  .then(() => crowdin.execCrowdinAsync("upload", "built/skillmap-strings.json"))
393
394
  .then(() => crowdin.execCrowdinAsync("upload", "built/authcode-strings.json"))
394
395
  .then(() => crowdin.execCrowdinAsync("upload", "built/multiplayer-strings.json"))
395
- .then(() => crowdin.execCrowdinAsync("upload", "built/kiosk-strings.json"));
396
+ .then(() => crowdin.execCrowdinAsync("upload", "built/kiosk-strings.json"))
397
+ .then(() => crowdin.execCrowdinAsync("upload", "built/teachertool-strings.json"));
396
398
  if (uploadApiStrings)
397
399
  p = p.then(() => crowdin.execCrowdinAsync("upload", "built/strings.json"));
398
400
  if (uploadDocs || uploadApiStrings)
@@ -922,6 +924,7 @@ function uploadCoreAsync(opts) {
922
924
  "authcodeUrl": opts.localDir + "authcode.html",
923
925
  "multiplayerUrl": opts.localDir + "multiplayer.html",
924
926
  "kioskUrl": opts.localDir + "kiosk.html",
927
+ "teachertoolUrl": opts.localDir + "teachertool.html",
925
928
  "isStatic": true,
926
929
  };
927
930
  const targetImageLocalPaths = targetImagePaths.map(k => `${opts.localDir}${path.join('./docs', k)}`);
@@ -972,6 +975,7 @@ function uploadCoreAsync(opts) {
972
975
  "authcode.html",
973
976
  "multiplayer.html",
974
977
  "kiosk.html",
978
+ "teachertool.html",
975
979
  ];
976
980
  // expandHtml is manually called on these files before upload
977
981
  // runs <!-- @include --> substitutions, fills in locale, etc
@@ -981,6 +985,7 @@ function uploadCoreAsync(opts) {
981
985
  "authcode.html",
982
986
  "multiplayer.html",
983
987
  "kiosk.html",
988
+ "teachertool.html",
984
989
  ];
985
990
  nodeutil.mkdirP("built/uploadrepl");
986
991
  function encodeURLs(urls) {
@@ -1821,7 +1826,8 @@ async function buildSemanticUIAsync(parsed) {
1821
1826
  await Promise.all([
1822
1827
  generateReactCommonCss("skillmap"),
1823
1828
  generateReactCommonCss("authcode"),
1824
- generateReactCommonCss("multiplayer")
1829
+ generateReactCommonCss("multiplayer"),
1830
+ generateReactCommonCss("teachertool")
1825
1831
  ]);
1826
1832
  // Run postcss with autoprefixer and rtlcss
1827
1833
  pxt.debug("running postcss");
@@ -1847,7 +1853,8 @@ async function buildSemanticUIAsync(parsed) {
1847
1853
  "blockly.css",
1848
1854
  "react-common-skillmap.css",
1849
1855
  "react-common-authcode.css",
1850
- "react-common-multiplayer.css"
1856
+ "react-common-multiplayer.css",
1857
+ "react-common-teachertool.css"
1851
1858
  ];
1852
1859
  for (const cssFile of files) {
1853
1860
  const css = await readFileAsync(`built/web/${cssFile}`, "utf8");
package/built/pxt.js CHANGED
@@ -155401,6 +155401,8 @@ var pxsim;
155401
155401
  let isDeferrableBroadcastMessage = false;
155402
155402
  const broadcastmsg = msg;
155403
155403
  if (source && (broadcastmsg === null || broadcastmsg === void 0 ? void 0 : broadcastmsg.broadcast)) {
155404
+ // include index of the source iframe
155405
+ broadcastmsg.srcFrameIndex = this.simFrames().findIndex((item) => item.contentWindow === source);
155404
155406
  // if the editor is hosted in a multi-editor setting
155405
155407
  // don't start extra frames
155406
155408
  const single = !!((_a = this._currentRuntime) === null || _a === void 0 ? void 0 : _a.single);
@@ -160832,7 +160834,8 @@ function pxtFileList(pref) {
160832
160834
  .concat(nodeutil.allFiles(pref + "built/web/skillmap", { maxDepth: 4 }))
160833
160835
  .concat(nodeutil.allFiles(pref + "built/web/authcode", { maxDepth: 4 }))
160834
160836
  .concat(nodeutil.allFiles(pref + "built/web/multiplayer", { maxDepth: 4 }))
160835
- .concat(nodeutil.allFiles(pref + "built/web/kiosk", { maxDepth: 4 }));
160837
+ .concat(nodeutil.allFiles(pref + "built/web/kiosk", { maxDepth: 4 }))
160838
+ .concat(nodeutil.allFiles(pref + "built/web/teachertool", { maxDepth: 4 }));
160836
160839
  }
160837
160840
  function semverCmp(a, b) {
160838
160841
  let parse = (s) => {
@@ -160916,7 +160919,8 @@ function ciAsync() {
160916
160919
  .then(() => crowdin.execCrowdinAsync("upload", "built/skillmap-strings.json"))
160917
160920
  .then(() => crowdin.execCrowdinAsync("upload", "built/authcode-strings.json"))
160918
160921
  .then(() => crowdin.execCrowdinAsync("upload", "built/multiplayer-strings.json"))
160919
- .then(() => crowdin.execCrowdinAsync("upload", "built/kiosk-strings.json"));
160922
+ .then(() => crowdin.execCrowdinAsync("upload", "built/kiosk-strings.json"))
160923
+ .then(() => crowdin.execCrowdinAsync("upload", "built/teachertool-strings.json"));
160920
160924
  if (uploadApiStrings)
160921
160925
  p = p.then(() => crowdin.execCrowdinAsync("upload", "built/strings.json"));
160922
160926
  if (uploadDocs || uploadApiStrings)
@@ -161446,6 +161450,7 @@ function uploadCoreAsync(opts) {
161446
161450
  "authcodeUrl": opts.localDir + "authcode.html",
161447
161451
  "multiplayerUrl": opts.localDir + "multiplayer.html",
161448
161452
  "kioskUrl": opts.localDir + "kiosk.html",
161453
+ "teachertoolUrl": opts.localDir + "teachertool.html",
161449
161454
  "isStatic": true,
161450
161455
  };
161451
161456
  const targetImageLocalPaths = targetImagePaths.map(k => `${opts.localDir}${path.join('./docs', k)}`);
@@ -161496,6 +161501,7 @@ function uploadCoreAsync(opts) {
161496
161501
  "authcode.html",
161497
161502
  "multiplayer.html",
161498
161503
  "kiosk.html",
161504
+ "teachertool.html",
161499
161505
  ];
161500
161506
  // expandHtml is manually called on these files before upload
161501
161507
  // runs <!-- @include --> substitutions, fills in locale, etc
@@ -161505,6 +161511,7 @@ function uploadCoreAsync(opts) {
161505
161511
  "authcode.html",
161506
161512
  "multiplayer.html",
161507
161513
  "kiosk.html",
161514
+ "teachertool.html",
161508
161515
  ];
161509
161516
  nodeutil.mkdirP("built/uploadrepl");
161510
161517
  function encodeURLs(urls) {
@@ -162345,7 +162352,8 @@ async function buildSemanticUIAsync(parsed) {
162345
162352
  await Promise.all([
162346
162353
  generateReactCommonCss("skillmap"),
162347
162354
  generateReactCommonCss("authcode"),
162348
- generateReactCommonCss("multiplayer")
162355
+ generateReactCommonCss("multiplayer"),
162356
+ generateReactCommonCss("teachertool")
162349
162357
  ]);
162350
162358
  // Run postcss with autoprefixer and rtlcss
162351
162359
  pxt.debug("running postcss");
@@ -162371,7 +162379,8 @@ async function buildSemanticUIAsync(parsed) {
162371
162379
  "blockly.css",
162372
162380
  "react-common-skillmap.css",
162373
162381
  "react-common-authcode.css",
162374
- "react-common-multiplayer.css"
162382
+ "react-common-multiplayer.css",
162383
+ "react-common-teachertool.css"
162375
162384
  ];
162376
162385
  for (const cssFile of files) {
162377
162386
  const css = await readFileAsync(`built/web/${cssFile}`, "utf8");
package/built/pxtlib.d.ts CHANGED
@@ -557,6 +557,7 @@ declare namespace pxt {
557
557
  authcodeUrl?: string;
558
558
  multiplayerUrl?: string;
559
559
  kioskUrl?: string;
560
+ teachertoolUrl?: string;
560
561
  isStatic?: boolean;
561
562
  verprefix?: string;
562
563
  }
@@ -1574,6 +1574,7 @@ var pxt;
1574
1574
  }
1575
1575
  function initInnerAsync() {
1576
1576
  pxt.setAppTarget(window.pxtTargetBundle);
1577
+ pxt.analytics.enable(pxt.Util.userLanguage());
1577
1578
  pxt.Util.assert(!!pxt.appTarget);
1578
1579
  const href = window.location.href;
1579
1580
  let force = false;
@@ -1817,7 +1818,13 @@ var pxt;
1817
1818
  runner.postSimMessage = postSimMessage;
1818
1819
  async function fetchSimJsInfo(simOptions) {
1819
1820
  try {
1820
- return await pxt.Cloud.downloadBuiltSimJsInfoAsync(simOptions.id);
1821
+ const start = Date.now();
1822
+ const result = await pxt.Cloud.downloadBuiltSimJsInfoAsync(simOptions.id);
1823
+ pxt.tickEvent("perfMeasurement", {
1824
+ durationMs: Date.now() - start,
1825
+ operation: "fetchSimJsInfo",
1826
+ });
1827
+ return result;
1821
1828
  }
1822
1829
  catch (e) {
1823
1830
  // This exception will happen in the majority of cases, so we don't want to log it unless for debugging.
@@ -1828,6 +1835,7 @@ var pxt;
1828
1835
  runner.fetchSimJsInfo = fetchSimJsInfo;
1829
1836
  async function buildSimJsInfo(simOptions) {
1830
1837
  var _a;
1838
+ const start = Date.now();
1831
1839
  await loadPackageAsync(simOptions.id, simOptions.code, simOptions.dependencies);
1832
1840
  let didUpgrade = false;
1833
1841
  const currentTargetVersion = pxt.appTarget.versions.target;
@@ -1885,6 +1893,10 @@ var pxt;
1885
1893
  }
1886
1894
  const res = pxtc.buildSimJsInfo(compileResult);
1887
1895
  res.parts = compileResult.usedParts;
1896
+ pxt.tickEvent("perfMeasurement", {
1897
+ durationMs: Date.now() - start,
1898
+ operation: "buildSimJsInfo",
1899
+ });
1888
1900
  return res;
1889
1901
  }
1890
1902
  runner.buildSimJsInfo = buildSimJsInfo;
package/built/pxtsim.d.ts CHANGED
@@ -386,6 +386,7 @@ declare namespace pxsim {
386
386
  interface SimulatorBroadcastMessage extends SimulatorMessage {
387
387
  broadcast: boolean;
388
388
  toParentIFrameOnly?: boolean;
389
+ srcFrameIndex?: number;
389
390
  }
390
391
  interface SimulatorControlMessage extends SimulatorBroadcastMessage {
391
392
  type: "messagepacket";
package/built/pxtsim.js CHANGED
@@ -6253,6 +6253,8 @@ var pxsim;
6253
6253
  let isDeferrableBroadcastMessage = false;
6254
6254
  const broadcastmsg = msg;
6255
6255
  if (source && (broadcastmsg === null || broadcastmsg === void 0 ? void 0 : broadcastmsg.broadcast)) {
6256
+ // include index of the source iframe
6257
+ broadcastmsg.srcFrameIndex = this.simFrames().findIndex((item) => item.contentWindow === source);
6256
6258
  // if the editor is hosted in a multi-editor setting
6257
6259
  // don't start extra frames
6258
6260
  const single = !!((_a = this._currentRuntime) === null || _a === void 0 ? void 0 : _a.single);
package/built/server.js CHANGED
@@ -24,7 +24,8 @@ let localHexCacheDir = path.join("built", "hexcache");
24
24
  let serveOptions;
25
25
  const webappNames = [
26
26
  "kiosk",
27
- "multiplayer"
27
+ "multiplayer",
28
+ "teachertool"
28
29
  // TODO: Add other webapp names here: "skillmap", "authcode"
29
30
  ];
30
31
  function setupDocfilesdirs() {