import * as React from "react" import "./styles/index.css" import type { Content, Editor } from "@tiptap/react" import type { UseMinimalTiptapEditorProps } from "./hooks/use-minimal-tiptap" import { EditorContent } from "@tiptap/react" import { Separator } from "@/components/ui/separator" import { cn } from "@/lib/utils" import { SectionOne } from "./components/section/one" import { SectionTwo } from "./components/section/two" import { SectionThree } from "./components/section/three" import { SectionFour } from "./components/section/four" import { SectionFive } from "./components/section/five" import { LinkBubbleMenu } from "./components/bubble-menu/link-bubble-menu" import { ImageBubbleMenu } from "./components/bubble-menu/image-bubble-menu" import { useMinimalTiptapEditor } from "./hooks/use-minimal-tiptap" export interface MinimalTiptapProps extends Omit { value?: Content onChange?: (value: Content) => void className?: string editorContentClassName?: string } const Toolbar = ({ editor }: { editor: Editor }) => (
) export const MinimalTiptapEditor = React.forwardRef< HTMLDivElement, MinimalTiptapProps >(({ value, onChange, className, editorContentClassName, ...props }, ref) => { const editor = useMinimalTiptapEditor({ value, onUpdate: onChange, ...props, }) if (!editor) { return null } return (
) }) MinimalTiptapEditor.displayName = "MinimalTiptapEditor" export default MinimalTiptapEditor