Skip to content

Commit

Permalink
chore(deps): upgrade prism-react-renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
efoken committed Sep 11, 2023
1 parent 410930c commit 77a38f5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions docs/src/components/code-block/code-block.tsx
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -39,7 +39,7 @@ export const CodeBlock: React.FC<CodeBlockProps> = ({
mountStylesheet,
noInline: manual,
rawCode,
theme,
theme: themes.vsDark,
}

if (mounted && (language === "jsx" || language === "tsx") && live === true) {
Expand Down Expand Up @@ -72,7 +72,7 @@ export const CodeBlock: React.FC<CodeBlockProps> = ({
language={language}
metastring={ln}
showLines={viewlines}
theme={theme}
theme={themes.vsDark}
/>
</Box>
<CopyButton code={rawCode} sx={{ top: 4 }} />
Expand Down
11 changes: 3 additions & 8 deletions docs/src/components/code-block/highlight.tsx
Original file line number Diff line number Diff line change
@@ -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,-]+)}/
Expand Down Expand Up @@ -41,12 +41,7 @@ export const Highlight: React.FC<HighlightProps> = ({
const shouldHighlightLine = calculateLinesToHighlight(metastring)

return (
<BaseHighlight
{...defaultProps}
code={codeString}
language={language}
theme={theme}
>
<BaseHighlight code={codeString} language={language} theme={theme}>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
<Box
as="div"
Expand Down
11 changes: 7 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14568,10 +14568,13 @@ [email protected]:
"@types/prismjs" "^1.26.0"
clsx "^1.2.1"

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

proc-log@^3.0.0:
version "3.0.0"
Expand Down

0 comments on commit 77a38f5

Please sign in to comment.