Skip to content

Commit 77a38f5

Browse files
committed
chore(deps): upgrade prism-react-renderer
1 parent 410930c commit 77a38f5

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"copy-to-clipboard": "^3.3.3",
2121
"next": "^13.4.19",
2222
"next-seo": "^6.1.0",
23-
"prism-react-renderer": "^1.3.5",
23+
"prism-react-renderer": "^2.0.6",
2424
"react": "18.2.0",
2525
"react-dom": "18.2.0",
2626
"react-live": "^4.1.3",

docs/src/components/code-block/code-block.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Box, useBoolean } from "@md3-ui/core"
22
import dynamic from "next/dynamic"
3-
import theme from "prism-react-renderer/themes/vsDark"
3+
import { themes } from "prism-react-renderer"
44
import { useEffect } from "react"
55
import { CopyButton } from "./copy-button"
66
import { Highlight } from "./highlight"
@@ -39,7 +39,7 @@ export const CodeBlock: React.FC<CodeBlockProps> = ({
3939
mountStylesheet,
4040
noInline: manual,
4141
rawCode,
42-
theme,
42+
theme: themes.vsDark,
4343
}
4444

4545
if (mounted && (language === "jsx" || language === "tsx") && live === true) {
@@ -72,7 +72,7 @@ export const CodeBlock: React.FC<CodeBlockProps> = ({
7272
language={language}
7373
metastring={ln}
7474
showLines={viewlines}
75-
theme={theme}
75+
theme={themes.vsDark}
7676
/>
7777
</Box>
7878
<CopyButton code={rawCode} sx={{ top: 4 }} />

docs/src/components/code-block/highlight.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Box, Text } from "@md3-ui/core"
2-
import BaseHighlight, {
2+
import {
3+
Highlight as BaseHighlight,
34
Language,
45
PrismTheme,
5-
defaultProps,
66
} from "prism-react-renderer"
77

88
const RE = /{([\d,-]+)}/
@@ -41,12 +41,7 @@ export const Highlight: React.FC<HighlightProps> = ({
4141
const shouldHighlightLine = calculateLinesToHighlight(metastring)
4242

4343
return (
44-
<BaseHighlight
45-
{...defaultProps}
46-
code={codeString}
47-
language={language}
48-
theme={theme}
49-
>
44+
<BaseHighlight code={codeString} language={language} theme={theme}>
5045
{({ className, style, tokens, getLineProps, getTokenProps }) => (
5146
<Box
5247
as="div"

yarn.lock

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14568,10 +14568,13 @@ [email protected]:
1456814568
"@types/prismjs" "^1.26.0"
1456914569
clsx "^1.2.1"
1457014570

14571-
prism-react-renderer@^1.3.5:
14572-
version "1.3.5"
14573-
resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-1.3.5.tgz#786bb69aa6f73c32ba1ee813fbe17a0115435085"
14574-
integrity sha512-IJ+MSwBWKG+SM3b2SUfdrhC+gu01QkV2KmRQgREThBfSQRoufqRfxfHUxpG1WcaFjP+kojcFyO9Qqtpgt3qLCg==
14571+
prism-react-renderer@^2.0.6:
14572+
version "2.0.6"
14573+
resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-2.0.6.tgz#24f0c1afbc07d4a268677fb05e77079ea80b6a2f"
14574+
integrity sha512-ERzmAI5UvrcTw5ivfEG20/dYClAsC84eSED5p9X3oKpm0xPV4A5clFK1mp7lPIdKmbLnQYsPTGiOI7WS6gWigw==
14575+
dependencies:
14576+
"@types/prismjs" "^1.26.0"
14577+
clsx "^1.2.1"
1457514578

1457614579
proc-log@^3.0.0:
1457714580
version "3.0.0"

0 commit comments

Comments
 (0)