diff --git a/docs/package.json b/docs/package.json index c60d7016..ffeb2f3f 100644 --- a/docs/package.json +++ b/docs/package.json @@ -20,7 +20,7 @@ "copy-to-clipboard": "^3.3.3", "next": "^13.4.19", "next-seo": "^6.1.0", - "prism-react-renderer": "^1.3.5", + "prism-react-renderer": "^2.0.6", "react": "18.2.0", "react-dom": "18.2.0", "react-live": "^4.1.3", diff --git a/docs/src/components/code-block/code-block.tsx b/docs/src/components/code-block/code-block.tsx index 93dbadf3..8f55364d 100644 --- a/docs/src/components/code-block/code-block.tsx +++ b/docs/src/components/code-block/code-block.tsx @@ -1,6 +1,6 @@ import { Box, useBoolean } from "@md3-ui/core" import dynamic from "next/dynamic" -import theme from "prism-react-renderer/themes/vsDark" +import { themes } from "prism-react-renderer" import { useEffect } from "react" import { CopyButton } from "./copy-button" import { Highlight } from "./highlight" @@ -39,7 +39,7 @@ export const CodeBlock: React.FC = ({ mountStylesheet, noInline: manual, rawCode, - theme, + theme: themes.vsDark, } if (mounted && (language === "jsx" || language === "tsx") && live === true) { @@ -72,7 +72,7 @@ export const CodeBlock: React.FC = ({ language={language} metastring={ln} showLines={viewlines} - theme={theme} + theme={themes.vsDark} /> diff --git a/docs/src/components/code-block/highlight.tsx b/docs/src/components/code-block/highlight.tsx index f75acae0..4f7c7407 100644 --- a/docs/src/components/code-block/highlight.tsx +++ b/docs/src/components/code-block/highlight.tsx @@ -1,8 +1,8 @@ import { Box, Text } from "@md3-ui/core" -import BaseHighlight, { +import { + Highlight as BaseHighlight, Language, PrismTheme, - defaultProps, } from "prism-react-renderer" const RE = /{([\d,-]+)}/ @@ -41,12 +41,7 @@ export const Highlight: React.FC = ({ const shouldHighlightLine = calculateLinesToHighlight(metastring) return ( - + {({ className, style, tokens, getLineProps, getTokenProps }) => (