@readme/markdown 9.15.0 → 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/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": "9.15.0",
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": "^13.1.0",
69
- "@readme/variable": "^16.1.0",
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": "16.x || 17.x || 18.x",
73
- "react-dom": "16.x || 17.x || 18.x"
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;
@@ -1,3 +0,0 @@
1
- .markdown-body pre.Mermaid {
2
- background: none;
3
- }
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './style.scss';
3
- declare const Mermaid: ({ children }: React.PropsWithChildren) => React.JSX.Element;
4
- export default Mermaid;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const TutorialTile: () => React.JSX.Element;
3
- export default TutorialTile;