mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	@@ -29,11 +29,11 @@ type HTMLPreviewProps = {
 | 
			
		||||
  onLoad?: (title?: string) => void;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export type HTMLPreviewHander = {
 | 
			
		||||
export type HTMLPreviewHandler = {
 | 
			
		||||
  reload: () => void;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const HTMLPreview = forwardRef<HTMLPreviewHander, HTMLPreviewProps>(
 | 
			
		||||
export const HTMLPreview = forwardRef<HTMLPreviewHandler, HTMLPreviewProps>(
 | 
			
		||||
  function HTMLPreview(props, ref) {
 | 
			
		||||
    const iframeRef = useRef<HTMLIFrameElement>(null);
 | 
			
		||||
    const [frameId, setFrameId] = useState<string>(nanoid());
 | 
			
		||||
@@ -207,7 +207,7 @@ export function Artifacts() {
 | 
			
		||||
  const [code, setCode] = useState("");
 | 
			
		||||
  const [loading, setLoading] = useState(true);
 | 
			
		||||
  const [fileName, setFileName] = useState("");
 | 
			
		||||
  const previewRef = useRef<HTMLPreviewHander>(null);
 | 
			
		||||
  const previewRef = useRef<HTMLPreviewHandler>(null);
 | 
			
		||||
 | 
			
		||||
  useEffect(() => {
 | 
			
		||||
    if (id) {
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ import { showImageModal, FullScreen } from "./ui-lib";
 | 
			
		||||
import {
 | 
			
		||||
  ArtifactsShareButton,
 | 
			
		||||
  HTMLPreview,
 | 
			
		||||
  HTMLPreviewHander,
 | 
			
		||||
  HTMLPreviewHandler,
 | 
			
		||||
} from "./artifacts";
 | 
			
		||||
import { useChatStore } from "../store";
 | 
			
		||||
import { IconButton } from "./button";
 | 
			
		||||
@@ -73,7 +73,7 @@ export function Mermaid(props: { code: string }) {
 | 
			
		||||
 | 
			
		||||
export function PreCode(props: { children: any }) {
 | 
			
		||||
  const ref = useRef<HTMLPreElement>(null);
 | 
			
		||||
  const previewRef = useRef<HTMLPreviewHander>(null);
 | 
			
		||||
  const previewRef = useRef<HTMLPreviewHandler>(null);
 | 
			
		||||
  const [mermaidCode, setMermaidCode] = useState("");
 | 
			
		||||
  const [htmlCode, setHtmlCode] = useState("");
 | 
			
		||||
  const { height } = useWindowSize();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user