pxt-core 8.6.18 → 8.6.20
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 +49 -7
- package/built/pxtblockly.js +2 -2
- package/built/pxtblocks.js +2 -2
- package/built/pxteditor.d.ts +1 -0
- package/built/pxtlib.d.ts +3 -0
- package/built/pxtlib.js +48 -7
- package/built/pxtrunner.js +2 -0
- package/built/pxtsim.d.ts +2 -0
- package/built/pxtsim.js +1 -0
- package/built/target.js +1 -1
- package/built/web/main.js +1 -1
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxtblockly.js +1 -1
- package/built/web/pxtblocks.js +1 -1
- package/built/web/pxtembed.js +2 -2
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtrunner.js +1 -1
- package/built/web/pxtsim.js +1 -1
- package/built/web/pxtworker.js +2 -2
- package/built/web/react-common-authcode.css +1 -1
- package/built/web/react-common-multiplayer.css +1 -1
- package/built/web/react-common-skillmap.css +1 -1
- package/built/web/rtlreact-common-authcode.css +1 -1
- package/built/web/rtlreact-common-multiplayer.css +1 -1
- package/built/web/rtlreact-common-skillmap.css +1 -1
- package/built/web/rtlsemantic.css +2 -2
- package/built/web/semantic.css +2 -2
- package/built/web/skillmap/css/main.33813779.css +1 -0
- package/built/web/skillmap/js/{main.7f57af89.js → main.ec9edc3c.js} +2 -2
- package/localtypings/pxtarget.d.ts +2 -0
- package/localtypings/pxtpackage.d.ts +1 -0
- package/package.json +1 -1
- package/react-common/components/animations/Confetti.tsx +20 -0
- package/react-common/components/controls/TeachingBubble.tsx +58 -11
- package/react-common/styles/animations/Confetti.less +49 -0
- package/react-common/styles/controls/Button.less +11 -0
- package/react-common/styles/onboarding/TeachingBubble.less +57 -15
- package/react-common/styles/react-common.less +1 -0
- package/theme/highcontrast.less +14 -0
- package/theme/themes/pxt/globals/site.variables +1 -1
- package/theme/tutorial-sidebar.less +25 -3
- package/webapp/public/skillmap.html +1 -1
- package/built/web/skillmap/css/main.06a18ee8.css +0 -1
package/built/pxt.js
CHANGED
|
@@ -107220,6 +107220,14 @@ var pxt;
|
|
|
107220
107220
|
return {};
|
|
107221
107221
|
}
|
|
107222
107222
|
gallery_1.parseTemplateProjectJSON = parseTemplateProjectJSON;
|
|
107223
|
+
function parseSimThemeJSON(md) {
|
|
107224
|
+
const pm = /```simtheme\s+([\s\S]*?)```/i.exec(md);
|
|
107225
|
+
if (pm) {
|
|
107226
|
+
return pxt.tutorial.parseSimThemeJson(pm[1]);
|
|
107227
|
+
}
|
|
107228
|
+
return {};
|
|
107229
|
+
}
|
|
107230
|
+
gallery_1.parseSimThemeJSON = parseSimThemeJSON;
|
|
107223
107231
|
function parseExampleMarkdown(name, md) {
|
|
107224
107232
|
if (!md)
|
|
107225
107233
|
return undefined;
|
|
@@ -107231,6 +107239,7 @@ var pxt;
|
|
|
107231
107239
|
const source = m[2];
|
|
107232
107240
|
const features = parseFeaturesFromMarkdown(md);
|
|
107233
107241
|
const jres = parseJResFromMarkdown(md);
|
|
107242
|
+
const simTheme = parseSimThemeJSON(md);
|
|
107234
107243
|
const prj = {
|
|
107235
107244
|
name,
|
|
107236
107245
|
filesOverride: {
|
|
@@ -107240,7 +107249,8 @@ var pxt;
|
|
|
107240
107249
|
dependencies,
|
|
107241
107250
|
features,
|
|
107242
107251
|
snippetType,
|
|
107243
|
-
source
|
|
107252
|
+
source,
|
|
107253
|
+
simTheme
|
|
107244
107254
|
};
|
|
107245
107255
|
prj.filesOverride = Object.assign(Object.assign({}, prj.filesOverride), parseTemplateProjectJSON(md));
|
|
107246
107256
|
if (jres) {
|
|
@@ -118612,7 +118622,7 @@ var pxt;
|
|
|
118612
118622
|
if (!steps)
|
|
118613
118623
|
return undefined; // error parsing steps
|
|
118614
118624
|
// collect code and infer editor
|
|
118615
|
-
const { code, templateCode, editor, language, jres, assetJson, customTs, tutorialValidationRulesStr } = computeBodyMetadata(body);
|
|
118625
|
+
const { code, templateCode, editor, language, jres, assetJson, customTs, tutorialValidationRulesStr, simThemeJson } = computeBodyMetadata(body);
|
|
118616
118626
|
// parses tutorial rules string into a map of rules and enablement flag
|
|
118617
118627
|
let tutorialValidationRules;
|
|
118618
118628
|
if (metadata.tutorialCodeValidation) {
|
|
@@ -118628,6 +118638,7 @@ var pxt;
|
|
|
118628
118638
|
diffify(steps, activities);
|
|
118629
118639
|
}
|
|
118630
118640
|
const assetFiles = parseAssetJson(assetJson);
|
|
118641
|
+
const simTheme = parseSimThemeJson(simThemeJson);
|
|
118631
118642
|
const globalBlockConfig = parseTutorialBlockConfig("global", tutorialmd);
|
|
118632
118643
|
const globalValidationConfig = parseTutorialValidationConfig("global", tutorialmd);
|
|
118633
118644
|
// strip hidden snippets
|
|
@@ -118651,12 +118662,13 @@ var pxt;
|
|
|
118651
118662
|
customTs,
|
|
118652
118663
|
tutorialValidationRules,
|
|
118653
118664
|
globalBlockConfig,
|
|
118654
|
-
globalValidationConfig
|
|
118665
|
+
globalValidationConfig,
|
|
118666
|
+
simTheme
|
|
118655
118667
|
};
|
|
118656
118668
|
}
|
|
118657
118669
|
tutorial.parseTutorial = parseTutorial;
|
|
118658
118670
|
function getMetadataRegex() {
|
|
118659
|
-
return /``` *(sim|block|blocks|filterblocks|spy|ghost|typescript|ts|js|javascript|template|python|jres|assetjson|customts|tutorialValidationRules|requiredTutorialBlock)\s*\n([\s\S]*?)\n```/gmi;
|
|
118671
|
+
return /``` *(sim|block|blocks|filterblocks|spy|ghost|typescript|ts|js|javascript|template|python|jres|assetjson|customts|tutorialValidationRules|requiredTutorialBlock|simtheme)\s*\n([\s\S]*?)\n```/gmi;
|
|
118660
118672
|
}
|
|
118661
118673
|
tutorial.getMetadataRegex = getMetadataRegex;
|
|
118662
118674
|
function computeBodyMetadata(body) {
|
|
@@ -118670,6 +118682,7 @@ var pxt;
|
|
|
118670
118682
|
let idx = 0;
|
|
118671
118683
|
let assetJson;
|
|
118672
118684
|
let customTs;
|
|
118685
|
+
let simThemeJson;
|
|
118673
118686
|
let tutorialValidationRulesStr;
|
|
118674
118687
|
// Concatenate all blocks in separate code blocks and decompile so we can detect what blocks are used (for the toolbox)
|
|
118675
118688
|
body
|
|
@@ -118708,6 +118721,9 @@ var pxt;
|
|
|
118708
118721
|
case "assetjson":
|
|
118709
118722
|
assetJson = m2;
|
|
118710
118723
|
break;
|
|
118724
|
+
case "simtheme":
|
|
118725
|
+
simThemeJson = m2;
|
|
118726
|
+
break;
|
|
118711
118727
|
case "customts":
|
|
118712
118728
|
customTs = m2;
|
|
118713
118729
|
m2 = "";
|
|
@@ -118722,7 +118738,17 @@ var pxt;
|
|
|
118722
118738
|
});
|
|
118723
118739
|
// default to blocks
|
|
118724
118740
|
editor = editor || pxt.BLOCKS_PROJECT_NAME;
|
|
118725
|
-
return {
|
|
118741
|
+
return {
|
|
118742
|
+
code,
|
|
118743
|
+
templateCode,
|
|
118744
|
+
editor,
|
|
118745
|
+
language,
|
|
118746
|
+
jres,
|
|
118747
|
+
assetJson,
|
|
118748
|
+
customTs,
|
|
118749
|
+
tutorialValidationRulesStr,
|
|
118750
|
+
simThemeJson
|
|
118751
|
+
};
|
|
118726
118752
|
function checkTutorialEditor(expected) {
|
|
118727
118753
|
if (editor && editor != expected) {
|
|
118728
118754
|
pxt.debug(`tutorial ambiguous: contains snippets of different types`);
|
|
@@ -118944,7 +118970,7 @@ ${code}
|
|
|
118944
118970
|
function stripHiddenSnippets(str) {
|
|
118945
118971
|
if (!str)
|
|
118946
118972
|
return str;
|
|
118947
|
-
const hiddenSnippetRegex = /```(filterblocks|package|ghost|config|template|jres|assetjson|customts|blockconfig\.local|blockconfig\.global|validation\.local|validation\.global)\s*\n([\s\S]*?)\n```/gmi;
|
|
118973
|
+
const hiddenSnippetRegex = /```(filterblocks|package|ghost|config|template|jres|assetjson|simtheme|customts|blockconfig\.local|blockconfig\.global|validation\.local|validation\.global)\s*\n([\s\S]*?)\n```/gmi;
|
|
118948
118974
|
return str.replace(hiddenSnippetRegex, '').trim();
|
|
118949
118975
|
}
|
|
118950
118976
|
/*
|
|
@@ -119028,7 +119054,8 @@ ${code}
|
|
|
119028
119054
|
customTs: tutorialInfo.customTs,
|
|
119029
119055
|
tutorialValidationRules: tutorialInfo.tutorialValidationRules,
|
|
119030
119056
|
globalBlockConfig: tutorialInfo.globalBlockConfig,
|
|
119031
|
-
globalValidationConfig: tutorialInfo.globalValidationConfig
|
|
119057
|
+
globalValidationConfig: tutorialInfo.globalValidationConfig,
|
|
119058
|
+
simTheme: tutorialInfo.simTheme,
|
|
119032
119059
|
};
|
|
119033
119060
|
return { options: tutorialOptions, editor: tutorialInfo.editor };
|
|
119034
119061
|
}
|
|
@@ -119085,6 +119112,20 @@ ${code}
|
|
|
119085
119112
|
};
|
|
119086
119113
|
}
|
|
119087
119114
|
tutorial.parseAssetJson = parseAssetJson;
|
|
119115
|
+
function parseSimThemeJson(json) {
|
|
119116
|
+
const pxtJson = pxt.Util.jsonTryParse(json);
|
|
119117
|
+
if (!pxtJson)
|
|
119118
|
+
return undefined;
|
|
119119
|
+
const res = {};
|
|
119120
|
+
if (pxtJson.theme) {
|
|
119121
|
+
res.theme = pxtJson.theme;
|
|
119122
|
+
}
|
|
119123
|
+
if (pxtJson.palette) {
|
|
119124
|
+
res.palette = pxtJson.palette;
|
|
119125
|
+
}
|
|
119126
|
+
return res;
|
|
119127
|
+
}
|
|
119128
|
+
tutorial.parseSimThemeJson = parseSimThemeJson;
|
|
119088
119129
|
})(tutorial = pxt.tutorial || (pxt.tutorial = {}));
|
|
119089
119130
|
})(pxt || (pxt = {}));
|
|
119090
119131
|
var pxt;
|
|
@@ -155512,6 +155553,7 @@ var pxsim;
|
|
|
155512
155553
|
single: opts.single,
|
|
155513
155554
|
dependencies: opts.dependencies,
|
|
155514
155555
|
activePlayer: opts.activePlayer,
|
|
155556
|
+
theme: opts.theme,
|
|
155515
155557
|
};
|
|
155516
155558
|
this.start();
|
|
155517
155559
|
}
|
package/built/pxtblockly.js
CHANGED
|
@@ -9123,7 +9123,7 @@ var pxt;
|
|
|
9123
9123
|
}
|
|
9124
9124
|
xmlList[xmlList.length - 1].setAttribute('gap', '24');
|
|
9125
9125
|
if (Blockly.Blocks['variables_change'] || Blockly.Blocks['variables_set']) {
|
|
9126
|
-
xmlList.unshift(createFlyoutGroupLabel("Your Variables"));
|
|
9126
|
+
xmlList.unshift(createFlyoutGroupLabel(lf("Your Variables")));
|
|
9127
9127
|
}
|
|
9128
9128
|
if (Blockly.Blocks['variables_change']) {
|
|
9129
9129
|
let gap = Blockly.Blocks['variables_get'] ? 20 : 8;
|
|
@@ -9560,7 +9560,7 @@ var pxt;
|
|
|
9560
9560
|
if (elems.length > 1) {
|
|
9561
9561
|
let returnBlock = mkReturnStatementBlock();
|
|
9562
9562
|
// Add divider
|
|
9563
|
-
elems.splice(1, 0, createFlyoutGroupLabel("Your Functions"));
|
|
9563
|
+
elems.splice(1, 0, createFlyoutGroupLabel(lf("Your Functions")));
|
|
9564
9564
|
// Insert after the "make a function" button
|
|
9565
9565
|
elems.splice(1, 0, returnBlock);
|
|
9566
9566
|
}
|
package/built/pxtblocks.js
CHANGED
|
@@ -5561,7 +5561,7 @@ var pxt;
|
|
|
5561
5561
|
}
|
|
5562
5562
|
xmlList[xmlList.length - 1].setAttribute('gap', '24');
|
|
5563
5563
|
if (Blockly.Blocks['variables_change'] || Blockly.Blocks['variables_set']) {
|
|
5564
|
-
xmlList.unshift(createFlyoutGroupLabel("Your Variables"));
|
|
5564
|
+
xmlList.unshift(createFlyoutGroupLabel(lf("Your Variables")));
|
|
5565
5565
|
}
|
|
5566
5566
|
if (Blockly.Blocks['variables_change']) {
|
|
5567
5567
|
let gap = Blockly.Blocks['variables_get'] ? 20 : 8;
|
|
@@ -5998,7 +5998,7 @@ var pxt;
|
|
|
5998
5998
|
if (elems.length > 1) {
|
|
5999
5999
|
let returnBlock = mkReturnStatementBlock();
|
|
6000
6000
|
// Add divider
|
|
6001
|
-
elems.splice(1, 0, createFlyoutGroupLabel("Your Functions"));
|
|
6001
|
+
elems.splice(1, 0, createFlyoutGroupLabel(lf("Your Functions")));
|
|
6002
6002
|
// Insert after the "make a function" button
|
|
6003
6003
|
elems.splice(1, 0, returnBlock);
|
|
6004
6004
|
}
|
package/built/pxteditor.d.ts
CHANGED
package/built/pxtlib.d.ts
CHANGED
|
@@ -1128,6 +1128,7 @@ declare namespace pxt.gallery {
|
|
|
1128
1128
|
filesOverride: pxt.Map<string>;
|
|
1129
1129
|
dependencies: pxt.Map<string>;
|
|
1130
1130
|
features?: string[];
|
|
1131
|
+
simTheme?: Partial<pxt.PackageConfig>;
|
|
1131
1132
|
}
|
|
1132
1133
|
function parsePackagesFromMarkdown(md: string): pxt.Map<string>;
|
|
1133
1134
|
function parseFeaturesFromMarkdown(md: string): string[];
|
|
@@ -1136,6 +1137,7 @@ declare namespace pxt.gallery {
|
|
|
1136
1137
|
ts: string;
|
|
1137
1138
|
};
|
|
1138
1139
|
function parseTemplateProjectJSON(md: string): pxt.Map<string>;
|
|
1140
|
+
function parseSimThemeJSON(md: string): Partial<pxt.PackageConfig>;
|
|
1139
1141
|
function parseExampleMarkdown(name: string, md: string): GalleryProject;
|
|
1140
1142
|
function parseCodeCards(md: string): pxt.CodeCard[];
|
|
1141
1143
|
function parseCodeCardsHtml(el: HTMLElement): CodeCard[];
|
|
@@ -2961,6 +2963,7 @@ declare namespace pxt.tutorial {
|
|
|
2961
2963
|
function parseCachedTutorialInfo(json: string, id?: string): Promise<void>;
|
|
2962
2964
|
function resolveLocalizedMarkdown(ghid: pxt.github.ParsedRepo, files: pxt.Map<string>, fileName?: string): string;
|
|
2963
2965
|
function parseAssetJson(json: string): pxt.Map<string>;
|
|
2966
|
+
function parseSimThemeJson(json: string): Partial<pxt.PackageConfig>;
|
|
2964
2967
|
}
|
|
2965
2968
|
declare namespace pxt.tutorial {
|
|
2966
2969
|
interface TutorialRuleStatus {
|
package/built/pxtlib.js
CHANGED
|
@@ -9534,6 +9534,14 @@ var pxt;
|
|
|
9534
9534
|
return {};
|
|
9535
9535
|
}
|
|
9536
9536
|
gallery_1.parseTemplateProjectJSON = parseTemplateProjectJSON;
|
|
9537
|
+
function parseSimThemeJSON(md) {
|
|
9538
|
+
const pm = /```simtheme\s+([\s\S]*?)```/i.exec(md);
|
|
9539
|
+
if (pm) {
|
|
9540
|
+
return pxt.tutorial.parseSimThemeJson(pm[1]);
|
|
9541
|
+
}
|
|
9542
|
+
return {};
|
|
9543
|
+
}
|
|
9544
|
+
gallery_1.parseSimThemeJSON = parseSimThemeJSON;
|
|
9537
9545
|
function parseExampleMarkdown(name, md) {
|
|
9538
9546
|
if (!md)
|
|
9539
9547
|
return undefined;
|
|
@@ -9545,6 +9553,7 @@ var pxt;
|
|
|
9545
9553
|
const source = m[2];
|
|
9546
9554
|
const features = parseFeaturesFromMarkdown(md);
|
|
9547
9555
|
const jres = parseJResFromMarkdown(md);
|
|
9556
|
+
const simTheme = parseSimThemeJSON(md);
|
|
9548
9557
|
const prj = {
|
|
9549
9558
|
name,
|
|
9550
9559
|
filesOverride: {
|
|
@@ -9554,7 +9563,8 @@ var pxt;
|
|
|
9554
9563
|
dependencies,
|
|
9555
9564
|
features,
|
|
9556
9565
|
snippetType,
|
|
9557
|
-
source
|
|
9566
|
+
source,
|
|
9567
|
+
simTheme
|
|
9558
9568
|
};
|
|
9559
9569
|
prj.filesOverride = Object.assign(Object.assign({}, prj.filesOverride), parseTemplateProjectJSON(md));
|
|
9560
9570
|
if (jres) {
|
|
@@ -20926,7 +20936,7 @@ var pxt;
|
|
|
20926
20936
|
if (!steps)
|
|
20927
20937
|
return undefined; // error parsing steps
|
|
20928
20938
|
// collect code and infer editor
|
|
20929
|
-
const { code, templateCode, editor, language, jres, assetJson, customTs, tutorialValidationRulesStr } = computeBodyMetadata(body);
|
|
20939
|
+
const { code, templateCode, editor, language, jres, assetJson, customTs, tutorialValidationRulesStr, simThemeJson } = computeBodyMetadata(body);
|
|
20930
20940
|
// parses tutorial rules string into a map of rules and enablement flag
|
|
20931
20941
|
let tutorialValidationRules;
|
|
20932
20942
|
if (metadata.tutorialCodeValidation) {
|
|
@@ -20942,6 +20952,7 @@ var pxt;
|
|
|
20942
20952
|
diffify(steps, activities);
|
|
20943
20953
|
}
|
|
20944
20954
|
const assetFiles = parseAssetJson(assetJson);
|
|
20955
|
+
const simTheme = parseSimThemeJson(simThemeJson);
|
|
20945
20956
|
const globalBlockConfig = parseTutorialBlockConfig("global", tutorialmd);
|
|
20946
20957
|
const globalValidationConfig = parseTutorialValidationConfig("global", tutorialmd);
|
|
20947
20958
|
// strip hidden snippets
|
|
@@ -20965,12 +20976,13 @@ var pxt;
|
|
|
20965
20976
|
customTs,
|
|
20966
20977
|
tutorialValidationRules,
|
|
20967
20978
|
globalBlockConfig,
|
|
20968
|
-
globalValidationConfig
|
|
20979
|
+
globalValidationConfig,
|
|
20980
|
+
simTheme
|
|
20969
20981
|
};
|
|
20970
20982
|
}
|
|
20971
20983
|
tutorial.parseTutorial = parseTutorial;
|
|
20972
20984
|
function getMetadataRegex() {
|
|
20973
|
-
return /``` *(sim|block|blocks|filterblocks|spy|ghost|typescript|ts|js|javascript|template|python|jres|assetjson|customts|tutorialValidationRules|requiredTutorialBlock)\s*\n([\s\S]*?)\n```/gmi;
|
|
20985
|
+
return /``` *(sim|block|blocks|filterblocks|spy|ghost|typescript|ts|js|javascript|template|python|jres|assetjson|customts|tutorialValidationRules|requiredTutorialBlock|simtheme)\s*\n([\s\S]*?)\n```/gmi;
|
|
20974
20986
|
}
|
|
20975
20987
|
tutorial.getMetadataRegex = getMetadataRegex;
|
|
20976
20988
|
function computeBodyMetadata(body) {
|
|
@@ -20984,6 +20996,7 @@ var pxt;
|
|
|
20984
20996
|
let idx = 0;
|
|
20985
20997
|
let assetJson;
|
|
20986
20998
|
let customTs;
|
|
20999
|
+
let simThemeJson;
|
|
20987
21000
|
let tutorialValidationRulesStr;
|
|
20988
21001
|
// Concatenate all blocks in separate code blocks and decompile so we can detect what blocks are used (for the toolbox)
|
|
20989
21002
|
body
|
|
@@ -21022,6 +21035,9 @@ var pxt;
|
|
|
21022
21035
|
case "assetjson":
|
|
21023
21036
|
assetJson = m2;
|
|
21024
21037
|
break;
|
|
21038
|
+
case "simtheme":
|
|
21039
|
+
simThemeJson = m2;
|
|
21040
|
+
break;
|
|
21025
21041
|
case "customts":
|
|
21026
21042
|
customTs = m2;
|
|
21027
21043
|
m2 = "";
|
|
@@ -21036,7 +21052,17 @@ var pxt;
|
|
|
21036
21052
|
});
|
|
21037
21053
|
// default to blocks
|
|
21038
21054
|
editor = editor || pxt.BLOCKS_PROJECT_NAME;
|
|
21039
|
-
return {
|
|
21055
|
+
return {
|
|
21056
|
+
code,
|
|
21057
|
+
templateCode,
|
|
21058
|
+
editor,
|
|
21059
|
+
language,
|
|
21060
|
+
jres,
|
|
21061
|
+
assetJson,
|
|
21062
|
+
customTs,
|
|
21063
|
+
tutorialValidationRulesStr,
|
|
21064
|
+
simThemeJson
|
|
21065
|
+
};
|
|
21040
21066
|
function checkTutorialEditor(expected) {
|
|
21041
21067
|
if (editor && editor != expected) {
|
|
21042
21068
|
pxt.debug(`tutorial ambiguous: contains snippets of different types`);
|
|
@@ -21258,7 +21284,7 @@ ${code}
|
|
|
21258
21284
|
function stripHiddenSnippets(str) {
|
|
21259
21285
|
if (!str)
|
|
21260
21286
|
return str;
|
|
21261
|
-
const hiddenSnippetRegex = /```(filterblocks|package|ghost|config|template|jres|assetjson|customts|blockconfig\.local|blockconfig\.global|validation\.local|validation\.global)\s*\n([\s\S]*?)\n```/gmi;
|
|
21287
|
+
const hiddenSnippetRegex = /```(filterblocks|package|ghost|config|template|jres|assetjson|simtheme|customts|blockconfig\.local|blockconfig\.global|validation\.local|validation\.global)\s*\n([\s\S]*?)\n```/gmi;
|
|
21262
21288
|
return str.replace(hiddenSnippetRegex, '').trim();
|
|
21263
21289
|
}
|
|
21264
21290
|
/*
|
|
@@ -21342,7 +21368,8 @@ ${code}
|
|
|
21342
21368
|
customTs: tutorialInfo.customTs,
|
|
21343
21369
|
tutorialValidationRules: tutorialInfo.tutorialValidationRules,
|
|
21344
21370
|
globalBlockConfig: tutorialInfo.globalBlockConfig,
|
|
21345
|
-
globalValidationConfig: tutorialInfo.globalValidationConfig
|
|
21371
|
+
globalValidationConfig: tutorialInfo.globalValidationConfig,
|
|
21372
|
+
simTheme: tutorialInfo.simTheme,
|
|
21346
21373
|
};
|
|
21347
21374
|
return { options: tutorialOptions, editor: tutorialInfo.editor };
|
|
21348
21375
|
}
|
|
@@ -21399,6 +21426,20 @@ ${code}
|
|
|
21399
21426
|
};
|
|
21400
21427
|
}
|
|
21401
21428
|
tutorial.parseAssetJson = parseAssetJson;
|
|
21429
|
+
function parseSimThemeJson(json) {
|
|
21430
|
+
const pxtJson = pxt.Util.jsonTryParse(json);
|
|
21431
|
+
if (!pxtJson)
|
|
21432
|
+
return undefined;
|
|
21433
|
+
const res = {};
|
|
21434
|
+
if (pxtJson.theme) {
|
|
21435
|
+
res.theme = pxtJson.theme;
|
|
21436
|
+
}
|
|
21437
|
+
if (pxtJson.palette) {
|
|
21438
|
+
res.palette = pxtJson.palette;
|
|
21439
|
+
}
|
|
21440
|
+
return res;
|
|
21441
|
+
}
|
|
21442
|
+
tutorial.parseSimThemeJson = parseSimThemeJson;
|
|
21402
21443
|
})(tutorial = pxt.tutorial || (pxt.tutorial = {}));
|
|
21403
21444
|
})(pxt || (pxt = {}));
|
|
21404
21445
|
var pxt;
|
package/built/pxtrunner.js
CHANGED
|
@@ -1764,6 +1764,7 @@ var pxt;
|
|
|
1764
1764
|
// iff matches and truthy, reuse existing simdriver
|
|
1765
1765
|
let currDriverId;
|
|
1766
1766
|
function initDriverAndOptions(container, simOptions, compileInfo) {
|
|
1767
|
+
var _a;
|
|
1767
1768
|
if (!simDriver || !simOptions.embedId || currDriverId !== simOptions.embedId) {
|
|
1768
1769
|
simDriver = new pxsim.SimulatorDriver(container);
|
|
1769
1770
|
currDriverId = simOptions.embedId;
|
|
@@ -1791,6 +1792,7 @@ var pxt;
|
|
|
1791
1792
|
autofocus: simOptions.autofocus,
|
|
1792
1793
|
queryParameters: simOptions.additionalQueryParameters,
|
|
1793
1794
|
mpRole: simOptions.mpRole,
|
|
1795
|
+
theme: (_a = runner.mainPkg.config) === null || _a === void 0 ? void 0 : _a.theme,
|
|
1794
1796
|
};
|
|
1795
1797
|
if (pxt.appTarget.simulator && !simOptions.fullScreen)
|
|
1796
1798
|
runOptions.aspectRatio = parts.length && pxt.appTarget.simulator.partsAspectRatio
|
package/built/pxtsim.d.ts
CHANGED
|
@@ -341,6 +341,7 @@ declare namespace pxsim {
|
|
|
341
341
|
single?: boolean;
|
|
342
342
|
traceDisabled?: boolean;
|
|
343
343
|
activePlayer?: 1 | 2 | 3 | 4 | undefined;
|
|
344
|
+
theme?: string | pxt.Map<string>;
|
|
344
345
|
}
|
|
345
346
|
interface SimulatorInstructionsMessage extends SimulatorMessage {
|
|
346
347
|
type: "instructions";
|
|
@@ -1335,6 +1336,7 @@ declare namespace pxsim {
|
|
|
1335
1336
|
queryParameters?: string;
|
|
1336
1337
|
mpRole?: "server" | "client";
|
|
1337
1338
|
activePlayer?: 1 | 2 | 3 | 4 | undefined;
|
|
1339
|
+
theme?: string | pxt.Map<string>;
|
|
1338
1340
|
}
|
|
1339
1341
|
interface HwDebugger {
|
|
1340
1342
|
postMessage: (msg: pxsim.SimulatorMessage) => void;
|