pxt-core 7.5.26 → 7.5.29
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 +43 -40
- package/built/pxtcompiler.d.ts +0 -1
- package/built/pxtcompiler.js +9 -25
- package/built/pxtlib.js +13 -12
- package/built/pxtpy.js +21 -3
- package/built/target.js +1 -1
- package/built/web/main.js +1 -1
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxtcompiler.js +1 -1
- package/built/web/pxtembed.js +1 -1
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtpy.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/react-common-authcode.css +8 -49
- package/built/web/react-common-skillmap.css +1 -1
- package/built/web/rtlreact-common-skillmap.css +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/built/web/skillmap/js/main.d734c596.chunk.js +1 -0
- package/docfiles/domains-template.html +1 -1
- package/localtypings/pxtarget.d.ts +2 -0
- package/localtypings/pxtpackage.d.ts +4 -0
- package/package.json +1 -1
- package/react-common/components/controls/Modal.tsx +12 -0
- package/react-common/styles/controls/Modal.less +9 -0
- package/react-common/styles/react-common.less +0 -1
- package/theme/common.less +139 -29
- package/webapp/public/skillmap.html +1 -1
- package/built/web/skillmap/js/main.27185090.chunk.js +0 -1
- package/react-common/components/extensions/ExtensionCard.tsx +0 -32
- package/react-common/styles/extensions/ExtensionCard.less +0 -56
package/built/pxt.js
CHANGED
|
@@ -104499,6 +104499,7 @@ var pxt;
|
|
|
104499
104499
|
});
|
|
104500
104500
|
res.generatedFiles["/codal.json"] = JSON.stringify(codalJson, null, 4) + "\n";
|
|
104501
104501
|
pxt.debug(`codal.json: ${res.generatedFiles["/codal.json"]}`);
|
|
104502
|
+
res.codal = codalJson;
|
|
104502
104503
|
}
|
|
104503
104504
|
else if (isPlatformio) {
|
|
104504
104505
|
const iniLines = compileService.platformioIni.slice();
|
|
@@ -113087,20 +113088,18 @@ var ts;
|
|
|
113087
113088
|
function computeUsedParts(resp, filter) {
|
|
113088
113089
|
if (!resp.usedSymbols || !pxt.appTarget.simulator || !pxt.appTarget.simulator.parts)
|
|
113089
113090
|
return [];
|
|
113091
|
+
const parseParts = (partsRaw, ps) => {
|
|
113092
|
+
if (partsRaw) {
|
|
113093
|
+
const partsSplit = partsRaw.split(/[ ,]+/g);
|
|
113094
|
+
ps.push(...partsSplit.filter(p => !!p && ps.indexOf(p) < 0));
|
|
113095
|
+
}
|
|
113096
|
+
};
|
|
113090
113097
|
let parts = [];
|
|
113098
|
+
let hiddenParts = [];
|
|
113091
113099
|
Object.keys(resp.usedSymbols).forEach(symbol => {
|
|
113092
|
-
|
|
113093
|
-
|
|
113094
|
-
|
|
113095
|
-
if (partsRaw) {
|
|
113096
|
-
let partsSplit = partsRaw.split(/[ ,]+/);
|
|
113097
|
-
partsSplit.forEach(p => {
|
|
113098
|
-
if (0 < p.length && parts.indexOf(p) < 0) {
|
|
113099
|
-
parts.push(p);
|
|
113100
|
-
}
|
|
113101
|
-
});
|
|
113102
|
-
}
|
|
113103
|
-
}
|
|
113100
|
+
const info = resp.usedSymbols[symbol];
|
|
113101
|
+
parseParts(info === null || info === void 0 ? void 0 : info.attributes.parts, parts);
|
|
113102
|
+
parseParts(info === null || info === void 0 ? void 0 : info.attributes.hiddenParts, hiddenParts);
|
|
113104
113103
|
});
|
|
113105
113104
|
if (filter) {
|
|
113106
113105
|
const builtinParts = pxt.appTarget.simulator.boardDefinition.onboardComponents;
|
|
@@ -113113,6 +113112,8 @@ var ts;
|
|
|
113113
113112
|
}
|
|
113114
113113
|
}
|
|
113115
113114
|
}
|
|
113115
|
+
// apply hidden parts filter
|
|
113116
|
+
parts = parts.filter(p => hiddenParts.indexOf(p) < 0);
|
|
113116
113117
|
//sort parts (so breadboarding layout is stable w.r.t. code ordering)
|
|
113117
113118
|
parts.sort();
|
|
113118
113119
|
parts = parts.reverse(); //not strictly necessary, but it's a little
|
|
@@ -130915,10 +130916,15 @@ var ts;
|
|
|
130915
130916
|
if (pxtc.target.isNative)
|
|
130916
130917
|
bin.procs = bin.procs.filter(p => p.inlineBody && !p.info.usedAsIface && !p.info.usedAsValue ? false : true);
|
|
130917
130918
|
if (opts.target.isNative) {
|
|
130918
|
-
|
|
130919
|
-
|
|
130920
|
-
|
|
130921
|
-
|
|
130919
|
+
// collect various output files from all variants
|
|
130920
|
+
[...(opts.otherMultiVariants || []), opts].forEach(({ extinfo }) => {
|
|
130921
|
+
if (extinfo.yotta)
|
|
130922
|
+
bin.writeFile("yotta.json", JSON.stringify(extinfo.yotta, null, 2));
|
|
130923
|
+
if (extinfo.codal)
|
|
130924
|
+
bin.writeFile("codal.json", JSON.stringify(extinfo.codal, null, 2));
|
|
130925
|
+
if (extinfo.platformio)
|
|
130926
|
+
bin.writeFile("platformio.json", JSON.stringify(extinfo.platformio, null, 2));
|
|
130927
|
+
});
|
|
130922
130928
|
if (opts.target.nativeType == pxtc.NATIVE_TYPE_VM)
|
|
130923
130929
|
pxtc.vmEmit(bin, opts);
|
|
130924
130930
|
else
|
|
@@ -138730,7 +138736,6 @@ var ts;
|
|
|
138730
138736
|
// don't export, fuse is internal only
|
|
138731
138737
|
let lastFuse;
|
|
138732
138738
|
let lastProjectFuse;
|
|
138733
|
-
let lastExtensionFuse;
|
|
138734
138739
|
function fileDiags(fn) {
|
|
138735
138740
|
if (!/\.ts$/.test(fn))
|
|
138736
138741
|
return [];
|
|
@@ -139151,26 +139156,6 @@ var ts;
|
|
|
139151
139156
|
const fns = lastFuse.search(search.term);
|
|
139152
139157
|
return fns.slice(0, SEARCH_RESULT_COUNT);
|
|
139153
139158
|
},
|
|
139154
|
-
extensionSearch: v => {
|
|
139155
|
-
const extensions = v.extensions.srcs;
|
|
139156
|
-
const searchFor = v.search.term;
|
|
139157
|
-
const fuseOptions = {
|
|
139158
|
-
shouldSort: true,
|
|
139159
|
-
threshold: 0.6,
|
|
139160
|
-
location: 0,
|
|
139161
|
-
distance: 100,
|
|
139162
|
-
maxPatternLength: 16,
|
|
139163
|
-
minMatchCharLength: 2,
|
|
139164
|
-
findAllMatches: false,
|
|
139165
|
-
caseSensitive: false,
|
|
139166
|
-
keys: [
|
|
139167
|
-
{ name: 'name', weight: 1 }
|
|
139168
|
-
]
|
|
139169
|
-
};
|
|
139170
|
-
lastExtensionFuse = new Fuse(extensions, fuseOptions);
|
|
139171
|
-
const found = lastExtensionFuse.search(searchFor);
|
|
139172
|
-
return found;
|
|
139173
|
-
},
|
|
139174
139159
|
projectSearch: v => {
|
|
139175
139160
|
const search = v.projectSearch;
|
|
139176
139161
|
const searchSet = search.headers;
|
|
@@ -141480,9 +141465,27 @@ var pxt;
|
|
|
141480
141465
|
unifyTypeOf(n.target, tpNumber);
|
|
141481
141466
|
let start = r.args.length == 1 ? B.mkText("0") : expr(r.args[0]);
|
|
141482
141467
|
let stop = expr(r.args[r.args.length == 1 ? 0 : 1]);
|
|
141483
|
-
|
|
141484
|
-
B.mkInfix(ref, "
|
|
141485
|
-
|
|
141468
|
+
if (r.args.length <= 2) {
|
|
141469
|
+
return B.mkStmt(B.mkText("for ("), B.mkInfix(def, "=", start), B.mkText("; "), B.mkInfix(ref, "<", stop), B.mkText("; "), B.mkPostfix([ref], "++"), B.mkText(")"), stmts(n.body));
|
|
141470
|
+
}
|
|
141471
|
+
// If there are three range arguments, the comparator we need to use
|
|
141472
|
+
// will either be > or < depending on the sign of the third argument.
|
|
141473
|
+
let numValue = r.args[2].kind === "Num" ? r.args[2].n : undefined;
|
|
141474
|
+
if (numValue == undefined && r.args[2].kind === "UnaryOp") {
|
|
141475
|
+
const uOp = r.args[2];
|
|
141476
|
+
if (uOp.operand.kind === "Num") {
|
|
141477
|
+
if (uOp.op === "UAdd")
|
|
141478
|
+
numValue = uOp.operand.n;
|
|
141479
|
+
else if (uOp.op === "USub")
|
|
141480
|
+
numValue = -uOp.operand.n;
|
|
141481
|
+
}
|
|
141482
|
+
}
|
|
141483
|
+
// If the third argument is not a number, we can't know the sign so we
|
|
141484
|
+
// have to emit a for-of loop instead
|
|
141485
|
+
if (numValue !== undefined) {
|
|
141486
|
+
const comparator = numValue > 0 ? "<" : ">";
|
|
141487
|
+
return B.mkStmt(B.mkText("for ("), B.mkInfix(def, "=", start), B.mkText("; "), B.mkInfix(ref, comparator, stop), B.mkText("; "), B.mkInfix(ref, "+=", expr(r.args[2])), B.mkText(")"), stmts(n.body));
|
|
141488
|
+
}
|
|
141486
141489
|
}
|
|
141487
141490
|
if (currIteration > 1) {
|
|
141488
141491
|
const typeOfTarget = typeOf(n.target);
|
package/built/pxtcompiler.d.ts
CHANGED
|
@@ -985,7 +985,6 @@ declare namespace ts.pxtc.service {
|
|
|
985
985
|
snippet: (v: OpArg) => string;
|
|
986
986
|
blocksInfo: (v: OpArg) => BlocksInfo;
|
|
987
987
|
apiSearch: (v: OpArg) => SearchInfo[];
|
|
988
|
-
extensionSearch: (v: OpArg) => ExtensionMeta[];
|
|
989
988
|
projectSearch: (v: OpArg) => ProjectSearchInfo[];
|
|
990
989
|
projectSearchClear: () => void;
|
|
991
990
|
}
|
package/built/pxtcompiler.js
CHANGED
|
@@ -9862,10 +9862,15 @@ var ts;
|
|
|
9862
9862
|
if (pxtc.target.isNative)
|
|
9863
9863
|
bin.procs = bin.procs.filter(p => p.inlineBody && !p.info.usedAsIface && !p.info.usedAsValue ? false : true);
|
|
9864
9864
|
if (opts.target.isNative) {
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9865
|
+
// collect various output files from all variants
|
|
9866
|
+
[...(opts.otherMultiVariants || []), opts].forEach(({ extinfo }) => {
|
|
9867
|
+
if (extinfo.yotta)
|
|
9868
|
+
bin.writeFile("yotta.json", JSON.stringify(extinfo.yotta, null, 2));
|
|
9869
|
+
if (extinfo.codal)
|
|
9870
|
+
bin.writeFile("codal.json", JSON.stringify(extinfo.codal, null, 2));
|
|
9871
|
+
if (extinfo.platformio)
|
|
9872
|
+
bin.writeFile("platformio.json", JSON.stringify(extinfo.platformio, null, 2));
|
|
9873
|
+
});
|
|
9869
9874
|
if (opts.target.nativeType == pxtc.NATIVE_TYPE_VM)
|
|
9870
9875
|
pxtc.vmEmit(bin, opts);
|
|
9871
9876
|
else
|
|
@@ -17677,7 +17682,6 @@ var ts;
|
|
|
17677
17682
|
// don't export, fuse is internal only
|
|
17678
17683
|
let lastFuse;
|
|
17679
17684
|
let lastProjectFuse;
|
|
17680
|
-
let lastExtensionFuse;
|
|
17681
17685
|
function fileDiags(fn) {
|
|
17682
17686
|
if (!/\.ts$/.test(fn))
|
|
17683
17687
|
return [];
|
|
@@ -18098,26 +18102,6 @@ var ts;
|
|
|
18098
18102
|
const fns = lastFuse.search(search.term);
|
|
18099
18103
|
return fns.slice(0, SEARCH_RESULT_COUNT);
|
|
18100
18104
|
},
|
|
18101
|
-
extensionSearch: v => {
|
|
18102
|
-
const extensions = v.extensions.srcs;
|
|
18103
|
-
const searchFor = v.search.term;
|
|
18104
|
-
const fuseOptions = {
|
|
18105
|
-
shouldSort: true,
|
|
18106
|
-
threshold: 0.6,
|
|
18107
|
-
location: 0,
|
|
18108
|
-
distance: 100,
|
|
18109
|
-
maxPatternLength: 16,
|
|
18110
|
-
minMatchCharLength: 2,
|
|
18111
|
-
findAllMatches: false,
|
|
18112
|
-
caseSensitive: false,
|
|
18113
|
-
keys: [
|
|
18114
|
-
{ name: 'name', weight: 1 }
|
|
18115
|
-
]
|
|
18116
|
-
};
|
|
18117
|
-
lastExtensionFuse = new Fuse(extensions, fuseOptions);
|
|
18118
|
-
const found = lastExtensionFuse.search(searchFor);
|
|
18119
|
-
return found;
|
|
18120
|
-
},
|
|
18121
18105
|
projectSearch: v => {
|
|
18122
18106
|
const search = v.projectSearch;
|
|
18123
18107
|
const searchSet = search.headers;
|
package/built/pxtlib.js
CHANGED
|
@@ -6813,6 +6813,7 @@ var pxt;
|
|
|
6813
6813
|
});
|
|
6814
6814
|
res.generatedFiles["/codal.json"] = JSON.stringify(codalJson, null, 4) + "\n";
|
|
6815
6815
|
pxt.debug(`codal.json: ${res.generatedFiles["/codal.json"]}`);
|
|
6816
|
+
res.codal = codalJson;
|
|
6816
6817
|
}
|
|
6817
6818
|
else if (isPlatformio) {
|
|
6818
6819
|
const iniLines = compileService.platformioIni.slice();
|
|
@@ -15401,20 +15402,18 @@ var ts;
|
|
|
15401
15402
|
function computeUsedParts(resp, filter) {
|
|
15402
15403
|
if (!resp.usedSymbols || !pxt.appTarget.simulator || !pxt.appTarget.simulator.parts)
|
|
15403
15404
|
return [];
|
|
15405
|
+
const parseParts = (partsRaw, ps) => {
|
|
15406
|
+
if (partsRaw) {
|
|
15407
|
+
const partsSplit = partsRaw.split(/[ ,]+/g);
|
|
15408
|
+
ps.push(...partsSplit.filter(p => !!p && ps.indexOf(p) < 0));
|
|
15409
|
+
}
|
|
15410
|
+
};
|
|
15404
15411
|
let parts = [];
|
|
15412
|
+
let hiddenParts = [];
|
|
15405
15413
|
Object.keys(resp.usedSymbols).forEach(symbol => {
|
|
15406
|
-
|
|
15407
|
-
|
|
15408
|
-
|
|
15409
|
-
if (partsRaw) {
|
|
15410
|
-
let partsSplit = partsRaw.split(/[ ,]+/);
|
|
15411
|
-
partsSplit.forEach(p => {
|
|
15412
|
-
if (0 < p.length && parts.indexOf(p) < 0) {
|
|
15413
|
-
parts.push(p);
|
|
15414
|
-
}
|
|
15415
|
-
});
|
|
15416
|
-
}
|
|
15417
|
-
}
|
|
15414
|
+
const info = resp.usedSymbols[symbol];
|
|
15415
|
+
parseParts(info === null || info === void 0 ? void 0 : info.attributes.parts, parts);
|
|
15416
|
+
parseParts(info === null || info === void 0 ? void 0 : info.attributes.hiddenParts, hiddenParts);
|
|
15418
15417
|
});
|
|
15419
15418
|
if (filter) {
|
|
15420
15419
|
const builtinParts = pxt.appTarget.simulator.boardDefinition.onboardComponents;
|
|
@@ -15427,6 +15426,8 @@ var ts;
|
|
|
15427
15426
|
}
|
|
15428
15427
|
}
|
|
15429
15428
|
}
|
|
15429
|
+
// apply hidden parts filter
|
|
15430
|
+
parts = parts.filter(p => hiddenParts.indexOf(p) < 0);
|
|
15430
15431
|
//sort parts (so breadboarding layout is stable w.r.t. code ordering)
|
|
15431
15432
|
parts.sort();
|
|
15432
15433
|
parts = parts.reverse(); //not strictly necessary, but it's a little
|
package/built/pxtpy.js
CHANGED
|
@@ -1231,9 +1231,27 @@ var pxt;
|
|
|
1231
1231
|
unifyTypeOf(n.target, tpNumber);
|
|
1232
1232
|
let start = r.args.length == 1 ? B.mkText("0") : expr(r.args[0]);
|
|
1233
1233
|
let stop = expr(r.args[r.args.length == 1 ? 0 : 1]);
|
|
1234
|
-
|
|
1235
|
-
B.mkInfix(ref, "
|
|
1236
|
-
|
|
1234
|
+
if (r.args.length <= 2) {
|
|
1235
|
+
return B.mkStmt(B.mkText("for ("), B.mkInfix(def, "=", start), B.mkText("; "), B.mkInfix(ref, "<", stop), B.mkText("; "), B.mkPostfix([ref], "++"), B.mkText(")"), stmts(n.body));
|
|
1236
|
+
}
|
|
1237
|
+
// If there are three range arguments, the comparator we need to use
|
|
1238
|
+
// will either be > or < depending on the sign of the third argument.
|
|
1239
|
+
let numValue = r.args[2].kind === "Num" ? r.args[2].n : undefined;
|
|
1240
|
+
if (numValue == undefined && r.args[2].kind === "UnaryOp") {
|
|
1241
|
+
const uOp = r.args[2];
|
|
1242
|
+
if (uOp.operand.kind === "Num") {
|
|
1243
|
+
if (uOp.op === "UAdd")
|
|
1244
|
+
numValue = uOp.operand.n;
|
|
1245
|
+
else if (uOp.op === "USub")
|
|
1246
|
+
numValue = -uOp.operand.n;
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
// If the third argument is not a number, we can't know the sign so we
|
|
1250
|
+
// have to emit a for-of loop instead
|
|
1251
|
+
if (numValue !== undefined) {
|
|
1252
|
+
const comparator = numValue > 0 ? "<" : ">";
|
|
1253
|
+
return B.mkStmt(B.mkText("for ("), B.mkInfix(def, "=", start), B.mkText("; "), B.mkInfix(ref, comparator, stop), B.mkText("; "), B.mkInfix(ref, "+=", expr(r.args[2])), B.mkText(")"), stmts(n.body));
|
|
1254
|
+
}
|
|
1237
1255
|
}
|
|
1238
1256
|
if (currIteration > 1) {
|
|
1239
1257
|
const typeOfTarget = typeOf(n.target);
|