|
|
@ -15,6 +15,7 @@ import LZString from 'lz-string'; |
|
|
|
import Prism from 'prismjs'; |
|
|
|
import React, { useContext, useEffect, useRef, useState } from 'react'; |
|
|
|
import CopyToClipboard from 'react-copy-to-clipboard'; |
|
|
|
import type { AntdPreviewerProps } from '.'; |
|
|
|
import useLocation from '../../../hooks/useLocation'; |
|
|
|
import BrowserFrame from '../../common/BrowserFrame'; |
|
|
|
import ClientOnly from '../../common/ClientOnly'; |
|
|
@ -27,7 +28,6 @@ import RiddleIcon from '../../common/RiddleIcon'; |
|
|
|
import type { SiteContextProps } from '../../slots/SiteContext'; |
|
|
|
import SiteContext from '../../slots/SiteContext'; |
|
|
|
import { ping } from '../../utils'; |
|
|
|
import type { AntdPreviewerProps } from '.'; |
|
|
|
|
|
|
|
const { ErrorBoundary } = Alert; |
|
|
|
|
|
|
@ -105,6 +105,7 @@ const CodePreviewer: React.FC<AntdPreviewerProps> = (props) => { |
|
|
|
filename, |
|
|
|
version, |
|
|
|
clientOnly, |
|
|
|
pkgDependencyList, |
|
|
|
} = props; |
|
|
|
|
|
|
|
const { pkg } = useSiteData(); |
|
|
@ -331,6 +332,7 @@ createRoot(document.getElementById('container')).render(<Demo />); |
|
|
|
main: 'index.js', |
|
|
|
dependencies: { |
|
|
|
...dependencies, |
|
|
|
'rc-util': pkgDependencyList['rc-util'], |
|
|
|
react: '^18.0.0', |
|
|
|
'react-dom': '^18.0.0', |
|
|
|
'react-scripts': '^5.0.0', |
|
|
|