@mui/internal-markdown 1.0.25 → 2.0.0
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/{extractImports.js → extractImports.mjs} +1 -3
- package/index.mjs +1 -0
- package/{loader.js → loader.mjs} +6 -6
- package/package.json +12 -7
- package/{parseMarkdown.js → parseMarkdown.mjs} +4 -4
- package/{prepareMarkdown.js → prepareMarkdown.mjs} +6 -6
- package/prism.mjs +3 -0
- package/{textToHash.js → textToHash.mjs} +1 -3
- package/index.js +0 -3
- /package/{index.d.ts → index.d.mts} +0 -0
- /package/{prism.js → prism.cjs} +0 -0
- /package/{prism.d.ts → prism.d.mts} +0 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
const importModuleRegexp =
|
|
2
2
|
/^\s*import (?:["'\s]*(?:[\w*{}\n, ]+)from\s*)?["'\s]*([^"'{}$\s]+)["'\s].*/gm;
|
|
3
3
|
|
|
4
|
-
function extractImports(code) {
|
|
4
|
+
export default function extractImports(code) {
|
|
5
5
|
return (code.match(importModuleRegexp) || []).map((x) => x.replace(importModuleRegexp, '$1'));
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
module.exports = extractImports;
|
package/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createRender, getHeaders, getTitle, renderMarkdown } from './parseMarkdown.mjs';
|
package/{loader.js → loader.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { promises as fs, readdirSync, statSync } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import prepareMarkdown from './prepareMarkdown.mjs';
|
|
4
|
+
import extractImports from './extractImports.mjs';
|
|
5
5
|
|
|
6
6
|
const notEnglishMarkdownRegExp = /-([a-z]{2})\.md$/;
|
|
7
7
|
|
|
@@ -59,7 +59,7 @@ function findComponents(packages) {
|
|
|
59
59
|
/**
|
|
60
60
|
* @type {import('webpack').loader.Loader}
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
export default async function demoLoader() {
|
|
63
63
|
const englishFilepath = this.resourcePath;
|
|
64
64
|
const options = this.getOptions();
|
|
65
65
|
|
|
@@ -636,4 +636,4 @@ ${Array.from(componentModuleIDs)
|
|
|
636
636
|
`;
|
|
637
637
|
|
|
638
638
|
return transformed;
|
|
639
|
-
}
|
|
639
|
+
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-markdown",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "MUI markdown parser. This is an internal package not meant for general use.",
|
|
6
|
-
"main": "./index.
|
|
7
|
-
"
|
|
6
|
+
"main": "./index.mjs",
|
|
7
|
+
"browser": "./index.mjs",
|
|
8
|
+
"types": "./index.d.mts",
|
|
8
9
|
"exports": {
|
|
9
|
-
".": "./index.
|
|
10
|
-
"./loader": "./loader.
|
|
11
|
-
"./prism":
|
|
10
|
+
".": "./index.mjs",
|
|
11
|
+
"./loader": "./loader.mjs",
|
|
12
|
+
"./prism": {
|
|
13
|
+
"types": "./prism.d.mts",
|
|
14
|
+
"require": "./prism.cjs",
|
|
15
|
+
"import": "./prism.mjs"
|
|
16
|
+
}
|
|
12
17
|
},
|
|
13
18
|
"repository": {
|
|
14
19
|
"type": "git",
|
|
@@ -16,7 +21,7 @@
|
|
|
16
21
|
"directory": "packages/markdown"
|
|
17
22
|
},
|
|
18
23
|
"dependencies": {
|
|
19
|
-
"@babel/runtime": "^7.26.
|
|
24
|
+
"@babel/runtime": "^7.26.7",
|
|
20
25
|
"lodash": "^4.17.21",
|
|
21
26
|
"marked": "^15.0.6",
|
|
22
27
|
"prismjs": "^1.29.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { marked } from 'marked';
|
|
2
|
+
import textToHash from './textToHash.mjs';
|
|
3
|
+
import prism from './prism.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Option used by `marked` the library parsing markdown.
|
|
@@ -486,7 +486,7 @@ function createRender(context) {
|
|
|
486
486
|
return render;
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
|
|
489
|
+
export {
|
|
490
490
|
createRender,
|
|
491
491
|
getContents,
|
|
492
492
|
getDescription,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable no-irregular-whitespace */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import kebabCase from 'lodash/kebabCase.js';
|
|
5
|
+
import {
|
|
6
6
|
createRender,
|
|
7
7
|
getContents,
|
|
8
8
|
getDescription,
|
|
@@ -10,7 +10,7 @@ const {
|
|
|
10
10
|
getFeatureList,
|
|
11
11
|
getHeaders,
|
|
12
12
|
getTitle,
|
|
13
|
-
}
|
|
13
|
+
} from './parseMarkdown.mjs';
|
|
14
14
|
|
|
15
15
|
const BaseUIReexportedComponents = ['ClickAwayListener', 'NoSsr', 'Portal', 'TextareaAutosize'];
|
|
16
16
|
|
|
@@ -267,4 +267,4 @@ ${headers.hooks
|
|
|
267
267
|
return { docs };
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
|
|
270
|
+
export default prepareMarkdown;
|
package/prism.mjs
ADDED
|
@@ -14,7 +14,7 @@ function makeUnique(hash, unique, i = 1) {
|
|
|
14
14
|
* @param {Record<string, boolean>} [unique] - Ensures that each output is unique in `unique`
|
|
15
15
|
* @returns {string} that is safe to use in fragment links
|
|
16
16
|
*/
|
|
17
|
-
function textToHash(text, unique = {}) {
|
|
17
|
+
export default function textToHash(text, unique = {}) {
|
|
18
18
|
return makeUnique(
|
|
19
19
|
encodeURI(
|
|
20
20
|
text
|
|
@@ -32,5 +32,3 @@ function textToHash(text, unique = {}) {
|
|
|
32
32
|
unique,
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
module.exports = textToHash;
|
package/index.js
DELETED
|
File without changes
|
/package/{prism.js → prism.cjs}
RENAMED
|
File without changes
|
|
File without changes
|