pxt-core 11.3.41 → 11.3.43

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
@@ -102699,7 +102699,7 @@ var pxt;
102699
102699
  BrowserUtils.isLocalHostDev = isLocalHostDev;
102700
102700
  function isSkillmapEditor() {
102701
102701
  try {
102702
- return /skill(?:s?)Map=1/.test(window.location.href);
102702
+ return /skill(?:s?)map=1/i.test(window.location.href);
102703
102703
  }
102704
102704
  catch (e) {
102705
102705
  return false;
@@ -118291,38 +118291,45 @@ var pxt;
118291
118291
  for (const dep of allPackages) {
118292
118292
  const isProject = dep.id === "this";
118293
118293
  const images = this.readImages(dep.parseJRes(), isProject);
118294
- for (const image of images) {
118295
- image.meta.package = dep.id;
118296
- if (image.type === "tile" /* AssetType.Tile */) {
118294
+ for (const toAdd of images) {
118295
+ toAdd.meta.package = dep.id;
118296
+ if (toAdd.type === "tile" /* AssetType.Tile */) {
118297
118297
  if (isProject) {
118298
- this.state.tiles.add(image);
118298
+ this.state.tiles.add(toAdd);
118299
118299
  }
118300
118300
  else {
118301
- this.gallery.tiles.add(image);
118301
+ this.gallery.tiles.add(toAdd);
118302
118302
  }
118303
118303
  }
118304
- else if (image.type === "image" /* AssetType.Image */) {
118304
+ else if (toAdd.type === "image" /* AssetType.Image */) {
118305
118305
  if (isProject) {
118306
- this.state.images.add(image);
118306
+ this.state.images.add(toAdd);
118307
118307
  }
118308
118308
  else {
118309
- this.gallery.images.add(image);
118309
+ this.gallery.images.add(toAdd);
118310
118310
  }
118311
118311
  }
118312
- else if (image.type === "animation" /* AssetType.Animation */) {
118312
+ else if (toAdd.type === "animation" /* AssetType.Animation */) {
118313
118313
  if (isProject) {
118314
- this.state.animations.add(image);
118314
+ this.state.animations.add(toAdd);
118315
118315
  }
118316
118316
  else {
118317
- this.gallery.animations.add(image);
118317
+ this.gallery.animations.add(toAdd);
118318
118318
  }
118319
118319
  }
118320
118320
  else {
118321
118321
  if (isProject) {
118322
- this.state.songs.add(image);
118322
+ // there was a bug at one point that caused songs to be erroneously serialized
118323
+ // with ids in the myImages namespace. if that's the case here, remap the id to
118324
+ // the correct namespace before loading it
118325
+ const IMAGE_NAMESPACE = pxt.sprite.IMAGES_NAMESPACE + ".";
118326
+ if (toAdd.id.startsWith(IMAGE_NAMESPACE)) {
118327
+ toAdd.id = toAdd.id.replace(IMAGE_NAMESPACE, pxt.sprite.SONG_NAMESPACE + ".");
118328
+ }
118329
+ this.state.songs.add(toAdd);
118323
118330
  }
118324
118331
  else {
118325
- this.gallery.songs.add(image);
118332
+ this.gallery.songs.add(toAdd);
118326
118333
  }
118327
118334
  }
118328
118335
  }
package/built/pxtlib.js CHANGED
@@ -5013,7 +5013,7 @@ var pxt;
5013
5013
  BrowserUtils.isLocalHostDev = isLocalHostDev;
5014
5014
  function isSkillmapEditor() {
5015
5015
  try {
5016
- return /skill(?:s?)Map=1/.test(window.location.href);
5016
+ return /skill(?:s?)map=1/i.test(window.location.href);
5017
5017
  }
5018
5018
  catch (e) {
5019
5019
  return false;
@@ -20605,38 +20605,45 @@ var pxt;
20605
20605
  for (const dep of allPackages) {
20606
20606
  const isProject = dep.id === "this";
20607
20607
  const images = this.readImages(dep.parseJRes(), isProject);
20608
- for (const image of images) {
20609
- image.meta.package = dep.id;
20610
- if (image.type === "tile" /* AssetType.Tile */) {
20608
+ for (const toAdd of images) {
20609
+ toAdd.meta.package = dep.id;
20610
+ if (toAdd.type === "tile" /* AssetType.Tile */) {
20611
20611
  if (isProject) {
20612
- this.state.tiles.add(image);
20612
+ this.state.tiles.add(toAdd);
20613
20613
  }
20614
20614
  else {
20615
- this.gallery.tiles.add(image);
20615
+ this.gallery.tiles.add(toAdd);
20616
20616
  }
20617
20617
  }
20618
- else if (image.type === "image" /* AssetType.Image */) {
20618
+ else if (toAdd.type === "image" /* AssetType.Image */) {
20619
20619
  if (isProject) {
20620
- this.state.images.add(image);
20620
+ this.state.images.add(toAdd);
20621
20621
  }
20622
20622
  else {
20623
- this.gallery.images.add(image);
20623
+ this.gallery.images.add(toAdd);
20624
20624
  }
20625
20625
  }
20626
- else if (image.type === "animation" /* AssetType.Animation */) {
20626
+ else if (toAdd.type === "animation" /* AssetType.Animation */) {
20627
20627
  if (isProject) {
20628
- this.state.animations.add(image);
20628
+ this.state.animations.add(toAdd);
20629
20629
  }
20630
20630
  else {
20631
- this.gallery.animations.add(image);
20631
+ this.gallery.animations.add(toAdd);
20632
20632
  }
20633
20633
  }
20634
20634
  else {
20635
20635
  if (isProject) {
20636
- this.state.songs.add(image);
20636
+ // there was a bug at one point that caused songs to be erroneously serialized
20637
+ // with ids in the myImages namespace. if that's the case here, remap the id to
20638
+ // the correct namespace before loading it
20639
+ const IMAGE_NAMESPACE = pxt.sprite.IMAGES_NAMESPACE + ".";
20640
+ if (toAdd.id.startsWith(IMAGE_NAMESPACE)) {
20641
+ toAdd.id = toAdd.id.replace(IMAGE_NAMESPACE, pxt.sprite.SONG_NAMESPACE + ".");
20642
+ }
20643
+ this.state.songs.add(toAdd);
20637
20644
  }
20638
20645
  else {
20639
- this.gallery.songs.add(image);
20646
+ this.gallery.songs.add(toAdd);
20640
20647
  }
20641
20648
  }
20642
20649
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference path="../../../../../localtypings/ocv.d.ts" />
2
- export declare const baseConfig: ocv.IFeedbackConfig;
2
+ export declare const getBaseConfig: () => ocv.IFeedbackConfig;
3
3
  export declare const createRatingQuestions: () => {
4
4
  questionInstruction: {
5
5
  displayedStringInEnglish: string;
@@ -10,4 +10,4 @@ export declare const createRatingQuestions: () => {
10
10
  displayedString: string;
11
11
  }[];
12
12
  };
13
- export declare const ratingFeedbackConfig: ocv.IFeedbackConfig;
13
+ export declare const getRatingFeedbackConfig: () => ocv.IFeedbackConfig;