pxt-core 8.1.7 → 8.2.3

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.
@@ -691,8 +691,8 @@ var pxt;
691
691
  renderer.image = function (href, title, text) {
692
692
  const endpointName = "makecode-lucas-testing-makecodetempmediaservice-usea";
693
693
  if (href.startsWith("youtube:")) {
694
- let out = '<div class="tutorial-video-embed"><iframe src="https://www.youtube.com/embed/' + href.split(":").pop()
695
- + '" title="' + title + '" frameborder="0" ' + 'allowFullScreen ' + 'allow="autoplay; picture-in-picture"></iframe></div>';
694
+ let out = '<div class="tutorial-video-embed"><iframe class="yt-embed" src="https://www.youtube.com/embed/' + href.split(":").pop()
695
+ + '" title="' + text + '" frameborder="0" ' + 'allowFullScreen ' + 'allow="autoplay; picture-in-picture"></iframe></div>';
696
696
  return out;
697
697
  }
698
698
  else if (href.startsWith("azuremedia:")) {
package/built/pxt.js CHANGED
@@ -106401,8 +106401,8 @@ var pxt;
106401
106401
  renderer.image = function (href, title, text) {
106402
106402
  const endpointName = "makecode-lucas-testing-makecodetempmediaservice-usea";
106403
106403
  if (href.startsWith("youtube:")) {
106404
- let out = '<div class="tutorial-video-embed"><iframe src="https://www.youtube.com/embed/' + href.split(":").pop()
106405
- + '" title="' + title + '" frameborder="0" ' + 'allowFullScreen ' + 'allow="autoplay; picture-in-picture"></iframe></div>';
106404
+ let out = '<div class="tutorial-video-embed"><iframe class="yt-embed" src="https://www.youtube.com/embed/' + href.split(":").pop()
106405
+ + '" title="' + text + '" frameborder="0" ' + 'allowFullScreen ' + 'allow="autoplay; picture-in-picture"></iframe></div>';
106406
106406
  return out;
106407
106407
  }
106408
106408
  else if (href.startsWith("azuremedia:")) {
@@ -153272,7 +153272,7 @@ var pxsim;
153272
153272
  }
153273
153273
  }
153274
153274
  createFrame(url) {
153275
- var _a;
153275
+ var _a, _b;
153276
153276
  const wrapper = document.createElement("div");
153277
153277
  wrapper.className = `simframe ui embed`;
153278
153278
  const frame = document.createElement('iframe');
@@ -153282,12 +153282,18 @@ var pxsim;
153282
153282
  frame.setAttribute('allow', 'autoplay;microphone');
153283
153283
  frame.setAttribute('sandbox', 'allow-same-origin allow-scripts');
153284
153284
  frame.className = 'no-select';
153285
- const furl = (url || this.getSimUrl()) + '#' + frame.id;
153285
+ let furl = url || this.getSimUrl().toString();
153286
+ if ((_a = this._runOptions) === null || _a === void 0 ? void 0 : _a.hideSimButtons) {
153287
+ const urlObject = new URL(furl);
153288
+ urlObject.searchParams.append("hideSimButtons", "1");
153289
+ furl = urlObject.toString();
153290
+ }
153291
+ furl += '#' + frame.id;
153286
153292
  frame.src = furl;
153287
153293
  frame.frameBorder = "0";
153288
153294
  frame.dataset['runid'] = this.runId;
153289
153295
  frame.dataset['origin'] = new URL(furl).origin || "*";
153290
- if ((_a = this._runOptions) === null || _a === void 0 ? void 0 : _a.autofocus)
153296
+ if ((_b = this._runOptions) === null || _b === void 0 ? void 0 : _b.autofocus)
153291
153297
  frame.setAttribute("autofocus", "true");
153292
153298
  wrapper.appendChild(frame);
153293
153299
  const i = document.createElement("i");
@@ -153524,8 +153530,7 @@ var pxsim;
153524
153530
  msg.frameCounter = ++this.frameCounter;
153525
153531
  msg.options = {
153526
153532
  theme: this.themes[this.nextFrameId++ % this.themes.length],
153527
- mpRole: (_b = (_a = /[\&\?]mp=(server|client)/i.exec(window.location.href)) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.toLowerCase(),
153528
- hideSimButtons: /hidesimbuttons(?:[:=])1/i.test(window.location.href)
153533
+ mpRole: (_b = (_a = /[\&\?]mp=(server|client)/i.exec(window.location.href)) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.toLowerCase()
153529
153534
  };
153530
153535
  msg.id = `${msg.options.theme}-${this.nextId()}`;
153531
153536
  frame.dataset['runid'] = this.runId;
package/built/pxtlib.js CHANGED
@@ -8715,8 +8715,8 @@ var pxt;
8715
8715
  renderer.image = function (href, title, text) {
8716
8716
  const endpointName = "makecode-lucas-testing-makecodetempmediaservice-usea";
8717
8717
  if (href.startsWith("youtube:")) {
8718
- let out = '<div class="tutorial-video-embed"><iframe src="https://www.youtube.com/embed/' + href.split(":").pop()
8719
- + '" title="' + title + '" frameborder="0" ' + 'allowFullScreen ' + 'allow="autoplay; picture-in-picture"></iframe></div>';
8718
+ let out = '<div class="tutorial-video-embed"><iframe class="yt-embed" src="https://www.youtube.com/embed/' + href.split(":").pop()
8719
+ + '" title="' + text + '" frameborder="0" ' + 'allowFullScreen ' + 'allow="autoplay; picture-in-picture"></iframe></div>';
8720
8720
  return out;
8721
8721
  }
8722
8722
  else if (href.startsWith("azuremedia:")) {
@@ -97,6 +97,7 @@ declare namespace pxt.runner {
97
97
  dependencies?: string[];
98
98
  builtJsInfo?: pxtc.BuiltSimJsInfo;
99
99
  single?: boolean;
100
+ hideSimButtons?: boolean;
100
101
  autofocus?: boolean;
101
102
  }
102
103
  let mainPkg: pxt.MainPackage;
@@ -1750,6 +1750,7 @@ var pxt;
1750
1750
  storedState: storedState,
1751
1751
  light: simOptions.light,
1752
1752
  single: simOptions.single,
1753
+ hideSimButtons: simOptions.hideSimButtons,
1753
1754
  autofocus: simOptions.autofocus
1754
1755
  };
1755
1756
  if (pxt.appTarget.simulator && !simOptions.fullScreen)
package/built/pxtsim.d.ts CHANGED
@@ -1268,6 +1268,7 @@ declare namespace pxsim {
1268
1268
  ipc?: boolean;
1269
1269
  dependencies?: Map<string>;
1270
1270
  single?: boolean;
1271
+ hideSimButtons?: boolean;
1271
1272
  autofocus?: boolean;
1272
1273
  }
1273
1274
  interface HwDebugger {
package/built/pxtsim.js CHANGED
@@ -6295,7 +6295,7 @@ var pxsim;
6295
6295
  }
6296
6296
  }
6297
6297
  createFrame(url) {
6298
- var _a;
6298
+ var _a, _b;
6299
6299
  const wrapper = document.createElement("div");
6300
6300
  wrapper.className = `simframe ui embed`;
6301
6301
  const frame = document.createElement('iframe');
@@ -6305,12 +6305,18 @@ var pxsim;
6305
6305
  frame.setAttribute('allow', 'autoplay;microphone');
6306
6306
  frame.setAttribute('sandbox', 'allow-same-origin allow-scripts');
6307
6307
  frame.className = 'no-select';
6308
- const furl = (url || this.getSimUrl()) + '#' + frame.id;
6308
+ let furl = url || this.getSimUrl().toString();
6309
+ if ((_a = this._runOptions) === null || _a === void 0 ? void 0 : _a.hideSimButtons) {
6310
+ const urlObject = new URL(furl);
6311
+ urlObject.searchParams.append("hideSimButtons", "1");
6312
+ furl = urlObject.toString();
6313
+ }
6314
+ furl += '#' + frame.id;
6309
6315
  frame.src = furl;
6310
6316
  frame.frameBorder = "0";
6311
6317
  frame.dataset['runid'] = this.runId;
6312
6318
  frame.dataset['origin'] = new URL(furl).origin || "*";
6313
- if ((_a = this._runOptions) === null || _a === void 0 ? void 0 : _a.autofocus)
6319
+ if ((_b = this._runOptions) === null || _b === void 0 ? void 0 : _b.autofocus)
6314
6320
  frame.setAttribute("autofocus", "true");
6315
6321
  wrapper.appendChild(frame);
6316
6322
  const i = document.createElement("i");
@@ -6547,8 +6553,7 @@ var pxsim;
6547
6553
  msg.frameCounter = ++this.frameCounter;
6548
6554
  msg.options = {
6549
6555
  theme: this.themes[this.nextFrameId++ % this.themes.length],
6550
- mpRole: (_b = (_a = /[\&\?]mp=(server|client)/i.exec(window.location.href)) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.toLowerCase(),
6551
- hideSimButtons: /hidesimbuttons(?:[:=])1/i.test(window.location.href)
6556
+ mpRole: (_b = (_a = /[\&\?]mp=(server|client)/i.exec(window.location.href)) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.toLowerCase()
6552
6557
  };
6553
6558
  msg.id = `${msg.options.theme}-${this.nextId()}`;
6554
6559
  frame.dataset['runid'] = this.runId;