From 3fde2f4d848e1a1825694095b8e901d781e33432 Mon Sep 17 00:00:00 2001 From: Felix Feng Date: Thu, 19 Dec 2024 15:45:34 +0800 Subject: [PATCH] fix --- .../default/block/slate-to-html/page.tsx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/www/src/registry/default/block/slate-to-html/page.tsx b/apps/www/src/registry/default/block/slate-to-html/page.tsx index 36acdfae45..5ced973ccd 100644 --- a/apps/www/src/registry/default/block/slate-to-html/page.tsx +++ b/apps/www/src/registry/default/block/slate-to-html/page.tsx @@ -60,8 +60,6 @@ import { BaseTableRowPlugin, } from '@udecode/plate-table'; import { BaseTogglePlugin } from '@udecode/plate-toggle'; -import fs from 'node:fs/promises'; -import path from 'node:path'; import Prism from 'prismjs'; import { H3 } from '@/components/typography'; @@ -134,17 +132,17 @@ export const iframeHeight = '800px'; export const containerClassName = 'w-full h-full'; -const getCachedTailwindCss = React.cache(async () => { - const cssPath = path.join(process.cwd(), 'public', 'tailwind.css'); +// const getCachedTailwindCss = React.cache(async () => { +// const cssPath = path.join(process.cwd(), 'public', 'tailwind.css'); - return await fs.readFile(cssPath, 'utf8'); -}); +// return await fs.readFile(cssPath, 'utf8'); +// }); -const getCachedPrismCss = React.cache(async () => { - const cssPath = path.join(process.cwd(), 'public', 'prism.css'); +// const getCachedPrismCss = React.cache(async () => { +// const cssPath = path.join(process.cwd(), 'public', 'prism.css'); - return await fs.readFile(cssPath, 'utf8'); -}); +// return await fs.readFile(cssPath, 'utf8'); +// }); export default async function SlateToHtmlBlock() { const components = { @@ -298,11 +296,13 @@ export default async function SlateToHtmlBlock() { value: createValue(), }); - const tailwindCss = await getCachedTailwindCss(); - const prismCss = await getCachedPrismCss(); + // const tailwindCss = await getCachedTailwindCss(); + // const prismCss = await getCachedPrismCss(); // const cookieStore = await cookies(); // const theme = cookieStore.get('theme')?.value; const theme = 'light'; + const prismCss = ''; + const tailwindCss = ''; // Get the editor content HTML using EditorStatic const editorHtml = await serializeHtml(editor, {