pxt-core 8.4.2 → 8.4.4

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 (82) hide show
  1. package/built/backendutils.js +1 -0
  2. package/built/cli.js +83 -75
  3. package/built/pxt.js +1279 -180
  4. package/built/pxtblockly.js +323 -40
  5. package/built/pxtblocks.d.ts +30 -7
  6. package/built/pxtblocks.js +324 -41
  7. package/built/pxtlib.d.ts +91 -5
  8. package/built/pxtlib.js +1173 -98
  9. package/built/pxtrunner.d.ts +1 -0
  10. package/built/pxtrunner.js +2 -1
  11. package/built/pxtsim.d.ts +1 -0
  12. package/built/pxtsim.js +23 -7
  13. package/built/server.js +4 -0
  14. package/built/target.js +1 -1
  15. package/built/web/main.js +1 -1
  16. package/built/web/multiplayer/css/main.1b9969ea.css +4 -0
  17. package/built/web/multiplayer/js/main.9f7f3192.js +2 -0
  18. package/built/web/pxtapp.js +1 -1
  19. package/built/web/pxtasseteditor.js +1 -1
  20. package/built/web/pxtblockly.js +1 -1
  21. package/built/web/pxtblocks.js +1 -1
  22. package/built/web/pxtembed.js +2 -2
  23. package/built/web/pxtlib.js +1 -1
  24. package/built/web/pxtrunner.js +1 -1
  25. package/built/web/pxtsim.js +1 -1
  26. package/built/web/pxtworker.js +2 -2
  27. package/built/web/react-common-authcode.css +4 -6993
  28. package/built/web/react-common-multiplayer.css +13 -0
  29. package/built/web/react-common-skillmap.css +1 -1
  30. package/built/web/rtlreact-common-authcode.css +13 -0
  31. package/built/web/rtlreact-common-multiplayer.css +13 -0
  32. package/built/web/rtlreact-common-skillmap.css +1 -1
  33. package/built/web/rtlsemantic.css +1 -1
  34. package/built/web/semantic.css +1 -1
  35. package/built/web/skillmap/js/main.a6cf40e1.chunk.js +1 -0
  36. package/common-docs/identity/sign-in.md +17 -3
  37. package/common-docs/static/music-editor/apple.png +0 -0
  38. package/common-docs/static/music-editor/burger.png +0 -0
  39. package/common-docs/static/music-editor/cake.png +0 -0
  40. package/common-docs/static/music-editor/car.png +0 -0
  41. package/common-docs/static/music-editor/cat.png +0 -0
  42. package/common-docs/static/music-editor/cherry.png +0 -0
  43. package/common-docs/static/music-editor/clam.png +0 -0
  44. package/common-docs/static/music-editor/computer.png +0 -0
  45. package/common-docs/static/music-editor/crab.png +0 -0
  46. package/common-docs/static/music-editor/dog.png +0 -0
  47. package/common-docs/static/music-editor/duck.png +0 -0
  48. package/common-docs/static/music-editor/egg.png +0 -0
  49. package/common-docs/static/music-editor/explosion.png +0 -0
  50. package/common-docs/static/music-editor/fish.png +0 -0
  51. package/common-docs/static/music-editor/ice-cream.png +0 -0
  52. package/common-docs/static/music-editor/lemon.png +0 -0
  53. package/common-docs/static/music-editor/metronomeWorker.js +35 -0
  54. package/common-docs/static/music-editor/snake.png +0 -0
  55. package/common-docs/static/music-editor/star.png +0 -0
  56. package/common-docs/static/music-editor/strawberry.png +0 -0
  57. package/common-docs/static/music-editor/taco.png +0 -0
  58. package/common-docs/static/music-editor/treble-clef.svg +1 -0
  59. package/package.json +4 -2
  60. package/react-common/components/controls/Input.tsx +7 -3
  61. package/react-common/styles/controls/Button.less +9 -0
  62. package/react-common/styles/react-common-authcode-core.less +1 -1
  63. package/react-common/styles/react-common-authcode.less +1 -1
  64. package/react-common/styles/react-common-multiplayer-core.less +10 -0
  65. package/react-common/styles/react-common-multiplayer.less +12 -0
  66. package/theme/highcontrast.less +6 -0
  67. package/theme/music-editor/EditControls.less +22 -0
  68. package/theme/music-editor/MusicEditor.less +25 -0
  69. package/theme/music-editor/Note.less +16 -0
  70. package/theme/music-editor/NoteGroup.less +7 -0
  71. package/theme/music-editor/PlaybackControls.less +55 -0
  72. package/theme/music-editor/ScrollableWorkspace.less +3 -0
  73. package/theme/music-editor/Staff.less +31 -0
  74. package/theme/music-editor/Track.less +0 -0
  75. package/theme/music-editor/TrackSelector.less +48 -0
  76. package/theme/music-editor/Workspace.less +3 -0
  77. package/theme/pxt.less +1 -0
  78. package/theme/tutorial-sidebar.less +3 -0
  79. package/webapp/public/multiplayer.html +1 -0
  80. package/webapp/public/run.html +13 -2
  81. package/webapp/public/skillmap.html +1 -1
  82. package/built/web/skillmap/js/main.6eec9e0f.chunk.js +0 -1
@@ -99,6 +99,7 @@ declare namespace pxt.runner {
99
99
  single?: boolean;
100
100
  hideSimButtons?: boolean;
101
101
  autofocus?: boolean;
102
+ additionalQueryParameters?: string;
102
103
  }
103
104
  let mainPkg: pxt.MainPackage;
104
105
  function initFooter(footer: HTMLElement, shareId?: string): void;
@@ -1764,7 +1764,8 @@ var pxt;
1764
1764
  light: simOptions.light,
1765
1765
  single: simOptions.single,
1766
1766
  hideSimButtons: simOptions.hideSimButtons,
1767
- autofocus: simOptions.autofocus
1767
+ autofocus: simOptions.autofocus,
1768
+ queryParameters: simOptions.additionalQueryParameters,
1768
1769
  };
1769
1770
  if (pxt.appTarget.simulator && !simOptions.fullScreen)
1770
1771
  runOptions.aspectRatio = parts.length && pxt.appTarget.simulator.partsAspectRatio
package/built/pxtsim.d.ts CHANGED
@@ -1279,6 +1279,7 @@ declare namespace pxsim {
1279
1279
  single?: boolean;
1280
1280
  hideSimButtons?: boolean;
1281
1281
  autofocus?: boolean;
1282
+ queryParameters?: string;
1282
1283
  }
1283
1284
  interface HwDebugger {
1284
1285
  postMessage: (msg: pxsim.SimulatorMessage) => void;
package/built/pxtsim.js CHANGED
@@ -6223,8 +6223,8 @@ var pxsim;
6223
6223
  if (parentWindow) {
6224
6224
  // if message comes from parent already, don't echo
6225
6225
  if (source !== parentWindow) {
6226
- const parentOrigin = this.options.parentOrigin || window.location.origin;
6227
- parentWindow.postMessage(msg, parentOrigin);
6226
+ // posting sim messages to parent frame; no origin restriction.
6227
+ parentWindow.postMessage(msg, "*");
6228
6228
  }
6229
6229
  }
6230
6230
  if (!this.options.nestedEditorSim && !(broadcastmsg === null || broadcastmsg === void 0 ? void 0 : broadcastmsg.toParentIFrameOnly)) {
@@ -6315,7 +6315,7 @@ var pxsim;
6315
6315
  }
6316
6316
  }
6317
6317
  createFrame(url) {
6318
- var _a, _b;
6318
+ var _a, _b, _c;
6319
6319
  const wrapper = document.createElement("div");
6320
6320
  wrapper.className = `simframe ui embed`;
6321
6321
  const frame = document.createElement('iframe');
@@ -6331,12 +6331,23 @@ var pxsim;
6331
6331
  urlObject.searchParams.append("hideSimButtons", "1");
6332
6332
  furl = urlObject.toString();
6333
6333
  }
6334
+ if ((_b = this._runOptions) === null || _b === void 0 ? void 0 : _b.queryParameters) {
6335
+ const urlObject = new URL(furl);
6336
+ const parameters = this._runOptions.queryParameters.split("&");
6337
+ for (const param of parameters) {
6338
+ const [a, b] = param.split(/[:=]/);
6339
+ if (a && b) {
6340
+ urlObject.searchParams.set(a, b);
6341
+ }
6342
+ }
6343
+ furl = urlObject.toString();
6344
+ }
6334
6345
  furl += '#' + frame.id;
6335
6346
  frame.src = furl;
6336
6347
  frame.frameBorder = "0";
6337
6348
  frame.dataset['runid'] = this.runId;
6338
6349
  frame.dataset['origin'] = new URL(furl).origin || "*";
6339
- if ((_b = this._runOptions) === null || _b === void 0 ? void 0 : _b.autofocus)
6350
+ if ((_c = this._runOptions) === null || _c === void 0 ? void 0 : _c.autofocus)
6340
6351
  frame.setAttribute("autofocus", "true");
6341
6352
  wrapper.appendChild(frame);
6342
6353
  const i = document.createElement("i");
@@ -7347,7 +7358,7 @@ var pxsim;
7347
7358
  channel.gain.gain.value = 0;
7348
7359
  channel.gain.gain.setValueAtTime(volume, context().currentTime);
7349
7360
  channel.gain.connect(destination);
7350
- if (channels.length > 5)
7361
+ if (channels.length > 20)
7351
7362
  channels[0].remove();
7352
7363
  channels.push(channel);
7353
7364
  const checkCancel = () => {
@@ -7417,7 +7428,7 @@ var pxsim;
7417
7428
  let resolved = false;
7418
7429
  let ctx = context();
7419
7430
  let channel = new Channel();
7420
- if (channels.length > 5)
7431
+ if (channels.length > 20)
7421
7432
  channels[0].remove();
7422
7433
  channels.push(channel);
7423
7434
  channel.gain = ctx.createGain();
@@ -7451,6 +7462,10 @@ var pxsim;
7451
7462
  const endVolume = readUint16(instructions, i + 8);
7452
7463
  const endFrequency = readUint16(instructions, i + 10);
7453
7464
  totalDuration += duration;
7465
+ if (wave === 0) {
7466
+ currentTime += duration;
7467
+ continue;
7468
+ }
7454
7469
  const isSquareWave = 11 <= wave && wave <= 15;
7455
7470
  if (!oscillators[wave]) {
7456
7471
  oscillators[wave] = getGenerator(wave, startFrequency);
@@ -7493,7 +7508,8 @@ var pxsim;
7493
7508
  return;
7494
7509
  }
7495
7510
  const { frequency, volume } = findFrequencyAndVolumeAtTime((time - startTime) * 1000, instructions);
7496
- onPull(frequency, volume / 1024);
7511
+ if (onPull)
7512
+ onPull(frequency, volume / 1024);
7497
7513
  requestAnimationFrame(handleAnimationFrame);
7498
7514
  };
7499
7515
  requestAnimationFrame(handleAnimationFrame);
package/built/server.js CHANGED
@@ -1050,6 +1050,10 @@ function serveAsync(options) {
1050
1050
  sendFile(path.join(publicDir, 'authcode.html'));
1051
1051
  return;
1052
1052
  }
1053
+ if (pathname == "/--multiplayer") {
1054
+ sendFile(path.join(publicDir, 'multiplayer.html'));
1055
+ return;
1056
+ }
1053
1057
  if (/\/-[-]*docs.*$/.test(pathname)) {
1054
1058
  sendFile(path.join(publicDir, 'docs.html'));
1055
1059
  return;