pxt-core 8.5.56 → 8.5.58
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/pxtblockly.js +29 -4
- package/built/pxtblocks.d.ts +1 -0
- package/built/pxtblocks.js +29 -4
- package/built/target.js +1 -1
- package/built/web/kiosk/css/main.bcfacf27.css +1 -0
- package/built/web/kiosk/js/{main.b8d03f33.js → main.513bea10.js} +2 -2
- package/built/web/pxtblockly.js +1 -1
- package/built/web/pxtblocks.js +1 -1
- package/built/web/pxtembed.js +1 -1
- package/package.json +1 -1
- package/webapp/public/kiosk.html +1 -1
- package/built/web/kiosk/css/main.0e93eecb.css +0 -1
package/built/pxtblockly.js
CHANGED
|
@@ -16243,12 +16243,21 @@ var pxtblockly;
|
|
|
16243
16243
|
return project.lookupAsset("image" /* pxt.AssetType.Image */, this.getBlockData());
|
|
16244
16244
|
}
|
|
16245
16245
|
const bmp = text ? pxt.sprite.imageLiteralToBitmap(text) : new pxt.sprite.Bitmap(this.params.initWidth, this.params.initHeight);
|
|
16246
|
+
let data;
|
|
16246
16247
|
if (!bmp) {
|
|
16247
|
-
|
|
16248
|
-
|
|
16249
|
-
|
|
16248
|
+
// check for qualified name
|
|
16249
|
+
data = qNameToBitmapData(text);
|
|
16250
|
+
if (!data) {
|
|
16251
|
+
this.isGreyBlock = true;
|
|
16252
|
+
this.valueText = text;
|
|
16253
|
+
return undefined;
|
|
16254
|
+
}
|
|
16255
|
+
else {
|
|
16256
|
+
this.qName = text;
|
|
16257
|
+
}
|
|
16250
16258
|
}
|
|
16251
|
-
|
|
16259
|
+
if (!data)
|
|
16260
|
+
data = bmp.data();
|
|
16252
16261
|
const newAsset = {
|
|
16253
16262
|
internalID: -1,
|
|
16254
16263
|
id: this.sourceBlock_.id,
|
|
@@ -16263,6 +16272,13 @@ var pxtblockly;
|
|
|
16263
16272
|
if (this.asset && !this.isTemporaryAsset()) {
|
|
16264
16273
|
return pxt.getTSReferenceForAsset(this.asset);
|
|
16265
16274
|
}
|
|
16275
|
+
else if (this.qName) {
|
|
16276
|
+
// check if image has been edited
|
|
16277
|
+
const data = qNameToBitmapData(this.qName);
|
|
16278
|
+
if (data && pxt.sprite.bitmapEquals(data, this.asset.bitmap)) {
|
|
16279
|
+
return this.qName;
|
|
16280
|
+
}
|
|
16281
|
+
}
|
|
16266
16282
|
return pxt.sprite.bitmapToImageLiteral(this.asset && pxt.sprite.Bitmap.fromData(this.asset.bitmap), "typescript" /* pxt.editor.FileType.TypeScript */);
|
|
16267
16283
|
}
|
|
16268
16284
|
parseFieldOptions(opts) {
|
|
@@ -16327,6 +16343,15 @@ var pxtblockly;
|
|
|
16327
16343
|
return res;
|
|
16328
16344
|
}
|
|
16329
16345
|
}
|
|
16346
|
+
function qNameToBitmapData(qName) {
|
|
16347
|
+
const project = pxt.react.getTilemapProject();
|
|
16348
|
+
const images = project.getGalleryAssets("image" /* pxt.AssetType.Image */).filter(asset => asset.id === qName);
|
|
16349
|
+
const img = images.length && images[0];
|
|
16350
|
+
if (img) {
|
|
16351
|
+
return img.bitmap;
|
|
16352
|
+
}
|
|
16353
|
+
return undefined;
|
|
16354
|
+
}
|
|
16330
16355
|
})(pxtblockly || (pxtblockly = {}));
|
|
16331
16356
|
/// <reference path="../../localtypings/pxtblockly.d.ts" />
|
|
16332
16357
|
var pxtblockly;
|
package/built/pxtblocks.d.ts
CHANGED
|
@@ -433,6 +433,7 @@ declare namespace pxtblockly {
|
|
|
433
433
|
protected undoRedoState: any;
|
|
434
434
|
protected pendingEdit: boolean;
|
|
435
435
|
protected isEmpty: boolean;
|
|
436
|
+
protected qName?: string;
|
|
436
437
|
isGreyBlock: boolean;
|
|
437
438
|
constructor(text: string, params: any, validator?: Function);
|
|
438
439
|
protected abstract getAssetType(): pxt.AssetType;
|
package/built/pxtblocks.js
CHANGED
|
@@ -12681,12 +12681,21 @@ var pxtblockly;
|
|
|
12681
12681
|
return project.lookupAsset("image" /* pxt.AssetType.Image */, this.getBlockData());
|
|
12682
12682
|
}
|
|
12683
12683
|
const bmp = text ? pxt.sprite.imageLiteralToBitmap(text) : new pxt.sprite.Bitmap(this.params.initWidth, this.params.initHeight);
|
|
12684
|
+
let data;
|
|
12684
12685
|
if (!bmp) {
|
|
12685
|
-
|
|
12686
|
-
|
|
12687
|
-
|
|
12686
|
+
// check for qualified name
|
|
12687
|
+
data = qNameToBitmapData(text);
|
|
12688
|
+
if (!data) {
|
|
12689
|
+
this.isGreyBlock = true;
|
|
12690
|
+
this.valueText = text;
|
|
12691
|
+
return undefined;
|
|
12692
|
+
}
|
|
12693
|
+
else {
|
|
12694
|
+
this.qName = text;
|
|
12695
|
+
}
|
|
12688
12696
|
}
|
|
12689
|
-
|
|
12697
|
+
if (!data)
|
|
12698
|
+
data = bmp.data();
|
|
12690
12699
|
const newAsset = {
|
|
12691
12700
|
internalID: -1,
|
|
12692
12701
|
id: this.sourceBlock_.id,
|
|
@@ -12701,6 +12710,13 @@ var pxtblockly;
|
|
|
12701
12710
|
if (this.asset && !this.isTemporaryAsset()) {
|
|
12702
12711
|
return pxt.getTSReferenceForAsset(this.asset);
|
|
12703
12712
|
}
|
|
12713
|
+
else if (this.qName) {
|
|
12714
|
+
// check if image has been edited
|
|
12715
|
+
const data = qNameToBitmapData(this.qName);
|
|
12716
|
+
if (data && pxt.sprite.bitmapEquals(data, this.asset.bitmap)) {
|
|
12717
|
+
return this.qName;
|
|
12718
|
+
}
|
|
12719
|
+
}
|
|
12704
12720
|
return pxt.sprite.bitmapToImageLiteral(this.asset && pxt.sprite.Bitmap.fromData(this.asset.bitmap), "typescript" /* pxt.editor.FileType.TypeScript */);
|
|
12705
12721
|
}
|
|
12706
12722
|
parseFieldOptions(opts) {
|
|
@@ -12765,6 +12781,15 @@ var pxtblockly;
|
|
|
12765
12781
|
return res;
|
|
12766
12782
|
}
|
|
12767
12783
|
}
|
|
12784
|
+
function qNameToBitmapData(qName) {
|
|
12785
|
+
const project = pxt.react.getTilemapProject();
|
|
12786
|
+
const images = project.getGalleryAssets("image" /* pxt.AssetType.Image */).filter(asset => asset.id === qName);
|
|
12787
|
+
const img = images.length && images[0];
|
|
12788
|
+
if (img) {
|
|
12789
|
+
return img.bitmap;
|
|
12790
|
+
}
|
|
12791
|
+
return undefined;
|
|
12792
|
+
}
|
|
12768
12793
|
})(pxtblockly || (pxtblockly = {}));
|
|
12769
12794
|
/// <reference path="../../localtypings/pxtblockly.d.ts" />
|
|
12770
12795
|
var pxtblockly;
|