pxt-core 11.2.22 → 11.2.24

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
@@ -114204,7 +114204,7 @@ var pxt;
114204
114204
  };
114205
114205
  await this.loadAsync();
114206
114206
  opts.bannedCategories = this.resolveBannedCategories();
114207
- pxt.debug(`building: ${this.sortedDeps().map(p => p.config.name).join(", ")}`);
114207
+ pxt.debug(`building: ${this.sortedDeps().map(p => { var _a; return (_a = p.config) === null || _a === void 0 ? void 0 : _a.name; }).join(", ")}`);
114208
114208
  let variants;
114209
114209
  if (pxt.appTarget.multiVariants) {
114210
114210
  // multiVariant available
@@ -155628,6 +155628,7 @@ var pxsim;
155628
155628
  this.runId = '';
155629
155629
  this.nextFrameId = 0;
155630
155630
  this.frameCounter = 0;
155631
+ this.singleSimulator = false;
155631
155632
  this.traceInterval = 0;
155632
155633
  this.breakpointsSet = false;
155633
155634
  this._runOptions = {};
@@ -155841,6 +155842,9 @@ var pxsim;
155841
155842
  return new URL(simUrl, location.origin);
155842
155843
  }
155843
155844
  }
155845
+ setSingleSimulator() {
155846
+ this.singleSimulator = true;
155847
+ }
155844
155848
  postMessage(msg, source, frameID) {
155845
155849
  var _a;
155846
155850
  if (this.hwdbg) {
@@ -155940,12 +155944,12 @@ var pxsim;
155940
155944
  isDeferrableBroadcastMessage = true;
155941
155945
  // start secondary frame if needed
155942
155946
  const mkcdFrames = frames.filter(frame => !frame.dataset[FRAME_DATA_MESSAGE_CHANNEL]);
155943
- if (mkcdFrames.length < 2) {
155947
+ if (mkcdFrames.length == 0 || mkcdFrames.length == 1 && !this.singleSimulator) {
155944
155948
  this.container.appendChild(this.createFrame());
155945
155949
  frames = this.simFrames();
155946
155950
  // there might be an old frame
155947
155951
  }
155948
- else if (mkcdFrames[1].dataset['runid'] != this.runId) {
155952
+ else if (mkcdFrames.length == 2 && mkcdFrames[1].dataset['runid'] != this.runId) {
155949
155953
  this.startFrame(mkcdFrames[1]);
155950
155954
  }
155951
155955
  }
@@ -156256,6 +156260,7 @@ var pxsim;
156256
156260
  this.scheduleFrameCleanup();
156257
156261
  if (!this._currentRuntime)
156258
156262
  return; // nothing to do
156263
+ this.singleSimulator = false;
156259
156264
  this.breakpointsSet = false;
156260
156265
  // first frame
156261
156266
  let frame = this.simFrames()[0];
package/built/pxtlib.js CHANGED
@@ -16518,7 +16518,7 @@ var pxt;
16518
16518
  };
16519
16519
  await this.loadAsync();
16520
16520
  opts.bannedCategories = this.resolveBannedCategories();
16521
- pxt.debug(`building: ${this.sortedDeps().map(p => p.config.name).join(", ")}`);
16521
+ pxt.debug(`building: ${this.sortedDeps().map(p => { var _a; return (_a = p.config) === null || _a === void 0 ? void 0 : _a.name; }).join(", ")}`);
16522
16522
  let variants;
16523
16523
  if (pxt.appTarget.multiVariants) {
16524
16524
  // multiVariant available
package/built/pxtsim.d.ts CHANGED
@@ -420,7 +420,7 @@ declare namespace pxsim {
420
420
  }
421
421
  interface SimulatorCommandMessage extends SimulatorMessage {
422
422
  type: "simulator";
423
- command: "modal" | "restart" | "reload" | "setstate" | "focus" | "blur";
423
+ command: "modal" | "restart" | "reload" | "setstate" | "focus" | "blur" | "single";
424
424
  stateKey?: string;
425
425
  stateValue?: any;
426
426
  header?: string;
@@ -1412,6 +1412,7 @@ declare namespace pxsim {
1412
1412
  private runId;
1413
1413
  private nextFrameId;
1414
1414
  private frameCounter;
1415
+ private singleSimulator;
1415
1416
  private _currentRuntime;
1416
1417
  private listener;
1417
1418
  private traceInterval;
@@ -1443,6 +1444,7 @@ declare namespace pxsim {
1443
1444
  private freeze;
1444
1445
  private simFrames;
1445
1446
  private getSimUrl;
1447
+ setSingleSimulator(): void;
1446
1448
  postMessage(msg: pxsim.SimulatorMessage, source?: Window, frameID?: string): void;
1447
1449
  protected deferredMessages: [HTMLIFrameElement, SimulatorMessage][];
1448
1450
  protected postDeferrableMessage(frame: HTMLIFrameElement, msg: SimulatorMessage): void;
package/built/pxtsim.js CHANGED
@@ -6207,6 +6207,7 @@ var pxsim;
6207
6207
  this.runId = '';
6208
6208
  this.nextFrameId = 0;
6209
6209
  this.frameCounter = 0;
6210
+ this.singleSimulator = false;
6210
6211
  this.traceInterval = 0;
6211
6212
  this.breakpointsSet = false;
6212
6213
  this._runOptions = {};
@@ -6420,6 +6421,9 @@ var pxsim;
6420
6421
  return new URL(simUrl, location.origin);
6421
6422
  }
6422
6423
  }
6424
+ setSingleSimulator() {
6425
+ this.singleSimulator = true;
6426
+ }
6423
6427
  postMessage(msg, source, frameID) {
6424
6428
  var _a;
6425
6429
  if (this.hwdbg) {
@@ -6519,12 +6523,12 @@ var pxsim;
6519
6523
  isDeferrableBroadcastMessage = true;
6520
6524
  // start secondary frame if needed
6521
6525
  const mkcdFrames = frames.filter(frame => !frame.dataset[FRAME_DATA_MESSAGE_CHANNEL]);
6522
- if (mkcdFrames.length < 2) {
6526
+ if (mkcdFrames.length == 0 || mkcdFrames.length == 1 && !this.singleSimulator) {
6523
6527
  this.container.appendChild(this.createFrame());
6524
6528
  frames = this.simFrames();
6525
6529
  // there might be an old frame
6526
6530
  }
6527
- else if (mkcdFrames[1].dataset['runid'] != this.runId) {
6531
+ else if (mkcdFrames.length == 2 && mkcdFrames[1].dataset['runid'] != this.runId) {
6528
6532
  this.startFrame(mkcdFrames[1]);
6529
6533
  }
6530
6534
  }
@@ -6835,6 +6839,7 @@ var pxsim;
6835
6839
  this.scheduleFrameCleanup();
6836
6840
  if (!this._currentRuntime)
6837
6841
  return; // nothing to do
6842
+ this.singleSimulator = false;
6838
6843
  this.breakpointsSet = false;
6839
6844
  // first frame
6840
6845
  let frame = this.simFrames()[0];