import type { ContentEditorTextStyle } from './content-editor-text-style' import type { Editor } from '@tiptap/react' // The block style the cursor sits in, innermost wrapper first so a heading inside a quote still // reads as the quote the sheet would toggle. export function getContentEditorTextStyle(editor: Editor): ContentEditorTextStyle { if (editor.isActive('codeBlock')) return 'code-block' if (editor.isActive('taskList')) return 'task-list' if (editor.isActive('bulletList')) return 'bullet-list' if (editor.isActive('orderedList')) return 'ordered-list' if (editor.isActive('blockquote')) return 'blockquote' if (editor.isActive('heading', { level: 1 })) return 'heading-1' if (editor.isActive('heading', { level: 2 })) return 'heading-2' if (editor.isActive('heading', { level: 3 })) return 'heading-3' return 'paragraph' }