@mui/internal-docs-infra 0.3.1-canary.2 → 0.3.1-canary.4

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.
Files changed (110) hide show
  1. package/esm/CodeControllerContext/CodeControllerContext.js +2 -2
  2. package/esm/CodeExternalsContext/CodeExternalsContext.js +1 -1
  3. package/esm/CodeHighlighter/CodeHighlighter.js +252 -327
  4. package/esm/CodeHighlighter/CodeHighlighterClient.js +447 -653
  5. package/esm/CodeHighlighter/CodeHighlighterContext.js +2 -2
  6. package/esm/CodeHighlighter/CodeHighlighterFallbackContext.js +2 -2
  7. package/esm/CodeHighlighter/codeToFallbackProps.js +21 -37
  8. package/esm/CodeHighlighter/errors.js +248 -400
  9. package/esm/CodeHighlighter/parseControlledCode.js +12 -20
  10. package/esm/CodeHighlighter/types.d.ts +7 -1
  11. package/esm/CodeProvider/CodeContext.js +3 -3
  12. package/esm/CodeProvider/CodeProvider.js +31 -40
  13. package/esm/abstractCreateDemo/abstractCreateDemo.js +13 -17
  14. package/esm/abstractCreateDemoClient/abstractCreateDemoClient.js +12 -12
  15. package/esm/cli/index.js +1 -1
  16. package/esm/cli/runValidate.js +160 -264
  17. package/esm/createDemoData/createDemoData.js +11 -12
  18. package/esm/createSitemap/createSitemap.js +2 -2
  19. package/esm/pipeline/getFileConventions/fileConventions.js +1 -1
  20. package/esm/pipeline/getFileConventions/getFileConventions.js +2 -15
  21. package/esm/pipeline/hastUtils/hastUtils.js +16 -17
  22. package/esm/pipeline/loadCodeVariant/addCodeVariantPaths.js +24 -24
  23. package/esm/pipeline/loadCodeVariant/applyCodeTransform.js +12 -22
  24. package/esm/pipeline/loadCodeVariant/calculateMainFilePath.js +30 -37
  25. package/esm/pipeline/loadCodeVariant/computeHastDeltas.js +107 -185
  26. package/esm/pipeline/loadCodeVariant/diffHast.js +18 -53
  27. package/esm/pipeline/loadCodeVariant/examineCodeVariant.js +24 -27
  28. package/esm/pipeline/loadCodeVariant/flattenCodeVariant.js +9 -10
  29. package/esm/pipeline/loadCodeVariant/hasAllCodeVariants.js +5 -5
  30. package/esm/pipeline/loadCodeVariant/loadCodeFallback.js +517 -727
  31. package/esm/pipeline/loadCodeVariant/loadCodeVariant.js +683 -1032
  32. package/esm/pipeline/loadCodeVariant/maybeCodeInitialData.js +14 -20
  33. package/esm/pipeline/loadCodeVariant/mergeCodeMetadata.js +53 -63
  34. package/esm/pipeline/loadCodeVariant/parseCode.js +40 -48
  35. package/esm/pipeline/loadCodeVariant/pathUtils.js +43 -64
  36. package/esm/pipeline/loadCodeVariant/transformSource.js +55 -125
  37. package/esm/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.js +160 -221
  38. package/esm/pipeline/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.js +377 -479
  39. package/esm/pipeline/loadPrecomputedCodeHighlighter/parseFunctionArguments.js +171 -173
  40. package/esm/pipeline/loadPrecomputedCodeHighlighter/performanceLogger.js +14 -30
  41. package/esm/pipeline/loadPrecomputedCodeHighlighter/replacePrecomputeValue.js +19 -21
  42. package/esm/pipeline/loadPrecomputedCodeHighlighter/serializeFunctionArguments.js +37 -71
  43. package/esm/pipeline/loadPrecomputedCodeHighlighterClient/filterRuntimeExternals.js +3 -9
  44. package/esm/pipeline/loadPrecomputedCodeHighlighterClient/generateImportStatements.js +54 -80
  45. package/esm/pipeline/loadPrecomputedCodeHighlighterClient/generateResolvedExternals.js +71 -98
  46. package/esm/pipeline/loadPrecomputedCodeHighlighterClient/injectImportsIntoSource.js +5 -5
  47. package/esm/pipeline/loadPrecomputedCodeHighlighterClient/loadPrecomputedCodeHighlighterClient.js +161 -211
  48. package/esm/pipeline/loadPrecomputedSitemap/loadPrecomputedSitemap.js +159 -207
  49. package/esm/pipeline/loadServerCodeMeta/loadServerCodeMeta.js +42 -64
  50. package/esm/pipeline/loadServerCodeMeta/resolveModulePathWithFs.js +20 -96
  51. package/esm/pipeline/loadServerPageIndex/loadServerPageIndex.js +66 -85
  52. package/esm/pipeline/loadServerSitemap/loadServerSitemap.js +71 -118
  53. package/esm/pipeline/loadServerSource/loadServerSource.js +121 -148
  54. package/esm/pipeline/loaderUtils/externalsToPackages.js +7 -7
  55. package/esm/pipeline/loaderUtils/extractNameAndSlugFromUrl.js +8 -12
  56. package/esm/pipeline/loaderUtils/fileUrlToPortablePath.js +5 -5
  57. package/esm/pipeline/loaderUtils/getFileNameFromUrl.js +19 -29
  58. package/esm/pipeline/loaderUtils/getLanguageFromExtension.d.ts +24 -0
  59. package/esm/pipeline/loaderUtils/getLanguageFromExtension.js +62 -0
  60. package/esm/pipeline/loaderUtils/index.d.ts +2 -1
  61. package/esm/pipeline/loaderUtils/index.js +2 -1
  62. package/esm/pipeline/loaderUtils/mergeExternals.js +15 -35
  63. package/esm/pipeline/loaderUtils/parseImportsAndComments.js +413 -433
  64. package/esm/pipeline/loaderUtils/processRelativeImports.js +153 -239
  65. package/esm/pipeline/loaderUtils/resolveModulePath.js +544 -1303
  66. package/esm/pipeline/loaderUtils/rewriteImports.js +73 -111
  67. package/esm/pipeline/parseSource/addLineGutters.js +33 -45
  68. package/esm/pipeline/parseSource/grammars.d.ts +12 -1
  69. package/esm/pipeline/parseSource/grammars.js +36 -4
  70. package/esm/pipeline/parseSource/index.d.ts +2 -1
  71. package/esm/pipeline/parseSource/index.js +2 -1
  72. package/esm/pipeline/parseSource/parseSource.js +23 -32
  73. package/esm/pipeline/syncPageIndex/createMarkdownNodes.js +32 -55
  74. package/esm/pipeline/syncPageIndex/mergeMetadataMarkdown.js +107 -160
  75. package/esm/pipeline/syncPageIndex/metadataToMarkdown.js +846 -1033
  76. package/esm/pipeline/syncPageIndex/syncPageIndex.js +291 -438
  77. package/esm/pipeline/transformHtmlCodePrecomputed/transformHtmlCodePrecomputed.js +266 -320
  78. package/esm/pipeline/transformMarkdownBlockquoteCallouts/transformMarkdownBlockquoteCallouts.js +10 -10
  79. package/esm/pipeline/transformMarkdownCode/transformMarkdownCode.js +183 -267
  80. package/esm/pipeline/transformMarkdownDemoLinks/transformMarkdownDemoLinks.js +25 -27
  81. package/esm/pipeline/transformMarkdownMetadata/transformMarkdownMetadata.js +572 -717
  82. package/esm/pipeline/transformMarkdownRelativePaths/transformMarkdownRelativePaths.js +8 -8
  83. package/esm/pipeline/transformTypescriptToJavascript/removeTypes.js +84 -113
  84. package/esm/pipeline/transformTypescriptToJavascript/transformTypescriptToJavascript.js +10 -26
  85. package/esm/useCode/Pre.d.ts +2 -0
  86. package/esm/useCode/Pre.js +58 -60
  87. package/esm/useCode/useCode.js +59 -61
  88. package/esm/useCode/useCodeUtils.js +54 -63
  89. package/esm/useCode/useCopyFunctionality.js +10 -9
  90. package/esm/useCode/useFileNavigation.js +171 -209
  91. package/esm/useCode/useSourceEditing.js +17 -14
  92. package/esm/useCode/useTransformManagement.js +23 -26
  93. package/esm/useCode/useUIState.js +12 -20
  94. package/esm/useCode/useVariantSelection.js +62 -79
  95. package/esm/useCopier/index.js +29 -56
  96. package/esm/useDemo/createCodeSandbox.js +12 -15
  97. package/esm/useDemo/createStackBlitz.js +14 -20
  98. package/esm/useDemo/exportVariant.js +200 -180
  99. package/esm/useDemo/exportVariantAsCra.js +22 -25
  100. package/esm/useDemo/useDemo.js +80 -84
  101. package/esm/useErrors/ErrorsContext.js +1 -1
  102. package/esm/useErrors/useErrors.js +3 -3
  103. package/esm/useLocalStorageState/useLocalStorageState.js +23 -39
  104. package/esm/usePreference/PreferencesProvider.js +1 -1
  105. package/esm/usePreference/usePreference.js +9 -11
  106. package/esm/useSearch/useSearch.js +290 -387
  107. package/esm/useUrlHashState/useUrlHashState.js +11 -14
  108. package/esm/withDocsInfra/withDeploymentConfig.js +26 -21
  109. package/esm/withDocsInfra/withDocsInfra.js +99 -101
  110. package/package.json +7 -4
@@ -13,28 +13,28 @@ import { visit } from 'unist-util-visit';
13
13
  *
14
14
  * Supported callout types: NOTE, TIP, IMPORTANT, WARNING, CAUTION
15
15
  */
16
- export var transformMarkdownBlockquoteCallouts = function transformMarkdownBlockquoteCallouts() {
17
- return function (tree) {
18
- visit(tree, 'blockquote', function (node) {
16
+ export const transformMarkdownBlockquoteCallouts = () => {
17
+ return tree => {
18
+ visit(tree, 'blockquote', node => {
19
19
  // Find the first paragraph in the blockquote
20
- var firstChild = node.children[0];
20
+ const firstChild = node.children[0];
21
21
  if (!firstChild || firstChild.type !== 'paragraph') {
22
22
  return;
23
23
  }
24
24
 
25
25
  // Find the first text node in the paragraph
26
- var firstTextNode = firstChild.children[0];
26
+ const firstTextNode = firstChild.children[0];
27
27
  if (!firstTextNode || firstTextNode.type !== 'text') {
28
28
  return;
29
29
  }
30
- var textNode = firstTextNode;
31
- var calloutPattern = /^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/;
32
- var match = textNode.value.match(calloutPattern);
30
+ const textNode = firstTextNode;
31
+ const calloutPattern = /^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/;
32
+ const match = textNode.value.match(calloutPattern);
33
33
  if (match) {
34
- var calloutType = match[1].toLowerCase();
34
+ const calloutType = match[1].toLowerCase();
35
35
 
36
36
  // Remove the callout marker from the text
37
- var newText = textNode.value.replace(calloutPattern, '');
37
+ const newText = textNode.value.replace(calloutPattern, '');
38
38
  if (newText.trim() === '') {
39
39
  // Remove the text node if it becomes empty
40
40
  firstChild.children.shift();