pxt-core 12.2.27 → 12.2.28

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
@@ -119272,7 +119272,25 @@ var pxt;
119272
119272
  }
119273
119273
  if (entry.tilemapTile) {
119274
119274
  tags.push("tile");
119275
- tags.push("category-" + namespaceName);
119275
+ let category = undefined;
119276
+ if (entry.displayName && entry.displayName.indexOf("--") !== -1) {
119277
+ const rawCategory = entry.displayName.split("--")[1].trim();
119278
+ const categoryParts = rawCategory.split(/[\s\-]+/g).map((part, index) => {
119279
+ if (index === 0) {
119280
+ return part;
119281
+ }
119282
+ else {
119283
+ return part.charAt(0).toUpperCase() + part.slice(1);
119284
+ }
119285
+ });
119286
+ category = categoryParts.join("");
119287
+ }
119288
+ if (!category && !/^transparency(?:4|8|16|32)$/.test(varName)) {
119289
+ category = namespaceName;
119290
+ }
119291
+ if (category) {
119292
+ tags.push("category-" + category);
119293
+ }
119276
119294
  }
119277
119295
  }
119278
119296
  if (mimeType === pxt.IMAGE_MIME_TYPE) {
@@ -119858,11 +119876,11 @@ var pxt;
119858
119876
  return snapshot.assets[type];
119859
119877
  }
119860
119878
  function patchTemporaryAsset(oldValue, newValue, project) {
119861
- if (!oldValue || assetEquals(oldValue, newValue))
119879
+ if (!oldValue || assetEquals(oldValue, newValue) || newValue.id !== oldValue.id)
119862
119880
  return newValue;
119863
119881
  newValue = cloneAsset(newValue, true);
119864
119882
  const wasTemporary = oldValue.internalID === -1;
119865
- const isTemporary = newValue.internalID === -1;
119883
+ const isTemporary = newValue.internalID === -1 && newValue.meta.displayName === undefined;
119866
119884
  // if we went from being temporary to no longer being temporary,
119867
119885
  // make sure we replace the junk id with a new value
119868
119886
  if (wasTemporary && !isTemporary) {
@@ -158795,6 +158813,10 @@ var pxsim;
158795
158813
  return;
158796
158814
  this.vca.disconnect();
158797
158815
  this.vca = undefined;
158816
+ const index = AudioSource.activeSources.indexOf(this);
158817
+ if (index !== -1) {
158818
+ AudioSource.activeSources.splice(index, 1);
158819
+ }
158798
158820
  }
158799
158821
  isDisposed() {
158800
158822
  return !this.vca;
@@ -159247,6 +159269,8 @@ var pxsim;
159247
159269
  this.distortion.disconnect();
159248
159270
  this.audioElement.pause();
159249
159271
  this.audioElement = undefined;
159272
+ this.source = undefined;
159273
+ this.distortion = undefined;
159250
159274
  }
159251
159275
  }
159252
159276
  AudioContextManager.AudioElementSource = AudioElementSource;
@@ -159319,6 +159343,7 @@ var pxsim;
159319
159343
  super.dispose();
159320
159344
  this.oscillator.stop();
159321
159345
  this.oscillator.disconnect();
159346
+ this.oscillator = undefined;
159322
159347
  AudioToneSource.instance = undefined;
159323
159348
  }
159324
159349
  }
@@ -159862,6 +159887,8 @@ var pxsim;
159862
159887
  super.dispose();
159863
159888
  this.analyser.disconnect();
159864
159889
  this.gain.disconnect();
159890
+ this.analyser = undefined;
159891
+ this.gain = undefined;
159865
159892
  }
159866
159893
  }
159867
159894
  AudioContextManager.PlayInstructionsSource = PlayInstructionsSource;
@@ -32,10 +32,12 @@ export declare class FieldAnimationEditor extends FieldAssetEditor<FieldAnimatio
32
32
  protected onEditorClose(newValue: pxt.Animation): void;
33
33
  protected getValueText(): string;
34
34
  protected redrawPreview(): void;
35
- protected onMouseEnter: () => void;
36
- protected onMouseLeave: () => void;
35
+ protected onMouseEnter: (e: MouseEvent) => void;
36
+ protected onDocumentMouseMove: (e: MouseEvent) => void;
37
+ protected cancelAnimation: () => void;
37
38
  protected getParentIntervalBlock(): Blockly.Block;
38
39
  protected setParentInterval(interval: number): void;
39
40
  protected getParentInterval(): number;
40
41
  protected parseFieldOptions(opts: FieldAnimationOptions): ParsedFieldAnimationOptions;
42
+ onDispose(): void;
41
43
  }
package/built/pxtlib.js CHANGED
@@ -21551,7 +21551,25 @@ var pxt;
21551
21551
  }
21552
21552
  if (entry.tilemapTile) {
21553
21553
  tags.push("tile");
21554
- tags.push("category-" + namespaceName);
21554
+ let category = undefined;
21555
+ if (entry.displayName && entry.displayName.indexOf("--") !== -1) {
21556
+ const rawCategory = entry.displayName.split("--")[1].trim();
21557
+ const categoryParts = rawCategory.split(/[\s\-]+/g).map((part, index) => {
21558
+ if (index === 0) {
21559
+ return part;
21560
+ }
21561
+ else {
21562
+ return part.charAt(0).toUpperCase() + part.slice(1);
21563
+ }
21564
+ });
21565
+ category = categoryParts.join("");
21566
+ }
21567
+ if (!category && !/^transparency(?:4|8|16|32)$/.test(varName)) {
21568
+ category = namespaceName;
21569
+ }
21570
+ if (category) {
21571
+ tags.push("category-" + category);
21572
+ }
21555
21573
  }
21556
21574
  }
21557
21575
  if (mimeType === pxt.IMAGE_MIME_TYPE) {
@@ -22137,11 +22155,11 @@ var pxt;
22137
22155
  return snapshot.assets[type];
22138
22156
  }
22139
22157
  function patchTemporaryAsset(oldValue, newValue, project) {
22140
- if (!oldValue || assetEquals(oldValue, newValue))
22158
+ if (!oldValue || assetEquals(oldValue, newValue) || newValue.id !== oldValue.id)
22141
22159
  return newValue;
22142
22160
  newValue = cloneAsset(newValue, true);
22143
22161
  const wasTemporary = oldValue.internalID === -1;
22144
- const isTemporary = newValue.internalID === -1;
22162
+ const isTemporary = newValue.internalID === -1 && newValue.meta.displayName === undefined;
22145
22163
  // if we went from being temporary to no longer being temporary,
22146
22164
  // make sure we replace the junk id with a new value
22147
22165
  if (wasTemporary && !isTemporary) {
package/built/pxtsim.js CHANGED
@@ -7966,6 +7966,10 @@ var pxsim;
7966
7966
  return;
7967
7967
  this.vca.disconnect();
7968
7968
  this.vca = undefined;
7969
+ const index = AudioSource.activeSources.indexOf(this);
7970
+ if (index !== -1) {
7971
+ AudioSource.activeSources.splice(index, 1);
7972
+ }
7969
7973
  }
7970
7974
  isDisposed() {
7971
7975
  return !this.vca;
@@ -8418,6 +8422,8 @@ var pxsim;
8418
8422
  this.distortion.disconnect();
8419
8423
  this.audioElement.pause();
8420
8424
  this.audioElement = undefined;
8425
+ this.source = undefined;
8426
+ this.distortion = undefined;
8421
8427
  }
8422
8428
  }
8423
8429
  AudioContextManager.AudioElementSource = AudioElementSource;
@@ -8490,6 +8496,7 @@ var pxsim;
8490
8496
  super.dispose();
8491
8497
  this.oscillator.stop();
8492
8498
  this.oscillator.disconnect();
8499
+ this.oscillator = undefined;
8493
8500
  AudioToneSource.instance = undefined;
8494
8501
  }
8495
8502
  }
@@ -9033,6 +9040,8 @@ var pxsim;
9033
9040
  super.dispose();
9034
9041
  this.analyser.disconnect();
9035
9042
  this.gain.disconnect();
9043
+ this.analyser = undefined;
9044
+ this.gain = undefined;
9036
9045
  }
9037
9046
  }
9038
9047
  AudioContextManager.PlayInstructionsSource = PlayInstructionsSource;