diff --git a/apps/web/src/app/test/report-playground/ReportPlayground.tsx b/apps/web/src/app/test/report-playground/ReportPlayground.tsx index 04f2d8198..2b2a9cd6b 100644 --- a/apps/web/src/app/test/report-playground/ReportPlayground.tsx +++ b/apps/web/src/app/test/report-playground/ReportPlayground.tsx @@ -71,7 +71,7 @@ export const ReportPlayground: React.FC = () => { -
+
diff --git a/apps/web/src/components/ui/report/EditorContainer.tsx b/apps/web/src/components/ui/report/EditorContainer.tsx index 2ef676a53..3a07a8c3b 100644 --- a/apps/web/src/components/ui/report/EditorContainer.tsx +++ b/apps/web/src/components/ui/report/EditorContainer.tsx @@ -50,7 +50,7 @@ export function EditorContainer({ return ( { export function ThemeWrapper({ children, className, defaultTheme }: ThemeWrapperProps) { return ( <> -
+
{children}
diff --git a/apps/web/src/components/ui/report/elements/MediaEmbedNode.tsx b/apps/web/src/components/ui/report/elements/MediaEmbedNode.tsx index 2b0be3123..a08563a72 100644 --- a/apps/web/src/components/ui/report/elements/MediaEmbedNode.tsx +++ b/apps/web/src/components/ui/report/elements/MediaEmbedNode.tsx @@ -6,13 +6,7 @@ import LiteYouTubeEmbed from 'react-lite-youtube-embed'; import type { TMediaEmbedElement } from 'platejs'; import type { PlateElementProps } from 'platejs/react'; -import { - parseTwitterUrl, - parseVideoUrl, - parseIframeUrl, - parseMediaUrl, - type EmbedUrlParser -} from '@platejs/media'; +import { parseTwitterUrl, parseVideoUrl, type EmbedUrlParser } from '@platejs/media'; import { MediaEmbedPlugin, useMediaState } from '@platejs/media/react'; import { ResizableProvider, useResizableValue } from '@platejs/resizable'; import { diff --git a/apps/web/src/components/ui/report/elements/TocNode.tsx b/apps/web/src/components/ui/report/elements/TocNode.tsx index aa81d22a8..ce7f94c65 100644 --- a/apps/web/src/components/ui/report/elements/TocNode.tsx +++ b/apps/web/src/components/ui/report/elements/TocNode.tsx @@ -6,12 +6,10 @@ import type { PlateElementProps } from 'platejs/react'; import { useTocElement, useTocElementState } from '@platejs/toc/react'; import { cva } from 'class-variance-authority'; -import { PlateElement } from 'platejs/react'; - -import { Button } from '@/components/ui/buttons'; +import { PlateElement, useScrollRef } from 'platejs/react'; const headingItemVariants = cva( - 'block h-auto w-full cursor-pointer truncate rounded-none px-0.5 py-1.5 text-left font-medium text-muted-foreground underline decoration-[0.5px] underline-offset-4 hover:bg-accent hover:text-muted-foreground', + 'block! h-auto w-full cursor-pointer truncate rounded-none px-0.5 py-1 text-left font-medium text-muted-foreground underline decoration-[0.5px] underline-offset-4 hover:bg-accent hover:text-muted-foreground', { variants: { depth: { @@ -28,21 +26,22 @@ export function TocElement(props: PlateElementProps) { const { props: btnProps } = useTocElement(state); const { headingList } = state; + const containerRef = useScrollRef(); + return (
{headingList.length > 0 ? ( headingList.map((item) => ( - +
)) ) : (