pxt-core 7.4.11 → 7.4.12
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 +94 -83
- package/built/pxt.js +95 -84
- package/built/pxtlib.js +1 -1
- 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/pxtembed.js +1 -1
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/react-common-skillmap.css +1 -0
- package/built/web/rtlreact-common-skillmap.css +1 -0
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/built/web/skillmap/js/{main.55881627.chunk.js → main.b96caef3.chunk.js} +1 -1
- package/package.json +3 -2
- package/react-common/components/Checkbox.tsx +25 -0
- package/react-common/components/Notification.tsx +82 -0
- package/react-common/components/profile/Badge.tsx +33 -0
- package/react-common/components/profile/BadgeInfo.tsx +74 -0
- package/react-common/components/profile/BadgeList.tsx +67 -0
- package/react-common/components/profile/Profile.tsx +42 -0
- package/react-common/components/profile/UserNotification.tsx +32 -0
- package/react-common/components/profile/UserPane.tsx +64 -0
- package/react-common/components/types.d.ts +29 -0
- package/react-common/components/util.tsx +35 -0
- package/{built/web/react-common.css → react-common/styles/profile/profile.less} +1 -0
- package/react-common/styles/react-common-skillmap-core.less +10 -0
- package/react-common/styles/react-common-skillmap.less +12 -0
- package/react-common/styles/react-common.less +1 -0
- package/react-common/tsconfig.json +36 -0
- package/theme/common-components.less +7 -0
- package/theme/common.less +1 -1
- package/theme/highcontrast.less +4 -0
- package/theme/pxt.less +2 -0
- package/theme/tutorial-sidebar.less +64 -6
- package/webapp/public/skillmap.html +2 -2
package/built/cli.js
CHANGED
|
@@ -1728,94 +1728,105 @@ ${gcards.map(gcard => `[${gcard.name}](${gcard.url})`).join(',\n')}
|
|
|
1728
1728
|
nodeutil.writeFileSync("built/target-strings.json", nodeutil.stringify(targetStringsSorted));
|
|
1729
1729
|
pxt.log(`target-strings.json built`);
|
|
1730
1730
|
}
|
|
1731
|
-
function buildSemanticUIAsync(parsed) {
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
if (!dirty) {
|
|
1738
|
-
const csstime = fs.statSync("built/web/semantic.css").mtime;
|
|
1739
|
-
dirty = nodeutil.allFiles("theme")
|
|
1740
|
-
.map(f => fs.statSync(f))
|
|
1741
|
-
.some(stat => stat.mtime > csstime);
|
|
1742
|
-
}
|
|
1743
|
-
if (!dirty && !forceRedbuild)
|
|
1744
|
-
return Promise.resolve();
|
|
1745
|
-
let pkg = readJson("package.json");
|
|
1731
|
+
async function buildSemanticUIAsync(parsed) {
|
|
1732
|
+
if (!fs.existsSync(path.join("theme", "style.less")) || !fs.existsSync(path.join("theme", "theme.config"))) {
|
|
1733
|
+
return;
|
|
1734
|
+
}
|
|
1735
|
+
const pkg = readJson("package.json");
|
|
1736
|
+
const isPxtCore = pkg["name"] === "pxt-core";
|
|
1746
1737
|
nodeutil.mkdirP(path.join("built", "web"));
|
|
1747
1738
|
const lessPath = require.resolve('less');
|
|
1748
1739
|
const lessCPath = path.join(path.dirname(lessPath), '/bin/lessc');
|
|
1749
|
-
|
|
1740
|
+
const lessIncludePaths = [
|
|
1741
|
+
"node_modules/semantic-ui-less",
|
|
1742
|
+
"node_modules/pxt-core/theme",
|
|
1743
|
+
"theme/foo/bar",
|
|
1744
|
+
"theme",
|
|
1745
|
+
"node_modules/pxt-core/react-common/styles",
|
|
1746
|
+
"react-common/styles"
|
|
1747
|
+
].join(":");
|
|
1748
|
+
// Build semantic css
|
|
1749
|
+
await nodeutil.spawnAsync({
|
|
1750
1750
|
cmd: "node",
|
|
1751
|
-
args: [
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
const reactCommonFile = (pkg["name"] == "pxt-core") ? 'built/web/react-common.css' : 'node_modules/pxt-core/built/web/react-common.css';
|
|
1772
|
-
const reactCommonCss = fs.readFileSync(reactCommonFile, "utf-8");
|
|
1773
|
-
semCss = semCss + "\n" + iconsCss + "\n" + reactCommonCss;
|
|
1774
|
-
nodeutil.writeFileSync('built/web/semantic.css', semCss);
|
|
1775
|
-
}).then(() => {
|
|
1776
|
-
// generate blockly css
|
|
1777
|
-
if (!fs.existsSync(path.join("theme", "blockly.less")))
|
|
1778
|
-
return Promise.resolve();
|
|
1779
|
-
return nodeutil.spawnAsync({
|
|
1751
|
+
args: [
|
|
1752
|
+
lessCPath,
|
|
1753
|
+
"theme/style.less",
|
|
1754
|
+
"built/web/semantic.css",
|
|
1755
|
+
"--include-path=" + lessIncludePaths
|
|
1756
|
+
]
|
|
1757
|
+
});
|
|
1758
|
+
// Inline all of our icon fonts
|
|
1759
|
+
let semCss = await readFileAsync('built/web/semantic.css', "utf8");
|
|
1760
|
+
semCss = await linkFontAsync("icons", semCss);
|
|
1761
|
+
semCss = await linkFontAsync("outline-icons", semCss);
|
|
1762
|
+
semCss = await linkFontAsync("brand-icons", semCss);
|
|
1763
|
+
// Append icons.css to semantic.css (custom pxt icons)
|
|
1764
|
+
const iconsFile = isPxtCore ? 'built/web/icons.css' : 'node_modules/pxt-core/built/web/icons.css';
|
|
1765
|
+
const iconsCss = await readFileAsync(iconsFile, "utf8");
|
|
1766
|
+
semCss = semCss + "\n" + iconsCss;
|
|
1767
|
+
nodeutil.writeFileSync('built/web/semantic.css', semCss);
|
|
1768
|
+
// Generate blockly css
|
|
1769
|
+
if (fs.existsSync(path.join("theme", "blockly.less"))) {
|
|
1770
|
+
await nodeutil.spawnAsync({
|
|
1780
1771
|
cmd: "node",
|
|
1781
|
-
args: [
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
const browserList = [
|
|
1788
|
-
"Chrome >= 38",
|
|
1789
|
-
"Firefox >= 31",
|
|
1790
|
-
"Edge >= 12",
|
|
1791
|
-
"ie >= 11",
|
|
1792
|
-
"Safari >= 9",
|
|
1793
|
-
"Opera >= 21",
|
|
1794
|
-
"iOS >= 9",
|
|
1795
|
-
"ChromeAndroid >= 59",
|
|
1796
|
-
"FirefoxAndroid >= 55"
|
|
1797
|
-
];
|
|
1798
|
-
const cssnano = require('cssnano')({
|
|
1799
|
-
zindex: false,
|
|
1800
|
-
autoprefixer: { browsers: browserList, add: true }
|
|
1801
|
-
});
|
|
1802
|
-
const rtlcss = require('rtlcss');
|
|
1803
|
-
const files = ['semantic.css', 'blockly.css'];
|
|
1804
|
-
files.forEach(cssFile => {
|
|
1805
|
-
fs.readFile(`built/web/${cssFile}`, "utf8", (err, css) => {
|
|
1806
|
-
postcss([cssnano])
|
|
1807
|
-
.process(css, { from: `built/web/${cssFile}`, to: `built/web/${cssFile}` }).then((result) => {
|
|
1808
|
-
fs.writeFile(`built/web/${cssFile}`, result.css, (err2) => {
|
|
1809
|
-
// process rtl css
|
|
1810
|
-
postcss([rtlcss])
|
|
1811
|
-
.process(result.css, { from: `built/web/${cssFile}`, to: `built/web/rtl${cssFile}` }).then((result2) => {
|
|
1812
|
-
nodeutil.writeFileSync(`built/web/rtl${cssFile}`, result2.css, { encoding: "utf8" });
|
|
1813
|
-
});
|
|
1814
|
-
});
|
|
1815
|
-
});
|
|
1816
|
-
});
|
|
1772
|
+
args: [
|
|
1773
|
+
lessCPath,
|
|
1774
|
+
"theme/blockly.less",
|
|
1775
|
+
"built/web/blockly.css",
|
|
1776
|
+
"--include-path=" + lessIncludePaths
|
|
1777
|
+
]
|
|
1817
1778
|
});
|
|
1779
|
+
}
|
|
1780
|
+
// Generate react-common css for skillmap
|
|
1781
|
+
const skillmapFile = isPxtCore ? "react-common/styles/react-common-skillmap-core.less" :
|
|
1782
|
+
"node_modules/pxt-core/react-common/styles/react-common-skillmap.less";
|
|
1783
|
+
await nodeutil.spawnAsync({
|
|
1784
|
+
cmd: "node",
|
|
1785
|
+
args: [
|
|
1786
|
+
lessCPath,
|
|
1787
|
+
skillmapFile,
|
|
1788
|
+
"built/web/react-common-skillmap.css",
|
|
1789
|
+
"--include-path=" + lessIncludePaths
|
|
1790
|
+
]
|
|
1791
|
+
});
|
|
1792
|
+
// Run postcss with autoprefixer and rtlcss
|
|
1793
|
+
pxt.debug("running postcss");
|
|
1794
|
+
const postcss = require('postcss');
|
|
1795
|
+
const browserList = [
|
|
1796
|
+
"Chrome >= 38",
|
|
1797
|
+
"Firefox >= 31",
|
|
1798
|
+
"Edge >= 12",
|
|
1799
|
+
"ie >= 11",
|
|
1800
|
+
"Safari >= 9",
|
|
1801
|
+
"Opera >= 21",
|
|
1802
|
+
"iOS >= 9",
|
|
1803
|
+
"ChromeAndroid >= 59",
|
|
1804
|
+
"FirefoxAndroid >= 55"
|
|
1805
|
+
];
|
|
1806
|
+
const cssnano = require("cssnano")({
|
|
1807
|
+
zindex: false,
|
|
1808
|
+
autoprefixer: { browsers: browserList, add: true }
|
|
1818
1809
|
});
|
|
1810
|
+
const rtlcss = require("rtlcss");
|
|
1811
|
+
const files = ["semantic.css", "blockly.css", "react-common-skillmap.css"];
|
|
1812
|
+
for (const cssFile of files) {
|
|
1813
|
+
const css = await readFileAsync(`built/web/${cssFile}`, "utf8");
|
|
1814
|
+
const processed = await postcss([cssnano])
|
|
1815
|
+
.process(css, { from: `built/web/${cssFile}`, to: `built/web/${cssFile}` });
|
|
1816
|
+
await writeFileAsync(`built/web/${cssFile}`, processed.css);
|
|
1817
|
+
const processedRtl = await postcss([rtlcss])
|
|
1818
|
+
.process(processed.css, { from: `built/web/${cssFile}`, to: `built/web/rtl${cssFile}` });
|
|
1819
|
+
await writeFileAsync(`built/web/rtl${cssFile}`, processedRtl.css, "utf8");
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
async function linkFontAsync(font, semCss) {
|
|
1823
|
+
const fontFile = await readFileAsync("node_modules/semantic-ui-less/themes/default/assets/fonts/" + font + ".woff");
|
|
1824
|
+
const url = "url(data:application/font-woff;charset=utf-8;base64,"
|
|
1825
|
+
+ fontFile.toString("base64") + ") format('woff')";
|
|
1826
|
+
const r = new RegExp(`src:.*url\\("fonts\/${font}\\.woff.*`, "g");
|
|
1827
|
+
semCss = semCss.replace('src: url("fonts/' + font + '.eot");', "")
|
|
1828
|
+
.replace(r, "src: " + url + ";");
|
|
1829
|
+
return semCss;
|
|
1819
1830
|
}
|
|
1820
1831
|
function buildWebStringsAsync() {
|
|
1821
1832
|
if (pxt.appTarget.id != "core")
|
|
@@ -1838,7 +1849,7 @@ function buildSkillMapAsync(parsed) {
|
|
|
1838
1849
|
nodeutil.cp("node_modules/pxt-core/built/pxtlib.js", `${skillmapRoot}/public/blb`);
|
|
1839
1850
|
nodeutil.cp("built/web/semantic.css", `${skillmapRoot}/public/blb`);
|
|
1840
1851
|
nodeutil.cp("node_modules/pxt-core/built/web/icons.css", `${skillmapRoot}/public/blb`);
|
|
1841
|
-
nodeutil.cp("node_modules/pxt-core/built/web/react-common.css", `${skillmapRoot}/public/blb`);
|
|
1852
|
+
nodeutil.cp("node_modules/pxt-core/built/web/react-common-skillmap.css", `${skillmapRoot}/public/blb`);
|
|
1842
1853
|
// copy 'assets' over from docs/static
|
|
1843
1854
|
nodeutil.cpR("docs/static/skillmap/assets", `${skillmapRoot}/public/assets`);
|
|
1844
1855
|
if (docsPath) {
|
|
@@ -6196,7 +6207,7 @@ ${pxt.crowdin.KEY_VARIABLE} - crowdin key
|
|
|
6196
6207
|
help: "build required css files",
|
|
6197
6208
|
flags: {
|
|
6198
6209
|
force: {
|
|
6199
|
-
description: "
|
|
6210
|
+
description: "deprecated; now on by default"
|
|
6200
6211
|
}
|
|
6201
6212
|
}
|
|
6202
6213
|
}, buildSemanticUIAsync);
|
package/built/pxt.js
CHANGED
|
@@ -98123,7 +98123,7 @@ var pxt;
|
|
|
98123
98123
|
return { success: false, res: undefined };
|
|
98124
98124
|
}
|
|
98125
98125
|
// Apply queued patches to the remote state in isolation and develop a final diff to send to the backend
|
|
98126
|
-
const remotePrefs = pxt.U.deepCopy(getResult.resp);
|
|
98126
|
+
const remotePrefs = pxt.U.deepCopy(getResult.resp) || auth.DEFAULT_USER_PREFERENCES();
|
|
98127
98127
|
const patchQueue = this.patchQueue;
|
|
98128
98128
|
this.patchQueue = []; // Reset the queue
|
|
98129
98129
|
patchQueue.forEach(patch => {
|
|
@@ -157678,94 +157678,105 @@ ${gcards.map(gcard => `[${gcard.name}](${gcard.url})`).join(',\n')}
|
|
|
157678
157678
|
nodeutil.writeFileSync("built/target-strings.json", nodeutil.stringify(targetStringsSorted));
|
|
157679
157679
|
pxt.log(`target-strings.json built`);
|
|
157680
157680
|
}
|
|
157681
|
-
function buildSemanticUIAsync(parsed) {
|
|
157682
|
-
|
|
157683
|
-
|
|
157684
|
-
|
|
157685
|
-
|
|
157686
|
-
|
|
157687
|
-
if (!dirty) {
|
|
157688
|
-
const csstime = fs.statSync("built/web/semantic.css").mtime;
|
|
157689
|
-
dirty = nodeutil.allFiles("theme")
|
|
157690
|
-
.map(f => fs.statSync(f))
|
|
157691
|
-
.some(stat => stat.mtime > csstime);
|
|
157692
|
-
}
|
|
157693
|
-
if (!dirty && !forceRedbuild)
|
|
157694
|
-
return Promise.resolve();
|
|
157695
|
-
let pkg = readJson("package.json");
|
|
157681
|
+
async function buildSemanticUIAsync(parsed) {
|
|
157682
|
+
if (!fs.existsSync(path.join("theme", "style.less")) || !fs.existsSync(path.join("theme", "theme.config"))) {
|
|
157683
|
+
return;
|
|
157684
|
+
}
|
|
157685
|
+
const pkg = readJson("package.json");
|
|
157686
|
+
const isPxtCore = pkg["name"] === "pxt-core";
|
|
157696
157687
|
nodeutil.mkdirP(path.join("built", "web"));
|
|
157697
157688
|
const lessPath = require.resolve('less');
|
|
157698
157689
|
const lessCPath = path.join(path.dirname(lessPath), '/bin/lessc');
|
|
157699
|
-
|
|
157690
|
+
const lessIncludePaths = [
|
|
157691
|
+
"node_modules/semantic-ui-less",
|
|
157692
|
+
"node_modules/pxt-core/theme",
|
|
157693
|
+
"theme/foo/bar",
|
|
157694
|
+
"theme",
|
|
157695
|
+
"node_modules/pxt-core/react-common/styles",
|
|
157696
|
+
"react-common/styles"
|
|
157697
|
+
].join(":");
|
|
157698
|
+
// Build semantic css
|
|
157699
|
+
await nodeutil.spawnAsync({
|
|
157700
157700
|
cmd: "node",
|
|
157701
|
-
args: [
|
|
157702
|
-
|
|
157703
|
-
|
|
157704
|
-
|
|
157705
|
-
|
|
157706
|
-
|
|
157707
|
-
|
|
157708
|
-
|
|
157709
|
-
|
|
157710
|
-
|
|
157711
|
-
|
|
157712
|
-
|
|
157713
|
-
|
|
157714
|
-
|
|
157715
|
-
|
|
157716
|
-
|
|
157717
|
-
|
|
157718
|
-
|
|
157719
|
-
|
|
157720
|
-
|
|
157721
|
-
const reactCommonFile = (pkg["name"] == "pxt-core") ? 'built/web/react-common.css' : 'node_modules/pxt-core/built/web/react-common.css';
|
|
157722
|
-
const reactCommonCss = fs.readFileSync(reactCommonFile, "utf-8");
|
|
157723
|
-
semCss = semCss + "\n" + iconsCss + "\n" + reactCommonCss;
|
|
157724
|
-
nodeutil.writeFileSync('built/web/semantic.css', semCss);
|
|
157725
|
-
}).then(() => {
|
|
157726
|
-
// generate blockly css
|
|
157727
|
-
if (!fs.existsSync(path.join("theme", "blockly.less")))
|
|
157728
|
-
return Promise.resolve();
|
|
157729
|
-
return nodeutil.spawnAsync({
|
|
157701
|
+
args: [
|
|
157702
|
+
lessCPath,
|
|
157703
|
+
"theme/style.less",
|
|
157704
|
+
"built/web/semantic.css",
|
|
157705
|
+
"--include-path=" + lessIncludePaths
|
|
157706
|
+
]
|
|
157707
|
+
});
|
|
157708
|
+
// Inline all of our icon fonts
|
|
157709
|
+
let semCss = await readFileAsync('built/web/semantic.css', "utf8");
|
|
157710
|
+
semCss = await linkFontAsync("icons", semCss);
|
|
157711
|
+
semCss = await linkFontAsync("outline-icons", semCss);
|
|
157712
|
+
semCss = await linkFontAsync("brand-icons", semCss);
|
|
157713
|
+
// Append icons.css to semantic.css (custom pxt icons)
|
|
157714
|
+
const iconsFile = isPxtCore ? 'built/web/icons.css' : 'node_modules/pxt-core/built/web/icons.css';
|
|
157715
|
+
const iconsCss = await readFileAsync(iconsFile, "utf8");
|
|
157716
|
+
semCss = semCss + "\n" + iconsCss;
|
|
157717
|
+
nodeutil.writeFileSync('built/web/semantic.css', semCss);
|
|
157718
|
+
// Generate blockly css
|
|
157719
|
+
if (fs.existsSync(path.join("theme", "blockly.less"))) {
|
|
157720
|
+
await nodeutil.spawnAsync({
|
|
157730
157721
|
cmd: "node",
|
|
157731
|
-
args: [
|
|
157732
|
-
|
|
157733
|
-
|
|
157734
|
-
|
|
157735
|
-
|
|
157736
|
-
|
|
157737
|
-
const browserList = [
|
|
157738
|
-
"Chrome >= 38",
|
|
157739
|
-
"Firefox >= 31",
|
|
157740
|
-
"Edge >= 12",
|
|
157741
|
-
"ie >= 11",
|
|
157742
|
-
"Safari >= 9",
|
|
157743
|
-
"Opera >= 21",
|
|
157744
|
-
"iOS >= 9",
|
|
157745
|
-
"ChromeAndroid >= 59",
|
|
157746
|
-
"FirefoxAndroid >= 55"
|
|
157747
|
-
];
|
|
157748
|
-
const cssnano = require('cssnano')({
|
|
157749
|
-
zindex: false,
|
|
157750
|
-
autoprefixer: { browsers: browserList, add: true }
|
|
157751
|
-
});
|
|
157752
|
-
const rtlcss = require('rtlcss');
|
|
157753
|
-
const files = ['semantic.css', 'blockly.css'];
|
|
157754
|
-
files.forEach(cssFile => {
|
|
157755
|
-
fs.readFile(`built/web/${cssFile}`, "utf8", (err, css) => {
|
|
157756
|
-
postcss([cssnano])
|
|
157757
|
-
.process(css, { from: `built/web/${cssFile}`, to: `built/web/${cssFile}` }).then((result) => {
|
|
157758
|
-
fs.writeFile(`built/web/${cssFile}`, result.css, (err2) => {
|
|
157759
|
-
// process rtl css
|
|
157760
|
-
postcss([rtlcss])
|
|
157761
|
-
.process(result.css, { from: `built/web/${cssFile}`, to: `built/web/rtl${cssFile}` }).then((result2) => {
|
|
157762
|
-
nodeutil.writeFileSync(`built/web/rtl${cssFile}`, result2.css, { encoding: "utf8" });
|
|
157763
|
-
});
|
|
157764
|
-
});
|
|
157765
|
-
});
|
|
157766
|
-
});
|
|
157722
|
+
args: [
|
|
157723
|
+
lessCPath,
|
|
157724
|
+
"theme/blockly.less",
|
|
157725
|
+
"built/web/blockly.css",
|
|
157726
|
+
"--include-path=" + lessIncludePaths
|
|
157727
|
+
]
|
|
157767
157728
|
});
|
|
157729
|
+
}
|
|
157730
|
+
// Generate react-common css for skillmap
|
|
157731
|
+
const skillmapFile = isPxtCore ? "react-common/styles/react-common-skillmap-core.less" :
|
|
157732
|
+
"node_modules/pxt-core/react-common/styles/react-common-skillmap.less";
|
|
157733
|
+
await nodeutil.spawnAsync({
|
|
157734
|
+
cmd: "node",
|
|
157735
|
+
args: [
|
|
157736
|
+
lessCPath,
|
|
157737
|
+
skillmapFile,
|
|
157738
|
+
"built/web/react-common-skillmap.css",
|
|
157739
|
+
"--include-path=" + lessIncludePaths
|
|
157740
|
+
]
|
|
157741
|
+
});
|
|
157742
|
+
// Run postcss with autoprefixer and rtlcss
|
|
157743
|
+
pxt.debug("running postcss");
|
|
157744
|
+
const postcss = require('postcss');
|
|
157745
|
+
const browserList = [
|
|
157746
|
+
"Chrome >= 38",
|
|
157747
|
+
"Firefox >= 31",
|
|
157748
|
+
"Edge >= 12",
|
|
157749
|
+
"ie >= 11",
|
|
157750
|
+
"Safari >= 9",
|
|
157751
|
+
"Opera >= 21",
|
|
157752
|
+
"iOS >= 9",
|
|
157753
|
+
"ChromeAndroid >= 59",
|
|
157754
|
+
"FirefoxAndroid >= 55"
|
|
157755
|
+
];
|
|
157756
|
+
const cssnano = require("cssnano")({
|
|
157757
|
+
zindex: false,
|
|
157758
|
+
autoprefixer: { browsers: browserList, add: true }
|
|
157768
157759
|
});
|
|
157760
|
+
const rtlcss = require("rtlcss");
|
|
157761
|
+
const files = ["semantic.css", "blockly.css", "react-common-skillmap.css"];
|
|
157762
|
+
for (const cssFile of files) {
|
|
157763
|
+
const css = await readFileAsync(`built/web/${cssFile}`, "utf8");
|
|
157764
|
+
const processed = await postcss([cssnano])
|
|
157765
|
+
.process(css, { from: `built/web/${cssFile}`, to: `built/web/${cssFile}` });
|
|
157766
|
+
await writeFileAsync(`built/web/${cssFile}`, processed.css);
|
|
157767
|
+
const processedRtl = await postcss([rtlcss])
|
|
157768
|
+
.process(processed.css, { from: `built/web/${cssFile}`, to: `built/web/rtl${cssFile}` });
|
|
157769
|
+
await writeFileAsync(`built/web/rtl${cssFile}`, processedRtl.css, "utf8");
|
|
157770
|
+
}
|
|
157771
|
+
}
|
|
157772
|
+
async function linkFontAsync(font, semCss) {
|
|
157773
|
+
const fontFile = await readFileAsync("node_modules/semantic-ui-less/themes/default/assets/fonts/" + font + ".woff");
|
|
157774
|
+
const url = "url(data:application/font-woff;charset=utf-8;base64,"
|
|
157775
|
+
+ fontFile.toString("base64") + ") format('woff')";
|
|
157776
|
+
const r = new RegExp(`src:.*url\\("fonts\/${font}\\.woff.*`, "g");
|
|
157777
|
+
semCss = semCss.replace('src: url("fonts/' + font + '.eot");', "")
|
|
157778
|
+
.replace(r, "src: " + url + ";");
|
|
157779
|
+
return semCss;
|
|
157769
157780
|
}
|
|
157770
157781
|
function buildWebStringsAsync() {
|
|
157771
157782
|
if (pxt.appTarget.id != "core")
|
|
@@ -157788,7 +157799,7 @@ function buildSkillMapAsync(parsed) {
|
|
|
157788
157799
|
nodeutil.cp("node_modules/pxt-core/built/pxtlib.js", `${skillmapRoot}/public/blb`);
|
|
157789
157800
|
nodeutil.cp("built/web/semantic.css", `${skillmapRoot}/public/blb`);
|
|
157790
157801
|
nodeutil.cp("node_modules/pxt-core/built/web/icons.css", `${skillmapRoot}/public/blb`);
|
|
157791
|
-
nodeutil.cp("node_modules/pxt-core/built/web/react-common.css", `${skillmapRoot}/public/blb`);
|
|
157802
|
+
nodeutil.cp("node_modules/pxt-core/built/web/react-common-skillmap.css", `${skillmapRoot}/public/blb`);
|
|
157792
157803
|
// copy 'assets' over from docs/static
|
|
157793
157804
|
nodeutil.cpR("docs/static/skillmap/assets", `${skillmapRoot}/public/assets`);
|
|
157794
157805
|
if (docsPath) {
|
|
@@ -162146,7 +162157,7 @@ ${pxt.crowdin.KEY_VARIABLE} - crowdin key
|
|
|
162146
162157
|
help: "build required css files",
|
|
162147
162158
|
flags: {
|
|
162148
162159
|
force: {
|
|
162149
|
-
description: "
|
|
162160
|
+
description: "deprecated; now on by default"
|
|
162150
162161
|
}
|
|
162151
162162
|
}
|
|
162152
162163
|
}, buildSemanticUIAsync);
|
package/built/pxtlib.js
CHANGED
|
@@ -437,7 +437,7 @@ var pxt;
|
|
|
437
437
|
return { success: false, res: undefined };
|
|
438
438
|
}
|
|
439
439
|
// Apply queued patches to the remote state in isolation and develop a final diff to send to the backend
|
|
440
|
-
const remotePrefs = pxt.U.deepCopy(getResult.resp);
|
|
440
|
+
const remotePrefs = pxt.U.deepCopy(getResult.resp) || auth.DEFAULT_USER_PREFERENCES();
|
|
441
441
|
const patchQueue = this.patchQueue;
|
|
442
442
|
this.patchQueue = []; // Reset the queue
|
|
443
443
|
patchQueue.forEach(patch => {
|