pxt-core 7.2.10 → 7.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/pxt.js +5 -4
- package/built/pxteditor.d.ts +6 -1
- package/built/pxteditor.js +4 -0
- package/built/pxtlib.js +5 -4
- package/built/pxtrunner.js +8 -3
- 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/pxteditor.js +1 -1
- package/built/web/pxtembed.js +1 -1
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtrunner.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/rtlsemantic.css +2 -2
- package/built/web/semantic.css +2 -2
- package/built/web/skillmap/css/{main.3ebf2087.chunk.css → main.9d95a1b2.chunk.css} +1 -1
- package/built/web/skillmap/js/main.0408feb7.chunk.js +1 -0
- package/package.json +1 -1
- package/theme/common-components.less +10 -0
- package/theme/keymap.less +16 -8
- package/theme/themes/pxt/collections/menu.overrides +13 -0
- package/theme/themes/pxt/globals/site.variables +2 -0
- package/theme/tutorial-sidebar.less +70 -11
- package/webapp/public/skillmap.html +2 -2
- package/built/web/skillmap/js/main.1de8694a.chunk.js +0 -1
package/built/pxt.js
CHANGED
|
@@ -97870,7 +97870,8 @@ var pxt;
|
|
|
97870
97870
|
auth.DEFAULT_USER_PREFERENCES = () => ({
|
|
97871
97871
|
highContrast: false,
|
|
97872
97872
|
language: pxt.appTarget.appTheme.defaultLocale,
|
|
97873
|
-
reader: ""
|
|
97873
|
+
reader: "",
|
|
97874
|
+
skillmap: { mapProgress: {}, completedTags: {} }
|
|
97874
97875
|
});
|
|
97875
97876
|
let _client;
|
|
97876
97877
|
function client() { return _client; }
|
|
@@ -116730,7 +116731,7 @@ ${code}
|
|
|
116730
116731
|
}
|
|
116731
116732
|
function parseTutorialTitle(tutorialmd) {
|
|
116732
116733
|
let title = tutorialmd.match(/^#[^#](.*)$/mi);
|
|
116733
|
-
return title && title.length > 1 ? title[1] : null;
|
|
116734
|
+
return title && title.length > 1 ? title[1].trim() : null;
|
|
116734
116735
|
}
|
|
116735
116736
|
function parseTutorialMarkdown(tutorialmd, metadata) {
|
|
116736
116737
|
if (metadata && metadata.activities) {
|
|
@@ -116774,7 +116775,7 @@ ${code}
|
|
|
116774
116775
|
let { header, hint, requiredBlocks } = parseTutorialHint(step, metadata && metadata.explicitHints, metadata.tutorialCodeValidation);
|
|
116775
116776
|
// if title is not hidden ("{TITLE HERE}"), strip flags
|
|
116776
116777
|
const title = !flags.match(/^\{.*\}$/)
|
|
116777
|
-
? flags.replace(/@(fullscreen|unplugged|showdialog|showhint|tutorialCompleted|resetDiff)/gi, "")
|
|
116778
|
+
? flags.replace(/@(fullscreen|unplugged|showdialog|showhint|tutorialCompleted|resetDiff)/gi, "").trim()
|
|
116778
116779
|
: undefined;
|
|
116779
116780
|
let info = {
|
|
116780
116781
|
title,
|
|
@@ -116817,7 +116818,7 @@ ${code}
|
|
|
116817
116818
|
}
|
|
116818
116819
|
else {
|
|
116819
116820
|
// everything after the first ``` section OR the first image is treated as a "hint"
|
|
116820
|
-
const hintTextRegex = /(^[\s\S]*?\S)\s*((
|
|
116821
|
+
const hintTextRegex = /(^[\s\S]*?\S)\s*((```|\[?\!\[[\s\S]+?\]\(\S+?\)\]?)[\s\S]*)/mi;
|
|
116821
116822
|
let hintText = step.match(hintTextRegex);
|
|
116822
116823
|
if (hintText && hintText.length > 2) {
|
|
116823
116824
|
header = hintText[1].trim();
|
package/built/pxteditor.d.ts
CHANGED
|
@@ -326,6 +326,7 @@ declare namespace pxt.editor {
|
|
|
326
326
|
createGitHubRepositoryAsync(): Promise<void>;
|
|
327
327
|
saveLocalProjectsToCloudAsync(headerIds: string[]): Promise<pxt.Map<string> | undefined>;
|
|
328
328
|
requestProjectCloudStatus(headerIds: string[]): Promise<void>;
|
|
329
|
+
convertCloudProjectsToLocal(userId: string): Promise<void>;
|
|
329
330
|
}
|
|
330
331
|
interface IHexFileImporter {
|
|
331
332
|
id: string;
|
|
@@ -529,7 +530,7 @@ declare namespace pxt.editor {
|
|
|
529
530
|
/**
|
|
530
531
|
* Request action
|
|
531
532
|
*/
|
|
532
|
-
action: "switchblocks" | "switchjavascript" | "startsimulator" | "restartsimulator" | "stopsimulator" | "hidesimulator" | "showsimulator" | "closeflyout" | "newproject" | "importproject" | "importtutorial" | "openheader" | "proxytosim" | "undo" | "redo" | "renderblocks" | "renderpython" | "setscale" | "startactivity" | "saveproject" | "unloadproject" | "shareproject" | "savelocalprojectstocloud" | "projectcloudstatus" | "requestprojectcloudstatus" | "toggletrace" | "togglehighcontrast" | "togglegreenscreen" | "settracestate" | "setsimulatorfullscreen" | "print" | "pair" | "workspacesync" | "workspacereset" | "workspacesave" | "workspaceloaded" | "workspaceevent" | "workspacediagnostics" | "event" | "simevent" | "info" | "tutorialevent" | ExtInitializeType | ExtDataStreamType | ExtUserCodeType | ExtReadCodeType | ExtWriteCodeType;
|
|
533
|
+
action: "switchblocks" | "switchjavascript" | "startsimulator" | "restartsimulator" | "stopsimulator" | "hidesimulator" | "showsimulator" | "closeflyout" | "newproject" | "importproject" | "importtutorial" | "openheader" | "proxytosim" | "undo" | "redo" | "renderblocks" | "renderpython" | "setscale" | "startactivity" | "saveproject" | "unloadproject" | "shareproject" | "savelocalprojectstocloud" | "projectcloudstatus" | "requestprojectcloudstatus" | "convertcloudprojectstolocal" | "toggletrace" | "togglehighcontrast" | "togglegreenscreen" | "settracestate" | "setsimulatorfullscreen" | "print" | "pair" | "workspacesync" | "workspacereset" | "workspacesave" | "workspaceloaded" | "workspaceevent" | "workspacediagnostics" | "event" | "simevent" | "info" | "tutorialevent" | ExtInitializeType | ExtDataStreamType | ExtUserCodeType | ExtReadCodeType | ExtWriteCodeType;
|
|
533
534
|
}
|
|
534
535
|
/**
|
|
535
536
|
* Request sent by the editor when a tick/error/expection is registered
|
|
@@ -650,6 +651,10 @@ declare namespace pxt.editor {
|
|
|
650
651
|
action: "requestprojectcloudstatus";
|
|
651
652
|
headerIds: string[];
|
|
652
653
|
}
|
|
654
|
+
interface EditorMessageConvertCloudProjectsToLocal extends EditorMessageRequest {
|
|
655
|
+
action: "convertcloudprojectstolocal";
|
|
656
|
+
userId: string;
|
|
657
|
+
}
|
|
653
658
|
interface EditorMessageImportTutorialRequest extends EditorMessageRequest {
|
|
654
659
|
action: "importtutorial";
|
|
655
660
|
markdown: string;
|
package/built/pxteditor.js
CHANGED
|
@@ -273,6 +273,10 @@ var pxt;
|
|
|
273
273
|
const msg = data;
|
|
274
274
|
return projectView.requestProjectCloudStatus(msg.headerIds);
|
|
275
275
|
}
|
|
276
|
+
case "convertcloudprojectstolocal": {
|
|
277
|
+
const msg = data;
|
|
278
|
+
return projectView.convertCloudProjectsToLocal(msg.userId);
|
|
279
|
+
}
|
|
276
280
|
}
|
|
277
281
|
return Promise.resolve();
|
|
278
282
|
});
|
package/built/pxtlib.js
CHANGED
|
@@ -184,7 +184,8 @@ var pxt;
|
|
|
184
184
|
auth.DEFAULT_USER_PREFERENCES = () => ({
|
|
185
185
|
highContrast: false,
|
|
186
186
|
language: pxt.appTarget.appTheme.defaultLocale,
|
|
187
|
-
reader: ""
|
|
187
|
+
reader: "",
|
|
188
|
+
skillmap: { mapProgress: {}, completedTags: {} }
|
|
188
189
|
});
|
|
189
190
|
let _client;
|
|
190
191
|
function client() { return _client; }
|
|
@@ -19044,7 +19045,7 @@ ${code}
|
|
|
19044
19045
|
}
|
|
19045
19046
|
function parseTutorialTitle(tutorialmd) {
|
|
19046
19047
|
let title = tutorialmd.match(/^#[^#](.*)$/mi);
|
|
19047
|
-
return title && title.length > 1 ? title[1] : null;
|
|
19048
|
+
return title && title.length > 1 ? title[1].trim() : null;
|
|
19048
19049
|
}
|
|
19049
19050
|
function parseTutorialMarkdown(tutorialmd, metadata) {
|
|
19050
19051
|
if (metadata && metadata.activities) {
|
|
@@ -19088,7 +19089,7 @@ ${code}
|
|
|
19088
19089
|
let { header, hint, requiredBlocks } = parseTutorialHint(step, metadata && metadata.explicitHints, metadata.tutorialCodeValidation);
|
|
19089
19090
|
// if title is not hidden ("{TITLE HERE}"), strip flags
|
|
19090
19091
|
const title = !flags.match(/^\{.*\}$/)
|
|
19091
|
-
? flags.replace(/@(fullscreen|unplugged|showdialog|showhint|tutorialCompleted|resetDiff)/gi, "")
|
|
19092
|
+
? flags.replace(/@(fullscreen|unplugged|showdialog|showhint|tutorialCompleted|resetDiff)/gi, "").trim()
|
|
19092
19093
|
: undefined;
|
|
19093
19094
|
let info = {
|
|
19094
19095
|
title,
|
|
@@ -19131,7 +19132,7 @@ ${code}
|
|
|
19131
19132
|
}
|
|
19132
19133
|
else {
|
|
19133
19134
|
// everything after the first ``` section OR the first image is treated as a "hint"
|
|
19134
|
-
const hintTextRegex = /(^[\s\S]*?\S)\s*((
|
|
19135
|
+
const hintTextRegex = /(^[\s\S]*?\S)\s*((```|\[?\!\[[\s\S]+?\]\(\S+?\)\]?)[\s\S]*)/mi;
|
|
19135
19136
|
let hintText = step.match(hintTextRegex);
|
|
19136
19137
|
if (hintText && hintText.length > 2) {
|
|
19137
19138
|
header = hintText[1].trim();
|
package/built/pxtrunner.js
CHANGED
|
@@ -1572,9 +1572,14 @@ var pxt;
|
|
|
1572
1572
|
const cookieValue = /PXT_LANG=(.*?)(?:;|$)/.exec(document.cookie);
|
|
1573
1573
|
const mlang = /(live)?(force)?lang=([a-z]{2,}(-[A-Z]+)?)/i.exec(href);
|
|
1574
1574
|
lang = mlang ? mlang[3] : (cookieValue && cookieValue[1] || pxt.appTarget.appTheme.defaultLocale || navigator.userLanguage || navigator.language);
|
|
1575
|
-
const
|
|
1576
|
-
|
|
1577
|
-
|
|
1575
|
+
const defLocale = pxt.appTarget.appTheme.defaultLocale;
|
|
1576
|
+
const langLowerCase = lang === null || lang === void 0 ? void 0 : lang.toLocaleLowerCase();
|
|
1577
|
+
const localDevServe = pxt.BrowserUtils.isLocalHostDev()
|
|
1578
|
+
&& (!langLowerCase || (defLocale
|
|
1579
|
+
? defLocale.toLocaleLowerCase() === langLowerCase
|
|
1580
|
+
: "en" === langLowerCase || "en-us" === langLowerCase));
|
|
1581
|
+
const serveLocal = pxt.BrowserUtils.isPxtElectron() || localDevServe;
|
|
1582
|
+
const liveTranslationsDisabled = serveLocal || pxt.appTarget.appTheme.disableLiveTranslations;
|
|
1578
1583
|
if (!liveTranslationsDisabled || !!(mlang === null || mlang === void 0 ? void 0 : mlang[1])) {
|
|
1579
1584
|
pxt.Util.enableLiveLocalizationUpdates();
|
|
1580
1585
|
}
|