pxt-core 11.3.59 → 11.3.62

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 CHANGED
@@ -119417,7 +119417,7 @@ var pxt;
119417
119417
  if (!steps)
119418
119418
  return undefined; // error parsing steps
119419
119419
  // collect code and infer editor
119420
- const { code, templateCode, templateLanguage, editor, language, jres, assetJson, customTs, simThemeJson } = computeBodyMetadata(body);
119420
+ const { code, templateCode, templateLanguage, editor, language, jres, assetJson, customTs, simThemeJson, hiddenNamespaces } = computeBodyMetadata(body);
119421
119421
  // For python HOC, hide the toolbox (we don't support flyoutOnly mode).
119422
119422
  if (pxt.BrowserUtils.useOldTutorialLayout() && language === "python" && metadata.flyoutOnly) {
119423
119423
  metadata.flyoutOnly = false;
@@ -119456,12 +119456,13 @@ var pxt;
119456
119456
  customTs,
119457
119457
  globalBlockConfig,
119458
119458
  globalValidationConfig,
119459
- simTheme
119459
+ simTheme,
119460
+ hiddenNamespaces
119460
119461
  };
119461
119462
  }
119462
119463
  tutorial_1.parseTutorial = parseTutorial;
119463
119464
  function getMetadataRegex() {
119464
- return /``` *(sim|block|blocks|filterblocks|spy|ghost|typescript|ts|js|javascript|template|python|jres|assetjson|customts|simtheme|python-template|ts-template|typescript-template|js-template|javascript-template)\s*\n([\s\S]*?)\n```/gmi;
119465
+ return /``` *(sim|block|blocks|filterblocks|spy|ghost|typescript|ts|js|javascript|template|python|jres|assetjson|customts|simtheme|python-template|ts-template|typescript-template|js-template|javascript-template|hiddennamespaces)\s*\n([\s\S]*?)\n```/gmi;
119465
119466
  }
119466
119467
  tutorial_1.getMetadataRegex = getMetadataRegex;
119467
119468
  function computeBodyMetadata(body) {
@@ -119477,6 +119478,7 @@ var pxt;
119477
119478
  let assetJson;
119478
119479
  let customTs;
119479
119480
  let simThemeJson;
119481
+ let hiddenNamespaces;
119480
119482
  // Concatenate all blocks in separate code blocks and decompile so we can detect what blocks are used (for the toolbox)
119481
119483
  body
119482
119484
  .replace(/((?!.)\s)+/g, "\n")
@@ -119536,6 +119538,10 @@ var pxt;
119536
119538
  customTs = m2;
119537
119539
  m2 = "";
119538
119540
  break;
119541
+ case "hiddennamespaces":
119542
+ hiddenNamespaces = m2.split(/\s/m).map(s => s.trim()).filter(s => !!s);
119543
+ m2 = "";
119544
+ break;
119539
119545
  }
119540
119546
  code.push(language === "python" ? `\n${m2}\n` : `{\n${m2}\n}`);
119541
119547
  idx++;
@@ -119552,7 +119558,8 @@ var pxt;
119552
119558
  jres,
119553
119559
  assetJson,
119554
119560
  customTs,
119555
- simThemeJson
119561
+ simThemeJson,
119562
+ hiddenNamespaces
119556
119563
  };
119557
119564
  function checkTutorialEditor(expected) {
119558
119565
  if (editor && editor != expected) {
@@ -119753,7 +119760,7 @@ ${code}
119753
119760
  function stripHiddenSnippets(str) {
119754
119761
  if (!str)
119755
119762
  return str;
119756
- 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;
119763
+ const hiddenSnippetRegex = /```(filterblocks|package|ghost|config|template|jres|assetjson|simtheme|customts|hiddennamespaces|blockconfig\.local|blockconfig\.global|validation\.local|validation\.global)\s*\n([\s\S]*?)\n```/gmi;
119757
119764
  return str.replace(hiddenSnippetRegex, '').trim();
119758
119765
  }
119759
119766
  /*
@@ -119839,6 +119846,7 @@ ${code}
119839
119846
  globalBlockConfig: tutorialInfo.globalBlockConfig,
119840
119847
  globalValidationConfig: tutorialInfo.globalValidationConfig,
119841
119848
  simTheme: tutorialInfo.simTheme,
119849
+ hiddenNamespaces: tutorialInfo.hiddenNamespaces,
119842
119850
  };
119843
119851
  return { options: tutorialOptions, editor: tutorialInfo.editor };
119844
119852
  }
package/built/pxtlib.js CHANGED
@@ -21731,7 +21731,7 @@ var pxt;
21731
21731
  if (!steps)
21732
21732
  return undefined; // error parsing steps
21733
21733
  // collect code and infer editor
21734
- const { code, templateCode, templateLanguage, editor, language, jres, assetJson, customTs, simThemeJson } = computeBodyMetadata(body);
21734
+ const { code, templateCode, templateLanguage, editor, language, jres, assetJson, customTs, simThemeJson, hiddenNamespaces } = computeBodyMetadata(body);
21735
21735
  // For python HOC, hide the toolbox (we don't support flyoutOnly mode).
21736
21736
  if (pxt.BrowserUtils.useOldTutorialLayout() && language === "python" && metadata.flyoutOnly) {
21737
21737
  metadata.flyoutOnly = false;
@@ -21770,12 +21770,13 @@ var pxt;
21770
21770
  customTs,
21771
21771
  globalBlockConfig,
21772
21772
  globalValidationConfig,
21773
- simTheme
21773
+ simTheme,
21774
+ hiddenNamespaces
21774
21775
  };
21775
21776
  }
21776
21777
  tutorial_1.parseTutorial = parseTutorial;
21777
21778
  function getMetadataRegex() {
21778
- return /``` *(sim|block|blocks|filterblocks|spy|ghost|typescript|ts|js|javascript|template|python|jres|assetjson|customts|simtheme|python-template|ts-template|typescript-template|js-template|javascript-template)\s*\n([\s\S]*?)\n```/gmi;
21779
+ return /``` *(sim|block|blocks|filterblocks|spy|ghost|typescript|ts|js|javascript|template|python|jres|assetjson|customts|simtheme|python-template|ts-template|typescript-template|js-template|javascript-template|hiddennamespaces)\s*\n([\s\S]*?)\n```/gmi;
21779
21780
  }
21780
21781
  tutorial_1.getMetadataRegex = getMetadataRegex;
21781
21782
  function computeBodyMetadata(body) {
@@ -21791,6 +21792,7 @@ var pxt;
21791
21792
  let assetJson;
21792
21793
  let customTs;
21793
21794
  let simThemeJson;
21795
+ let hiddenNamespaces;
21794
21796
  // Concatenate all blocks in separate code blocks and decompile so we can detect what blocks are used (for the toolbox)
21795
21797
  body
21796
21798
  .replace(/((?!.)\s)+/g, "\n")
@@ -21850,6 +21852,10 @@ var pxt;
21850
21852
  customTs = m2;
21851
21853
  m2 = "";
21852
21854
  break;
21855
+ case "hiddennamespaces":
21856
+ hiddenNamespaces = m2.split(/\s/m).map(s => s.trim()).filter(s => !!s);
21857
+ m2 = "";
21858
+ break;
21853
21859
  }
21854
21860
  code.push(language === "python" ? `\n${m2}\n` : `{\n${m2}\n}`);
21855
21861
  idx++;
@@ -21866,7 +21872,8 @@ var pxt;
21866
21872
  jres,
21867
21873
  assetJson,
21868
21874
  customTs,
21869
- simThemeJson
21875
+ simThemeJson,
21876
+ hiddenNamespaces
21870
21877
  };
21871
21878
  function checkTutorialEditor(expected) {
21872
21879
  if (editor && editor != expected) {
@@ -22067,7 +22074,7 @@ ${code}
22067
22074
  function stripHiddenSnippets(str) {
22068
22075
  if (!str)
22069
22076
  return str;
22070
- 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;
22077
+ const hiddenSnippetRegex = /```(filterblocks|package|ghost|config|template|jres|assetjson|simtheme|customts|hiddennamespaces|blockconfig\.local|blockconfig\.global|validation\.local|validation\.global)\s*\n([\s\S]*?)\n```/gmi;
22071
22078
  return str.replace(hiddenSnippetRegex, '').trim();
22072
22079
  }
22073
22080
  /*
@@ -22153,6 +22160,7 @@ ${code}
22153
22160
  globalBlockConfig: tutorialInfo.globalBlockConfig,
22154
22161
  globalValidationConfig: tutorialInfo.globalValidationConfig,
22155
22162
  simTheme: tutorialInfo.simTheme,
22163
+ hiddenNamespaces: tutorialInfo.hiddenNamespaces,
22156
22164
  };
22157
22165
  return { options: tutorialOptions, editor: tutorialInfo.editor };
22158
22166
  }