pxt-core 8.2.12 → 8.2.14
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/buildengine.js +3 -3
- package/built/cli.js +5 -5
- package/built/gdb.js +4 -4
- package/built/nodeutil.d.ts +1 -0
- package/built/pxt.js +366 -364
- package/built/pxtblockly.js +35 -35
- package/built/pxtblocks.js +35 -35
- package/built/pxtcompiler.js +162 -160
- package/built/pxteditor.d.ts +15 -3
- package/built/pxteditor.js +6 -6
- package/built/pxtlib.d.ts +2 -1
- package/built/pxtlib.js +162 -161
- package/built/pxtpy.js +34 -35
- package/built/pxtsim.d.ts +5 -5
- package/built/pxtsim.js +3 -3
- package/built/server.js +5 -5
- package/built/storage.js +4 -4
- package/built/target.js +1 -1
- package/built/web/main.js +1 -1
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxtasseteditor.js +1 -1
- package/built/web/pxtcompiler.js +1 -1
- package/built/web/pxteditor.js +1 -1
- package/built/web/pxtembed.js +2 -2
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtpy.js +1 -1
- package/built/web/pxtsim.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/built/web/skillmap/js/2.960f04a5.chunk.js +2 -0
- package/built/web/skillmap/js/main.44b2383f.chunk.js +1 -0
- package/common-docs/static/logo/social-buttons/google-classroom.png +0 -0
- package/common-docs/static/logo/social-buttons/microsoft-teams.png +0 -0
- package/docfiles/pxtweb/tsconfig.json +2 -1
- package/localtypings/dom.d.ts +3 -0
- package/localtypings/react.d.ts +1 -1
- package/package.json +6 -6
- package/react-common/components/controls/Modal.tsx +2 -2
- package/react-common/components/share/ShareInfo.tsx +1 -1
- package/react-common/tsconfig.json +3 -2
- package/theme/common.less +5 -3
- package/theme/highcontrast.less +3 -0
- package/theme/toolbox.less +25 -0
- package/theme/tutorial-sidebar.less +171 -115
- package/webapp/public/skillmap.html +1 -1
- package/built/web/skillmap/js/2.26325281.chunk.js +0 -2
- package/built/web/skillmap/js/main.d94a2bd9.chunk.js +0 -1
package/built/pxtblockly.js
CHANGED
|
@@ -5050,7 +5050,7 @@ var pxt;
|
|
|
5050
5050
|
// Otherwise, after the first compile the function will be renamed because it conflicts
|
|
5051
5051
|
// with itself. You can still get collisions if you attempt to define a function with
|
|
5052
5052
|
// the same name as a function defined in another file in the user's project (e.g. custom.ts)
|
|
5053
|
-
if (info.pkg && (info.kind === 6 /* Enum */ || info.kind === 3 /* Function */ || info.kind === 5 /* Module */ || info.kind === 4 /* Variable */)) {
|
|
5053
|
+
if (info.pkg && (info.kind === 6 /* pxtc.SymbolKind.Enum */ || info.kind === 3 /* pxtc.SymbolKind.Function */ || info.kind === 5 /* pxtc.SymbolKind.Module */ || info.kind === 4 /* pxtc.SymbolKind.Variable */)) {
|
|
5054
5054
|
e.renames.takenNames[info.qName] = true;
|
|
5055
5055
|
}
|
|
5056
5056
|
});
|
|
@@ -6697,7 +6697,7 @@ var pxt;
|
|
|
6697
6697
|
const enums = {};
|
|
6698
6698
|
Object.keys(info.apis.byQName).forEach(k => {
|
|
6699
6699
|
let api = info.apis.byQName[k];
|
|
6700
|
-
if (api.kind == 7 /* EnumMember */)
|
|
6700
|
+
if (api.kind == 7 /* pxtc.SymbolKind.EnumMember */)
|
|
6701
6701
|
enums[api.namespace + '.' + (api.attributes.blockImportId || api.attributes.block || api.attributes.blockId || api.name)]
|
|
6702
6702
|
= api.namespace + '.' + api.name;
|
|
6703
6703
|
});
|
|
@@ -6732,7 +6732,7 @@ var pxt;
|
|
|
6732
6732
|
let comp = blocks_2.compileInfo(symbol);
|
|
6733
6733
|
(_a = symbol.parameters) === null || _a === void 0 ? void 0 : _a.forEach((p, i) => {
|
|
6734
6734
|
let ptype = info.apis.byQName[p.type];
|
|
6735
|
-
if (ptype && ptype.kind == 6 /* Enum */) {
|
|
6735
|
+
if (ptype && ptype.kind == 6 /* pxtc.SymbolKind.Enum */) {
|
|
6736
6736
|
let field = getFirstChildWithAttr(block, "field", "name", comp.actualNameToParam[p.name].definitionName);
|
|
6737
6737
|
if (field) {
|
|
6738
6738
|
let en = enums[ptype.name + '.' + field.textContent];
|
|
@@ -7749,7 +7749,7 @@ var pxt;
|
|
|
7749
7749
|
function initBlock(block, info, fn, comp) {
|
|
7750
7750
|
var _a;
|
|
7751
7751
|
const ns = (fn.attributes.blockNamespace || fn.namespace).split('.')[0];
|
|
7752
|
-
const instance = fn.kind == 1 /* Method */ || fn.kind == 2 /* Property */;
|
|
7752
|
+
const instance = fn.kind == 1 /* pxtc.SymbolKind.Method */ || fn.kind == 2 /* pxtc.SymbolKind.Property */;
|
|
7753
7753
|
const nsinfo = info.apis.byQName[ns];
|
|
7754
7754
|
const color =
|
|
7755
7755
|
// blockNamespace overrides color on block
|
|
@@ -7920,7 +7920,7 @@ var pxt;
|
|
|
7920
7920
|
hasParameter = true;
|
|
7921
7921
|
const defName = pr.definitionName;
|
|
7922
7922
|
const actName = pr.actualName;
|
|
7923
|
-
let isEnum = typeInfo && typeInfo.kind == 6 /* Enum */;
|
|
7923
|
+
let isEnum = typeInfo && typeInfo.kind == 6 /* pxtc.SymbolKind.Enum */;
|
|
7924
7924
|
let isFixed = typeInfo && !!typeInfo.attributes.fixedInstances && !pr.shadowBlockId;
|
|
7925
7925
|
let isConstantShim = !!fn.attributes.constantShim;
|
|
7926
7926
|
let isCombined = pr.type == "@combined@";
|
|
@@ -9900,7 +9900,7 @@ var pxt;
|
|
|
9900
9900
|
return pxt.Util.values(apis.byQName).filter(sym => sym.namespace === enumName && !sym.attributes.blockHidden);
|
|
9901
9901
|
}
|
|
9902
9902
|
function getFixedInstanceDropdownValues(apis, qName) {
|
|
9903
|
-
const symbols = pxt.Util.values(apis.byQName).filter(sym => sym.kind === 4 /* Variable */
|
|
9903
|
+
const symbols = pxt.Util.values(apis.byQName).filter(sym => sym.kind === 4 /* pxtc.SymbolKind.Variable */
|
|
9904
9904
|
&& sym.attributes.fixedInstance
|
|
9905
9905
|
&& isSubtype(apis, sym.retType, qName))
|
|
9906
9906
|
.sort((l, r) => (r.attributes.weight || 50) - (l.attributes.weight || 50));
|
|
@@ -11569,17 +11569,17 @@ var pxtblockly;
|
|
|
11569
11569
|
params.blocksInfo = this.blocksInfo;
|
|
11570
11570
|
let editorKind;
|
|
11571
11571
|
switch (this.asset.type) {
|
|
11572
|
-
case "tile" /* Tile */:
|
|
11573
|
-
case "image" /* Image */:
|
|
11572
|
+
case "tile" /* pxt.AssetType.Tile */:
|
|
11573
|
+
case "image" /* pxt.AssetType.Image */:
|
|
11574
11574
|
editorKind = "image-editor";
|
|
11575
|
-
params.temporaryAssets = pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "image" /* Image */);
|
|
11575
|
+
params.temporaryAssets = pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "image" /* pxt.AssetType.Image */);
|
|
11576
11576
|
break;
|
|
11577
|
-
case "animation" /* Animation */:
|
|
11577
|
+
case "animation" /* pxt.AssetType.Animation */:
|
|
11578
11578
|
editorKind = "animation-editor";
|
|
11579
|
-
params.temporaryAssets = pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "image" /* Image */)
|
|
11580
|
-
.concat(pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "animation" /* Animation */));
|
|
11579
|
+
params.temporaryAssets = pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "image" /* pxt.AssetType.Image */)
|
|
11580
|
+
.concat(pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "animation" /* pxt.AssetType.Animation */));
|
|
11581
11581
|
break;
|
|
11582
|
-
case "tilemap" /* Tilemap */:
|
|
11582
|
+
case "tilemap" /* pxt.AssetType.Tilemap */:
|
|
11583
11583
|
editorKind = "tilemap-editor";
|
|
11584
11584
|
const project = pxt.react.getTilemapProject();
|
|
11585
11585
|
pxt.sprite.addMissingTilemapTilesAndReferences(project, this.asset);
|
|
@@ -11715,14 +11715,14 @@ var pxtblockly;
|
|
|
11715
11715
|
if (this.asset) {
|
|
11716
11716
|
let dataURI;
|
|
11717
11717
|
switch (this.asset.type) {
|
|
11718
|
-
case "image" /* Image */:
|
|
11719
|
-
case "tile" /* Tile */:
|
|
11718
|
+
case "image" /* pxt.AssetType.Image */:
|
|
11719
|
+
case "tile" /* pxt.AssetType.Tile */:
|
|
11720
11720
|
dataURI = pxtblockly.bitmapToImageURI(pxt.sprite.Bitmap.fromData(this.asset.bitmap), PREVIEW_WIDTH, this.lightMode);
|
|
11721
11721
|
break;
|
|
11722
|
-
case "animation" /* Animation */:
|
|
11722
|
+
case "animation" /* pxt.AssetType.Animation */:
|
|
11723
11723
|
dataURI = pxtblockly.bitmapToImageURI(pxt.sprite.Bitmap.fromData(this.asset.frames[0]), PREVIEW_WIDTH, this.lightMode);
|
|
11724
11724
|
break;
|
|
11725
|
-
case "tilemap" /* Tilemap */:
|
|
11725
|
+
case "tilemap" /* pxt.AssetType.Tilemap */:
|
|
11726
11726
|
dataURI = pxtblockly.tilemapToImageURI(this.asset.data, PREVIEW_WIDTH, this.lightMode);
|
|
11727
11727
|
break;
|
|
11728
11728
|
}
|
|
@@ -11920,7 +11920,7 @@ var pxtblockly;
|
|
|
11920
11920
|
this.size_.width = TOTAL_WIDTH;
|
|
11921
11921
|
}
|
|
11922
11922
|
getAssetType() {
|
|
11923
|
-
return "animation" /* Animation */;
|
|
11923
|
+
return "animation" /* pxt.AssetType.Animation */;
|
|
11924
11924
|
}
|
|
11925
11925
|
createNewAsset(text) {
|
|
11926
11926
|
const project = pxt.react.getTilemapProject();
|
|
@@ -11934,14 +11934,14 @@ var pxtblockly;
|
|
|
11934
11934
|
const newAnimation = {
|
|
11935
11935
|
internalID: -1,
|
|
11936
11936
|
id,
|
|
11937
|
-
type: "animation" /* Animation */,
|
|
11937
|
+
type: "animation" /* pxt.AssetType.Animation */,
|
|
11938
11938
|
frames,
|
|
11939
11939
|
interval: this.getParentInterval(),
|
|
11940
11940
|
meta: {},
|
|
11941
11941
|
};
|
|
11942
11942
|
return newAnimation;
|
|
11943
11943
|
}
|
|
11944
|
-
const asset = project.lookupAssetByName("animation" /* Animation */, text.trim());
|
|
11944
|
+
const asset = project.lookupAssetByName("animation" /* pxt.AssetType.Animation */, text.trim());
|
|
11945
11945
|
if (asset)
|
|
11946
11946
|
return asset;
|
|
11947
11947
|
}
|
|
@@ -11950,7 +11950,7 @@ var pxtblockly;
|
|
|
11950
11950
|
const newAnimation = {
|
|
11951
11951
|
internalID: -1,
|
|
11952
11952
|
id,
|
|
11953
|
-
type: "animation" /* Animation */,
|
|
11953
|
+
type: "animation" /* pxt.AssetType.Animation */,
|
|
11954
11954
|
frames: [bitmap],
|
|
11955
11955
|
interval: 500,
|
|
11956
11956
|
meta: {},
|
|
@@ -11964,7 +11964,7 @@ var pxtblockly;
|
|
|
11964
11964
|
if (!this.asset)
|
|
11965
11965
|
return "[]";
|
|
11966
11966
|
if (this.isTemporaryAsset()) {
|
|
11967
|
-
return "[" + this.asset.frames.map(frame => pxt.sprite.bitmapToImageLiteral(pxt.sprite.Bitmap.fromData(frame), "typescript" /* TypeScript */)).join(",") + "]";
|
|
11967
|
+
return "[" + this.asset.frames.map(frame => pxt.sprite.bitmapToImageLiteral(pxt.sprite.Bitmap.fromData(frame), "typescript" /* pxt.editor.FileType.TypeScript */)).join(",") + "]";
|
|
11968
11968
|
}
|
|
11969
11969
|
return pxt.getTSReferenceForAsset(this.asset);
|
|
11970
11970
|
}
|
|
@@ -15870,7 +15870,7 @@ var pxtblockly;
|
|
|
15870
15870
|
(function (pxtblockly) {
|
|
15871
15871
|
class FieldSpriteEditor extends pxtblockly.FieldAssetEditor {
|
|
15872
15872
|
getAssetType() {
|
|
15873
|
-
return "image" /* Image */;
|
|
15873
|
+
return "image" /* pxt.AssetType.Image */;
|
|
15874
15874
|
}
|
|
15875
15875
|
createNewAsset(text) {
|
|
15876
15876
|
const project = pxt.react.getTilemapProject();
|
|
@@ -15880,7 +15880,7 @@ var pxtblockly;
|
|
|
15880
15880
|
return asset;
|
|
15881
15881
|
}
|
|
15882
15882
|
if (this.getBlockData()) {
|
|
15883
|
-
return project.lookupAsset("image" /* Image */, this.getBlockData());
|
|
15883
|
+
return project.lookupAsset("image" /* pxt.AssetType.Image */, this.getBlockData());
|
|
15884
15884
|
}
|
|
15885
15885
|
const bmp = text ? pxt.sprite.imageLiteralToBitmap(text) : new pxt.sprite.Bitmap(this.params.initWidth, this.params.initHeight);
|
|
15886
15886
|
if (!bmp) {
|
|
@@ -15892,7 +15892,7 @@ var pxtblockly;
|
|
|
15892
15892
|
const newAsset = {
|
|
15893
15893
|
internalID: -1,
|
|
15894
15894
|
id: this.sourceBlock_.id,
|
|
15895
|
-
type: "image" /* Image */,
|
|
15895
|
+
type: "image" /* pxt.AssetType.Image */,
|
|
15896
15896
|
jresData: pxt.sprite.base64EncodeBitmap(data),
|
|
15897
15897
|
meta: {},
|
|
15898
15898
|
bitmap: data
|
|
@@ -15903,7 +15903,7 @@ var pxtblockly;
|
|
|
15903
15903
|
if (this.asset && !this.isTemporaryAsset()) {
|
|
15904
15904
|
return pxt.getTSReferenceForAsset(this.asset);
|
|
15905
15905
|
}
|
|
15906
|
-
return pxt.sprite.bitmapToImageLiteral(this.asset && pxt.sprite.Bitmap.fromData(this.asset.bitmap), "typescript" /* TypeScript */);
|
|
15906
|
+
return pxt.sprite.bitmapToImageLiteral(this.asset && pxt.sprite.Bitmap.fromData(this.asset.bitmap), "typescript" /* pxt.editor.FileType.TypeScript */);
|
|
15907
15907
|
}
|
|
15908
15908
|
parseFieldOptions(opts) {
|
|
15909
15909
|
return parseFieldOptions(opts);
|
|
@@ -16016,7 +16016,7 @@ var pxtblockly;
|
|
|
16016
16016
|
return (_a = this.asset) === null || _a === void 0 ? void 0 : _a.data.tileset;
|
|
16017
16017
|
}
|
|
16018
16018
|
getAssetType() {
|
|
16019
|
-
return "tilemap" /* Tilemap */;
|
|
16019
|
+
return "tilemap" /* pxt.AssetType.Tilemap */;
|
|
16020
16020
|
}
|
|
16021
16021
|
createNewAsset(newText = "") {
|
|
16022
16022
|
if (newText) {
|
|
@@ -16273,11 +16273,11 @@ var pxtblockly;
|
|
|
16273
16273
|
}
|
|
16274
16274
|
dispose() {
|
|
16275
16275
|
super.dispose();
|
|
16276
|
-
pxt.react.getTilemapProject().removeChangeListener("tile" /* Tile */, this.assetChangeListener);
|
|
16276
|
+
pxt.react.getTilemapProject().removeChangeListener("tile" /* pxt.AssetType.Tile */, this.assetChangeListener);
|
|
16277
16277
|
}
|
|
16278
16278
|
updateAssetListener() {
|
|
16279
16279
|
const project = pxt.react.getTilemapProject();
|
|
16280
|
-
project.removeChangeListener("tile" /* Tile */, this.assetChangeListener);
|
|
16280
|
+
project.removeChangeListener("tile" /* pxt.AssetType.Tile */, this.assetChangeListener);
|
|
16281
16281
|
if (this.selectedOption_) {
|
|
16282
16282
|
project.addChangeListener(this.selectedOption_[2], this.assetChangeListener);
|
|
16283
16283
|
}
|
|
@@ -17197,13 +17197,13 @@ var pxtblockly;
|
|
|
17197
17197
|
if (map.block.id === excludeBlockID)
|
|
17198
17198
|
continue;
|
|
17199
17199
|
for (const tile of ((_a = map.ref.getTileset()) === null || _a === void 0 ? void 0 : _a.tiles) || []) {
|
|
17200
|
-
all[tile.id] = project.lookupAsset("tile" /* Tile */, tile.id);
|
|
17200
|
+
all[tile.id] = project.lookupAsset("tile" /* pxt.AssetType.Tile */, tile.id);
|
|
17201
17201
|
}
|
|
17202
17202
|
}
|
|
17203
|
-
const projectMaps = project.getAssets("tilemap" /* Tilemap */);
|
|
17203
|
+
const projectMaps = project.getAssets("tilemap" /* pxt.AssetType.Tilemap */);
|
|
17204
17204
|
for (const projectMap of projectMaps) {
|
|
17205
17205
|
for (const tile of projectMap.data.tileset.tiles) {
|
|
17206
|
-
all[tile.id] = project.lookupAsset("tile" /* Tile */, tile.id);
|
|
17206
|
+
all[tile.id] = project.lookupAsset("tile" /* pxt.AssetType.Tile */, tile.id);
|
|
17207
17207
|
}
|
|
17208
17208
|
}
|
|
17209
17209
|
const allTiles = getAllBlocksWithTilesets(workspace);
|
|
@@ -17211,7 +17211,7 @@ var pxtblockly;
|
|
|
17211
17211
|
const value = tilesetField.ref.getValue();
|
|
17212
17212
|
const match = /^\s*assets\s*\.\s*tile\s*`([^`]*)`\s*$/.exec(value);
|
|
17213
17213
|
if (match) {
|
|
17214
|
-
const tile = project.lookupAssetByName("tile" /* Tile */, match[1]);
|
|
17214
|
+
const tile = project.lookupAssetByName("tile" /* pxt.AssetType.Tile */, match[1]);
|
|
17215
17215
|
if (tile && !all[tile.id]) {
|
|
17216
17216
|
all[tile.id] = tile;
|
|
17217
17217
|
}
|
|
@@ -17225,10 +17225,10 @@ var pxtblockly;
|
|
|
17225
17225
|
pxtblockly.getAllReferencedTiles = getAllReferencedTiles;
|
|
17226
17226
|
function getTemporaryAssets(workspace, type) {
|
|
17227
17227
|
switch (type) {
|
|
17228
|
-
case "image" /* Image */:
|
|
17228
|
+
case "image" /* pxt.AssetType.Image */:
|
|
17229
17229
|
return getAllFields(workspace, field => field instanceof pxtblockly.FieldSpriteEditor && field.isTemporaryAsset())
|
|
17230
17230
|
.map(f => f.ref.getAsset());
|
|
17231
|
-
case "animation" /* Animation */:
|
|
17231
|
+
case "animation" /* pxt.AssetType.Animation */:
|
|
17232
17232
|
return getAllFields(workspace, field => field instanceof pxtblockly.FieldAnimationEditor && field.isTemporaryAsset())
|
|
17233
17233
|
.map(f => f.ref.getAsset());
|
|
17234
17234
|
default: return [];
|
package/built/pxtblocks.js
CHANGED
|
@@ -1488,7 +1488,7 @@ var pxt;
|
|
|
1488
1488
|
// Otherwise, after the first compile the function will be renamed because it conflicts
|
|
1489
1489
|
// with itself. You can still get collisions if you attempt to define a function with
|
|
1490
1490
|
// the same name as a function defined in another file in the user's project (e.g. custom.ts)
|
|
1491
|
-
if (info.pkg && (info.kind === 6 /* Enum */ || info.kind === 3 /* Function */ || info.kind === 5 /* Module */ || info.kind === 4 /* Variable */)) {
|
|
1491
|
+
if (info.pkg && (info.kind === 6 /* pxtc.SymbolKind.Enum */ || info.kind === 3 /* pxtc.SymbolKind.Function */ || info.kind === 5 /* pxtc.SymbolKind.Module */ || info.kind === 4 /* pxtc.SymbolKind.Variable */)) {
|
|
1492
1492
|
e.renames.takenNames[info.qName] = true;
|
|
1493
1493
|
}
|
|
1494
1494
|
});
|
|
@@ -3135,7 +3135,7 @@ var pxt;
|
|
|
3135
3135
|
const enums = {};
|
|
3136
3136
|
Object.keys(info.apis.byQName).forEach(k => {
|
|
3137
3137
|
let api = info.apis.byQName[k];
|
|
3138
|
-
if (api.kind == 7 /* EnumMember */)
|
|
3138
|
+
if (api.kind == 7 /* pxtc.SymbolKind.EnumMember */)
|
|
3139
3139
|
enums[api.namespace + '.' + (api.attributes.blockImportId || api.attributes.block || api.attributes.blockId || api.name)]
|
|
3140
3140
|
= api.namespace + '.' + api.name;
|
|
3141
3141
|
});
|
|
@@ -3170,7 +3170,7 @@ var pxt;
|
|
|
3170
3170
|
let comp = blocks_2.compileInfo(symbol);
|
|
3171
3171
|
(_a = symbol.parameters) === null || _a === void 0 ? void 0 : _a.forEach((p, i) => {
|
|
3172
3172
|
let ptype = info.apis.byQName[p.type];
|
|
3173
|
-
if (ptype && ptype.kind == 6 /* Enum */) {
|
|
3173
|
+
if (ptype && ptype.kind == 6 /* pxtc.SymbolKind.Enum */) {
|
|
3174
3174
|
let field = getFirstChildWithAttr(block, "field", "name", comp.actualNameToParam[p.name].definitionName);
|
|
3175
3175
|
if (field) {
|
|
3176
3176
|
let en = enums[ptype.name + '.' + field.textContent];
|
|
@@ -4187,7 +4187,7 @@ var pxt;
|
|
|
4187
4187
|
function initBlock(block, info, fn, comp) {
|
|
4188
4188
|
var _a;
|
|
4189
4189
|
const ns = (fn.attributes.blockNamespace || fn.namespace).split('.')[0];
|
|
4190
|
-
const instance = fn.kind == 1 /* Method */ || fn.kind == 2 /* Property */;
|
|
4190
|
+
const instance = fn.kind == 1 /* pxtc.SymbolKind.Method */ || fn.kind == 2 /* pxtc.SymbolKind.Property */;
|
|
4191
4191
|
const nsinfo = info.apis.byQName[ns];
|
|
4192
4192
|
const color =
|
|
4193
4193
|
// blockNamespace overrides color on block
|
|
@@ -4358,7 +4358,7 @@ var pxt;
|
|
|
4358
4358
|
hasParameter = true;
|
|
4359
4359
|
const defName = pr.definitionName;
|
|
4360
4360
|
const actName = pr.actualName;
|
|
4361
|
-
let isEnum = typeInfo && typeInfo.kind == 6 /* Enum */;
|
|
4361
|
+
let isEnum = typeInfo && typeInfo.kind == 6 /* pxtc.SymbolKind.Enum */;
|
|
4362
4362
|
let isFixed = typeInfo && !!typeInfo.attributes.fixedInstances && !pr.shadowBlockId;
|
|
4363
4363
|
let isConstantShim = !!fn.attributes.constantShim;
|
|
4364
4364
|
let isCombined = pr.type == "@combined@";
|
|
@@ -6338,7 +6338,7 @@ var pxt;
|
|
|
6338
6338
|
return pxt.Util.values(apis.byQName).filter(sym => sym.namespace === enumName && !sym.attributes.blockHidden);
|
|
6339
6339
|
}
|
|
6340
6340
|
function getFixedInstanceDropdownValues(apis, qName) {
|
|
6341
|
-
const symbols = pxt.Util.values(apis.byQName).filter(sym => sym.kind === 4 /* Variable */
|
|
6341
|
+
const symbols = pxt.Util.values(apis.byQName).filter(sym => sym.kind === 4 /* pxtc.SymbolKind.Variable */
|
|
6342
6342
|
&& sym.attributes.fixedInstance
|
|
6343
6343
|
&& isSubtype(apis, sym.retType, qName))
|
|
6344
6344
|
.sort((l, r) => (r.attributes.weight || 50) - (l.attributes.weight || 50));
|
|
@@ -8007,17 +8007,17 @@ var pxtblockly;
|
|
|
8007
8007
|
params.blocksInfo = this.blocksInfo;
|
|
8008
8008
|
let editorKind;
|
|
8009
8009
|
switch (this.asset.type) {
|
|
8010
|
-
case "tile" /* Tile */:
|
|
8011
|
-
case "image" /* Image */:
|
|
8010
|
+
case "tile" /* pxt.AssetType.Tile */:
|
|
8011
|
+
case "image" /* pxt.AssetType.Image */:
|
|
8012
8012
|
editorKind = "image-editor";
|
|
8013
|
-
params.temporaryAssets = pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "image" /* Image */);
|
|
8013
|
+
params.temporaryAssets = pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "image" /* pxt.AssetType.Image */);
|
|
8014
8014
|
break;
|
|
8015
|
-
case "animation" /* Animation */:
|
|
8015
|
+
case "animation" /* pxt.AssetType.Animation */:
|
|
8016
8016
|
editorKind = "animation-editor";
|
|
8017
|
-
params.temporaryAssets = pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "image" /* Image */)
|
|
8018
|
-
.concat(pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "animation" /* Animation */));
|
|
8017
|
+
params.temporaryAssets = pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "image" /* pxt.AssetType.Image */)
|
|
8018
|
+
.concat(pxtblockly.getTemporaryAssets(this.sourceBlock_.workspace, "animation" /* pxt.AssetType.Animation */));
|
|
8019
8019
|
break;
|
|
8020
|
-
case "tilemap" /* Tilemap */:
|
|
8020
|
+
case "tilemap" /* pxt.AssetType.Tilemap */:
|
|
8021
8021
|
editorKind = "tilemap-editor";
|
|
8022
8022
|
const project = pxt.react.getTilemapProject();
|
|
8023
8023
|
pxt.sprite.addMissingTilemapTilesAndReferences(project, this.asset);
|
|
@@ -8153,14 +8153,14 @@ var pxtblockly;
|
|
|
8153
8153
|
if (this.asset) {
|
|
8154
8154
|
let dataURI;
|
|
8155
8155
|
switch (this.asset.type) {
|
|
8156
|
-
case "image" /* Image */:
|
|
8157
|
-
case "tile" /* Tile */:
|
|
8156
|
+
case "image" /* pxt.AssetType.Image */:
|
|
8157
|
+
case "tile" /* pxt.AssetType.Tile */:
|
|
8158
8158
|
dataURI = pxtblockly.bitmapToImageURI(pxt.sprite.Bitmap.fromData(this.asset.bitmap), PREVIEW_WIDTH, this.lightMode);
|
|
8159
8159
|
break;
|
|
8160
|
-
case "animation" /* Animation */:
|
|
8160
|
+
case "animation" /* pxt.AssetType.Animation */:
|
|
8161
8161
|
dataURI = pxtblockly.bitmapToImageURI(pxt.sprite.Bitmap.fromData(this.asset.frames[0]), PREVIEW_WIDTH, this.lightMode);
|
|
8162
8162
|
break;
|
|
8163
|
-
case "tilemap" /* Tilemap */:
|
|
8163
|
+
case "tilemap" /* pxt.AssetType.Tilemap */:
|
|
8164
8164
|
dataURI = pxtblockly.tilemapToImageURI(this.asset.data, PREVIEW_WIDTH, this.lightMode);
|
|
8165
8165
|
break;
|
|
8166
8166
|
}
|
|
@@ -8358,7 +8358,7 @@ var pxtblockly;
|
|
|
8358
8358
|
this.size_.width = TOTAL_WIDTH;
|
|
8359
8359
|
}
|
|
8360
8360
|
getAssetType() {
|
|
8361
|
-
return "animation" /* Animation */;
|
|
8361
|
+
return "animation" /* pxt.AssetType.Animation */;
|
|
8362
8362
|
}
|
|
8363
8363
|
createNewAsset(text) {
|
|
8364
8364
|
const project = pxt.react.getTilemapProject();
|
|
@@ -8372,14 +8372,14 @@ var pxtblockly;
|
|
|
8372
8372
|
const newAnimation = {
|
|
8373
8373
|
internalID: -1,
|
|
8374
8374
|
id,
|
|
8375
|
-
type: "animation" /* Animation */,
|
|
8375
|
+
type: "animation" /* pxt.AssetType.Animation */,
|
|
8376
8376
|
frames,
|
|
8377
8377
|
interval: this.getParentInterval(),
|
|
8378
8378
|
meta: {},
|
|
8379
8379
|
};
|
|
8380
8380
|
return newAnimation;
|
|
8381
8381
|
}
|
|
8382
|
-
const asset = project.lookupAssetByName("animation" /* Animation */, text.trim());
|
|
8382
|
+
const asset = project.lookupAssetByName("animation" /* pxt.AssetType.Animation */, text.trim());
|
|
8383
8383
|
if (asset)
|
|
8384
8384
|
return asset;
|
|
8385
8385
|
}
|
|
@@ -8388,7 +8388,7 @@ var pxtblockly;
|
|
|
8388
8388
|
const newAnimation = {
|
|
8389
8389
|
internalID: -1,
|
|
8390
8390
|
id,
|
|
8391
|
-
type: "animation" /* Animation */,
|
|
8391
|
+
type: "animation" /* pxt.AssetType.Animation */,
|
|
8392
8392
|
frames: [bitmap],
|
|
8393
8393
|
interval: 500,
|
|
8394
8394
|
meta: {},
|
|
@@ -8402,7 +8402,7 @@ var pxtblockly;
|
|
|
8402
8402
|
if (!this.asset)
|
|
8403
8403
|
return "[]";
|
|
8404
8404
|
if (this.isTemporaryAsset()) {
|
|
8405
|
-
return "[" + this.asset.frames.map(frame => pxt.sprite.bitmapToImageLiteral(pxt.sprite.Bitmap.fromData(frame), "typescript" /* TypeScript */)).join(",") + "]";
|
|
8405
|
+
return "[" + this.asset.frames.map(frame => pxt.sprite.bitmapToImageLiteral(pxt.sprite.Bitmap.fromData(frame), "typescript" /* pxt.editor.FileType.TypeScript */)).join(",") + "]";
|
|
8406
8406
|
}
|
|
8407
8407
|
return pxt.getTSReferenceForAsset(this.asset);
|
|
8408
8408
|
}
|
|
@@ -12308,7 +12308,7 @@ var pxtblockly;
|
|
|
12308
12308
|
(function (pxtblockly) {
|
|
12309
12309
|
class FieldSpriteEditor extends pxtblockly.FieldAssetEditor {
|
|
12310
12310
|
getAssetType() {
|
|
12311
|
-
return "image" /* Image */;
|
|
12311
|
+
return "image" /* pxt.AssetType.Image */;
|
|
12312
12312
|
}
|
|
12313
12313
|
createNewAsset(text) {
|
|
12314
12314
|
const project = pxt.react.getTilemapProject();
|
|
@@ -12318,7 +12318,7 @@ var pxtblockly;
|
|
|
12318
12318
|
return asset;
|
|
12319
12319
|
}
|
|
12320
12320
|
if (this.getBlockData()) {
|
|
12321
|
-
return project.lookupAsset("image" /* Image */, this.getBlockData());
|
|
12321
|
+
return project.lookupAsset("image" /* pxt.AssetType.Image */, this.getBlockData());
|
|
12322
12322
|
}
|
|
12323
12323
|
const bmp = text ? pxt.sprite.imageLiteralToBitmap(text) : new pxt.sprite.Bitmap(this.params.initWidth, this.params.initHeight);
|
|
12324
12324
|
if (!bmp) {
|
|
@@ -12330,7 +12330,7 @@ var pxtblockly;
|
|
|
12330
12330
|
const newAsset = {
|
|
12331
12331
|
internalID: -1,
|
|
12332
12332
|
id: this.sourceBlock_.id,
|
|
12333
|
-
type: "image" /* Image */,
|
|
12333
|
+
type: "image" /* pxt.AssetType.Image */,
|
|
12334
12334
|
jresData: pxt.sprite.base64EncodeBitmap(data),
|
|
12335
12335
|
meta: {},
|
|
12336
12336
|
bitmap: data
|
|
@@ -12341,7 +12341,7 @@ var pxtblockly;
|
|
|
12341
12341
|
if (this.asset && !this.isTemporaryAsset()) {
|
|
12342
12342
|
return pxt.getTSReferenceForAsset(this.asset);
|
|
12343
12343
|
}
|
|
12344
|
-
return pxt.sprite.bitmapToImageLiteral(this.asset && pxt.sprite.Bitmap.fromData(this.asset.bitmap), "typescript" /* TypeScript */);
|
|
12344
|
+
return pxt.sprite.bitmapToImageLiteral(this.asset && pxt.sprite.Bitmap.fromData(this.asset.bitmap), "typescript" /* pxt.editor.FileType.TypeScript */);
|
|
12345
12345
|
}
|
|
12346
12346
|
parseFieldOptions(opts) {
|
|
12347
12347
|
return parseFieldOptions(opts);
|
|
@@ -12454,7 +12454,7 @@ var pxtblockly;
|
|
|
12454
12454
|
return (_a = this.asset) === null || _a === void 0 ? void 0 : _a.data.tileset;
|
|
12455
12455
|
}
|
|
12456
12456
|
getAssetType() {
|
|
12457
|
-
return "tilemap" /* Tilemap */;
|
|
12457
|
+
return "tilemap" /* pxt.AssetType.Tilemap */;
|
|
12458
12458
|
}
|
|
12459
12459
|
createNewAsset(newText = "") {
|
|
12460
12460
|
if (newText) {
|
|
@@ -12711,11 +12711,11 @@ var pxtblockly;
|
|
|
12711
12711
|
}
|
|
12712
12712
|
dispose() {
|
|
12713
12713
|
super.dispose();
|
|
12714
|
-
pxt.react.getTilemapProject().removeChangeListener("tile" /* Tile */, this.assetChangeListener);
|
|
12714
|
+
pxt.react.getTilemapProject().removeChangeListener("tile" /* pxt.AssetType.Tile */, this.assetChangeListener);
|
|
12715
12715
|
}
|
|
12716
12716
|
updateAssetListener() {
|
|
12717
12717
|
const project = pxt.react.getTilemapProject();
|
|
12718
|
-
project.removeChangeListener("tile" /* Tile */, this.assetChangeListener);
|
|
12718
|
+
project.removeChangeListener("tile" /* pxt.AssetType.Tile */, this.assetChangeListener);
|
|
12719
12719
|
if (this.selectedOption_) {
|
|
12720
12720
|
project.addChangeListener(this.selectedOption_[2], this.assetChangeListener);
|
|
12721
12721
|
}
|
|
@@ -13635,13 +13635,13 @@ var pxtblockly;
|
|
|
13635
13635
|
if (map.block.id === excludeBlockID)
|
|
13636
13636
|
continue;
|
|
13637
13637
|
for (const tile of ((_a = map.ref.getTileset()) === null || _a === void 0 ? void 0 : _a.tiles) || []) {
|
|
13638
|
-
all[tile.id] = project.lookupAsset("tile" /* Tile */, tile.id);
|
|
13638
|
+
all[tile.id] = project.lookupAsset("tile" /* pxt.AssetType.Tile */, tile.id);
|
|
13639
13639
|
}
|
|
13640
13640
|
}
|
|
13641
|
-
const projectMaps = project.getAssets("tilemap" /* Tilemap */);
|
|
13641
|
+
const projectMaps = project.getAssets("tilemap" /* pxt.AssetType.Tilemap */);
|
|
13642
13642
|
for (const projectMap of projectMaps) {
|
|
13643
13643
|
for (const tile of projectMap.data.tileset.tiles) {
|
|
13644
|
-
all[tile.id] = project.lookupAsset("tile" /* Tile */, tile.id);
|
|
13644
|
+
all[tile.id] = project.lookupAsset("tile" /* pxt.AssetType.Tile */, tile.id);
|
|
13645
13645
|
}
|
|
13646
13646
|
}
|
|
13647
13647
|
const allTiles = getAllBlocksWithTilesets(workspace);
|
|
@@ -13649,7 +13649,7 @@ var pxtblockly;
|
|
|
13649
13649
|
const value = tilesetField.ref.getValue();
|
|
13650
13650
|
const match = /^\s*assets\s*\.\s*tile\s*`([^`]*)`\s*$/.exec(value);
|
|
13651
13651
|
if (match) {
|
|
13652
|
-
const tile = project.lookupAssetByName("tile" /* Tile */, match[1]);
|
|
13652
|
+
const tile = project.lookupAssetByName("tile" /* pxt.AssetType.Tile */, match[1]);
|
|
13653
13653
|
if (tile && !all[tile.id]) {
|
|
13654
13654
|
all[tile.id] = tile;
|
|
13655
13655
|
}
|
|
@@ -13663,10 +13663,10 @@ var pxtblockly;
|
|
|
13663
13663
|
pxtblockly.getAllReferencedTiles = getAllReferencedTiles;
|
|
13664
13664
|
function getTemporaryAssets(workspace, type) {
|
|
13665
13665
|
switch (type) {
|
|
13666
|
-
case "image" /* Image */:
|
|
13666
|
+
case "image" /* pxt.AssetType.Image */:
|
|
13667
13667
|
return getAllFields(workspace, field => field instanceof pxtblockly.FieldSpriteEditor && field.isTemporaryAsset())
|
|
13668
13668
|
.map(f => f.ref.getAsset());
|
|
13669
|
-
case "animation" /* Animation */:
|
|
13669
|
+
case "animation" /* pxt.AssetType.Animation */:
|
|
13670
13670
|
return getAllFields(workspace, field => field instanceof pxtblockly.FieldAnimationEditor && field.isTemporaryAsset())
|
|
13671
13671
|
.map(f => f.ref.getAsset());
|
|
13672
13672
|
default: return [];
|