@readme/markdown 9.15.1 → 10.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/components/Callout/style.scss +8 -3
- package/components/{TutorialTile.tsx → Recipe.tsx} +2 -2
- package/components/index.ts +1 -2
- package/dist/components/Recipe.d.ts +3 -0
- package/dist/components/index.d.ts +1 -2
- package/dist/main.css +1 -2
- package/dist/main.css.map +1 -1
- package/dist/main.js +39571 -39590
- package/dist/main.node.js +39573 -39592
- package/dist/main.node.js.map +1 -1
- package/package.json +8 -6
- package/components/Mermaid/index.tsx +0 -45
- package/components/Mermaid/style.scss +0 -3
- package/dist/components/Mermaid/index.d.ts +0 -4
- package/dist/components/TutorialTile.d.ts +0 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@readme/markdown",
|
|
3
3
|
"description": "ReadMe's React-based Markdown parser",
|
|
4
4
|
"author": "Rafe Goldberg <rafe@readme.io>",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "10.0.0",
|
|
6
6
|
"main": "dist/main.node.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"browser": "dist/main.js",
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@mdx-js/react": "^3.0.0",
|
|
68
|
-
"@readme/syntax-highlighter": "^
|
|
69
|
-
"@readme/variable": "^
|
|
68
|
+
"@readme/syntax-highlighter": "^14.0.0",
|
|
69
|
+
"@readme/variable": "^17.0.0",
|
|
70
70
|
"@tippyjs/react": "^4.1.0",
|
|
71
71
|
"acorn": "v8.13.0",
|
|
72
|
-
"react": "
|
|
73
|
-
"react-dom": "
|
|
72
|
+
"react": "18.x || 19.x",
|
|
73
|
+
"react-dom": "18.x || 19.x"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@babel/core": "^7.21.4",
|
|
@@ -157,6 +157,8 @@
|
|
|
157
157
|
"mermaid": "^11.3.0"
|
|
158
158
|
},
|
|
159
159
|
"overrides": {
|
|
160
|
-
"conventional-changelog-conventionalcommits": ">= 8.0.0"
|
|
160
|
+
"conventional-changelog-conventionalcommits": ">= 8.0.0",
|
|
161
|
+
"@readme/syntax-highlighter": "^14.0.0",
|
|
162
|
+
"@readme/variable": "^17.0.0"
|
|
161
163
|
}
|
|
162
164
|
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { Mermaid as MermaidType } from 'mermaid';
|
|
2
|
-
|
|
3
|
-
import React, { useContext, useEffect, useRef } from 'react';
|
|
4
|
-
|
|
5
|
-
import ThemeContext from '../../contexts/Theme';
|
|
6
|
-
|
|
7
|
-
import './style.scss';
|
|
8
|
-
|
|
9
|
-
let mermaid: MermaidType;
|
|
10
|
-
|
|
11
|
-
const Mermaid = ({ children }: React.PropsWithChildren) => {
|
|
12
|
-
const theme = useContext(ThemeContext);
|
|
13
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
14
|
-
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
if (typeof window !== 'undefined') {
|
|
17
|
-
import('mermaid').then(async module => {
|
|
18
|
-
mermaid = module.default;
|
|
19
|
-
// Initialize Mermaid with the current theme
|
|
20
|
-
mermaid.initialize({
|
|
21
|
-
theme: theme === 'dark' ? 'dark' : 'default',
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
if (containerRef.current) {
|
|
25
|
-
const code = containerRef.current.textContent || '';
|
|
26
|
-
// Render the diagram and inject it into the container
|
|
27
|
-
const { svg } = await mermaid.render('generatedDiagram', code);
|
|
28
|
-
if (containerRef.current) {
|
|
29
|
-
containerRef.current.innerHTML = svg;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
}, [children, theme]);
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<div ref={containerRef}>
|
|
38
|
-
<pre className="Mermaid mermaid">
|
|
39
|
-
{children}
|
|
40
|
-
</pre>
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default Mermaid;
|