@mui/internal-markdown 1.0.3 → 1.0.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.
package/index.d.ts CHANGED
@@ -12,7 +12,24 @@ export function createRender(context: {
12
12
  ignoreLanguagePages: (path: string) => boolean;
13
13
  }): (markdown: string) => string;
14
14
 
15
- export function getHeaders(markdown: string): Record<string, string | string[]>;
15
+ export interface MarkdownHeaders {
16
+ packageName?: string;
17
+ productId: string;
18
+ githubLabel?: string;
19
+ waiAria?: string;
20
+ materialDesign?: string;
21
+ components: string[];
22
+ hooks?: string[];
23
+ slug?: string;
24
+ title?: string;
25
+ description?: string;
26
+ image?: string;
27
+ tags?: string[];
28
+ authors?: string[];
29
+ date?: string;
30
+ }
31
+
32
+ export function getHeaders(markdown: string): MarkdownHeaders;
16
33
 
17
34
  export function getTitle(markdown: string): string;
18
35
 
package/loader.js CHANGED
@@ -19,7 +19,7 @@ function upperCaseFirst(string) {
19
19
  * @example moduleIDToJSIdentifier('../Box-new.js') === '$$$BoxNewJs'
20
20
  */
21
21
  function moduleIDToJSIdentifier(moduleID) {
22
- const delimiter = /(\.|-|\/|:)/;
22
+ const delimiter = /(@|\.|-|\/|:)/;
23
23
  return moduleID
24
24
  .split(delimiter)
25
25
  .filter((part) => !delimiter.test(part))
@@ -485,7 +485,9 @@ module.exports = async function demoLoader() {
485
485
  );
486
486
 
487
487
  componentNames.forEach((componentName) => {
488
- const moduleID = path.join(this.rootContext, 'src', componentName).replace(/\\/g, '/');
488
+ const moduleID = componentName.startsWith('@mui/docs/')
489
+ ? componentName
490
+ : path.join(this.rootContext, 'src', componentName).replace(/\\/g, '/');
489
491
 
490
492
  components[moduleID] = componentName;
491
493
  componentModuleIDs.add(moduleID);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/internal-markdown",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "author": "MUI Team",
5
5
  "description": "MUI markdown parser. This is an internal package not meant for general use.",
6
6
  "main": "./index.js",
@@ -16,13 +16,13 @@
16
16
  "directory": "packages/markdown"
17
17
  },
18
18
  "dependencies": {
19
- "@babel/runtime": "^7.24.4",
19
+ "@babel/runtime": "^7.24.5",
20
20
  "lodash": "^4.17.21",
21
21
  "marked": "^5.1.2",
22
22
  "prismjs": "^1.29.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@types/chai": "^4.3.14",
25
+ "@types/chai": "^4.3.16",
26
26
  "chai": "^4.4.1"
27
27
  },
28
28
  "publishConfig": {
package/parseMarkdown.js CHANGED
@@ -364,7 +364,7 @@ function createRender(context) {
364
364
  }
365
365
 
366
366
  return [
367
- `<h${level} id="${hash}"><a href="#${hash}" class="title-link-to-anchor">${headingHtml}<div class="anchor-icon"><svg><use xlink:href="#anchor-link-icon" /></svg></div></a>`,
367
+ `<h${level} id="${hash}"><a href="#${hash}" class="title-link-to-anchor">${headingHtml}<span class="anchor-icon"><svg><use xlink:href="#anchor-link-icon" /></svg></span></a>`,
368
368
  `<button title="Post a comment" class="comment-link" data-feedback-hash="${hash}">`,
369
369
  '<svg><use xlink:href="#comment-link-icon" /></svg>',
370
370
  `</button>`,
@@ -423,10 +423,8 @@ function createRender(context) {
423
423
  escaped ? code : escape(code, true)
424
424
  }</code></pre>${[
425
425
  '<button data-ga-event-category="code" data-ga-event-action="copy-click" aria-label="Copy the code" class="MuiCode-copy">',
426
- '<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="ContentCopyRoundedIcon">',
427
- '<use class="MuiCode-copy-icon" xlink:href="#copy-icon" />',
428
- '<use class="MuiCode-copied-icon" xlink:href="#copied-icon" />',
429
- '</svg>',
426
+ '<span class="MuiCode-copy-label">Copy</span>',
427
+ '<span class="MuiCode-copied-label">Copied</span>',
430
428
  '<span class="MuiCode-copyKeypress"><span>(or</span> $keyC<span>)</span></span></button></div>',
431
429
  ].join('')}\n`;
432
430
  };
@@ -295,9 +295,9 @@ authors:
295
295
  ).to.equal(
296
296
  [
297
297
  `<h1>Accordion</h1>`,
298
- `<h2 id="basic-features"><a href="#basic-features" class="title-link-to-anchor">Basic features 🧪<div class="anchor-icon"><svg><use xlink:href="#anchor-link-icon" /></svg></div></a><button title="Post a comment" class="comment-link" data-feedback-hash="basic-features"><svg><use xlink:href="#comment-link-icon" /></svg></button></h2>`,
299
- `<h2 id="using-slots-and-slotprops"><a href="#using-slots-and-slotprops" class="title-link-to-anchor">Using <code>slots</code> and <code>slotProps</code><div class="anchor-icon"><svg><use xlink:href="#anchor-link-icon" /></svg></div></a><button title="Post a comment" class="comment-link" data-feedback-hash="using-slots-and-slotprops"><svg><use xlink:href="#comment-link-icon" /></svg></button></h2>`,
300
- `<h3 id="specific-example"><a href="#specific-example" class="title-link-to-anchor">Specific example<div class="anchor-icon"><svg><use xlink:href="#anchor-link-icon" /></svg></div></a><button title="Post a comment" class="comment-link" data-feedback-hash="specific-example"><svg><use xlink:href="#comment-link-icon" /></svg></button></h3>`,
298
+ `<h2 id="basic-features"><a href="#basic-features" class="title-link-to-anchor">Basic features 🧪<span class="anchor-icon"><svg><use xlink:href="#anchor-link-icon" /></svg></span></a><button title="Post a comment" class="comment-link" data-feedback-hash="basic-features"><svg><use xlink:href="#comment-link-icon" /></svg></button></h2>`,
299
+ `<h2 id="using-slots-and-slotprops"><a href="#using-slots-and-slotprops" class="title-link-to-anchor">Using <code>slots</code> and <code>slotProps</code><span class="anchor-icon"><svg><use xlink:href="#anchor-link-icon" /></svg></span></a><button title="Post a comment" class="comment-link" data-feedback-hash="using-slots-and-slotprops"><svg><use xlink:href="#comment-link-icon" /></svg></button></h2>`,
300
+ `<h3 id="specific-example"><a href="#specific-example" class="title-link-to-anchor">Specific example<span class="anchor-icon"><svg><use xlink:href="#anchor-link-icon" /></svg></span></a><button title="Post a comment" class="comment-link" data-feedback-hash="specific-example"><svg><use xlink:href="#comment-link-icon" /></svg></button></h3>`,
301
301
  ].join(''),
302
302
  );
303
303