pxt-core 13.1.23 → 13.1.25
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/cli.js +2 -2
- package/built/pxt.js +18 -7
- package/built/pxtlib.js +16 -5
- package/built/target.js +1 -1
- package/built/targetlight.js +1 -1
- package/built/web/main.js +30 -30
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxtasseteditor.js +1 -1
- package/built/web/pxtembed.js +1 -1
- package/built/web/pxtlib.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/localtypings/pxtarget.d.ts +1 -0
- package/package.json +1 -1
- package/theme/common.less +1 -1
- package/theme/tutorial-sidebar.less +156 -2
package/built/cli.js
CHANGED
|
@@ -1859,8 +1859,8 @@ function saveThemeJson(cfg, localDir, packaged) {
|
|
|
1859
1859
|
const url = card.url || card.learnMoreUrl || card.buyUrl || (card.youTubeId && `https://youtu.be/${card.youTubeId}`);
|
|
1860
1860
|
tocmd += ` * [${card.name || card.title}](${url})
|
|
1861
1861
|
`;
|
|
1862
|
-
|
|
1863
|
-
|
|
1862
|
+
for (const term of (card.tags || []).concat(card.searchTerms || []))
|
|
1863
|
+
targetStrings[term] = term;
|
|
1864
1864
|
}));
|
|
1865
1865
|
});
|
|
1866
1866
|
nodeutil.writeFileSync(path.join(docsRoot, "docs/projects/SUMMARY.md"), tocmd, { encoding: "utf8" });
|
package/built/pxt.js
CHANGED
|
@@ -108094,7 +108094,7 @@ var pxt;
|
|
|
108094
108094
|
if (cards && !Array.isArray(cards))
|
|
108095
108095
|
cards = [cards];
|
|
108096
108096
|
if (cards === null || cards === void 0 ? void 0 : cards.length)
|
|
108097
|
-
return cards;
|
|
108097
|
+
return cards.map(normalizeCodeCardStringArrays);
|
|
108098
108098
|
// not json, try parsing as sequence of key,value pairs, with line splits
|
|
108099
108099
|
cards = md.split(/^---$/gm)
|
|
108100
108100
|
.filter(cmd => !!cmd)
|
|
@@ -108120,7 +108120,7 @@ var pxt;
|
|
|
108120
108120
|
})
|
|
108121
108121
|
.filter(cc => !!cc);
|
|
108122
108122
|
if (cards === null || cards === void 0 ? void 0 : cards.length)
|
|
108123
|
-
return cards;
|
|
108123
|
+
return cards.map(normalizeCodeCardStringArrays);
|
|
108124
108124
|
return undefined;
|
|
108125
108125
|
}
|
|
108126
108126
|
gallery_1.parseCodeCards = parseCodeCards;
|
|
@@ -108161,9 +108161,18 @@ var pxt;
|
|
|
108161
108161
|
// legacy JSON format
|
|
108162
108162
|
cards = pxt.Util.jsonTryParse(el.textContent);
|
|
108163
108163
|
}
|
|
108164
|
-
return !!(cards === null || cards === void 0 ? void 0 : cards.length) && cards;
|
|
108164
|
+
return !!(cards === null || cards === void 0 ? void 0 : cards.length) && cards.map(normalizeCodeCardStringArrays);
|
|
108165
108165
|
}
|
|
108166
108166
|
gallery_1.parseCodeCardsHtml = parseCodeCardsHtml;
|
|
108167
|
+
function normalizeCodeCardStringArrays(card) {
|
|
108168
|
+
["tags", "searchTerms"].forEach(field => {
|
|
108169
|
+
const value = card[field];
|
|
108170
|
+
if (typeof value === "string") {
|
|
108171
|
+
card[field] = value.split(',').map(term => term.trim()).filter(term => !!term);
|
|
108172
|
+
}
|
|
108173
|
+
});
|
|
108174
|
+
return card;
|
|
108175
|
+
}
|
|
108167
108176
|
function parseGalleryMardown(md) {
|
|
108168
108177
|
if (!md)
|
|
108169
108178
|
return [];
|
|
@@ -120752,7 +120761,7 @@ ${code}
|
|
|
120752
120761
|
const validationConfig = parseTutorialValidationConfig("local", step);
|
|
120753
120762
|
// if title is not hidden ("{TITLE HERE}"), strip flags
|
|
120754
120763
|
const title = !flags.match(/^\{.*\}$/)
|
|
120755
|
-
? flags.replace(/@(fullscreen|unplugged|showdialog|showhint|tutorialCompleted|resetDiff)/gi, "").trim()
|
|
120764
|
+
? flags.replace(/@(simFullscreen|fullscreen|unplugged|showdialog|showhint|tutorialCompleted|resetDiff)\b/gi, "").trim()
|
|
120756
120765
|
: undefined;
|
|
120757
120766
|
let info = {
|
|
120758
120767
|
title,
|
|
@@ -120761,10 +120770,12 @@ ${code}
|
|
|
120761
120770
|
localBlockConfig: blockConfig,
|
|
120762
120771
|
localValidationConfig: validationConfig
|
|
120763
120772
|
};
|
|
120764
|
-
if (/@(fullscreen|unplugged|showdialog|showhint)/i.test(flags))
|
|
120773
|
+
if (/@(fullscreen|unplugged|showdialog|showhint)\b/i.test(flags))
|
|
120765
120774
|
info.showHint = true;
|
|
120766
120775
|
if (/@(unplugged|showdialog)/i.test(flags))
|
|
120767
120776
|
info.showDialog = true;
|
|
120777
|
+
if (/@simFullscreen\b/i.test(flags))
|
|
120778
|
+
info.simFullscreen = true;
|
|
120768
120779
|
if (/@tutorialCompleted/.test(flags))
|
|
120769
120780
|
info.tutorialCompleted = true;
|
|
120770
120781
|
if (/@resetDiff/.test(flags))
|
|
@@ -166141,8 +166152,8 @@ function saveThemeJson(cfg, localDir, packaged) {
|
|
|
166141
166152
|
const url = card.url || card.learnMoreUrl || card.buyUrl || (card.youTubeId && `https://youtu.be/${card.youTubeId}`);
|
|
166142
166153
|
tocmd += ` * [${card.name || card.title}](${url})
|
|
166143
166154
|
`;
|
|
166144
|
-
|
|
166145
|
-
|
|
166155
|
+
for (const term of (card.tags || []).concat(card.searchTerms || []))
|
|
166156
|
+
targetStrings[term] = term;
|
|
166146
166157
|
}));
|
|
166147
166158
|
});
|
|
166148
166159
|
nodeutil.writeFileSync(path.join(docsRoot, "docs/projects/SUMMARY.md"), tocmd, { encoding: "utf8" });
|
package/built/pxtlib.js
CHANGED
|
@@ -10373,7 +10373,7 @@ var pxt;
|
|
|
10373
10373
|
if (cards && !Array.isArray(cards))
|
|
10374
10374
|
cards = [cards];
|
|
10375
10375
|
if (cards === null || cards === void 0 ? void 0 : cards.length)
|
|
10376
|
-
return cards;
|
|
10376
|
+
return cards.map(normalizeCodeCardStringArrays);
|
|
10377
10377
|
// not json, try parsing as sequence of key,value pairs, with line splits
|
|
10378
10378
|
cards = md.split(/^---$/gm)
|
|
10379
10379
|
.filter(cmd => !!cmd)
|
|
@@ -10399,7 +10399,7 @@ var pxt;
|
|
|
10399
10399
|
})
|
|
10400
10400
|
.filter(cc => !!cc);
|
|
10401
10401
|
if (cards === null || cards === void 0 ? void 0 : cards.length)
|
|
10402
|
-
return cards;
|
|
10402
|
+
return cards.map(normalizeCodeCardStringArrays);
|
|
10403
10403
|
return undefined;
|
|
10404
10404
|
}
|
|
10405
10405
|
gallery_1.parseCodeCards = parseCodeCards;
|
|
@@ -10440,9 +10440,18 @@ var pxt;
|
|
|
10440
10440
|
// legacy JSON format
|
|
10441
10441
|
cards = pxt.Util.jsonTryParse(el.textContent);
|
|
10442
10442
|
}
|
|
10443
|
-
return !!(cards === null || cards === void 0 ? void 0 : cards.length) && cards;
|
|
10443
|
+
return !!(cards === null || cards === void 0 ? void 0 : cards.length) && cards.map(normalizeCodeCardStringArrays);
|
|
10444
10444
|
}
|
|
10445
10445
|
gallery_1.parseCodeCardsHtml = parseCodeCardsHtml;
|
|
10446
|
+
function normalizeCodeCardStringArrays(card) {
|
|
10447
|
+
["tags", "searchTerms"].forEach(field => {
|
|
10448
|
+
const value = card[field];
|
|
10449
|
+
if (typeof value === "string") {
|
|
10450
|
+
card[field] = value.split(',').map(term => term.trim()).filter(term => !!term);
|
|
10451
|
+
}
|
|
10452
|
+
});
|
|
10453
|
+
return card;
|
|
10454
|
+
}
|
|
10446
10455
|
function parseGalleryMardown(md) {
|
|
10447
10456
|
if (!md)
|
|
10448
10457
|
return [];
|
|
@@ -23031,7 +23040,7 @@ ${code}
|
|
|
23031
23040
|
const validationConfig = parseTutorialValidationConfig("local", step);
|
|
23032
23041
|
// if title is not hidden ("{TITLE HERE}"), strip flags
|
|
23033
23042
|
const title = !flags.match(/^\{.*\}$/)
|
|
23034
|
-
? flags.replace(/@(fullscreen|unplugged|showdialog|showhint|tutorialCompleted|resetDiff)/gi, "").trim()
|
|
23043
|
+
? flags.replace(/@(simFullscreen|fullscreen|unplugged|showdialog|showhint|tutorialCompleted|resetDiff)\b/gi, "").trim()
|
|
23035
23044
|
: undefined;
|
|
23036
23045
|
let info = {
|
|
23037
23046
|
title,
|
|
@@ -23040,10 +23049,12 @@ ${code}
|
|
|
23040
23049
|
localBlockConfig: blockConfig,
|
|
23041
23050
|
localValidationConfig: validationConfig
|
|
23042
23051
|
};
|
|
23043
|
-
if (/@(fullscreen|unplugged|showdialog|showhint)/i.test(flags))
|
|
23052
|
+
if (/@(fullscreen|unplugged|showdialog|showhint)\b/i.test(flags))
|
|
23044
23053
|
info.showHint = true;
|
|
23045
23054
|
if (/@(unplugged|showdialog)/i.test(flags))
|
|
23046
23055
|
info.showDialog = true;
|
|
23056
|
+
if (/@simFullscreen\b/i.test(flags))
|
|
23057
|
+
info.simFullscreen = true;
|
|
23047
23058
|
if (/@tutorialCompleted/.test(flags))
|
|
23048
23059
|
info.tutorialCompleted = true;
|
|
23049
23060
|
if (/@resetDiff/.test(flags))
|