mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-28 08:27:03 +02:00
chore: upgrade syntax highlighting dependencies, prism-react-renderer
to v2, react-live
to v4 (#9316)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
df42d891c2
commit
dceaae41d7
26 changed files with 124 additions and 137 deletions
|
@ -30,7 +30,7 @@
|
|||
"@philpl/buble": "^0.19.7",
|
||||
"clsx": "^1.2.1",
|
||||
"fs-extra": "^11.1.1",
|
||||
"react-live": "2.2.3",
|
||||
"react-live": "^4.1.5",
|
||||
"tslib": "^2.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
declare module '@philpl/buble' {
|
||||
import type {TransformOptions as OriginalTransformOptions} from 'buble';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies, no-restricted-syntax
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
export * from 'buble';
|
||||
export const features: string[];
|
||||
export type TransformOptions = OriginalTransformOptions & {
|
||||
|
|
|
@ -18,9 +18,10 @@ declare module '@docusaurus/theme-live-codeblock' {
|
|||
|
||||
declare module '@theme/Playground' {
|
||||
import type {Props as BaseProps} from '@theme/CodeBlock';
|
||||
import type {LiveProviderProps} from 'react-live';
|
||||
import type {LiveProvider} from 'react-live';
|
||||
|
||||
type CodeBlockProps = Omit<BaseProps, 'className' | 'language' | 'title'>;
|
||||
type LiveProviderProps = React.ComponentProps<typeof LiveProvider>;
|
||||
|
||||
export interface Props extends CodeBlockProps, LiveProviderProps {
|
||||
children: string;
|
||||
|
|
|
@ -13,7 +13,6 @@ import CodeBlock, {type Props} from '@theme-init/CodeBlock';
|
|||
const withLiveEditor = (Component: typeof CodeBlock) => {
|
||||
function WrappedComponent(props: Props) {
|
||||
if (props.live) {
|
||||
// @ts-expect-error: we have deliberately widened the type of language prop
|
||||
return <Playground scope={ReactLiveScope} {...props} />;
|
||||
}
|
||||
|
||||
|
|
|
@ -115,7 +115,6 @@ export default function Playground({
|
|||
|
||||
return (
|
||||
<div className={styles.playgroundContainer}>
|
||||
{/* @ts-expect-error: type incompatibility with refs */}
|
||||
<LiveProvider
|
||||
code={children.replace(/\n$/, '')}
|
||||
noInline={noInline}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue