'use client' import type * as React from 'react' import type { useContentEditor } from '@admin/hooks/content-editor/use-content-editor' import type { ContentEditorTableAddControls } from '@admin/hooks/content-editor/use-content-editor-table-add-controls' import type { Editor } from '@tiptap/react' import { cn } from '@admin/utils/shared/cn' import { EditorContent } from '@tiptap/react' import { MathBubbleMenu } from './math-popover' import { SelectionBubbleMenu } from './selection-bubble-menu' import { SlashCommandMenu } from './slash-command-menu' import { TableAddControls } from './table-add-controls' import { TableBubbleMenu } from './table-bubble-menu' // The rich-text surface both layouts share: the bubble menus, the slash menu and the scrolling // ProseMirror view. The desktop card and the phone focus view only differ in what frames it; the // phone view drops the selection bubble (`hasSelectionMenu={false}`), which sat behind the iOS // Cut / Copy / Paste menu and repeats the dock's keys, and the slash popup (`hasSlashMenu={false}`), // whose commands it shows in the text-style sheet instead. export function ContentEditorRichBody({ editor, state, tableAddControls, containerRef, className, contentClassName, hasSelectionMenu = true, hasSlashMenu = true, children }: { editor: Editor state: ReturnType tableAddControls: ContentEditorTableAddControls | null containerRef?: React.Ref className?: string contentClassName?: string hasSelectionMenu?: boolean hasSlashMenu?: boolean children?: React.ReactNode }) { return (
{hasSelectionMenu ? : null} {hasSlashMenu ? ( ) : null} {children}
) }